helma/Root/main.hac
stefanp 4a7616d5a0 This commit was generated by cvs2svn to compensate for changes in r2155,
which included commits to RCS files with non-trunk default branches.
2002-03-11 13:49:50 +00:00

46 lines
1.1 KiB
Text

/**
* main action, show server-stats
* perform start, stop, restart and flush-action
*
*/
if ( checkAddress()==false ) return;
if ( req.data.app!=null && req.data.app!="" && req.data.action!=null && req.data.action!="" ) {
var appObj = root.getApp(req.data.app);
// check access for application. md5-encoded uname/pwd can also be put in
// app.properties to limit access to a single app
if ( checkAuth(appObj)==false ) return;
if ( req.data.action=="start" ) {
this.startApplication(req.data.app);
res.redirect ( appObj.href("main") );
} else if ( req.data.action=="stop" ) {
if ( checkAuth()==false ) return;
this.stopApplication(req.data.app);
res.redirect ( root.href("main") );
} else if ( req.data.action=="restart" ) {
this.stopApplication(req.data.app);
this.startApplication(req.data.app);
res.redirect ( appObj.href("main") );
} else if ( req.data.action=="flush" ) {
appObj.clearAppCache();
res.redirect ( appObj.href("main") );
}
}
// output only to root
if ( checkAuth()==false ) return;
res.skin = "global";
res.title = "Helma Object Publisher - Serverinfo";
res.body = this.renderSkinAsString("main");