本文整理汇总了PHP中phpbb\auth\auth::login方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::login方法的具体用法?PHP auth::login怎么用?PHP auth::login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb\auth\auth
的用法示例。
在下文中一共展示了auth::login方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* {@inheritdoc}
*/
public function run()
{
$this->user->session_begin();
$this->user->setup('common');
if ($this->config['email_enable']) {
include $this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext;
// functions_messenger.php uses config to determine language paths
// Remove when able
global $config;
$config = $this->config;
$messenger = new \messenger(false);
$messenger->template('installed', $this->install_config->get('user_language', 'en'));
$messenger->to($this->config['board_email'], $this->install_config->get('admin_name'));
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($this->install_config->get('admin_name')), 'PASSWORD' => htmlspecialchars_decode($this->install_config->get('admin_passwd'))));
$messenger->send(NOTIFY_EMAIL);
}
// Login admin
// Ugly but works
$this->auth->login($this->install_config->get('admin_name'), $this->install_config->get('admin_passwd'), false, true, true);
$this->iohandler->set_cookie($this->config['cookie_name'] . '_sid', $this->user->session_id);
$this->iohandler->set_cookie($this->config['cookie_name'] . '_u', $this->user->cookie_data['u']);
$this->iohandler->set_cookie($this->config['cookie_name'] . '_k', $this->user->cookie_data['k']);
// Create log
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_INSTALL_INSTALLED', false, array($this->config['version']));
// Remove install_lock
@unlink($this->phpbb_root_path . 'cache/install_lock');
}