@@ -713,7 +713,7 @@ public function update_profile($id, $info, $section)
713713 $ form ['admin_note ' ] = Utils::trim (Input::post ('admin_note ' ));
714714
715715 // Are we allowed to change usernames?
716- if (User::get ()-> g_id == ForumEnv:: get ( ' FEATHER_ADMIN ' ) || (User::can ('mod.is_mod ' ) && User::can ('mod.rename_users ' ))) {
716+ if (User::isAdmin ( ) || (User::can ('mod.is_mod ' ) && User::can ('mod.rename_users ' ))) {
717717 $ form ['username ' ] = Utils::trim (Input::post ('req_username ' ));
718718
719719 if ($ form ['username ' ] != $ info ['old_username ' ]) {
@@ -728,7 +728,7 @@ public function update_profile($id, $info, $section)
728728 }
729729
730730 // We only allow administrators to update the post count
731- if (User::get ()-> g_id == ForumEnv:: get ( ' FEATHER_ADMIN ' )) {
731+ if (User::isAdmin ( )) {
732732 $ form ['num_posts ' ] = intval (Input::post ('num_posts ' ));
733733 }
734734 }
@@ -771,7 +771,7 @@ public function update_profile($id, $info, $section)
771771 $ form ['url ' ] = '' ;
772772 }
773773
774- if (User::get ()-> g_id == ForumEnv:: get ( ' FEATHER_ADMIN ' )) {
774+ if (User::isAdmin ( )) {
775775 $ form ['title ' ] = Utils::trim (Input::post ('title ' ));
776776 } elseif (User::can ('user.set_title ' )) {
777777 $ form ['title ' ] = Utils::trim (Input::post ('title ' ));
@@ -1114,7 +1114,7 @@ public function edit_essentials($id, $user)
11141114 $ user_disp = Container::get ('hooks ' )->fire ('model.profile.edit_essentials_start ' , $ user_disp , $ id , $ user );
11151115
11161116 if (User::isAdminMod ()) {
1117- if (User::get ()-> g_id == ForumEnv:: get ( ' FEATHER_ADMIN ' ) || User::can ('mod.rename_users ' )) {
1117+ if (User::isAdmin ( ) || User::can ('mod.rename_users ' )) {
11181118 $ user_disp ['username_field ' ] = '<label class="required"><strong> ' .__ ('Username ' ).' <span> ' .__ ('Required ' ).'</span></strong><br /><input type="text" name="req_username" value=" ' .Utils::escape ($ user ['username ' ]).'" size="25" maxlength="25" required /><br /></label> ' ."\n" ;
11191119 } else {
11201120 $ user_disp ['username_field ' ] = '<p> ' .sprintf (__ ('Username info ' ), Utils::escape ($ user ['username ' ])).'</p> ' ."\n" ;
@@ -1134,13 +1134,13 @@ public function edit_essentials($id, $user)
11341134 $ user_disp ['posts_field ' ] = '' ;
11351135 $ posts_actions = array ();
11361136
1137- if (User::get ()-> g_id == ForumEnv:: get ( ' FEATHER_ADMIN ' )) {
1137+ if (User::isAdmin ( )) {
11381138 $ user_disp ['posts_field ' ] .= '<label> ' .__ ('Posts ' ).'<br /><input type="text" name="num_posts" value=" ' .$ user ['num_posts ' ].'" size="8" maxlength="8" /><br /></label> ' ;
11391139 } elseif (ForumSettings::get ('o_show_post_count ' ) == '1 ' || User::isAdminMod ()) {
11401140 $ posts_actions [] = sprintf (__ ('Posts info ' ), Utils::forum_number_format ($ user ['num_posts ' ]));
11411141 }
11421142
1143- if (User::can ('search.topics ' ) || User::get ()-> g_id == ForumEnv:: get ( ' FEATHER_ADMIN ' )) {
1143+ if (User::can ('search.topics ' ) || User::isAdmin ( )) {
11441144 $ posts_actions [] = '<a href=" ' .Router::pathFor ('search ' ).'?action=show_user_topics&user_id= ' .$ id .'"> ' .__ ('Show topics ' ).'</a> ' ;
11451145 $ posts_actions [] = '<a href=" ' .Router::pathFor ('search ' ).'?action=show_user_posts&user_id= ' .$ id .'"> ' .__ ('Show posts ' ).'</a> ' ;
11461146
0 commit comments