Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: configuration.pike,v 1.392 2001/07/31 07:41:03 per Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.393 2001/09/03 18:48:49 per Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>      inherit "basic_defvar";      mapping enabled_modules = ([]);   mapping(string:array(int)) error_log=([]);
Roxen.git/server/base_server/configuration.pike:666: Inside #if defined(MODULE_LEVEL_SECURITY)
   return 1;       if(!sizeof(seclevels[0]))    return 0; // Ok if there are no patterns.       mixed err;    err = catch {    foreach(seclevels[0], level) {    switch(level[0]) {    case MOD_ALLOW: // allow ip=... +  NOCACHE();    if(level[1](id->remoteaddr)) {    ip_ok = ~0; // Match. It's ok.    } else {    ip_ok |= 1; // IP may be bad.    }    break;       case MOD_DENY: // deny ip=... -  +  NOCACHE();    if(level[1](id->remoteaddr))    return Roxen.http_low_answer(403, "<h2> Access forbidden </h2>");    break;       case MOD_USER: // allow user=...    if(id->auth && id->auth[0] && level[1](id->auth[1])) {    auth_ok = ~0; // Match. It's ok.    } else {    auth_ok |= 1; // Auth may be bad.    }    break;       case MOD_PROXY_USER: // allow user=... -  +  NOCACHE();    if (ip_ok != 1) {    // IP is OK as of yet.    if(id->misc->proxyauth && id->misc->proxyauth[0] &&    level[1](id->misc->proxyauth[1])) return 0;    return Roxen.http_proxy_auth_required(seclevels[2]);    } else {    // Bad IP.    return 1;    }    break;       case MOD_ACCEPT: // accept ip=...    // Short-circuit version on allow. -  +  NOCACHE();    if(level[1](id->remoteaddr)) {    // Match. It's ok.    return 0;    } else {    ip_ok |= 1; // IP may be bad.    }    break;       case MOD_ACCEPT_USER: // accept user=...    // Short-circuit version on allow.