Changeset 1139
- Timestamp:
- 09/21/08 19:41:12 (2 months ago)
- Files:
-
- trunk/lib/Ak.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/Ak.php
r980 r1139 1142 1142 1143 1143 1144 function encrypt($data, $key = 'Ak3los-m3D1a') 1145 { 1144 function encrypt($data, $key = null) 1145 { 1146 $key = empty($key) ? md5(AK_SESSION_NAME) : $key; 1146 1147 srand((double)microtime() *1000000); 1147 1148 $k2 = md5(rand(0, 32000)); … … 1167 1168 } 1168 1169 1169 function decrypt($encrypted_data, $key = 'Ak3los-m3D1a') 1170 { 1170 function decrypt($encrypted_data, $key = null) 1171 { 1172 $key = empty($key) ? md5(AK_SESSION_NAME) : $key; 1171 1173 $t = base64_decode($encrypted_data); 1172 1174 $k = md5($key); … … 1189 1191 1190 1192 1191 function blowfishEncrypt($data, $key = 'Ak3los-m3D1a')1192 { 1193 $key = substr( $key,0,56);1193 function blowfishEncrypt($data, $key = null) 1194 { 1195 $key = substr((empty($key) ? md5(AK_SESSION_NAME) : $key),0,56); 1194 1196 require_once(AK_CONTRIB_DIR.DS.'pear'.DS.'Crypt'.DS.'Blowfish.php'); 1195 1197 $Blowfish =& Ak::singleton('Crypt_Blowfish', $key); … … 1198 1200 } 1199 1201 1200 function blowfishDecrypt($encrypted_data, $key = 'Ak3los-m3D1a')1201 { 1202 $key = substr( $key,0,56);1202 function blowfishDecrypt($encrypted_data, $key = null) 1203 { 1204 $key = substr(empty($key) ? md5(AK_SESSION_NAME) : $key,0,56); 1203 1205 require_once(AK_CONTRIB_DIR.DS.'pear'.DS.'Crypt'.DS.'Blowfish.php'); 1204 1206 $Blowfish =& Ak::singleton('Crypt_Blowfish', $key); … … 1988 1990 } 1989 1991 1992 function getSetting($namespace, $variable, $default_value = null) 1993 { 1994 if($settings = Ak::getSettings($namespace)){ 1995 return isset($settings[$variable]) ? $settings[$variable] : $default_value; 1996 } 1997 return $default_value; 1998 } 1999 1990 2000 function _parseSettingsConstants($settingsStr) 1991 2001 {
