/** * Forgery constructor */ public function __forge() { $user = \Magelight\Auth\Models\User::find(\Magelight\Http\Request::getInstance()->getGet('id')); if ($user) { $this->set('user', $user->asArray()); } }
/** * {@inheritdoc} */ public function initBlock() { $currentUserId = \Magelight\Http\Session::getInstance()->get('user_id', false); if ($currentUserId && ($userData = \Magelight\Auth\Models\User::find($currentUserId)->asArray())) { $this->set('user_id', $currentUserId); $this->set('user_data', $userData); } return parent::initBlock(); }
/** * {@inheritdoc} */ public function initBlock() { $currentUserId = \Magelight\Http\Session::getInstance()->get('user_id'); if (!empty($currentUserId)) { if ($user = \Magelight\Auth\Models\User::find($currentUserId)) { $userData = $user->asArray(); $this->setGlobal('user_data', $userData); } } $document = \Magelight\Core\Blocks\Document::getInstance(); $document->addMeta(['http-equiv' => "content-type", 'content' => "text/html; charset=utf-8"]); $document->addCss('Magelight/Core/static/css/bootstrap.css'); $document->addCss('Magelight/Core/static/css/hint.css'); $document->addJs('Magelight/Core/static/js/jquery.js'); $document->addJs('Magelight/Core/static/js/bootstrap.min.js'); return parent::initBlock(); }