Пример #1
0
 /**
  * {@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');
 }