<?php
-/**
- * Bacula® - The Network Backup Solution
- * Baculum - Bacula web interface
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
*
- * Copyright (C) 2013-2015 Marcin Haba
+ * Copyright (C) 2013-2016 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
- * The main author of Bacula is Kern Sibbald, with contributions from many
- * others, a complete list can be found in the file AUTHORS.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
*
* You may use this file and others of this release according to the
* license defined in the LICENSE file, which includes the Affero General
* Public License, v3.0 ("AGPLv3") and some additional permissions and
* terms pursuant to its AGPLv3 Section 7.
*
- * Bacula® is a registered trademark of Kern Sibbald.
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
*/
Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
{
public $firstRun;
public $applicationConfig;
+ public $userPattern;
const DEFAULT_DB_NAME = 'bacula';
const DEFAULT_DB_LOGIN = 'bacula';
public function onInit($param) {
parent::onInit($param);
$this->Lang->SelectedValue = $_SESSION['language'];
- $this->firstRun = !$this->getModule('configuration')->isApplicationConfig();
- $this->applicationConfig = $this->getModule('configuration')->getApplicationConfig();
+ $config = $this->getModule('configuration');
+ $this->firstRun = !$config->isApplicationConfig();
+ $this->applicationConfig = $config->getApplicationConfig();
+ $this->userPattern = $config->getUserPattern();
if($this->firstRun === false && $this->User->getIsAdmin() === false) {
die('Access denied.');
}
if($this->getModule('configuration')->isUsersConfig() === true) { // version with users config file, so next is try to auto-login
$previousUser = ($this->firstRun === false) ? $this->applicationConfig['baculum']['login'] : null;
$this->getModule('configuration')->setUsersConfig($cfgData['baculum']['login'], $cfgData['baculum']['password'], $this->firstRun, $previousUser);
+
// Automatic login after finish wizard.
$http_protocol = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) ? 'https' : 'http';
- $urlPrefix = $this->Application->getModule('friendly-url')->getUrlPrefix();
- $location = sprintf("%s://%s:%s@%s:%d%s", $http_protocol, $cfgData['baculum']['login'], $cfgData['baculum']['password'], $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $urlPrefix);
- header("Location: $location");
- return;
+ $this->getModule('configuration')->switchToUser($http_protocol, $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $cfgData['baculum']['login'], $cfgData['baculum']['password']);
+ exit();
} else { // standard version (user defined auth method)
$this->goToDefaultPage();
}
$isValidate = ($result === 0);
$this->BconsoleTestResultOk->Display = ($isValidate === true) ? 'Dynamic' : 'None';
$this->BconsoleTestResultErr->Display = ($isValidate === false) ? 'Dynamic' : 'None';
- $this->Step4Content->render($param->NewWriter);
}
}
?>