helma/Root/main.hac
hns b46c2f1f4f The duplicate clearAppCache() method in Application() isn't necessary
anymore because a JavaScript prototype without all the HopObject
crap is used for scripting Java objects now. Calling clearCache()
will reach through to the Java method.
2002-03-19 19:32:41 +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.clearCache();
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");