helma/Root/main.hac

45 lines
1.1 KiB
Text
Raw Normal View History

/**
* 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.clearCache();
res.redirect ( appObj.href("main") );
}
}
// output only to root
if ( checkAuth()==false ) return;
res.data.title = "Helma Object Publisher - Serverinfo";
res.data.body = this.renderSkinAsString("main");
renderSkin("global");