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.24 1996/12/06 17:04:19 per Exp $"; + string cvs_version = "$Id: mainconfig.pike,v 1.25 1996/12/06 23:01:16 per Exp $";   inherit "roxenlib";   inherit "config/draw_things";      #include <confignode.h>   #include <module.h>      #define dR "00"   #define dG "06"   #define dB "30"   
Roxen.git/server/base_server/mainconfig.pike:412:   {    string res="";    object o;    foreach(roxen->configurations, o)    res += "<option>Copy of '"+o->name+"'";    return res;   }      string new_configuration_form()   { -  return replace(default_head("")+read_bytes("etc/newconfig.html"), ({"$COPIES","$configurl"}), +  return replace(default_head("")+"<blockquote>"+read_bytes("etc/newconfig.html"), ({"$COPIES","$configurl"}),    ({configuration_list(),CONFIG_URL})) + -  "\n\n</body>"; +  "\n\n</blockquote></body>";   }      mapping module_nomore(string name, int type, object conf)   {    mapping module;    object o;   // perror("Module: "+name+"\n");    if((module = conf->modules[name])    && (!module->copies && module->enabled))    return module;
Roxen.git/server/base_server/mainconfig.pike:510:    roxen->rescan_modules();    perror("CONFIG: Done.\n");    }       a=roxen->allmodules;    mods=sort_array(indices(a), lambda(string a, string b, mapping m) {    return m[a][0] > m[b][0];    }, a);       res = ({default_head("Add a module")+"\n\n"+ -  "<table width=500><tr><td width=500>" +  "<blockquote><table width=500><tr><td width=500>"    "<h2>Select a module to add from the list below</h2>" });       foreach(mods, q)    {    if(b = module_nomore(q, a[q][2], node->config()))    {    if(b->sname != q)    res += ({("<p>"+    (roxen->QUERY(BS)?"<h2>"+a[q][0]+"</h2>":    "<img alt=\""+a[q][0]+"\" src=/auto/module/"+
Roxen.git/server/base_server/mainconfig.pike:535:    "\">Disable that module</a> if you want this one insted</i>"    "\n<p><br><p>")});    } else {    res += ({"<p><a href=/(newmodule)"+node->path(1)+"?"+q+"=1>"+    (roxen->QUERY(BS)?"<h2>"+a[q][0]+"</h2>":    "<img border=0 alt=\""+a[q][0]+"\" src=/auto/module/"+    q+" width=500>")+    "</a><br>"+a[q][1]+"<p><br><p>"});    }    } -  return res*""+"</td></tr></table>"; +  return res*""+"</td></tr></table></blockquote>";   }      mapping new_module(object id, object node)   {    string varname;       if(!sizeof(id->variables))    return stores(new_module_form(id, node));       varname=indices(id->variables)[0];
Roxen.git/server/base_server/mainconfig.pike:682:    return 1;   }      mapping new_configuration(object id)   {    if(!sizeof(id->variables))    return stores(new_configuration_form());       if(!id->variables->name)    return stores(default_head("Bad luck")+ -  "<h1>No configuration name?</h1>" +  "<blockquote><h1>No configuration name?</h1>"    "Either you entered no name, or your WWW-browser " -  "failed to include it in the request"); +  "failed to include it in the request</blockquote>");       id->variables->name=(replace(id->variables->name,"\000"," ")/" "-({""}))*" ";    if(!low_enable_configuration(id->variables->name, id->variables->type))    return stores(default_head("Bad luck") + -  "<h1>Illegal configuration name</h1>" +  "<blockquote><h1>Illegal configuration name</h1>"    "The name of the configuration must contain characters"    " other than space and tab, it should not end with "    "~, and it must not be 'CVS', 'Global Variables' or "    "'global variables', nor the name of an existing " -  "configuration, and the character '/' cannot be included"); +  "configuration, and the character '/' cannot be included</blockquote>");    return std_redirect(root->descend("Configurations"), id);   }      int conf_auth_ok(mixed auth)   {    if(!(auth && sizeof(auth)>1))    return 0;       if(sscanf(auth[1], "%s:%s", auth[0], auth[1]) < 2)    return 0;
Roxen.git/server/base_server/mainconfig.pike:754:       n2 = node->descend("Configuration interface", 1)->descend("User", 1);    n2->data[VAR_VALUE] = roxen->QUERY(ConfigurationUser);    n2->change(1);       root->save();    return std_redirect(root, id);    }    }    -  res = default_head("Welcome to Roxen Challenger") + "<hr noshade>"; +  res = default_head("Welcome to Roxen Challenger") + "<blockquote>";       res += read_bytes("etc/welcome.html");    if(error && strlen(error))    res += "\n<p><b>"+error+"</b>";       res += ("<pre>"    "<font size=+1>"    "<form action=/(initial)/Globals/>"    " User name <input name=user type=string>\n"    " Password <input name=pass type=password>\n"    " Again <input name=pass2 type=password>\n"   // Avoid this trap for people that likes to shoot themselevs in the foot.   // /Peter   // "IP-pattern <input name=pattern type=string>\n"    " <input type=submit value=\"Use these values\">\n" -  "</form></font></pre>"); +  "</form></font></pre></blockquote>");       return stores(res);   }      object module_of(object node)   {    while(node)    {    if(node->type == NODE_MODULE_COPY)    return node->data;
Roxen.git/server/base_server/mainconfig.pike:1154:    case NODE_MODULE_COPY_VARIABLES:       case NODE_MODULE_COPY:    PUSH("<font size=+2>Do you really want to delete this copy "    " of the module "+ o->up->data->name + "?\n\n<p></font>");    break;       case NODE_CONFIGURATIONS:    return stores("You don't want to do that...\n");    } -  PUSH("<font size=+2><i>This action cannot be undone.\n\n<p></font>"+ +  PUSH("<blockquote><font size=+2><i>This action cannot be undone.\n\n<p></font>"+    TABLEP("<table>", "") +"<tr><td><form action="+    o->path(1)+">"    "<input type=submit value=\"No, I do not want to delete it\"> "    "</form></td><td><form action=/(really_delete)"+o->path(1)+    "><input type=submit value=\"Go ahead\"></form></td></tr> " -  "</table>"); +  "</table></blockquote>");       return stores(res*"");    break;       /* When this has been called, the node will be * _very_ deleted    * The amount of work needed to delete a node does vary    * depending on the node, since there is no 'zap' function in    * the nodes at the moment. I will probably move this code into    * function-pointers in the nodes.    */