tdav::check_lock_for_unlock (public)
tdav::check_lock_for_unlock uri
Defined in packages/oacs-dav/tcl/tDAV-procs.tcl
Check the Lock-Token header against the stored lock for an UNLOCK request.
- Parameters:
- uri (required)
- Resource URI.
- Returns:
- unlocked if the token matches or no lock exists, or filter_return if the token is missing or does not match.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: regsub {^/} $uri {} uri # if lock exists, work. if not, just return. if {[file exists [tdav::get_lock_file $uri]]} { set hdr [ns_set iget [ns_conn headers] {Lock-Token}] # the If header exists, work, otherwise 423 if {[info exists hdr] && [string length $hdr]} { regexp {<([^>]+)>} $hdr nil token set ftk [lindex [tdav::read_lock $uri] 3] if {[info exists token] && $token eq $ftk} { # it's good, the tokens match. carry on. } else { return filter_return } } else { return filter_return } # also check for uri == hdr_uri } return unlockedXQL Not present: Generic, PostgreSQL, Oracle