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.45 1997/07/19 22:22:14 grubba Exp $"; + string cvs_version = "$Id: mainconfig.pike,v 1.46 1997/08/04 07:52:30 grubba Exp $";   inherit "roxenlib";   inherit "config/draw_things";      import Array;   import Stdio;      /* Work-around for Simulate.perror */   #define perror roxen_perror      #include <confignode.h>
Roxen.git/server/base_server/mainconfig.pike:419:   {    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"}), -  ({configuration_list(),CONFIG_URL})) + +  return replace(default_head("") + read_bytes("etc/newconfig.html"), +  ({"$COPIES", "$configurl"}), +  ({configuration_list(), CONFIG_URL})) +    "\n\n</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))
Roxen.git/server/base_server/mainconfig.pike:537:    res += ({("<p>"+    (roxen->QUERY(BS)?"<h2>"+a[q][0]+"</h2>":    "<img alt=\""+a[q][0]+"\" src=/auto/module/" +a[q][2]+"/"+    q+" height=24 width=500>")+ "<br><blockquote>" + a[q][1] +    "<p><i>A module of the same type is already enabled (" +    b->name + "). <a href=\"/(delete)" +    node->descend(b->name, 1)->path(1) + "?" + (bar++) +    "\">Disable that module</a> if you want this one instead</i>"    "\n<p><br><p></blockquote>")});    } else { -  res += ({"<p><a href=/(newmodule)"+node->path(1)+"?"+q+"=1>"+ +  res += ({"<p><a href=/(addmodule)"+node->path(1)+"?"+q+"=1>"+    (roxen->QUERY(BS)?"<h2>"+a[q][0]+"</h2>":    "<img border=0 alt=\""+a[q][0]+"\" src=/auto/module/"    +a[q][2]+"/"+q+" height=24 width=500>")+    "</a><blockquote><br>"+a[q][1]+"<p><br><p></blockquote>"});    }    }    return res*"";   }      mapping new_module(object id, object node)
Roxen.git/server/base_server/mainconfig.pike:586:    case "\t":    case "CVS":    case "Global Variables":    case "global variables":    case "Global variables":    return 0;    break;       default:    object o, o2, confnode; +  array(string) arr = type/" ";    -  switch(type = lower_case((type/" ")[0])) { +  switch(type = lower_case(arr[0])) {    default: /* Minimal configuration */    case "bare":    o=roxen->enable_configuration(name);    break;       case "standard":    o = roxen->enable_configuration(name);    o->enable_module("cgi#0");    o->enable_module("contenttypes#0");    o->enable_module("ismap#0");
Roxen.git/server/base_server/mainconfig.pike:634:    o->enable_module("proxy#0");    o->enable_module("gopher#0");    o->enable_module("ftpgateway#0");    o->enable_module("contenttypes#0");    o->enable_module("wais#0");    break;       case "copy":    string from;    mapping tmp; -  sscanf(type, "%*s'%s'", from); -  tmp = roxen->copy_configuration(from, name); -  if(!tmp) error("No configuration to copy from!\n"); -  tmp["spider#0"]->LogFile = "../logs/"+roxenp()->short_name(name)+"/Log"; +  if ((sizeof(arr) > 1) && +  (sscanf(arr[1..]*" ", "%*s'%s'", from) == 2) && +  (tmp = roxen->copy_configuration(from, name))) { +  tmp["spider#0"]->LogFile = +  "../logs/" + roxenp()->short_name(name) + "/Log";    roxenp()->save_it(name);    roxen->enable_configuration(name); -  +  } else { +  error("No configuration to copy from!\n");    } -  +  break; +  }    confnode = root->descend("Configurations");    node=confnode->descend(name);       node->describer = describe_configuration;    node->saver = save_configuration;    node->data = roxen->configurations[-1];    node->type = NODE_CONFIGURATION;    build_configuration(node);    node->folded=0;    node->change(1);
Roxen.git/server/base_server/mainconfig.pike:1378:    case "changepass":    return initial_configuration(id);          // Hmm. No idea, really. Beats me :-) /Per    case "new":    o->new();    break;       // Add a new module to the current configuration. -  case "newmodule": +  case "newmodule": // For backward compatibility +  case "addmodule":    id->referer = ({ CONFIG_URL + o->path(1) });    return new_module(id,o);          // Add a new copy of the current module to the current configuration.    case "newmodulecopy":    id->referer = ({ CONFIG_URL + o->path(1) });    new_module_copy_copy(o, id);    break;   
Roxen.git/server/base_server/mainconfig.pike:1444:       PUSH("</dl>");    PUSH("<p><br clear=all>&nbsp;\n");       int lm=1;       if(o->type == NODE_CONFIGURATIONS)    BUTTON(newconfig, "New virtual server", left);       if(o->type == NODE_CONFIGURATION) -  BUTTON(newmodule, "New module", left); +  BUTTON(addmodule, "Add module", left);       if(o->type == NODE_MODULE)    {    BUTTON(delete, "Delete module", left);    if(o->data->copies)    BUTTON(newmodulecopy, "Copy module", left);    }       i=0;    if(o->type == NODE_MODULE_MASTER_COPY || o->type == NODE_MODULE_COPY