Esempio n. 1
0
function loginUser($email, $password)
{
    $user = new SI_User();
    $login_user = $user->getUserByLogin($email, $password);
    if ($login_user === FALSE) {
        debug_message($user->getLastError());
        unset($_SESSION['userObj']);
        return FALSE;
    } else {
        $user->hasRight("admin");
        $_SESSION['userObj'] = $login_user;
        return TRUE;
    }
}
Esempio n. 2
0
</tr>
<tr>
	<td class="form_field_header_cell">Type of User:</td>
	<td class="form_field_cell">
		<select name="user_type_id" class="input_text">
			<?php 
echo SI_UserType::getSelectTags($user->user_type_id);
?>
		</select>
	</td>
</tr>
<tr>
	<td class="form_field_header_cell">User Rights:</td>
	<td class="form_field_cell">
		<input type="checkbox" name="rights[admin]" value="1" <?php 
echo $user->hasRight('admin') ? 'CHECKED' : '';
?>
/>&nbsp;Administrative Access<br>
		<input type="checkbox" name="rights[accounting]" value="1" <?php 
echo $user->hasRight('accounting') ? 'CHECKED' : '';
?>
/>&nbsp;Accounting Access<br>  
	</td>
</tr>
<tr>
	<td class="form_field_header_cell">Created On:</td>
	<td class="form_field_cell"><?php 
echo $user->created_ts ? date("D M jS, Y \\a\\t h:i:s A", $user->created_ts) : "";
?>
</td>
</tr>
Esempio n. 3
0
 function authenticateUser($email, $password)
 {
     session_regenerate_id();
     $user = new SI_User();
     $login_user = $user->getUserByLogin($email, md5($password));
     if ($login_user === FALSE || is_null($login_user)) {
         $this->error = $user->getLastError();
         unset($_SESSION['userObj']);
         return FALSE;
     } else {
         $user->hasRight("admin");
         $_SESSION['userObj'] = $login_user;
         return $login_user;
     }
 }