inc/users.inc.php
changeset 113 e7a448dba024
parent 109 34b2d49f52c6
child 119 f74e4f88b680
equal deleted inserted replaced
112:0e5d362abf5a 113:e7a448dba024
    38 	}
    38 	}
    39 
    39 
    40         // Set current user ID.
    40         // Set current user ID.
    41         $userid=$_SESSION['userid'];
    41         $userid=$_SESSION['userid'];
    42 
    42 
       
    43 		$query = 'SELECT id FROM perm_items WHERE name='.$db->quote('user_is_ueberuser');
       
    44 		$ueberUserId = $db->queryOne($query);
       
    45 
    43         // Find the template ID that this user has been assigned.
    46         // Find the template ID that this user has been assigned.
    44         $query = "SELECT perm_templ
    47         $query = "SELECT perm_templ
    45 			FROM users 
    48 			FROM users 
    46 			WHERE id = " . $db->quote($userid) ;
    49 			WHERE id = " . $db->quote($userid) ;
    47         $templ_id = $db->queryOne($query);
    50         $templ_id = $db->queryOne($query);
    48 
    51 
    49         // Does this user have ueberuser rights?
    52         // Does this user have ueberuser rights?
    50         $query = "SELECT id 
    53         $query = "SELECT id 
    51 			FROM perm_templ_items 
    54 			FROM perm_templ_items 
    52 			WHERE templ_id = " . $db->quote($templ_id) . " 
    55 			WHERE templ_id = " . $db->quote($templ_id) . " 
    53 			AND perm_id = '53'";
    56 			AND perm_id = ".$ueberUserId;
    54         $result = $db->query($query);
    57         $result = $db->query($query);
    55         if ( $result->numRows() > 0 ) {
    58         if ( $result->numRows() > 0 ) {
    56                 return 1;
    59                 return 1;
    57         }
    60         }
    58 
    61