{Disalble ??}

This add-on will allow you to give "moderators" access to manage users, and theire permissions, admin accounts are protected

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

{Disalble ??}

Postby Kazango on Thu 16. Oct, 2003 13:49

Question, for the moderator panel How can I edit so that the moderator can't for instance delete users, ect.

I no this {DISABLE_ADMIN} {DISABLE_MOD}
But is there something for user? {DISABLE_USER} don't work

Tell me!!
User avatar
Kazango
Poster
Poster
 
Posts: 10
Joined: Thu 16. Oct, 2003 13:44

Postby kooky on Thu 16. Oct, 2003 23:16

You have to do the same thing like that:
Code: Select all
{DISABLE_USER}


but i think that will be more easy to remove this option: "deleteuser"

For that OPEN modcp/mod_users.php
FIND:
Code: Select all
      if( $HTTP_POST_VARS['deleteuser'] )
      {
         $sql = "SELECT g.group_id
            FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g

.../... to

         $message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("mod_users.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');

         message_die(GENERAL_MESSAGE, $message);
      }


Remove all these lines :)

Then OPEN templates/your_theme/modcp/user_edit_body.tpl
FIND:
Code: Select all
   <tr>
     <td class="row1"><span class="gen">{L_DELETE_USER}?</span></td>
     <td class="row2">
      <input type="checkbox" name="deleteuser" {DISABLE_ADMIN} {DISABLE_MOD} />
      {L_DELETE_USER_EXPLAIN}</td>
   </tr>

Remove this part

Not tested but i assume that will work :)
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby Kazango on Thu 16. Oct, 2003 23:27

Sure that wil work but it wil not work for the username!
The moderator can also edit usernames in this panel. I don't like that. So remove same parts is not a option.

Maybe it's not possible Moderator overrules de User?!?
User avatar
Kazango
Poster
Poster
 
Posts: 10
Joined: Thu 16. Oct, 2003 13:44

Postby kooky on Thu 16. Oct, 2003 23:56

OK for that, you have to create a new entry for {DISABLE_USER}
This variable should be paste like this:

Code: Select all
   <tr>
     <td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
     <td class="row2">
      <input class="post" type="text" name="username" size="35" maxlength="40" value="{USERNAME}" {DISABLE_ADMIN} {DISABLE_USER} />
     </td>
   </tr>


then in mod_users.php
under 'DISABLE_MOD' => ...........
ADD:
Code: Select all
         'DISABLE_USER' => ($this_userdata['user_id'] != $username) ? ' DISABLED ' : '',

i have tested it quickly
not tested on other user's field
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby Kazango on Fri 17. Oct, 2003 10:21

:D :D YES it works!!!! Thanks

It work also in other fields!
User avatar
Kazango
Poster
Poster
 
Posts: 10
Joined: Thu 16. Oct, 2003 13:44

Postby darakhshan on Thu 18. Nov, 2004 09:27

where is modcp/mod_users.php

I can not find it in my modcp folder I do not have such a thing
darakhshan
Poster
Poster
 
Posts: 46
Joined: Sat 15. May, 2004 12:19

Postby kooky on Thu 18. Nov, 2004 18:12

darakhshan wrote:where is modcp/mod_users.php

I can not find it in my modcp folder I do not have such a thing
sure
this was use in old version
new version keep original names even if they are a little different than your files from admin directory
so mod_users.php is admin_users.php
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves


Return to Moderator CP [2.0.17/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron