Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 04-07-2004, 11:01 AM
dakotausa dakotausa is offline
 
Join Date: Jun 2003
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Lock Members from editing profile

This is another hack on vb2 that i'd like to see here, also would it be possible to lock them out of editing their options, but still let them in the User CP? Preferably a hack that'd allow for Lock/Unlock. either All are locked or all are unlocked, so i guess they'd be controlled by one click.

If confused i'll do my best to clarify.

Thank you.
dakotausa
Reply With Quote
  #2  
Old 04-07-2004, 11:42 AM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This has been a default usergroup permission since vB2.

Usergroup Manager -> Select a usergroup -> 'Can Edit Own Profile' -> No.
Reply With Quote
  #3  
Old 04-07-2004, 04:44 PM
68 Z-28 68 Z-28 is offline
 
Join Date: Jul 2003
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I understand that, but would like to make it imposed on a single person, not a whole usergroup. I'd like to stay away from creating a new usergroup.
Reply With Quote
  #4  
Old 04-13-2004, 04:26 AM
68 Z-28 68 Z-28 is offline
 
Join Date: Jul 2003
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #5  
Old 04-13-2004, 04:57 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well since you're a fellow F-Body owner & car enthusiast I'll help ya out.


Run this query via phpmyadmin:

ALTER TABLE user ADD pban smallint(5) unsigned DEFAULT 1 NOT NULL

In admincp/user.php find:
Code:
	{
		print_profilefield_row($profilefield, $userfield);
	}
Below it add:
Code:
print_yes_no_row($vbphrase['can_edit_profile'], 'pban',$user[pban]);
Find:
Code:
if ($_POST['do'] == 'update')
{
	globalize($_POST, array(
		'password',
		'user',
		'membergroup',
		'modifyavatar',
		'birthday',
		'signature',
		'modifyprofilepic',
		'joindate',
		'lastvisit',
		'lastactivity',
		'lastpost',
		'options',
		'referrer',
		'threaddisplaymode' => INT
	));
Replace it with:
Code:
if ($_POST['do'] == 'update')
{
	globalize($_POST, array(
		'password',
		'user',
		'membergroup',
		'modifyavatar',
		'birthday',
		'signature',
		'modifyprofilepic',
		'joindate',
		'lastvisit',
		'lastactivity',
		'lastpost',
		'options',
		'referrer',
		'pban',
		'threaddisplaymode' => INT
	));
Find:
Code:
		$DB_site->query("
			INSERT INTO " . TABLE_PREFIX . "usertextfield
				(userid, signature)
			VALUES
				($userid, '" . addslashes($signature) . "')
		");
	}
Below it add:
Code:
 $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET pban=$pban WHERE userid=$userid");
In profile.php find:
Code:
if ($_REQUEST['do'] == 'editprofile')
{
Below it add:
Code:
  if ($bbuserinfo[pban]==0) 
{
	print_no_permission();
  }
If you want to stop them from editing other things just place that same code under whichever parts you don't want them to edit. For example, if you wanted to stop them from editing the options you would find this:
Code:
if ($_REQUEST['do'] == 'editoptions')
{
And add this below it:

Code:
  if ($bbuserinfo[pban]==0) 
{
	print_no_permission();
  }
Same goes for the avatar, signature, and whatever else you want to limit. Or if you prefer to limit them from everything you would just add that code below this:
Code:
// ############################################################################
// ALL FUNCTIONS BELOW HERE REQUIRE 'canmodifyprofile' PERMISSION, SO CHECK IT
In your admincp under "Languages & Phrases" click "Phrase Manager", then click "Add new Phrase". Add the following phrase:

Varname: can_edit_profile
Text: Can edit Profile?

Then to lock a member from editing his profile you would just click user options and set can edit profile to "no".
Reply With Quote
  #6  
Old 05-19-2004, 09:50 PM
Lugnut Lugnut is offline
 
Join Date: Jun 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, thank you, thank you. I've been looking for something like this, but the closest thing I found was a hack that changed way too many things I didn't need changed.
Reply With Quote
  #7  
Old 05-19-2004, 09:57 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have alos added to this to make a link in the memberinfo for locking and unlocking each user's profile. And also added the safety check for the Super Admin user so no one can change his (or her) profile. The link only shows up to Admins.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:30 PM.


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.06426 seconds
  • Memory Usage 2,218KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (11)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete