vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Hide Email and Password change (https://vborg.vbsupport.ru/showthread.php?t=218747)

Freebord 07-16-2009 05:42 PM

Hide Email and Password change
 
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:

Code:

<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:

Code:

<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:


Code:

// ****** 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!


All times are GMT. The time now is 03:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00994 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete