Page Index Toggle Pages: 1
Topic Tools
Normal Topic Deleting the delete user button (Read 2,144 times)
rhosheen
Junior Member
**
Offline



Posts: 75
Location: Seattle area
Deleting the delete user button
Sep 11th, 2010 at 10:46pm
Post Tools
I don't want to allow users to delete themselves but can't seem to remember what code to modify in profiles.pl. I just upgraded to 2.5.
  
Back to top
 
IP Logged
 
Captain John
Ex Member


Re: Deleting the delete user button
Reply #1 - Sep 12th, 2010 at 2:21pm
Post Tools
The Code in Profile.pl
Code (Perl)
Select All
  if (($iamadmin && ($username ne $user)) || ($username ne "admin")) {
    $showProfile .= qq~ &nbsp; &nbsp; &nbsp; <input type="submit" name="moda" value="$profile_txt{'89'}" onclick="return confirm('$confdel_text')" class="button" />~;
  } 



Make a backup of the file !  This should work, Remove highlighted.  Allows admin, but not user.
« Last Edit: Sep 12th, 2010 at 2:21pm by »  
Back to top
 
IP Logged
 
jon666
Junior Member
**
Offline



Posts: 83
Re: Deleting the delete user button
Reply #2 - Jan 10th, 2011 at 2:27pm
Post Tools
Captain John,

I just tried this on my forum removing the exact code you highlighted in blue from Profile.pl. When (my test) user tries to access profile he gets this message:

Untrapped Error :
syntax error at /var/www/cgi-bin/wcf/Sources/Profile.pl line 303, near ")) " syntax error at /var/www/cgi-bin/wcf/Sources/Profile.pl line 305, near "}" Compilation failed in require at YaBB.pl line 148.

John A.
  
Back to top
 
IP Logged
 
jon666
Junior Member
**
Offline



Posts: 83
Re: Deleting the delete user button
Reply #3 - Jan 10th, 2011 at 2:32pm
Post Tools
Sorry, Captain but I deleted more than I should. Will do it right this time!

John A.
  
Back to top
 
IP Logged
 
jon666
Junior Member
**
Offline



Posts: 83
Re: Deleting the delete user button
Reply #4 - Jan 10th, 2011 at 2:59pm
Post Tools
No it doesn't work - in Yabb 2.4 at least. Was very careful to delete exactly as you showed in yellow with same spacing where delete was made. Got the same error message as before.

John A.
  
Back to top
 
IP Logged
 
Carsten
Ex Member


Re: Deleting the delete user button
Reply #5 - Jan 10th, 2011 at 3:27pm
Post Tools
In Profile.pl find:
Code
Select All
	if (($iamadmin && ($username ne $user)) || ($username ne "admin")) { 



and replace it with:
Code
Select All
	if ($iamadmin && $user ne "admin") { 


  
Back to top
 
IP Logged
 
jon666
Junior Member
**
Offline



Posts: 83
Re: Deleting the delete user button
Reply #6 - Jan 10th, 2011 at 9:54pm
Post Tools
Many thanks Carsten, that worked perfectly! Now I don't have to worry about my hard won members deserting without a fight!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top