33 $hash_data = @explode(
"-", $_COOKIE[
'xo_install_user'], 2);
34 list(
$uname, $hash_login) = array($hash_data[0], strval(@$hash_data[1]));
35 if (empty(
$uname) || empty($hash_login)) {
41 $user = array_pop($users);
46 $xoops->userIsAdmin =
true;
59 @chmod(XOOPS_ROOT_PATH .
"/mainfile.php", 0444);
61 @chmod(XOOPS_VAR_PATH .
"/data/secure.php", 0444);
81 $value =
$myts->htmlspecialchars($value, ENT_QUOTES);
82 echo
"<label class='xolabel' for='$name'>$label</label>\n";
84 echo
'<div class="xoform-help">' . $help .
"</div>\n";
86 if (
$name ==
"adminname") {
87 echo
"<input type='text' name='$name' id='$name' value='$value' maxlength='25' />";
89 echo
"<input type='text' name='$name' id='$name' value='$value' />";
108 $value =
$myts->htmlspecialchars($value, ENT_QUOTES);
109 echo
"<label class='xolabel' for='{$name}'>{$label}</label>\n";
111 echo
'<div class="xoform-help">' . $help .
"</div>\n";
114 if (
$name ==
"adminpass") {
115 echo
"<input type='password' name='{$name}' id='{$name}' value='{$value}' onkeyup='passwordStrength(this.value)' />";
117 echo
"<input type='password' name='{$name}' id='{$name}' value='{$value}' />";
136 $value =
$myts->htmlspecialchars($value, ENT_QUOTES);
137 echo
"<label class='xolabel' for='$name'>$label</label>\n";
139 echo
'<div class="xoform-help">' . $help .
"</div>\n";
141 $checked = $value ?
'checked' :
'';
142 echo
"<input type=\"checkbox\" name=\"{$name}\" value=\"1\" {$checked} />"
156 while (
$file = readdir($handle)) {
178 $classes = array(-1 =>
'error', 0 =>
'warning', 1 =>
'success');
183 return '<span class="' . $classes[
$status] .
'">' . $str .
'</span>';
194 $setting = strtolower(ini_get(
$name));
195 $setting = (empty($setting) || $setting ==
'off' || $setting ==
'false') ?
false :
true;
196 if ($setting == $wanted) {
197 return xoDiag(1, $setting ?
'ON' :
'OFF');
199 return xoDiag($severe ? -1 : 0, $setting ?
'ON' :
'OFF');
211 if (!is_dir(
$path)) {
212 if (file_exists(
$path)) {
228 if (version_compare(phpversion(),
'5.4.0',
'>=')) {
229 return xoDiag(1, phpversion());
231 return xoDiag(-1, phpversion());
254 return '<span class="pathmessage"><img src="img/yes.png" alt="Success" />' .
$msg .
'</span>';
267 return '<span class="pathmessage"><img src="img/no.png" alt="Error" /> ' .
$msg .
'</span>';
277 static $charsets = array();
282 $charsets[
"utf8"] =
"UTF-8 Unicode";
283 $ut8_available =
false;
285 while ($row = mysql_fetch_assoc(
$result)) {
286 $charsets[$row[
"Charset"]] = $row[
"Description"];
287 if ($row[
"Charset"] ==
"utf8") {
288 $ut8_available =
true;
292 if (!$ut8_available) {
293 unset($charsets[
"utf8"]);
306 static $collations = array();
307 if (!empty($collations[$charset])) {
308 return $collations[$charset];
311 if (
$result = mysql_query(
"SHOW COLLATION WHERE CHARSET = '" . mysql_real_escape_string($charset) .
"'",
$link)) {
312 while ($row = mysql_fetch_assoc(
$result)) {
313 $collations[$charset][$row[
"Collation"]] = $row[
"Default"] ? 1 : 0;
317 return $collations[$charset];
330 if (empty($charset)) {
333 if (version_compare(mysql_get_server_info(
$link),
"4.1.0",
"lt")) {
334 $charset = $collation =
"";
336 if (empty($charset) && empty($collation)) {
341 if (!isset($charsets[$charset])) {
344 if (!empty($collation)) {
346 if (!isset($collations[$collation])) {
366 if (version_compare(mysql_get_server_info(
$link),
"4.1.0",
"lt")) {
376 $value =
$myts->htmlspecialchars($value, ENT_QUOTES);
378 $field =
"<label class='xolabel' for='{$name}'>{$label}</label>\n";
380 $field .=
'<div class="xoform-help">' . $help .
"</div>\n";
382 $field .=
"<select name='{$name}' id='{$name}'\">";
384 $collation_default =
"";
386 foreach ($collations as $key => $isDefault) {
388 $collation_default = $key;
391 $options .=
"<option value='{$key}'" . (($value == $key) ?
" selected='selected'" :
"") .
">{$key}</option>";
393 if ($collation_default) {
394 $field .=
"<option value='{$collation_default}'" . (($value == $collation_default || empty($value))
395 ?
" 'selected'" :
"") .
">{$collation_default} (Default)</option>";
398 $field .=
"</select>";
414 $block =
'<div id="' .
$name .
'_div">';
431 if (version_compare(mysql_get_server_info(
$link),
"4.1.0",
"lt")) {
439 if (isset($chars[
"utf8"])) {
440 $charsets[
"utf8"] = $chars[
"utf8"];
441 unset ($chars[
"utf8"]);
444 $charsets = array_merge($charsets, $chars);
449 $value =
$myts->htmlspecialchars($value, ENT_QUOTES);
451 $field =
"<label class='xolabel' for='{$name}'>{$label}</label>\n";
453 $field .=
'<div class="xoform-help">' . $help .
"</div>\n";
455 $field .=
"<select name='{$name}' id='{$name}' onchange=\"setFormFieldCollation('DB_COLLATION_div', this.value)\">";
456 $field .=
"<option value=''>None</option>";
457 foreach ($charsets as $key => $desc) {
458 $field .=
"<option value='{$key}'" . (($value == $key) ?
" selected='selected'"
459 :
"") .
">{$key} - {$desc}</option>";
461 $field .=
"</select>";
481 $connectionParams = array(
488 $connectionParams[$param] =
$settings[
$wizard->configs[
'db_param_names'][$param]];
492 return $connectionParams;
505 $config = new \Doctrine\DBAL\Configuration();
509 $instance = \Doctrine\DBAL\DriverManager::getConnection($connectionParams,
$config);
510 }
catch (Exception $e) {
511 $error = $e->getMessage();
519 $instance->connect();
520 }
catch (Exception $e) {
521 $error = $e->getMessage();
$_SESSION['RF']["verify"]
if(empty($settings['ROOT_PATH'])) elseif(empty($settings['DB_PARAMETERS'])) $error
xoFormFieldCharset($name, $value, $label, $help, $link)
if($uname== ''||$pass== '') $member_handler
const ERR_INVALID_DBCHARSET
if(!isset($xoops->paths[$path_type])) if($path_type== 'var') $file
if(array_key_exists('DB_PARAMETERS', $settings)) $driver_info
xoPassField($name, $value, $label, $help= '')
const ERR_COULD_NOT_ACCESS
genPathCheckHtml($path, $valid)
const ERR_INVALID_DBCOLLATION
xoDiagBoolSetting($name, $wanted=false, $severe=false)
xoFormField($name, $value, $label, $help= '')
install_finalize($installer_modified)
xoFormFieldCollation($name, $value, $label, $help, $link, $charset)
install_acceptUser($hash= '')
xoDiag($status=-1, $str= '')
if(!is_object($module)||!$module->getVar('isactive')) $msg
xoBoolField($name, $value, $label, $help= '')
const ERR_NO_DBCONNECTION
xoFormBlockCollation($name, $value, $label, $help, $link, $charset)
getDbCollations($link, $charset)
validateDbCharset($link, &$charset, &$collation)