@@ -47,7 +47,7 @@ public function display($req, $res, $args)
4747
4848 return $ this ->model ->update_mod_forums ($ args ['id ' ]);
4949 } elseif (Input::post ('ban ' )) {
50- if (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && (User::get ()-> g_moderator != '1 ' || User::get ()->g_mod_ban_users == '0 ' )) {
50+ if (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && (User::getPref ( ' mod.is_mod ' ) != '1 ' || User::get ()->g_mod_ban_users == '0 ' )) {
5151 throw new Error (__ ('No permission ' ), 403 );
5252 }
5353
@@ -199,7 +199,7 @@ public function display($req, $res, $args)
199199
200200 } elseif ($ args ['section ' ] == 'admin ' ) {
201201
202- if (!User::get ()->is_admmod || (User::get ()-> g_moderator == '1 ' && User::get ()->g_mod_ban_users == '0 ' )) {
202+ if (!User::get ()->is_admmod || (User::getPref ( ' mod.is_mod ' ) == '1 ' && User::get ()->g_mod_ban_users == '0 ' )) {
203203 throw new Error (__ ('Bad request ' ), 404 );
204204 }
205205
@@ -244,7 +244,7 @@ public function action($req, $res, $args)
244244
245245 if (!User::get ()->is_admmod ) { // A regular user trying to change another user's password?
246246 throw new Error (__ ('No permission ' ), 403 );
247- } elseif (User::get ()-> g_moderator == '1 ' ) {
247+ } elseif (User::getPref ( ' mod.is_mod ' ) == '1 ' ) {
248248 // A moderator trying to change a user's password?
249249 $ user ['select ' ] = array ('u.group_id ' , 'g.g_moderator ' );
250250
@@ -285,7 +285,7 @@ public function action($req, $res, $args)
285285
286286 if (!User::get ()->is_admmod ) { // A regular user trying to change another user's email?
287287 throw new Error (__ ('No permission ' ), 403 );
288- } elseif (User::get ()-> g_moderator == '1 ' ) {
288+ } elseif (User::getPref ( ' mod.is_mod ' ) == '1 ' ) {
289289 // A moderator trying to change a user's email?
290290 $ user ['select ' ] = array ('u.group_id ' , 'g.g_moderator ' );
291291
@@ -348,7 +348,7 @@ public function action($req, $res, $args)
348348
349349 return Router::redirect (Router::pathFor ('profileSection ' , array ('id ' => $ args ['id ' ], 'section ' => 'personality ' )), __ ('Avatar deleted redirect ' ));
350350 } elseif ($ args ['action ' ] == 'promote ' ) {
351- if (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && (User::get ()-> g_moderator != '1 ' || User::get ()->g_mod_promote_users == '0 ' )) {
351+ if (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && (User::getPref ( ' mod.is_mod ' ) != '1 ' || User::get ()->g_mod_promote_users == '0 ' )) {
352352 throw new Error (__ ('No permission ' ), 403 );
353353 }
354354
0 commit comments