Go Back   Pligg CMS Forum > Pligg Development > Bug Report

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-03-2007, 06:04 PM
New Pligger
 
Join Date: Feb 2007
Posts: 8
Thanks: 0
Thanked 10 Times in 2 Posts
[Fixed] Admin security bug

Right now admins can edit gods and other admins which shouldn't be the case. An admin can reset god's password and login as god.

So I made some changes to admin_users.php and user_show_center.tpl. Basically I made a function in the php:

Code:
function canIChangeUser($user_level) {
    global $amIgod, $main_smarty;
    
    //Don't want to let admins reset other admins or god
    $viewer = $main_smarty->get_template_vars('user_logged_in');
    $target = $_GET["user"];
    
    if ($viewer != $target && !$amIgod && (($user_level == 'god') || ($user_level == 'admin'))) {
        echo "Access denied";
        die;
    } 
}
And I stuck this function in the different "Mode" sections.

Also modified user_show_center.tpl to not show the edit panel if the user is an admin or a god (unless it's the viewer himself):

Code:
         {* Only show edit panel if: 
           - user is god
           - user is viewing him/herself
           - viewed person is not an admin or god
         *} 
	{if $amIgod || $user_logged_in eq $userdata[nr].user_login || ($userdata[nr].user_level neq 'admin' && $userdata[nr].user_level neq 'god')}
		    <div id="admin_view_user_edit">
   etc...
admin_user.php also includes the header redirective to go back to user list instead of the tpl with the "go back to user" button. The button just goes back in window history, and if you edited the user's name, things get messed up.

Lemme know what u think.
Attached Files
File Type: php admin_users.php (18.6 KB, 22 views)
File Type: tpl user_show_center.tpl (2.1 KB, 30 views)
Reply With Quote
The Following 8 Users Say Thank You to kevin1 For This Useful Post:
  #2 (permalink)  
Old 03-05-2007, 07:45 AM
Constant Pligger
 
Join Date: Jan 2007
Posts: 310
Thanks: 0
Thanked 8 Times in 6 Posts
don't look like we have user_show_center.tpl in 9.1, is this a new file you created to fix the problem? It it's where can we upload user_show_center.tpl to? Under the templates/yget sub-directory?

Thanks...
Reply With Quote
  #3 (permalink)  
Old 03-05-2007, 07:48 AM
Casual Pligger
 
Join Date: Feb 2007
Location: England
Posts: 45
Thanks: 7
Thanked 18 Times in 12 Posts
argh2xxx - user_show_center.tpl can be found in the admin_templates folder.
Reply With Quote
  #4 (permalink)  
Old 03-05-2007, 09:12 AM
Casual Pligger
 
Join Date: Aug 2006
Posts: 44
Thanks: 16
Thanked 1 Time in 1 Post
Red face Is this patch already in?

I didn't found it in 9.1 code nor in latest SVN (802)
Reply With Quote
  #5 (permalink)  
Old 03-05-2007, 09:18 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,579
Thanks: 255
Thanked 651 Times in 515 Posts
It's in /templates/your_template/admin_templates/user_show_center.tpl
__________________
I accept donations for my time helping users like you on the forum and IRC.
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
[Fixed] Admin Panel almost empty dams Bug Report 7 02-28-2007 05:34 PM
[Fixed] cannot change admin password v 9.1 - yget template PurpleCow Bug Report 2 02-21-2007 12:08 AM
Admin - Huge Security Vuln andiroo Bug Report 5 10-20-2006 07:12 PM
admin config messes up the template since beta 8 mito Installation and Upgrade Help 6 10-09-2006 08:20 PM
New Admin Panel AshDigg Retired Threads 9 08-21-2006 12:49 PM


Search Engine Friendly URLs by vBSEO 3.2.0