* fix bug #t
This commit is contained in:
@@ -243,6 +243,7 @@ class commonModel extends model
|
||||
$user->admin = false;
|
||||
$user->rights = $this->loadModel('user')->authorize('guest');
|
||||
$user->groups = array('group');
|
||||
$user->visions = $this->config->vision;
|
||||
if(!defined('IN_UPGRADE')) $user->view = $this->user->grantUserView($user->account, $user->rights['acls']);
|
||||
$this->session->set('user', $user);
|
||||
$this->app->user = $this->session->user;
|
||||
|
||||
@@ -249,13 +249,16 @@ class userModel extends model
|
||||
/**
|
||||
* Get user info by ID.
|
||||
*
|
||||
* @param mix $userID
|
||||
* @param string $field id|account
|
||||
* @param mix $userID
|
||||
* @param string $field id|account
|
||||
* @access public
|
||||
* @return object|bool
|
||||
*/
|
||||
public function getById($userID, $field = 'account')
|
||||
{
|
||||
/* Return current user when user is guest or empty to make sure pages in dashboard work fine. */
|
||||
if(empty($userID) && $this->app->user->account == 'guest') return $this->app->user;
|
||||
|
||||
if($field == 'id') $userID = (int)$userID;
|
||||
if($field == 'account') $userID = str_replace(' ', '', $userID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user