Initialize the currentUser component.

You can overrule this function to specify your own project translation method / file.

Use $this->currentUser to access afterwards

@return \Gems_User_User
557356
protected function _initCurrentUser()
    {
        $this->bootstrap(array('acl', 'basepath', 'cache', 'db', 'loader', 'project', 'session', 'translate', 'util'));

        // Fix for _init resourcea being case insensitive
        $container = $this->getContainer();
        $user      = $this->loader->getCurrentUser();
        $container->currentUser = $user;

        return $user;
    }
425059
public static function user()
    {
        if (self::check()) {
            if (is_null(static::$user)) {
                $data = Session::get(static::resource('session'));

                $data = static::query($data);

                static::$user = static::orm($data[0]);
            }

            return static::$user;
        }
    }
1310444
protected function isAdmin() {
        $member = $this->currentUser();
        return $member && \Injector::inst()->get('PermissionChecks')->isAdmin($member);
    }
549843
public function initialize()
    {
        $app = $this->app;

        $Driver = $this->options['driver'];
        $driver = new $Driver($this->options);

        if (is_callable($this->options['lang'])) {
            $fn = $this->options['lang'];
            $this->options['lang'] = $fn();
        }

        $Translator = new Translator($this->options, $driver);

        $app->container->singleton('translator', function () use ($Translator) {
            return $Translator;
        });
    }
1012681
public function user()
    {
        if (!is_null($this->user)) {
            return $this->user;
        }

        if ($this->jwt->setRequest($this->request)->getToken() && $this->jwt->check()) {
            $id = $this->jwt->payload()->get('sub');

            return $this->user = $this->provider->retrieveById($id);
        }
    }
100355
public static function initialize()
    {
        if (!isset($GLOBALS['_SESSION']) or !($GLOBALS['_SESSION'] instanceof self)) {
            $GLOBALS['_SESSION'] = self::getInstance();
        }

        return self::getInstance();
    }
980640
protected function GetCurrentUser()
	{
		if (!$this->_cu)
		{
			require_once("verysimple/Authentication/Authenticator.php");
			
			$this->Phreezer->Observe("Loading CurrentUser from Session");
			$this->_cu = Authenticator::GetCurrentUser($this->GUID);

			if ($this->_cu )
			{
				if (get_class($this->_cu) == "__PHP_Incomplete_Class")
				{
					// this happens if the class used for authentication was not included before the session was started
					$tmp = print_r($this->_cu,1);
					$parts1 = explode("__PHP_Incomplete_Class_Name] => ",$tmp);
					$parts2 = explode("[",$parts1[1]);
					$name = trim($parts2[0]);

					Authenticator::ClearAuthentication($this->GUID);
					throw new Exception("The class definition used for authentication '$name' must be defined (included) before the session is started, for example in _app_config.php.");
				}
				else
				{
					// refresh the current user if the object supports it
					if (method_exists($this->_cu, 'Refresh')) $this->_cu->Refresh($this->Phreezer);
				}
			}
		}
		else
		{
			$this->Phreezer->Observe("Using previously loaded CurrentUser");
		}

		return $this->_cu;
	}
588089
public function getUser()
    {
        if ($this->_user === null) {
            /* @var $user User */
            $this->_user = is_string($this->userComponent) ? Yii::$app->get($this->userComponent,
                false) : $this->userComponent;
        }
        return $this->_user;
    }
355790
public function init()
    {
        // Get options
        $filter_slug = $this->currentPage;

        // Check sections
        if (!empty($this->options['sections']) && is_array($this->options['sections'])) {
            foreach ($this->options['sections'] as $sectionSlug => $sectionName) {
                if ($sectionSlug !== $this->currentSection) {
                    continue;
                }

                $filter_slug .= '-'.$this->currentSection;
                break;
            }
        }

        /**
         * Build page contents.
         *
         * @var     string  $currentPage
         * @param   array   $contents
         * @return  array   $contents
         */
        $this->fields = apply_filters('ol_zeus_adminpage_'.$filter_slug.'_contents', []);

        // Display main render
        $this->renderFields();
    }
1096791
public function getCurrentUser() {
    if (empty($this->currentUser)) {
      $this->currentUser = \Drupal::service('current_user');
    }
    return $this->currentUser;
  }
67097
static function currentUser()
    {
        $user = self::instance();
        if ( $user->isAnonymous() || $user->isEnabled() )
        {
            return $user;
        }
        self::logoutCurrent();
        return self::instance();
    }
246176
protected function Init()
    {
        $this->container = new Container(Request::GetData('container'));
        $this->containerRights = new ContainerRights($this->container->GetUserGroupRights());
        $this->AddNameField();
        $this->AddUserGroupField();
        $this->AddSubmit();
        return parent::Init();
    }
468251
public function current() {
        $user = \core_user::get_user($this->userids[$this->iteratorposition]);

        if (false === $user) {
            // This user was not found.
            unset($this->userids[$this->iteratorposition]);

            // Check to see if there are any more users left.
            if ($this->count()) {
                // Move the pointer to the next record and try again.
                $this->next();
                $user = $this->current();
            } else {
                // There are no more context ids left.
                return;
            }
        }

        return $user;
    }
1012580
public function user()
    {
        if (! $this->user) {
            $this->user = app(Users::class)->find(auth()->guard()->id());
        }

        return $this->user;
    }
788678
public function initialize()
    {
        //Loads components
        //The configuration for `AuthComponent`  takes place in the same class
        $this->loadComponent('MeCms.Auth');
        $this->loadComponent('MeTools.Flash');
        $this->loadComponent('RequestHandler', ['enableBeforeRedirect' => false]);
        $this->loadComponent('MeTools.Uploader');
        $this->loadComponent('Recaptcha.Recaptcha', [
            'sitekey' => getConfigOrFail('Recaptcha.public'),
            'secret' => getConfigOrFail('Recaptcha.private'),
            'lang' => substr(I18n::getLocale(), 0, 2),
        ]);

        parent::initialize();
    }
1144694
public function init() {

		parent::init();

		// Permissions
		$this->crudPermission = CoreGlobal::PERM_USER;

		// Services
		$this->modelService			= Yii::$app->factory->get( 'siteService' );
		$this->userService			= Yii::$app->factory->get( 'userService' );
		$this->siteMemberService	= Yii::$app->factory->get( 'siteMemberService' );
	}
1073083
protected function Init()
    {
        $this->member = new Member(Request::GetData('member'));
        $this->groupsExist = Membergroup::Schema()->Count() > 0;
        $this->AddNameField();
        $this->AddEMailField();
        $this->AddPasswordField();
        $this->AddMemberGroupField();
        $this->AddSubmit();
        return parent::Init();
    }