Changeset 1231
- Timestamp:
- 10/21/07 02:15:23 (9 months ago)
- Files:
-
- branches/1.0/src/config/wp-config-sample.php (modified) (1 diff)
- branches/1.0/src/lib/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/src/config/wp-config-sample.php
r1177 r1231 37 37 define('ERRORLOG', LOGDIR . 'lyceum_error_log'); 38 38 define('QUERYLOG', LOGDIR . 'lyceum_query_log'); 39 define('TOKENLOG', LOGDIR . 'lyceum_token_log'); 39 40 40 41 // Change this to localize WordPress. A corresponding MO file for the branches/1.0/src/lib/functions.php
r1185 r1231 12 12 } 13 13 } 14 } 15 16 function token_log($event, $information){ 17 $time = date('i:s'); 18 $message = "\n".$time." - [$event]: $information"; 19 error_log($message, 3, TOKENLOG); 14 20 } 15 21 … … 196 202 $key = sha1($targetscript.$action.$id.$userdata->ID); 197 203 //trace('checking token: $token, $targetscript, $action, $id, user, $key', "$token, $targetscript, $action, $id, $userdata->ID, $key"); 198 if (!array_key_exists($token, $_SESSION['formtokens'][$key])) 204 if (!array_key_exists($token, $_SESSION['formtokens'][$key])){ 205 token_log('Token does not exist', 206 "Key: " . $key . "\n" . 207 "Token: " . $token . "\n" 208 ); 199 209 return false; 200 201 $token_age = time() - $_SESSION['formtokens'][$key][$token]; 202 203 if ($token_age >= 86400)//86400 seconds = 24 hours 210 } 211 $current_time = time(); 212 $token_age = $current_time - $_SESSION['formtokens'][$key][$token]; 213 214 if ($token_age >= 86400){//86400 seconds = 24 hours 215 token_log('Token age failure', 216 "Key: " . $key . "\n" . 217 "Token: " . $token . "\n" . 218 "Current time: " . $current_time . "\n" . 219 "Token age: " . $token_age . "\n" 220 ); 204 221 return false; 222 } 205 223 206 224 if (!$keep)
