View Full Version : Hide Email and Password change
Freebord
07-16-2009, 05:42 PM
Hi all, I'm looking for a way to hide/ disable the change email and password button from just one user. I'd like to use this account as a kind of test account and I don't want the guests to be able to change the email and password of the account.
I've tried inserting a conditional in the USERCP_SHELL template here:
<if condition="$bbuserinfo['userid'] != bob">
<tr>
<td class="$navclass[password]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editpassword">$vbphrase[edit_email_and_password]</a></td>
</tr>
</if>
But that doesn't seem to work. When I login as userid Bob, I'm still able to change the email and password.
Any other ideas? Many thanks in advance...
Freesteyelz
07-16-2009, 06:38 PM
Try:
<if condition="!$bbuserinfo[userid] == 1">
<tr><td class="$navclass[password]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editpassword">$vbphrase[edit_email_and_password]</a></td></tr>
</if>
Where "1" is change the user ID to that who you do not want to see that code.
For multiple users try:
<if condition="!in_array($bbuserinfo[userid], array(1,2,3))">
<tr><td class="$navclass[password]" nowrap="nowrap"><a class="smallfont" href="profile.php?$session[sessionurl]do=editpassword">$vbphrase[edit_email_and_password]</a></td></tr>
</if>
When you add users make sure to add a comma after the number. Good luck. :)
--------------- Added 16 Jul 2009 at 09:48 ---------------
BUT...
I'd like to add that the user can still change the password by using password recovery or if they know the URL of the e-mail and password edit. Instead, I'd edit /forum/includes/config.php and find the codes:
// ****** UNDELETABLE / UNALTERABLE USERS ******
// The users specified here will not be deletable or alterable from the control panel by any users.
// To specify more than one user, separate userids with commas.
$config['SpecialUsers']['undeletableusers'] = '1,2,3';
Just as you do with conditionals, add the user ID who you do not want to be able to edit anything in the Control Panel. At the same time I'd also include any user who has access to the Admin CP. :)
Freebord
07-16-2009, 08:48 PM
It worked, thank you so much!
Freesteyelz
07-17-2009, 03:53 AM
Cool. :)
leoglobant
12-12-2011, 03:58 PM
Hello.
I was wondering how to achieve the same but not allowing anyone to change their password and email except the admin.
Thanks!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.