Roxen.git
/
server
/
base_server
/
mainconfig.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/base_server/mainconfig.pike:1:
inherit "config/builders";
-
string cvs_version = "$Id: mainconfig.pike,v 1.
31
1997/02/
07
21
:
11
:
20
nisse
Exp $";
+
string cvs_version = "$Id: mainconfig.pike,v 1.
32
1997/02/
13
13
:
00
:
57
per
Exp $";
inherit "roxenlib"; inherit "config/draw_things";
-
+
import Stdio;
+
import Array;
+
#include <confignode.h> #include <module.h> #define dR "00" #define dG "06" #define dB "30" #define bdR "00" #define bdG "50" #define bdB "90"
Roxen.git/server/base_server/mainconfig.pike:237:
} } return 0; } mixed decode_form_result(string var, int type, object node, mapping allvars) { switch(type) { case TYPE_MODULE_LIST:
-
return map
_array
(var/"\000", find_module);
+
return map(var/"\000", find_module);
case TYPE_MODULE: return find_module(var, node->config()); case TYPE_PORTS: /* Encoded like this: new_port --> Add a new port ok[_<ID>] --> Save the value for all or one port
Roxen.git/server/base_server/mainconfig.pike:282:
op[i][1] = allvars["protocol_"+i]||op[i][1]; op[i][2] = allvars["ip_number_"+i]||op[i][2]; op[i][3] = allvars["arguments_"+i]||op[i][3]; } else // Delete this port. op[i]=0; } return op - ({ 0 }); case TYPE_DIR_LIST: array foo;
-
foo=map
_array
((var-" ")/",", lambda(string var, object node) {
-
if (!strlen( var ) || file_
size
( var ) != -2)
+
foo=map((var-" ")/",", lambda(string var, object node) {
+
if (!strlen( var ) || file_
stat
( var )
[1]
!= -2)
{ if(node->error) node->error += ", " +var + " is not a directory"; else node->error = var + " is not a directory"; return 0; } if(var[-1] != '/') return var + "/"; return var; }, node); if(sizeof(foo-({0})) != sizeof(foo)) return 0; return foo; case TYPE_DIR:
-
if (!strlen( var ) || file_
size
( var ) != -2)
+
if (!strlen( var ) || file_
stat
( var )
[1]
!= -2)
{ node->error = var + " is not a directory"; return 0; } if(var[-1] != '/') return var + "/"; return var; case TYPE_TEXT_FIELD: var -= "\r";
Roxen.git/server/base_server/mainconfig.pike:347:
{ node->error= var + " is not a arbitary precision floating point number"; return 0; } return tmp; case TYPE_INT_LIST: if(node->data[VAR_MISC]) return (int)var; else
-
return map
_array
((var-" ")/",", lambda(string s){
+
return map((var-" ")/",", lambda(string s){
return (int)s; }); case TYPE_STRING_LIST: if(node->data[VAR_MISC]) return var; else return (var-" ")/",";
Roxen.git/server/base_server/mainconfig.pike:406:
{ 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("")
+ 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])
Roxen.git/server/base_server/mainconfig.pike:814:
} mapping (string:string) selected_nodes = ([ "Configurations":"/Configurations", "Globals":"/Globals", "Status":"/Status", "Errors":"/Errors", ]);
-
constant
tabs = ({
+
array
tabs = ({
"Configurations", "Globals", "Status", "Errors", });
-
constant
tab_names = ({
+
array
tab_names = ({
" Virtual servers ", " Global variables ", " Status info ", " Error log ", }); string display_tabular_header(object node) { string p, s;
Roxen.git/server/base_server/mainconfig.pike:858:
int nunfolded(object o) { int i; if(o = o->down) do { i+=!o->folded; } while(o=o->next); return i; }
-
object module_font =
Font
(
)->load(
"base_server/config/font");
-
object button_font =
Font
(
)->load(
"base_server/config/button_font");
+
object module_font =
get_font
("base_server/config/font"
,0,0,0,"left",1.0,1.0
);
+
object button_font =
get_font
("base_server/config/button_font"
,0,0,0,"left",1.0,1.0
);
mapping auto_image(string in, object id) { string key, value; array trans = ({ (int)("0x"+dR),(int)("0x"+dG),(int)("0x"+dB) }); mapping r; mixed e; object i; if(r=cache_lookup("config_images", in)) return r;
Roxen.git/server/base_server/mainconfig.pike:998:
if(!o) // Bad node, perhaps an old bookmark or something. { id->referer = ({ }); return std_redirect(0, id); } else if(o == root) { // The URL is http://config-url/, not one of the top nodes, but // _above_ them. This is supposed to be some nice introductory // text about the configuration interface... return http_string_answer(default_head("Roxen Challenger")+
-
display_tabular_header(root)
+read
_bytes("etc/config.html"),"text/html");
+
display_tabular_header(root)
+
+
read
_bytes("etc/config.html"),"text/html");
} if(sizeof(id->prestate)) { switch(indices(id->prestate)[0]) { // It is possible to mark variables as 'VAR_EXPERT', this // will make it impossible to configure them whithout the // 'expert' mode. It can be useful. case "expert": expert_mode = 1; break;
Roxen.git/server/base_server/mainconfig.pike:1186:
for(i=0; i<sizeof(roxen->configurations); i++) if(roxen->configurations[i] == o->data) break; if(i==sizeof(roxen->configurations)) error("Configuration not found.\n"); roxen->remove_configuration(o->data->name); if(roxen->configurations[i]->ports_open)
-
map
_array
(values(roxen->configurations[i]->ports_open), destruct);
+
map(values(roxen->configurations[i]->ports_open), destruct);
destruct(roxen->configurations[i]); roxen->configurations = roxen->configurations[..i-1] + roxen->configurations[i+1..]; o->change(-o->changed); o->dest(); break; case NODE_MODULE_COPY_VARIABLE: