antville/code/ImageMgr/create.hac

29 lines
860 B
Text
Raw Normal View History

checkIfLoggedIn(this.href(req.action));
2001-10-07 19:31:19 +00:00
var deny = this.isDenied(session.user,req.data.memberlevel);
2001-09-05 21:54:06 +00:00
if (deny) {
2002-12-01 19:26:40 +00:00
res.message = getMessage("error",deny);
res.redirect(path.site.href());
2001-09-05 21:54:06 +00:00
}
2001-06-18 08:57:33 +00:00
2001-09-05 21:54:06 +00:00
if (req.data.submit == "cancel" || req.data.cancel)
2001-06-18 08:57:33 +00:00
res.redirect(this.href());
else if (req.data.submit == "save" || req.data.save) {
// check if a url has been passed instead of a file upload. hw
if ((!req.data.rawimage || req.data.rawimage.contentLength == 0) && req.data.url)
req.data.rawimage = getURL(req.data.url);
var result = this.evalImg(req.data,session.user);
res.message = result.message;
if (!result.error)
res.redirect(this.href());
}
2001-06-18 08:57:33 +00:00
2002-05-15 23:12:41 +00:00
res.data.action = this.href(req.action);
res.data.title = path.site.title;
2001-09-05 21:54:06 +00:00
var newImg = new image();
res.data.body = newImg.renderSkinAsString("new");
path.site.renderSkin("page");