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.
127
1999/06/
07
00
:
22
:
50
mast
Exp $";
+
string cvs_version = "$Id: mainconfig.pike,v 1.
128
1999/06/
11
15
:
46
:
30
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:901:
object oT; object get_template(string t) { t-=".pike"; if(ot==t) return oT; ot=t; return (oT = compile_file("server_templates/"+t+".pike")()); } int check_config_name(string name) {
-
if(
strlen
(name)
&&
name[-1] == '~')
name
=
"";
-
if
(search(name, "/")!= -1) return 1;
+
if((name
== ""
)
||
+
(
name[-1] == '~')
||
+
(search(name, "/")
!= -1)
)
{
+
return 1;
+
}
-
+
name = lower_case(name);
+
foreach(roxen->configurations, object c)
-
if(lower_case(c->name) ==
lower_case(
name)
)
+
if(lower_case(c->name) == name)
return 1;
-
switch
(
lower_case(name))
{
-
case
" "
:
case
"\t"
:
case
"cvs"
:
-
case
"global variables"
:
-
return 1
;
+
return
(
<
" "
,
"\t"
,
"cvs"
,
"global variables"
>)[name]
;
}
-
return !strlen(name);
-
}
+
int low_enable_configuration(string name, string type) { object node; object o, o2, confnode; array(string) arr = replace(type,"."," ")/" "; object template; if(check_config_name(name)) return 0;
Roxen.git/server/base_server/mainconfig.pike:987:
return 1; } mapping new_configuration(object id) { if(!sizeof(id->variables)) return stores(new_configuration_form()); if(id->variables->no) return http_redirect(roxen->config_url()+id->not_query[1..]+"?"+bar++);
+
// FIXME: Localize!
+
if(!id->variables->name) return stores(default_head("Bad luck")+ "<blockquote><h1>No configuration name?</h1>" "Either you entered no name, or your WWW-browser " "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") + "<blockquote><h1>Illegal configuration name</h1>"
-
"The name of the configuration must contain characters"
-
"
other than space and tab, it should not end with "
+
"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
</blockquote>");
+
"configuration, and the character '/' cannot be
"
+
"used
</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:1429:
id->referer = ({ }); foreach(indices(selected_nodes), string n) if(selected_nodes[n] == id->not_query) selected_nodes[n] = "/"+n; 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...
-
// We also need to determine
wether
this is the full or the
+
// We also need to determine
whether
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 =
Roxen.git/server/base_server/mainconfig.pike:1464:
// 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; case "noexpert": expert_mode = 0; break; case "morevars": more_mode = 1; save_more_mode(); break; case "nomorevars": more_mode = 0; save_more_mode(); break; // Fold and unfold nodes, this is _very_ simple, once all the
-
// supporting code was
writte
.
+
// supporting code was
written
.
case "fold": o->folded=1; break; case "unfold": o->folded=0; break; case "moredocs": o->moredocs=1; break; case "lessdocs": o->moredocs=0; break; case "foldall": o->map(lambda(object o) { o->folded=1; }); break;