37 if (@empty(
$_SERVER[
'REQUEST_URI'])) {
42 $this->
initLanguage(!empty( $_COOKIE[
'xo_install_lang']) ? $_COOKIE[
'xo_install_lang'] :
'english');
44 include_once
'./include/page.php';
48 include_once
'./include/config.php';
83 $pagename = preg_replace(
'~(page_)(.*)~',
'$2', basename(
$_SERVER[
'PHP_SELF'],
".php"));
87 header(
"Cache-Control: no-store, no-cache, must-revalidate",
false);
88 header(
"Pragma: no-cache");
95 if (!isset(
$_SERVER[
'PHP_AUTH_USER']) ) {
96 header(
'WWW-Authenticate: Basic realm="XOOPS Installer"');
97 header(
'HTTP/1.0 401 Unauthorized');
98 echo
'You can not access this XOOPS installer.';
102 header(
'HTTP/1.0 401 Unauthorized');
103 echo
'You can not access this XOOPS installer.';
107 header(
'HTTP/1.0 401 Unauthorized');
108 echo
'You can not access this XOOPS installer.';
113 if (empty(
$GLOBALS[
'xoopsOption'][
'checkadmin'])) {
117 if (empty(
$GLOBALS[
'xoopsUser']) && !empty($_COOKIE[
"xo_install_user"])) {
123 if (!
$GLOBALS[
'xoopsUser']->isAdmin()) {
131 if (file_exists(
"./language/{$this->language}/{$file}.php")) {
132 include_once
"./language/{$this->language}/{$file}.php";
134 include_once
"./language/english/$file.php";
141 if (!file_exists(
"./language/{$language}/install.php")) {
150 $pages = array_keys($this->pages);
152 $this->pageIndex =
$page;
154 }
else if (isset( $this->pages[
$page])) {
155 $this->currentPage =
$page;
156 $this->pageIndex = array_search($this->currentPage,
$pages);
161 if ($this->pageIndex > 0 && !isset($_COOKIE[
'xo_install_lang'])) {
162 header(
'Location: index.php');
170 $proto = ( @
$_SERVER[
'HTTPS'] ==
'on') ?
'https' :
'http';
172 $base = substr(
$_SERVER[
'PHP_SELF'], 0, strrpos(
$_SERVER[
'PHP_SELF'],
'/'));
173 return $proto .
'://' . $host . $base;
178 $pages = array_keys($this->pages);
180 if (!(
int)
$page{0}) {
181 if (
$page{0} ==
'+') {
183 }
else if (
$page{0} ==
'-') {
190 if (defined(
"XOOPS_URL")) {
203 $proto = !@empty(
$_SERVER[
'SERVER_PROTOCOL']) ?
$_SERVER[
'SERVER_PROTOCOL'] :
'HTTP/1.1';
204 header(
"{$proto} {$status} {$message}");
206 header(
"Location: {$location}");
215 $ret .=
"<fieldset><legend>" . $form->getTitle() .
"</legend>\n";
217 foreach ($form->getElements() as $ele) {
218 if (is_object($ele)) {
219 if (!$ele->isHidden() ) {
220 if (($caption = $ele->getCaption()) !=
'') {
221 $name = $ele->getName();
222 $ret .=
"<label class='xolabel' for='" . $ele->getName() .
"'>" . $caption .
"</label>";
223 if (($desc = $ele->getDescription()) !=
'') {
224 $ret .=
"<div class='xoform-help'>";
229 $ret .= $ele->render() .
"\n";
231 $hidden .= $ele->render() .
"\n";
235 $ret .=
"</fieldset>\n" . $hidden.
"\n" . $form->renderValidationJS(
true);