protected function setUserFromDb()
	{
		$this->intId = $this->id;

		// Unserialize values
		foreach ($this->arrData as $k=>$v)
		{
			if (!is_numeric($v))
			{
				$this->$k = StringUtil::deserialize($v);
			}
		}

		$GLOBALS['TL_USERNAME'] = $this->username;

		// Make sure that groups is an array
		if (!\is_array($this->groups))
		{
			$this->groups = ($this->groups != '') ? array($this->groups) : array();
		}

		// Skip inactive groups
		if (($objGroups = MemberGroupModel::findAllActive()) !== null)
		{
			$this->groups = array_intersect($this->groups, $objGroups->fetchEach('id'));
		}

		// Get the group login page
		if ($this->groups[0] > 0)
		{
			$objGroup = MemberGroupModel::findPublishedById($this->groups[0]);

			if ($objGroup !== null && $objGroup->redirect && $objGroup->jumpTo)
			{
				$this->strLoginPage = $objGroup->jumpTo;
			}
		}
	}
protected function setUserFromDb()
	{
		$this->intId = $this->id;

		
		foreach ($this->arrData as $k=>$v)
		{
			if (!is_numeric($v))
			{
				$this->$k = StringUtil::deserialize($v);
			}
		}

		$GLOBALS['TL_USERNAME'] = $this->username;

		
		if (!\is_array($this->groups))
		{
			$this->groups = ($this->groups != '') ? array($this->groups) : array();
		}

		
		if (($objGroups = MemberGroupModel::findAllActive()) !== null)
		{
			$this->groups = array_intersect($this->groups, $objGroups->fetchEach('id'));
		}

		
		if ($this->groups[0] > 0)
		{
			$objGroup = MemberGroupModel::findPublishedById($this->groups[0]);

			if ($objGroup !== null && $objGroup->redirect && $objGroup->jumpTo)
			{
				$this->strLoginPage = $objGroup->jumpTo;
			}
		}
	}
protected function setUserFromDb ( ) { $ this -> intId = $ this -> id ; // Unserialize values foreach ( $ this -> arrData as $ k => $ v ) { if ( ! is_numeric ( $ v ) ) { $ this -> $ k = StringUtil :: deserialize ( $ v ) ; } } $ GLOBALS [ 'TL_USERNAME' ] = $ this -> username ; // Make sure that groups is an array if ( ! \ is_array ( $ this -> groups ) ) { $ this -> groups = ( $ this -> groups != '' ) ? array ( $ this -> groups ) : array ( ) ; } // Skip inactive groups if ( ( $ objGroups = MemberGroupModel :: findAllActive ( ) ) !== null ) { $ this -> groups = array_intersect ( $ this -> groups , $ objGroups -> fetchEach ( 'id' ) ) ; } // Get the group login page if ( $ this -> groups [ 0 ] > 0 ) { $ objGroup = MemberGroupModel :: findPublishedById ( $ this -> groups [ 0 ] ) ; if ( $ objGroup !== null && $ objGroup -> redirect && $ objGroup -> jumpTo ) { $ this -> strLoginPage = $ objGroup -> jumpTo ; } } }
Set all user properties from a database record
Set all user properties from a database record