tdav::check_lock_for_unlock

 tdav::check_lock_for_unlock

Defined in

Partial Call Graph (max 5 caller/called nodes):
%3 oacs_dav::impl::content_folder::unlock oacs_dav::impl::content_folder::unlock (private) tdav::check_lock_for_unlock tdav::check_lock_for_unlock oacs_dav::impl::content_folder::unlock->tdav::check_lock_for_unlock oacs_dav::impl::content_revision::unlock oacs_dav::impl::content_revision::unlock (private) oacs_dav::impl::content_revision::unlock->tdav::check_lock_for_unlock tdav::get_lock_file tdav::get_lock_file tdav::check_lock_for_unlock->tdav::get_lock_file tdav::read_lock tdav::read_lock tdav::check_lock_for_unlock->tdav::read_lock

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 unlocked
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: