vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Lock Members from editing profile (https://vborg.vbsupport.ru/showthread.php?t=63572)

dakotausa 04-07-2004 11:01 AM

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

NTLDR 04-07-2004 11:42 AM

This has been a default usergroup permission since vB2.

Usergroup Manager -> Select a usergroup -> 'Can Edit Own Profile' -> No.

68 Z-28 04-07-2004 04:44 PM

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.

68 Z-28 04-13-2004 04:26 AM

bump

EvilLS1 04-13-2004 04:57 AM

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".

Lugnut 05-19-2004 09:50 PM

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.

Boofo 05-19-2004 09:57 PM

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.


All times are GMT. The time now is 08:57 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.01118 seconds
  • Memory Usage 1,731KB
  • 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
  • (11)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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