Skip to content
Snippets Groups Projects
Commit 0275d931 authored by echicken's avatar echicken
Browse files

Allow message deletion if 'mail' sub and message addressed to this user, or if...

Allow message deletion if 'mail' sub and message addressed to this user, or if msg_area.sub[MsgBase.cfg.code].is_operator.
parent 4534b6e1
No related branches found
No related tags found
No related merge requests found
......@@ -176,8 +176,7 @@ var printThread = function(sub, t) {
system.timestr(header.when_written_time),
linkify(strip_exascii(body).replace(/\r\n/g, "<br />").replace(/\n/g, "<br />"))
);
// if(sub == 'mail' || user.compare_ars(msgBase.cfg.operator_ars)) {
if(sub == 'mail' || user.number == 1) {
if(sub == 'mail' || msg_area.sub[msgBase.cfg.code].is_operator) {
out += format(
"<a class='ulLink' onclick='deleteMessage(\"http://%s/%sforum-async.ssjs\", \"%s\", \"%s\", \"sub-%s-thread-%s-%s\")'>Delete Message</a> - ",
http_request.host, webIni.appendURL, sub, header.number, sub, t, header.number
......@@ -292,8 +291,7 @@ var deleteMessage = function(sub, message) {
log(LOG_ERR, err);
return false;
}
// if(sub != "mail" && !user.compare_ars(msgBase.cfg.operator_ars)) {
if(sub != "mail" && !user.number != 1) {
if(sub != "mail" && !msg_area.sub[msgBase.cfg.code].is_operator) {
print("You're not allowed to delete that message.");
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment