Log in with username/password: lyceum/lyceum

Changes in trunk [788:789]

Show
Ignore:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/lib/functions.php

    r788 r789  
    130130} 
    131131 
    132 function tokenIsValid ($token, $targetscript, $action='default', $id=0) { 
     132function tokenIsValid ($token, $targetscript, $action='default', $id=0, $keep=false) { 
    133133   global $userdata; 
    134134//trace('$_SESSION', array_print($_SESSION)); 
     
    143143      return false; 
    144144 
    145    unset($_SESSION['formtokens'][$key][$token]);//not sure if this is really achieving what i want -jjb 
     145   if (!$keep) 
     146      unset($_SESSION['formtokens'][$key][$token]); 
    146147   return true; 
    147148} 
    148149 
    149 function validateToken( $token, $targetscript, $action='default', $id=0 ){ 
    150    if (!tokenIsValid( $token, $targetscript, $action, $id )) 
     150function validateToken( $token, $targetscript, $action='default', $id=0, $keep=false ){ 
     151   if (!tokenIsValid( $token, $targetscript, $action, $id, $keep )) 
    151152      badTokenMessage(); 
    152153} 
  • trunk/src/lyceum/wp-comments-post.php

    r624 r789  
    88assert('hv($comment_post_ID)'); 
    99 
    10 validateToken($_POST['token'], basename(__FILE__), 'default', $comment_post_ID); 
     10validateToken($_POST['token'], basename(__FILE__), 'default', $comment_post_ID, true); 
    1111 
    1212$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); 
     
    6565$location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to'];  
    6666 
     67validateToken($_POST['token'], basename(__FILE__), 'default', $comment_post_ID); 
    6768wp_redirect( $location ); 
    6869?> 
Log in with username/password: lyceum/lyceum