Logo Search packages:      
Sourcecode: davical version File versions  Download package

CalDAVRequest::ValidateLockToken ( lock_token )

Checks to see whether the lock token given matches one of the ones handed in with the request.

Parameters:
string$lock_tokenThe opaquelocktoken which we are looking for

Definition at line 475 of file CalDAVRequest.php.

Referenced by FailIfLocked().

                                            {
    if ( isset($this->lock_token) && $this->lock_token == $lock_token ) return true;
    if ( isset($this->if_clause) ) {
      dbg_error_log( "caldav", "Checking lock token '%s' against '%s'", $lock_token, $this->if_clause );
      $tokens = preg_split( '/[<>]/', $this->if_clause );
      foreach( $tokens AS $k => $v ) {
        dbg_error_log( "caldav", "Checking lock token '%s' against '%s'", $lock_token, $v );
        if ( 'opaquelocktoken:' == substr( $v, 0, 16 ) ) {
          if ( substr( $v, 16 ) == $lock_token ) {
            dbg_error_log( "caldav", "Lock token '%s' validated OK against '%s'", $lock_token, $v );
            return true;
          }
        }
      }
    }
    else {
      @dbg_error_log( "caldav", "Invalid lock token '%s' - not in Lock-token (%s) or If headers (%s) ", $lock_token, $this->lock_token, $this->if_clause );
    }

    return false;
  }

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index