@@ -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::can ('mod.is_mod ' ) || User::get ()-> g_mod_ban_users == ' 0 ' )) {
50+ if (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && (!User::can ('mod.is_mod ' ) || ! User::can ( ' mod.ban_users ' ) )) {
5151 throw new Error (__ ('No permission ' ), 403 );
5252 }
5353
@@ -75,7 +75,7 @@ public function display($req, $res, $args)
7575 if (User::get ()->id != $ args ['id ' ] && // If we aren't the user (i.e. editing your own profile)
7676 (!User::get ()->is_admmod || // and we are not an admin or mod
7777 (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && // or we aren't an admin and ...
78- (User::get ()-> g_mod_edit_users == ' 0 ' || // mods aren't allowed to edit users
78+ (! User::can ( ' mod.edit_users ' ) || // mods aren't allowed to edit users
7979 $ info ['group_id ' ] == ForumEnv::get ('FEATHER_ADMIN ' ) || // or the user is an admin
8080 $ info ['is_moderator ' ])))) { // or the user is another mod
8181 throw new Error (__ ('No permission ' ), 403 );
@@ -94,7 +94,7 @@ public function display($req, $res, $args)
9494 if (User::get ()->id != $ args ['id ' ] && // If we aren't the user (i.e. editing your own profile)
9595 (!User::get ()->is_admmod || // and we are not an admin or mod
9696 (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && // or we aren't an admin and ...
97- (User::get ()-> g_mod_edit_users == ' 0 ' || // mods aren't allowed to edit users
97+ (! User::can ( ' mod.edit_users ' ) || // mods aren't allowed to edit users
9898 $ user ['g_id ' ] == ForumEnv::get ('FEATHER_ADMIN ' ) || // or the user is an admin
9999 $ user ['g_moderator ' ] == '1 ' )))) { // or the user is another mod
100100 $ user_info = $ this ->model ->parse_user_info ($ user );
@@ -199,7 +199,7 @@ public function display($req, $res, $args)
199199
200200 } elseif ($ args ['section ' ] == 'admin ' ) {
201201
202- if (!User::get ()->is_admmod || (User::can ('mod.is_mod ' ) && User::get ()-> g_mod_ban_users == ' 0 ' )) {
202+ if (!User::get ()->is_admmod || (User::can ('mod.is_mod ' ) && ! User::can ( ' mod.ban_users ' ) )) {
203203 throw new Error (__ ('Bad request ' ), 404 );
204204 }
205205
@@ -260,7 +260,7 @@ public function action($req, $res, $args)
260260 throw new Error (__ ('Bad request ' ), 404 );
261261 }
262262
263- if (User::get ()-> g_mod_edit_users == ' 0 ' || User::get ()-> g_mod_change_passwords == ' 0 ' || $ user ['group_id ' ] == ForumEnv::get ('FEATHER_ADMIN ' ) || $ user ['g_moderator ' ] == '1 ' ) {
263+ if (! User::can ( ' mod.edit_users ' ) || ! User::can ( ' mod.change_passwords ' ) || $ user ['group_id ' ] == ForumEnv::get ('FEATHER_ADMIN ' ) || $ user ['g_moderator ' ] == '1 ' ) {
264264 throw new Error (__ ('No permission ' ), 403 );
265265 }
266266 }
@@ -301,7 +301,7 @@ public function action($req, $res, $args)
301301 throw new Error (__ ('Bad request ' ), 404 );
302302 }
303303
304- if (User::get ()-> g_mod_edit_users == ' 0 ' || User::get ()-> g_mod_change_passwords == ' 0 ' || $ user ['group_id ' ] == ForumEnv::get ('FEATHER_ADMIN ' ) || $ user ['g_moderator ' ] == '1 ' ) {
304+ if (! User::can ( ' mod.edit_users ' ) || ! User::can ( ' mod.change_passwords ' ) || $ user ['group_id ' ] == ForumEnv::get ('FEATHER_ADMIN ' ) || $ user ['g_moderator ' ] == '1 ' ) {
305305 throw new Error (__ ('No permission ' ), 403 );
306306 }
307307 }
@@ -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::can ('mod.is_mod ' ) || User::get ()-> g_mod_promote_users == ' 0 ' )) {
351+ if (User::get ()->g_id != ForumEnv::get ('FEATHER_ADMIN ' ) && (!User::can ('mod.is_mod ' ) || ! User::can ( ' mod.promote_users ' ) )) {
352352 throw new Error (__ ('No permission ' ), 403 );
353353 }
354354
0 commit comments