vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Mods can edit Users (https://vborg.vbsupport.ru/showthread.php?t=42096)

Xenon 08-08-2002 10:00 PM

Mods can edit Users
 
With this Hack your Mods can edit really everything of a user account, nearly as much as an Admin can! (Changing usergroups....)

But it is very customizable, too. If you don't want em to change usergroups, then they can't. Or you can define which usergroups they can move the users into..

Also if you add if-clauses in the front section to the hack, you can customize it to which of your mod can modify which fields..

this block in front of the hack code defines nearly everything you need to customize the hack:

$canedit[profilefields]=1;
$canedit[timefields]=0;
$canedit[options]=1;
$canedit[addresses]=1; // HP, Email, ICQ, AIM ...
$canedit[signature]=1;
$canedit[title]=0;
$canedit[name]=1;
$canedit[avatars]=1; // 0 Cant edit, 1 Can edit, 2 Can upload custom avatars
$canedit[changegroups]=0; // Mods can move users from one group to another (just groups included in $canedit[usergroupids])
$canedit[usergroupids]="1 2 3 4 10 11"; // Which usergroups can be edited

Screenshots in following Posts

Xenon 08-09-2002 03:51 PM

nearly an admin panel:

Xenon 08-09-2002 03:52 PM

old style:

Xenon 08-09-2002 03:53 PM

usergroup changer (to which a mod is allowed) :)

assassingod 08-09-2002 04:25 PM

Very nice, I might install it:) My forums are a bit new and I havent got very many mods =/

ladyfyre 08-09-2002 05:38 PM

I like it :)

as usual...i have one question *blush*

Is there a way to set this so that different mod usergroups have a different set of usergroups they can move users to?

We have in essence, two totally different userlevel systems on my site...one for ladies, one for gentlemen. Thus, lady mods handle female stuff, male mods handle male stuff. I would prefer not to have lady mods accessing male stuff and vice versa.

Or......now that i think about this....
could i set up a separate mod panel for women and men, and then have the two configured differently?

okrogius 08-09-2002 08:22 PM

Good job :).

NTLDR 08-09-2002 10:11 PM

Very nice hack Xenon, particulary usefull for large boards.

Xenon 08-09-2002 11:39 PM

a ladyfire:

very easy, instead of this line
PHP Code:

$canedit[usergroupids]="1 2 3 4"

add an if-clause like this:

PHP Code:

if($bbuserinfo[usergroupid]==ladymodgroupid) {
$canedit[usergroupids]="2 3 4"//groups your femal mods can edit
} else {
$canedit[usergroupids]="2 8 9"//groups your male mods can edit


seperate modpanel would also be possible, you have to alter global.php in the new folder to just allow male/female mods go into it ;)

[D]Vincent 08-10-2002 05:30 AM

Looks nice. I'll probably disable being able to change the username but I might install this later ^^

dxb 08-10-2002 08:31 PM

man it looks like you are reading my mind :) ... i was looking for these things for my mods

but one thing I tried changing the title for one of my users and it gave Record updated

but when I re-checked the user account the title was not changed " and yes I choose "yes" to give a custom title "

and also I have this option

$canedit[title]=1;

set at 1

anyway thank you very very very much for this useful hack :)

MrLister 08-10-2002 10:10 PM

great job!

i was looking for getting me one of these. saved me time :)

thanks!

ladyfyre 08-11-2002 05:46 PM

Nope Xenon, the above didn't work for me :(

This is the exact code I put in...it is giving a parse error.
PHP Code:

if($bbuserinfo[usergroupid]==26)_{
$canedit[usergroupids]="2 3 9 25";_
}_else_{
$canedit[usergroupids]="2 9 12 17 19 22 23 ";_



g-force2k2 08-11-2002 05:56 PM

Quote:

Originally posted by ladyfyre
Nope Xenon, the above didn't work for me :(

This is the exact code I put in...it is giving a parse error.
PHP Code:

if($bbuserinfo[usergroupid]==26)_{
$canedit[usergroupids]="2 3 9 25";_
}_else_{
$canedit[usergroupids]="2 9 12 17 19 22 23 ";_



ladyfyre just use this code:

PHP Code:

if($bbuserinfo[usergroupid] == 26) {
  
$canedit[usergroupids] = "2 3 9 25"
} else {
  
$canedit[usergroupids] = "2 9 12 17 19 22 23 ";


don't have the "_" included ;)

g-force2k2

Xenon 08-12-2002 12:24 AM

@lady: see what g-force said ^^

@dxb: really? hmm, it worked in my last test, so i think it should work.
i've checked the file and all seems fine, but i'll test it again later, k?

Xenon 08-12-2002 01:07 AM

Ok
dxb, you were right, there was a little bug in my file i posted here.

i have uploaded a new one, now it should work perfect!

changes: doupdate section

dxb 08-12-2002 05:45 AM

waaaw now it works like a charm

great work

thanks alot Xenon :)

BorgGanon 09-15-2002 08:00 PM

Works fine.
here is a little change, so that you can easy choose, wich MOD can edit an wich not

Do the following Query:
ALTER TABLE `moderator` ADD `canedituser` SMALLINT( 6 ) DEFAULT '0' NOT NULL ;

In /admin/forum.php:
FIND
PHP Code:

  makeyesnocode("Can can view whole user profile (but not edit)","canviewprofile",0); 

AFTER ADD
PHP Code:

  makeyesnocode("Can edit User","canedituser",0); 

FIND
PHP Code:

  makeyesnocode("Can can view whole user profile (but not edit)","canviewprofile",$moderator[canviewprofile]); 

AFTER ADD
PHP Code:

  makeyesnocode("Can edit User","canedituser",$moderator[canedituser]); 

FIND
PHP Code:

    $DB_site->query("INSERT INTO moderator (moderatorid,forumid,userid,newpostemail,newthreademail,caneditposts,candeleteposts,canviewips,canmanagethreads,canopenclose,caneditthreads,caneditstyles,canbanusers,canviewprofile,canannounce,canmassmove,canmassprune,canmoderateposts,canmoderateattachments) VALUES (NULL,'$parentid','$userid','$newpostemail','$newthreademail','$caneditposts','$candeleteposts','$canviewips','$canmanagethreads','$canopenclose','$caneditthreads','$caneditstyles','$canbanusers','$canviewprofile','$canannounce','$canmassmove','$canmassprune','$canmoderateposts','$canmoderateattachments')"); 

REPLACE WITH
PHP Code:

    $DB_site->query("INSERT INTO moderator (moderatorid,forumid,userid,newpostemail,newthreademail,caneditposts,candeleteposts,canviewips,canmanagethreads,canopenclose,caneditthreads,caneditstyles,canbanusers,canviewprofile,canedituser,canannounce,canmassmove,canmassprune,canmoderateposts,canmoderateattachments) VALUES (NULL,'$parentid','$userid','$newpostemail','$newthreademail','$caneditposts','$candeleteposts','$canviewips','$canmanagethreads','$canopenclose','$caneditthreads','$caneditstyles','$canbanusers','$canviewprofile','$canedituser','$canannounce','$canmassmove','$canmassprune','$canmoderateposts','$canmoderateattachments')"); 

FIND
PHP Code:

  $moderator=$DB_site->query_first("SELECT forumid,userid,newpostemail,newthreademail,caneditposts,candeleteposts,canviewips,canmanagethreads,canopenclose,caneditthreads,caneditstyles,canbanusers,canviewprofile,canannounce,canmassmove,canmassprune,canmoderateposts,canmoderateattachments FROM moderator WHERE moderatorid=$moderatorid"); 

REPLACE WITH
PHP Code:

  $moderator=$DB_site->query_first("SELECT forumid,userid,newpostemail,newthreademail,caneditposts,candeleteposts,canviewips,canmanagethreads,canopenclose,caneditthreads,caneditstyles,canbanusers,canviewprofile,canedituser,canannounce,canmassmove,canmassprune,canmoderateposts,canmoderateattachments FROM moderator WHERE moderatorid=$moderatorid"); 

FIND
PHP Code:

    $DB_site->query("UPDATE moderator SET forumid='$parentid',userid='$userid',newpostemail='$newpostemail',newthreademail='$newthreademail',caneditposts='$caneditposts',candeleteposts='$candeleteposts',canviewips='$canviewips',canmanagethreads='$canmanagethreads',canopenclose='$canopenclose',caneditthreads='$caneditthreads',caneditstyles='$caneditstyles',canbanusers='$canbanusers',canviewprofile='$canviewprofile',canannounce='$canannounce',canmassmove='$canmassmove',canmassprune='$canmassprune',canmoderateposts='$canmoderateposts',canmoderateattachments='$canmoderateattachments' WHERE moderatorid='$moderatorid'"); 

REPLACE WITH
PHP Code:

    $DB_site->query("UPDATE moderator SET forumid='$parentid',userid='$userid',newpostemail='$newpostemail',newthreademail='$newthreademail',caneditposts='$caneditposts',candeleteposts='$candeleteposts',canviewips='$canviewips',canmanagethreads='$canmanagethreads',canopenclose='$canopenclose',caneditthreads='$caneditthreads',caneditstyles='$caneditstyles',canbanusers='$canbanusers',canviewprofile='$canviewprofile',canedituser='$canedituser',canannounce='$canannounce',canmassmove='$canmassmove',canmassprune='$canmassprune',canmoderateposts='$canmoderateposts',canmoderateattachments='$canmoderateattachments' WHERE moderatorid='$moderatorid'"); 

in mod/index.php:
FIND
PHP Code:

makenavoption("View","user.php?action=find"); 

REPLACE WITH
PHP Code:

makenavoption("View","user.php?action=find","|");
makenavoption("Edit","user.php?action=find"); 

in mod/user.php:
FIND
PHP Code:

if ($action=="edit") { 

AFTER ADD
PHP Code:

  $perms=getpermissions();
  if (!
$perms[ismoderator] and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND canedituser=1")) {
    echo 
"<p>You do not have permission to do this!</p>";
    exit;
  } 

FIND
PHP Code:

echo "<tr><td nowrap><p>$user[username]</p></td>".iif($perms[ismoderator] or $ismod['canbanusers']==1"<td nowrap><a href=\"user.php?action=ban&userid=$user[userid]\"><p>[ban]</p></a></td>""").iif($perms[ismoderator] or $ismod['canviewprofile']==1"<td nowrap><a href=\"user.php?action=viewuser&userid=$user[userid]\"><p>[view user]</p></a></td>""").iif($perms[ismoderator] or $ismod['canviewprofile']==1"<td nowrap><a href=\"user.php?action=edit&userid=$user[userid]\"><p>[edit user]</p></a></td>""")."</tr>\n"

REPLACE WITH
PHP Code:

echo "<tr><td nowrap><p>$user[username]</p></td>".iif($perms[ismoderator] or $ismod['canbanusers']==1"<td nowrap><a href=\"user.php?action=ban&userid=$user[userid]\"><p>[ban]</p></a></td>""").iif($perms[ismoderator] or $ismod['canviewprofile']==1"<td nowrap><a href=\"user.php?action=viewuser&userid=$user[userid]\"><p>[view user]</p></a></td>""").iif($perms[ismoderator] or $ismod['canedituser']==1"<td nowrap><a href=\"user.php?action=edit&userid=$user[userid]\"><p>[edit user]</p></a></td>""")."</tr>\n"


Xenon 09-16-2002 12:08 PM

thanks, i have planned such a thing since a long time, was just to lazy to do ;)

then after i heard about the new permission system in vb3 i decided to wait ^^

Rapdis 09-24-2002 12:01 PM

u added it, where can the mod access that cp?

Rapdis 09-24-2002 12:41 PM

I have attached a screen shot of the cp they see, the save button is still not there.

Rapdis 09-24-2002 12:42 PM

I have also attached the mod/user after i installed the hack

Xenon 09-24-2002 01:21 PM

in the quick userfinder, if you enter an username then you'll come up with 3 options: [ban] [view] [edit]...
i think you should try the edit link ;)

supersimon 09-29-2002 10:45 PM

this hack doesnt work for me ?
i did everything rite ?
iam using 2.2.7

Xenon 09-30-2002 10:15 AM

the hack works perfect with vb227 and also 228

perhaps you have forgotten to manually set the right permissions in the mod/user.php

Erwin 09-30-2002 10:23 AM

Xenon, I've been running your original version of this hack for most of the year now, and it is working fine with 2.2.8. :) Thanks for the great hack.

Xenon 09-30-2002 10:26 AM

:)
thanks for the nice words :)

but you should upgrade to the newest version, it's much more customizable than the original one

Sengir 10-09-2002 11:41 AM

This hack doesn't allow mods to change admin members does it?

Xenon 10-09-2002 11:48 AM

no you can specify which usergroups are affacted by this hack.
if you want you can allow to change admin members, but i think you don't want do you? ^^

bobbydavro 10-21-2002 12:12 PM

will this work with 2.2.1?

looks great by the way!

Xenon 10-21-2002 04:50 PM

normally it should, because it's just an addition to a file no important changes on original lines...

so i'd say try it, i think it'll work

Axel Foley 11-03-2002 01:39 AM

First of all thanks for your work Xenon...it's helpful.

One of my moderators reported me this problem:

Everything works fine, except that when he edits himself (his own profile), instead of giving an error because I didn't include his groupid in the permissions, vB gives him a db error, I can confirm because an email is sent to me with the error as soon as he does this operation. Here's the mail:

Quote:

Database error in vBulletin Mod Control Panel 2.2.5:

Invalid SQL: SELECT usertitle FROM usergroup WHERE usergroupid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

Date: Saturday 02nd of November 2002 07:55:47 PM
Script: http://forum.xxxxxx.org/mod/user.php
Referer: http://forum.xxxxxx.org/mod/user.php...edit&userid=32
This only happens when he tries to edit his own profile, if he tries to edit another moderator's profile, a permission error correctly shows up.

Could you check on this one please?

Thanks again...

Xenon 11-03-2002 07:40 PM

ahh, i see.

well it's always hard to test such things, because there are so many combinations of possibilities.....

i think it should work now, download the newest version, i've added a small if-clause within the update part, which should fix this bug..

Axel Foley 11-06-2002 07:03 PM

Sorry for the delay Xenon...just wanted to let you know that the fix worked...and thank you very much for your work...really appreciated...:)

John 11-06-2002 07:52 PM

Good work Xenon! ;)

Xenon 11-07-2002 02:08 PM

Thanks :)

wolfman 11-07-2002 05:43 PM

Yes I love this hack since its a pain to have only admin make minor changes the users request sometimes. Well on my forum it seems the users do not want to PM me but they want to ask a mod to do this for them. This does help out alot and is far less work to install than the lesser admin panel. Not saying it not any good but this is just so much easier to install.

Ice Man_00 11-10-2002 03:25 PM

Hi m8.

Great hack.... but got a error, have any clues ??

Fatal error: Cannot redeclare usergroupchooser() (previously declared in /home/www/forum/mod/user.php:199) in /home/www/forum/mod/user.php on line 456

???

Cheers, ICe Man_00

Xenon 11-10-2002 03:29 PM

hmm, maybe you've made something wrong while installing the hack.

reinstall it on a fresh user.php

Ice Man_00 11-10-2002 03:40 PM

Hmm.. i did a fresh copy, then the edit user link din`t work, but the view user work... strange.. but no buttons at the bottom...

hehe.. confused..


All times are GMT. The time now is 04:50 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.01730 seconds
  • Memory Usage 1,882KB
  • 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
  • (21)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete