2002-12-04 09:21:40 +00:00
|
|
|
|
|
|
|
if (checkAddress()==false)
|
2002-11-21 18:36:03 +00:00
|
|
|
return;
|
2002-03-11 13:49:50 +00:00
|
|
|
|
2002-12-04 09:21:40 +00:00
|
|
|
var obj = new Object();
|
|
|
|
obj.msg = "";
|
|
|
|
if (req.data.username!=null && req.data.password!=null) {
|
|
|
|
|
|
|
|
// we have input from webform
|
|
|
|
if ( req.data.username=="" )
|
|
|
|
obj.msg += "username can't be left empty!<br>";
|
|
|
|
if ( req.data.password=="" )
|
|
|
|
obj.msg += "password can't be left empty!<br>";
|
|
|
|
if ( obj.msg!="" ) {
|
|
|
|
obj.username = req.data.username;
|
|
|
|
res.reset();
|
|
|
|
res.data.body = renderSkinAsString ("pwdform",obj);
|
|
|
|
} else {
|
|
|
|
// render the md5-string:
|
|
|
|
obj.propsString = "adminAccess=" + Packages.helma.util.MD5Encoder.encode(req.data.username + "-" + req.data.password) + "<br>\n";
|
|
|
|
res.data.body = renderSkinAsString ("pwdfeedback", obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// no input from webform, so print it
|
|
|
|
res.data.body = renderSkinAsString("pwdform",obj);
|
|
|
|
|
|
|
|
}
|
2002-03-11 13:49:50 +00:00
|
|
|
|
2002-12-04 09:21:40 +00:00
|
|
|
res.data.title = "username & password on " + root.hostname_macro();
|
|
|
|
res.data.head = renderSkinAsString("head");
|
|
|
|
renderSkin("basic");
|