1997-08-12
1997-08-12 11:10:42 by Per Hedbor <ph@opera.com>
-
00aff8e352ebf37cb0681ae6e55cd626373fb83a
(60 lines)
(+45/-15)
[
Show
| Annotate
]
Branch: 5.2
nu med actions
Rev: server/base_server/config/builders.pike:1.10
Rev: server/base_server/config/describers.pike:1.31
Rev: server/base_server/mainconfig.pike:1.53
Rev: server/config_actions/changepass.pike:1.1
Rev: server/config_actions/reloadmoduledb.pike:1.1
Rev: server/etc/include/confignode.h:1.2
Rev: server/etc/restart.html:1.11
1:
inherit "config/builders";
- string cvs_version = "$Id: mainconfig.pike,v 1.52 1997/08/12 09:35:06 neotron Exp $";
+ string cvs_version = "$Id: mainconfig.pike,v 1.53 1997/08/12 11:10:33 per Exp $";
inherit "roxenlib";
inherit "config/draw_things";
67:
"</a>\n "+s+"\n");
}
- string describe(int i)
+ mixed describe(int i, object id)
{
array (string) res=({""});
object node,prevnode;
mixed tmp;
if(describer)
- tmp = describer(this_object());
+ tmp = describer(this_object(), id);
#ifdef NODE_DEBUG
else
{
82: Inside #if defined(NODE_DEBUG)
return 0;
}
#endif
+ if(mappingp(tmp)) {
+ werror("Got mapping.\n");
+ return tmp;
+ }
if(arrayp(tmp) && sizeof(tmp))
PUSH(tmp[0] + "<dt>" + (i?tmp[i]:show_me(tmp[1])) + "\n");
else if(stringp(tmp) && strlen(tmp))
274:
"value=\"%s\">\n</pre><p>",
name, name, def);
}
- changed_port_servers = ([]);
+ changed_port_servers = (<>);
return stores(res+"<input type=submit value=\"Continue...\"></form>");
}
974:
"Globals":"/Globals",
"Status":"/Status",
"Errors":"/Errors",
+ "Actions":"/Actions",
]);
array tabs = ({
981:
"Globals",
"Status",
"Errors",
+ "Actions",
});
array tab_names = ({
- " Virtual servers ",
- " Global variables ",
- " Status info ",
- " Event log ",
+ "Virtual Servers",
+ "Global variables",
+ "Status",
+ "Events",
+ "Actions",
});
1000:
selected_nodes[tabs[1]]+"?"+(bar++),
selected_nodes[tabs[2]]+"?"+(bar++),
selected_nodes[tabs[3]]+"?"+(bar++),
+ selected_nodes[tabs[4]]+"?"+(bar++),
});
if(node != root)
1126:
string dn(object node)
{
if(!node) return "???";
- string s = node->_path[-1];
+ string s = sizeof(node->_path)?node->_path[-1]:".";
if(((string)((int)s))==s)
return "Instance "+s;
-
+ switch(s)
+ {
+ case "Globals":
+ return "Global Variables";
+ case "Configurations":
+ return "Servers";
+ case "Errors":
+ return "Events";
+ }
return s;
}
1139:
foreach(node->path(1)/"/", string p)
{
q+=p+"/";
- if(cnt>=2)
+ if(cnt>0)
{
// werror("q="+q+"\n");
- res += "<font size=+1><a href="+q+">"+
- dn(find_node(http_decode_string(q[..strlen(q)-2])))+"</a></font> -> ";
+ res += "<b><font size=+1><a href="+q+">"+
+ dn(find_node(http_decode_string(q[..strlen(q)-2])))+"</a></font></b> -> ";
}
else
cnt++;
1154:
string status_row(object node)
{
return ("<table width=100% bgcolor=#dddddd border=0 cellpadding=0"
- " cellspacing=0><tr><td align=left><a href=$docurl><img border=0 "
+ " cellspacing=0><tr><td valign=center align=left><a href=$docurl><img border=0 "
"src=/image/roxen-small.gif></a></td><td align=right valign=top>"+
- describe_node_path(node)+"</td></tr></table><br>");
+ describe_node_path(node)+"</td><td> </td></tr></table><br>");
}
-
+ mapping logged = ([ ]);
-
+ void check_login(object id)
+ {
+ if(logged[id->remoteaddr]+1000<time())
+ report_notice("Administrator logged on from "+
+ roxen->blocking_ip_to_host(id->remoteaddr)+".");
+ logged[id->remoteaddr]=time(1);
+ }
+
mapping configuration_parse(object id)
{
array (string) res=({});
1586:
return std_redirect(o, id);
}
+ check_login(id);
+
PUSH(default_head("Roxen server configuration"));
// PUSH("<table><tr><td> <td>"
PUSH("<dl>\n");
1596:
"<img src=/auto/back alt='[Up]' align=left hspace=0 border=0></a>\n");
if(i=o->folded) o->folded=0;
- string tmp = o->describe(1);
+ mixed tmp = o->describe(1,id);
+ if(mappingp(tmp)) return tmp;
if(!id->supports->font)
tmp = parse_html(tmp, ([]),(["font":remove_font, ]));
PUSH(tmp);