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.331 2000/08/08 12:12:31 jhs Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.332 2000/08/11 19:30:26 lange 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:521:    ({ (string)m->mday, (string)(m->mon),    (string)(m->year),(string)m->hour,    cached_hostname,    }));    mkdirhier( ff );    fd = open( ff, "wac" );    if(!fd)    {    remove_call_out( do_open );    call_out( do_open, 120 ); -  report_error(LOC_M("", "Failed to open logfile")+" "+fname+" " +  report_error(LOC_M(37, "Failed to open logfile")+" "+fname+" "   #if constant(strerror)    "(" + strerror(errno()) + ")"   #endif    "\n");    return;    }    opened = 1;    remove_call_out( do_open );    call_out( do_open, 1800 );    }
Roxen.git/server/base_server/configuration.pike:751:    }       return res;   }      public array(string) userinfo(string u, RequestID|void id)   {    if(auth_module) return auth_module->userinfo(u);    else report_warning(sprintf("userinfo(): %s\n"    "%s\n", -  LOC_M("", "No authorization module"), +  LOC_M(38, "No authorization module"),    describe_backtrace(backtrace())));   }      public array(string) userlist(RequestID|void id)   {    if(auth_module) return auth_module->userlist();    else report_warning(sprintf("userlist(): %s\n"    "%s\n", -  LOC_M("", "No authorization module"), +  LOC_M(38, "No authorization module"),    describe_backtrace(backtrace())));   }      public array(string) user_from_uid(int u, RequestID|void id)   {    if(auth_module)    return auth_module->user_from_uid(u);    else report_warning(sprintf("user_from_uid(): %s\n"    "%s\n", -  LOC_M("", "No authorization module"), +  LOC_M(38, "No authorization module"),    describe_backtrace(backtrace())));   }      public string last_modified_by(Stdio.File file, RequestID id)   {    array(int) s;    int uid;    array u;       if(objectp(file)) s=file->stat();
Roxen.git/server/base_server/configuration.pike:924: Inside #if defined(MODULE_LEVEL_SECURITY)
   return Roxen.http_auth_required(seclevels[2]);    }    }    break;    }    }    };       if (err) {    report_error("check_security(): %s:\n%s\n", -  LOC_M("", "Error during module security check"), +  LOC_M(39, "Error during module security check"),    describe_backtrace(err));    return 1;    }       if (ip_ok == 1) {    // Bad IP.    return 1;    } else {    // IP OK, or no IP restrictions.    if (auth_ok == 1) {
Roxen.git/server/base_server/configuration.pike:970:   }      // Empty all the caches above AND the ones in the loaded modules.   void clear_memory_caches()   {    invalidate_cache();    foreach(indices(otomod), RoxenModule m)    if (m && m->clear_memory_caches)    if (mixed err = catch( m->clear_memory_caches() ))    report_error("clear_memory_caches() "+ -  LOC_M("", "failed for module %O:\n%s\n"), +  LOC_M(40, "failed for module %O:\n%s\n"),    otomod[m], describe_backtrace(err));   }      string draw_saturation_bar(int hue,int brightness, int where)   {    Image.Image bar=Image.Image(30,256);       for(int i=0;i<128;i++)    {    int j = i*2;
Roxen.git/server/base_server/configuration.pike:2338:    if( !me )    {    if(err = catch(me = moduleinfo->instance(this_object())))    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");    if (err != "") {   #endif    string bt=describe_backtrace(err);    report_error("enable_module(): " + -  LOC_M("", "Error while initiating module copy of %s%s"), +  LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));   #ifdef MODULE_DEBUG    }   #endif    return module[id];    }    }       if(module[id] && module[id] != me)    {
Roxen.git/server/base_server/configuration.pike:2494:   {    int module_type = moduleinfo->type, pr;    mixed err;    if((me->start) && (err = catch( me->start(0, this_object()) ) ) )    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs)    report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOC_M("", "Error while initiating module copy of %s%s"), +  report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));       /* Clean up some broken references to this module. */   // m_delete(otomod, me);   // m_delete(module->copies, search( module->copies, me ));   // destruct(me);   // return 0;    }    if( inited && me->ready_to_receive_requests )    if( mixed q = catch( me->ready_to_receive_requests( this_object() ) ) )
Roxen.git/server/base_server/configuration.pike:2518:   #endif    report_error( "While calling ready_to_receive_requests:\n"+    describe_backtrace( q ) );    }    if (err = catch(pr = me->query("_priority")))    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOC_M("", "Error while initiating module copy of %s%s"), +  report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));    pr = 3;    }       api_module_cache |= me->api_functions();       if(module_type & MODULE_EXTENSION)    {    report_error("%s is an MODULE_EXTENSION, that type is no "    "longer available.\nPlease notify the modules writer.\n"
Roxen.git/server/base_server/configuration.pike:2550:    if(pri[pr]->file_extension_modules[foo] )    pri[pr]->file_extension_modules[foo]+=({me});    else    pri[pr]->file_extension_modules[foo]=({me});    }    }) {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOC_M("", "Error while initiating module copy of %s%s"), +  report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));    }       if(module_type & MODULE_PROVIDER)    if (err = catch    {    mixed provs = me->query_provides();    if(stringp(provs))    provs = (< provs >);    if(arrayp(provs))    provs = mkmultiset(provs);    if (multisetp(provs)) {    pri[pr]->provider_modules [ me ] = provs;    }    }) {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOC_M("", "Error while initiating module copy of %s%s"), +  report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));    }       if(module_type & MODULE_TYPES)    {    types_module = me;    types_fun = me->type_from_extension;    }       if(module_type & MODULE_PARSER)
Roxen.git/server/base_server/configuration.pike:2668:    int id, pr;    sscanf(modname, "%s#%d", modname, id );       ModuleInfo moduleinfo = roxen->find_module( modname );    mapping module = modules[ modname ];    string descr = moduleinfo->get_name() + (id ? " copy " + (id + 1) : "");       if(!module)    {    report_error("disable_module(): " + -  LOC_M("", "Failed to disable module:\n" +  LOC_M(42, "Failed to disable module:\n"    "No module by that name: \"%s\".\n"), modname);    return 0;    }       me = module[id];    m_delete(module->copies, id);       if(!sizeof(module->copies))    m_delete( modules, modname );       invalidate_cache();       if(!me)    {    report_error("disable_module(): " + -  LOC_M("", "Failed to disable module \"%s\".\n"), +  LOC_M(43, "Failed to disable module \"%s\".\n"),    descr);    return 0;    }       if(me->stop)    if (mixed err = catch (me->stop())) {    string bt=describe_backtrace(err);    report_error("disable_module(): " + -  LOC_M("", "Error while disabling module %s%s"), +  LOC_M(44, "Error while disabling module %s%s"),    descr, (bt ? ":\n"+bt : "\n"));    }      #ifdef MODULE_DEBUG    report_debug("Disabling "+descr+"\n");   #endif       if(moduleinfo->type & MODULE_FILE_EXTENSION)    {    string foo;
Roxen.git/server/base_server/configuration.pike:2907:    if(search(modules_to_process, "userdb#0")>-1)    modules_to_process = (({"userdb#0"})+(modules_to_process-({"userdb#0"})));       array err;    forcibly_added = (<>);    enable_module_batch_msgs = 1;    foreach( modules_to_process, tmp_string )    {    if( !forcibly_added[ tmp_string ] )    if(err = catch( enable_module( tmp_string ))) -  report_error(LOC_M("", "Failed to enable the module %s. Skipping.\n%s"), +  report_error(LOC_M(45, "Failed to enable the module %s. Skipping.\n%s"),    tmp_string, describe_backtrace(err));    }    enable_module_batch_msgs = 0;    roxenloader.pop_compile_error_handler();    if( strlen( ec->get() ) )    report_error( "While enabling modules in "+name+":\n"+ec->get() );    if( strlen( ec->get_warnings() ) )    report_warning( "While enabling modules in "+name+":\n"+ec->get_warnings());       foreach( ({this_object()})+indices( otomod ), object mod )