Roxen.git / server / base_server / mainconfig.pike

version» Context lines:

Roxen.git/server/base_server/mainconfig.pike:1:   inherit "config/builders"; - string cvs_version = "$Id: mainconfig.pike,v 1.123 1999/05/14 02:49:27 neotron Exp $"; + string cvs_version = "$Id: mainconfig.pike,v 1.124 1999/05/15 21:25:07 grubba Exp $";   //inherit "roxenlib";      inherit "config/draw_things";      // import Array;   // import Stdio;      string status_row(object node);   string display_tabular_header(object node);   object get_template(string t);
Roxen.git/server/base_server/mainconfig.pike:188:         void create()   {    build_root(root);    init_ip_list();    call_out(init_ip_list, 0);   }      // Note stringification of ACTION and ALIGN - #define BUTTON(ACTION,TEXT,ALIGN) do{buttons += ({({"<a href=\"/("#ACTION")"+(o?o->path(1):"/")+"?"+(bar++)+"\"><img border=0 hspacing=0 vspacing=0 src=\"/auto/button/"+(lm?"lm/":""),replace(TEXT," ","%20")+"\" alt=\""+(lm?"/ ":" ")+TEXT+" /\""+((#ALIGN-" ")=="left"?"":" align="+(#ALIGN-" "))+"></a>"})});lm=0;}while(0) + #define BUTTON(ACTION,TEXT,ALIGN) do{buttons += ({({"<a href=\"/("#ACTION")"+(o?o->path(1):"/")+"?"+(bar++)+"\"><img border=0 hspacing=0 vspacing=0 src=\"/auto/button/"+(lm?"lm/":""),replace(/*string_to_utf8(*/TEXT/*)*/," ","%20")+"\" alt=\""+(lm?"/ ":" ")+TEXT+" /\""+((#ALIGN-" ")=="left"?"":" align="+(#ALIGN-" "))+"></a>"})});lm=0;}while(0)   #define PUSH_BUTTONS(CLEAR) do{if(sizeof(buttons)){buttons[-1][0]+="rm/";res+=`+(@buttons);if(CLEAR){PUSH("<br clear=all>");}}lm=1;buttons=({});}while(0)               string default_head(string h, string|void save)   {    return ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Draft//EN\">"    "<head><title>"+h+"</title>\n<META HTTP-EQUIV=\"Expires\" CONTENT=\"0\">\n</head>\n"+ BODY+"\n");   }
Roxen.git/server/base_server/mainconfig.pike:226:   }         mapping charset_encode( mapping what )   {    if(what->type && (what->type/"/")[0] == "text")    {    string enc = LOW_LOCALE->reply_encoding || LOW_LOCALE->encoding;    if(enc)    { +  if (catch {    what->data = Locale.Charset->encoder(enc)->feed(what->data)->drain(); -  +  }) { +  // Error during encoding. +  // Try using UTF8 instead. +  enc = "utf-8"; +  what->data = Locale.Charset->encoder(enc)->feed(what->data)->drain(); +  }    if(!what->extra_heads)    what->extra_heads = ([]);    what->extra_heads["Content-type"] = what->type+"; charset="+enc;    }    }    return what;   }      string charset_decode_from_url( string what )   {
Roxen.git/server/base_server/mainconfig.pike:1197:      // werror("Str=%O\n", in);       if(!module_font) module_font = resolve_font(0);    if(!button_font) button_font = resolve_font(0);    string img_key = "auto/"+replace(in,"/","_")+".gif"-" ";       if(e=file_image(encode_filename(img_key)))    return e;    -  +     key = (in/"/")[0];    value = (in/"/")[1..]*"/";   // werror("key=%O; value=%O\n", key,value);          switch(key)    {    case "module":    sscanf(value, "%*d/%s", value);    i = draw_module_header(charset_decode(roxen->allmodules[value][0]),
Roxen.git/server/base_server/mainconfig.pike:1370:      void check_login(object id)   {    if(logged[id->remoteaddr] + 1000 < time()) {    report_notice(LOCALE->    admin_logged_on(roxen->blocking_ip_to_host(id->remoteaddr)));    }    logged[id->remoteaddr] = time(1);   }    + /* This is the equvivalent to find_file() in a location module. */   mapping configuration_parse(object id)   {    array (string) res=({});    string tmp, tmp2;       if (sscanf(id->not_query, "/%s/%s", tmp, tmp2) &&    Locale.Roxen[tmp]) {    SET_LOCALE(Locale.Roxen[tmp]);    id->not_query = "/" + tmp2;    }
Roxen.git/server/base_server/mainconfig.pike:1440:    // We also need to determine wether this is the full or the    // lobotomized international version.       int full_version=0;    catch {    if (sizeof(indices(master()->resolv("_Crypto")))) {    full_version = 1;    }    };    -  mapping tmp = http_string_answer(default_head("Roxen Challenger " + +  mapping tmp = +  http_string_answer(default_head("Roxen Challenger " +    roxen->__roxen_version__ + "." +    roxen->__roxen_build__)+    status_row(root)+    display_tabular_header(root)+    Stdio.read_bytes(full_version?"etc/config.html":    "etc/config.int.html"), "text/html");    return charset_encode(tmp);    }       if(sizeof(id->prestate))