list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
}
+define('APPLICATION_DIRECTORY', __DIR__);
+
require_once('./protected/Pages/Requirements.php');
new Requirements(__DIR__);
require_once('./framework/prado.php');
$application=new TApplication;
$application->run();
-?>
\ No newline at end of file
+?>
$protocol = !empty($_SERVER['HTTPS']) ? 'https' : 'http';
$host = $_SERVER['SERVER_NAME'];
$port = $_SERVER['SERVER_PORT'];
- $url = sprintf('%s://%s:%d/', $protocol, $host, $port);
+ $urlPrefix = $this->Application->getModule('friendly-url')->getUrlPrefix();
+ $url = sprintf('%s://%s:%d%s/', $protocol, $host, $port, $urlPrefix);
return $url;
}
return $resource;
}
}
-?>
\ No newline at end of file
+?>
parent::onPreInit($param);
$configuration = $this->getModule('configuration');
$this->Application->getGlobalization()->Culture = $this->getLanguage();
+ $this->setPrefixForSubdir();
}
public function getLanguage() {
public function goToPage($pagePath,$getParameters=null) {
$this->Response->redirect($this->Service->constructUrl($pagePath,$getParameters,false));
}
-
+
public function goToDefaultPage() {
$this->goToPage($this->Service->DefaultPage);
}
+
+ public function setPrefixForSubdir() {
+ $fullDocumentRoot = preg_replace('#(\/)$#', '', $this->getFullDocumentRoot());
+ $urlPrefix = str_replace($fullDocumentRoot, '', APPLICATION_DIRECTORY);
+ if(!empty($urlPrefix)) {
+ $this->Application->getModule('friendly-url')->setUrlPrefix($urlPrefix);
+ }
+ }
+
+ private function getFullDocumentRoot() {
+ $rootDir = array();
+ $dirs = explode('/', $_SERVER['DOCUMENT_ROOT']);
+ for($i = 0; $i < count($dirs); $i++) {
+ $documentRootPart = implode('/', $rootDir) . '/' . $dirs[$i];
+ if(is_link($documentRootPart)) {
+ $rootDir = array(readlink($documentRootPart));
+ } else {
+ $rootDir[] = $dirs[$i];
+ }
+ }
+
+ $rootDir = implode('/', $rootDir);
+ return $rootDir;
+ }
}
-?>
\ No newline at end of file
+?>
$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';
- $location = sprintf("%s://%s:%s@%s:%d/", $http_protocol, $cfgData['baculum']['login'], $cfgData['baculum']['password'], $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']);
+ $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");
+ exit();
} else { // standard version (user defined auth method)
$this->goToDefaultPage();
}
$this->Step4Content->render($param->NewWriter);
}
}
-?>
\ No newline at end of file
+?>
body {
background-color: #b5c9d3;
- background-image: url('/themes/Baculum-v1/background.png');
+ background-image: url('background.png');
background-repeat: repeat-x;
font-family: Arial, Helvetica, sans-serif;
color: white;
#top {
width: 975px;
height: 51px;
- background-image: url('/themes/Baculum-v1/bls_top.png');
+ background-image: url('bls_top.png');
background-repeat: no-repeat;
clear: both;
}
}
div.configuration-progress {
- background: rgba(182,182,182,0.7) url('/themes/Baculum-v1/progress.gif') no-repeat center center;
+ background: rgba(182,182,182,0.7) url('progress.gif') no-repeat center center;
width: 443px;
height: 575px;
z-index: 10;
}
div.slide-window-progress {
- background: rgba(182,182,182,0.7) url('/themes/Baculum-v1/progress.gif') no-repeat center center;
+ background: rgba(182,182,182,0.7) url('progress.gif') no-repeat center center;
width: 100%;
height: 100%;
z-index: 10;
#bottom {
width: 975px;
height: 11px;
- background: transparent url('/themes/Baculum-v1/bls_bottom.png') no-repeat top left;
+ background: transparent url('bls_bottom.png') no-repeat top left;
}
#message-box {
}
.storage-btn {
- background: transparent url('/themes/Baculum-v1/storage_icon_inactive.png') no-repeat top left;
+ background: transparent url('storage_icon_inactive.png') no-repeat top left;
}
.storage-btn:hover {
- background: transparent url('/themes/Baculum-v1/storage_icon.png') no-repeat top left;
+ background: transparent url('storage_icon.png') no-repeat top left;
}
.client-btn {
- background: transparent url('/themes/Baculum-v1/client_icon_inactive.png') no-repeat top left;
+ background: transparent url('client_icon_inactive.png') no-repeat top left;
}
.client-btn:hover {
- background: transparent url('/themes/Baculum-v1/client_icon.png') no-repeat top left;
+ background: transparent url('client_icon.png') no-repeat top left;
}
.media-btn {
- background: transparent url('/themes/Baculum-v1/media_icon_inactive.png') no-repeat top left;
+ background: transparent url('media_icon_inactive.png') no-repeat top left;
}
.media-btn:hover {
- background: transparent url('/themes/Baculum-v1/media_icon.png') no-repeat top left;
+ background: transparent url('media_icon.png') no-repeat top left;
}
.pool-btn {
- background: transparent url('/themes/Baculum-v1/pool_icon_inactive.png') no-repeat top left;
+ background: transparent url('pool_icon_inactive.png') no-repeat top left;
}
.pool-btn:hover {
- background: transparent url('/themes/Baculum-v1/pool_icon.png') no-repeat top left;
+ background: transparent url('pool_icon.png') no-repeat top left;
}
.job-btn {
- background: transparent url('/themes/Baculum-v1/job_icon_inactive.png') no-repeat top left;
+ background: transparent url('job_icon_inactive.png') no-repeat top left;
}
.job-btn:hover {
- background: transparent url('/themes/Baculum-v1/job_icon.png') no-repeat top left;
+ background: transparent url('job_icon.png') no-repeat top left;
}
.jobrun-btn {
- background: transparent url('/themes/Baculum-v1/jobrun_icon_inactive.png') no-repeat top left;
+ background: transparent url('jobrun_icon_inactive.png') no-repeat top left;
}
.jobrun-btn:hover {
- background: transparent url('/themes/Baculum-v1/jobrun_icon.png') no-repeat top left;
+ background: transparent url('jobrun_icon.png') no-repeat top left;
}
.restore-btn {
- background: transparent url('/themes/Baculum-v1/restore_icon_inactive.png') no-repeat top left;
+ background: transparent url('restore_icon_inactive.png') no-repeat top left;
}
.restore-btn:hover {
- background: transparent url('/themes/Baculum-v1/restore_icon.png') no-repeat top left;
+ background: transparent url('restore_icon.png') no-repeat top left;
}
.setting-btn {
- background: transparent url('/themes/Baculum-v1/setting_icon_inactive.png') no-repeat top left;
+ background: transparent url('setting_icon_inactive.png') no-repeat top left;
}
.setting-btn:hover {
- background: transparent url('/themes/Baculum-v1/setting_icon.png') no-repeat top left;
+ background: transparent url('setting_icon.png') no-repeat top left;
}
.line {
}
.bbutton input.button-left {
- background: transparent url('/themes/Baculum-v1/button-left.png') no-repeat left 0;
+ background: transparent url('button-left.png') no-repeat left 0;
}
.bbutton input.button-center {
padding: 0 7px;
min-width: 65px;
- background: transparent url('/themes/Baculum-v1/button-center.png') repeat-x left 0;
+ background: transparent url('button-center.png') repeat-x left 0;
}
.bbutton input.button-right {
- background: transparent url('/themes/Baculum-v1/button-right.png') no-repeat left 0;
+ background: transparent url('button-right.png') no-repeat left 0;
}
.bbutton:hover input.button-left {
- background: transparent url('/themes/Baculum-v1/button-left.png') no-repeat left -25px;
+ background: transparent url('button-left.png') no-repeat left -25px;
}
.bbutton:hover input.button-center {
- background: transparent url('/themes/Baculum-v1/button-center.png') repeat-x left -25px;
+ background: transparent url('button-center.png') repeat-x left -25px;
}
.bbutton:hover input.button-right {
- background: transparent url('/themes/Baculum-v1/button-right.png') no-repeat left -25px;
+ background: transparent url('button-right.png') no-repeat left -25px;
}
div.slide-window-container {
}
div.slide-window-bar {
- background: transparent url('/themes/Baculum-v1/panel-border-btns.png') no-repeat top right;
+ background: transparent url('panel-border-btns.png') no-repeat top right;
text-align: center;
font-size: 10px;
height: 14px;
}
div.slide-window-bar-title {
- background: transparent url('/themes/Baculum-v1/panel-border-bg.png') repeat-x top left;
+ background: transparent url('panel-border-bg.png') repeat-x top left;
height: 14px;
margin-right: 51px;
padding: 0;
.steps {
padding: 20px;
height: 435px;
- background-image: url('/themes/Baculum-v1/wizard-content.png');
+ background-image: url('wizard-content.png');
background-repeat: repeat-y;
}
.navigation {
text-align: center;
padding: 11px 0;
- background-image: url('/themes/Baculum-v1/wizard-bottom.png');
+ background-image: url('wizard-bottom.png');
background-repeat: no-repeat;
}
.step-first {
width: 126px;
- background-image: url('/themes/Baculum-v1/step-first.png');
+ background-image: url('step-first.png');
}
.step-first-active {
width: 126px;
- background-image: url('/themes/Baculum-v1/step-first-active.png');
+ background-image: url('step-first-active.png');
}
.step-first-next-active{
width: 126px;
- background-image: url('/themes/Baculum-v1/step-first-next-active.png');
+ background-image: url('step-first-next-active.png');
}
.step-last {
width: 130px;
- background-image: url('/themes/Baculum-v1/step-last.png');
+ background-image: url('step-last.png');
}
.step-last-active {
width: 130px;
- background-image: url('/themes/Baculum-v1/step-last-active.png');
+ background-image: url('step-last-active.png');
}
.step-last-next-active{
width: 130px;
- background-image: url('/themes/Baculum-v1/step-last-next-active.png');
+ background-image: url('step-last-next-active.png');
}
.step-normal, .step-prev-active {
- background-image: url('/themes/Baculum-v1/step.png');
+ background-image: url('step.png');
}
.step-active{
- background-image: url('/themes/Baculum-v1/step-active.png');
+ background-image: url('step-active.png');
}
.step-prev-active {
- background-image: url('/themes/Baculum-v1/step-prev-active.png');
+ background-image: url('step-prev-active.png');
}
#licence {
clear: left;
font-size: 14px;
font-weight: bold;
- background-image: url('/themes/Baculum-v1/wizard-header.png');
+ background-image: url('wizard-header.png');
background-repeat: no-repeat;
padding: 4px;
}