Roxen.git / server / modules / filesystems / filesystem.pike

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:1:   // This is a roxen module. Copyright © 1996 - 2001, Roxen IS.      // This is a virtual "file-system".   // It will be located somewhere in the name-space of the server.   // Also inherited by some of the other filesystems.      inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.145 2004/05/14 21:21:22 mast Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.146 2004/05/15 10:44:08 grubba Exp $";   constant thread_safe=1;      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>         //<locale-token project="mod_filesystem">LOCALE</locale-token>   #define LOCALE(X,Y) _DEF_LOCALE("mod_filesystem",X,Y)
Roxen.git/server/modules/filesystems/filesystem.pike:392:   {    if(stat_file( f, id )) {    return real_path(f, id);    }   }      // We support locking if put is enabled.   mapping(string:mixed) lock_file(string path, DAVLock lock, RequestID id)   {    if (!query("put")) return 0; -  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) { -  TRACE_LEAVE("PUT: Permission denied"); +  if (query("check_auth") && (!id->conf->authenticate( id )) ) { +  TRACE_LEAVE("LOCK: Permission denied");    return    // FIXME: Sane realm.    Roxen.http_auth_required("foo", -  "<h1>Permission to 'PUT' files denied</h1>"); +  "<h1>Permission to 'LOCK' files denied</h1>");    }    register_lock(path, lock, id);    return 0;   }      mapping(string:mixed) unlock_file(string path, DAVLock lock, RequestID|int(0..0) id)   {    if (!query("put")) return 0; -  if(query("check_auth") && (!id || (!id->conf->authenticate( id ) )) ) { -  TRACE_LEAVE("PUT: Permission denied"); +  if (id && query("check_auth") && (!id->conf->authenticate( id )) ) { +  TRACE_LEAVE("UNLOCK: Permission denied");    return    // FIXME: Sane realm.    Roxen.http_auth_required("foo", -  "<h1>Permission to 'PUT' files denied</h1>"); +  "<h1>Permission to 'UNLOCK' files denied</h1>");    }    unregister_lock(path, lock, id);    return 0;   }      int dir_filter_function(string f, RequestID id)   {    if(f[0]=='.' && !dotfiles) return 0;    if(!tilde && Roxen.backup_extension(f)) return 0;    return 1;