From 6ac4c34ca7fbcd4ce4e19c8c2bb2fe1f1926224d Mon Sep 17 00:00:00 2001 From: Alix Date: Thu, 18 May 2023 23:19:07 +0330 Subject: [PATCH] Update install.php --- install/install.php | 130 ++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/install/install.php b/install/install.php index 2e708c1d..0fe361f0 100644 --- a/install/install.php +++ b/install/install.php @@ -85,13 +85,13 @@ if ($currentStep == 0) {
- +
@@ -100,10 +100,10 @@ if ($currentStep == 0) { "; if (!$json or ($developer == 'N' and !is_object($json)) or ($developer == 'Y' and !is_array($json)) or ($developer == 'N' and property_exists($json, 'tag_name') and $easyWiVersion == $json->tag_name) or ($developer == 'Y' and is_object($json[0]) and property_exists($json[0], 'name') and $easyWiVersion == $json[0]->name )) { - $displayToUser .= "

{$languageObject->welcome_header}

{$languageObject->welcome_text}

"; + $displayToUser .= "

{$languageObject->welcome_header}

{$languageObject->welcome_text}

"; } else { $apiVersion = ($developer == 'Y') ? $json[0]->name : $json->tag_name; - $displayToUser .= "
{$languageObject->welcome_old_version}{$apiVersion}

{$languageObject->welcome_header}

{$languageObject->welcome_text}

"; + $displayToUser .= "
{$languageObject->welcome_old_version}{$apiVersion}

{$languageObject->welcome_header}

{$languageObject->welcome_text}

"; } } else { @@ -171,19 +171,19 @@ if ($currentStep == 0) { ); foreach ($folderArray as $folder) { - if (is_dir(EASYWIDIR . "/${folder}")) { - $handle = @fopen(EASYWIDIR . "/${folder}test.txt", "w+"); + if (is_dir(EASYWIDIR . "/{$folder}")) { + $handle = @fopen(EASYWIDIR . "/{$folder}test.txt", "w+"); if ($handle) { fclose($handle); - unlink(EASYWIDIR . "/${folder}test.txt"); - $systemCheckOk['folders'][] = "{$languageObject->system_check_ok_folder_1} ${folder} {$languageObject->system_check_ok_folder_2}"; + unlink(EASYWIDIR . "/{$folder}test.txt"); + $systemCheckOk['folders'][] = "{$languageObject->system_check_ok_folder_1} {$folder} {$languageObject->system_check_ok_folder_2}"; } else { - $systemCheckError['folders'][] = "{$languageObject->system_check_error_folder_not_writable_1} ${folder} {$languageObject->system_check_error_folder_not_writable_2}"; + $systemCheckError['folders'][] = "{$languageObject->system_check_error_folder_not_writable_1} {$folder} {$languageObject->system_check_error_folder_not_writable_2}"; } } else { - $systemCheckError['folders'][] = "{$languageObject->system_check_error_folder_not_exist_1} ${folder} {$languageObject->system_check_error_folder_not_exist_2}"; + $systemCheckError['folders'][] = "{$languageObject->system_check_error_folder_not_exist_1} {$folder} {$languageObject->system_check_error_folder_not_exist_2}"; } } @@ -192,31 +192,31 @@ if ($currentStep == 0) { if ($currentStep == 1) { if (count($systemCheckError) == 0) { - $displayToUser .= ""; + $displayToUser .= ""; } foreach ($systemCheckError as $v) { if (is_array($v)) { foreach ($v as $v2) { - $displayToUser .= "
${v2}
"; + $displayToUser .= "
{$v2}
"; } } else { - $displayToUser .= "
${v}
"; + $displayToUser .= "
{$v}
"; } } foreach ($systemCheckOk as $v) { if (is_array($v)) { foreach ($v as $v2) { - $displayToUser .= "
${v2}
"; + $displayToUser .= "
{$v2}
"; } } else { - $displayToUser .= "
${v}
"; + $displayToUser .= "
{$v}
"; } } if (count($systemCheckError) == 0) { - $displayToUser .= ""; + $displayToUser .= ""; } } @@ -237,35 +237,35 @@ if ($currentStep == 2 and count($systemCheckError) == 0) { } $displayToUser = " - +
- +
- +
- +
- +
- +

{$languageObject->aeskey2}

{$languageObject->aeskey3}

@@ -284,7 +284,7 @@ if ($currentStep == 2 and count($systemCheckError) == 0) { try { - $sql = new PDO("mysql:host=${_POST['host']};dbname=${_POST['db']}", $_POST['user'], $_POST['pwd'], array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); + $sql = new PDO("mysql:host={$_POST['host']};dbname={$_POST['db']}", $_POST['user'], $_POST['pwd'], array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $configFp = @fopen(EASYWIDIR . '/stuff/config.php', "w+"); @@ -356,7 +356,7 @@ $aeskey = "' . addcslashes($_POST['aeskey'], "'") . '"; try { - $sql = new PDO("mysql:host=${host};dbname=${db}", $user, $pwd, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); + $sql = new PDO("mysql:host={$host};dbname={$db}", $user, $pwd, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $error) { @@ -383,7 +383,7 @@ $aeskey = "' . addcslashes($_POST['aeskey'], "'") . '"; if ($currentStep == 3 and count($systemCheckError) == 0) { $displayToUser .= "
{$languageObject->ok_files_created}
"; $displayToUser .= "
{$languageObject->ok_db_connect}
"; - $displayToUser .= ""; + $displayToUser .= ""; } if ($currentStep == 4 and count($systemCheckError) == 0) { @@ -412,7 +412,7 @@ if ($currentStep == 4 and count($systemCheckError) == 0) { $displayToUser .= "
{$languageObject->ok_db_tables_create}
"; } - $displayToUser .= ""; + $displayToUser .= ""; } catch(PDOException $error) { $systemCheckError['tables_add.php'] = "
{$error->getMessage()}" . implode("\r\n", $tables->getExecutedSql()) . "
"; @@ -451,7 +451,7 @@ if ($currentStep == 5 and count($systemCheckError) == 0) { $displayToUser .= "
{$languageObject->ok_db_tables_check}
"; } - $displayToUser .= ""; + $displayToUser .= ""; } @@ -501,17 +501,17 @@ if ($currentStep == 6 and count($systemCheckError) == 0) { if (!isset($_POST['passw1']) or strlen($displayToUser) > 0) { $displayToUser .= " - +
- +
- +
@@ -552,7 +552,7 @@ if ($currentStep == 6 and count($systemCheckError) == 0) { $query->execute(); $displayToUser .= "
{$languageObject->ok_admin_user}
"; - $displayToUser .= ""; + $displayToUser .= ""; } catch(PDOException $error) { @@ -634,7 +634,7 @@ if ($currentStep == 7 and count($systemCheckError) == 0) { $dirs = scandir(EASYWIDIR . "/languages/default/"); foreach ($dirs as $row) { if (preg_match("/^[a-z]{2}+$/", $row)) { - $languages[] = ($row == $menuLanguage) ? "" : ""; + $languages[] = ($row == $menuLanguage) ? "" : ""; } } } @@ -644,11 +644,11 @@ if ($currentStep == 7 and count($systemCheckError) == 0) { if (!isset($_POST['email']) or strlen($displayToUser) > 0) { $displayToUser .= " - +
- +
@@ -667,19 +667,19 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
- +
- +
- +

{$languageObject->email2}

@@ -688,7 +688,7 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {

{$languageObject->captcha_2}

@@ -696,14 +696,14 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
- +

{$languageObject->faillogins2}

- +

{$languageObject->brandname2}

@@ -712,14 +712,14 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
- +

{$languageObject->prefix2}

@@ -756,7 +756,7 @@ if ($currentStep == 7 and count($systemCheckError) == 0) { $query = $sql->prepare("INSERT INTO `traffic_settings` (`id`,`type`) VALUES (1,'mysql') ON DUPLICATE KEY UPDATE `type`=`type`"); $query->execute(); - $query = $sql->prepare("INSERT INTO `easywi_version` (`id`,`version`,`de`,`en`) VALUES (1,'${easyWiVersion}','','') ON DUPLICATE KEY UPDATE `id`=`id`"); + $query = $sql->prepare("INSERT INTO `easywi_version` (`id`,`version`,`de`,`en`) VALUES (1,'{$easyWiVersion}','','') ON DUPLICATE KEY UPDATE `id`=`id`"); $query->execute(); $query = $sql->prepare("INSERT INTO `page_pages` (`id`,`authorid`,`type`) VALUES (1,0,'about') ON DUPLICATE KEY UPDATE `id`=`id`"); @@ -809,7 +809,7 @@ if ($currentStep == 7 and count($systemCheckError) == 0) { } $displayToUser .= "
{$languageObject->ok_configuration}
"; - $displayToUser .= ""; + $displayToUser .= ""; } catch(PDOException $error) { @@ -825,7 +825,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) { $displayToUser .= "
{$languageObject->games_insert}
"; $displayToUser .= " - +
@@ -840,7 +840,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) { include(EASYWIDIR . '/stuff/data/gameslist.php'); - $displayToUser .= ""; + $displayToUser .= ""; $displayToUser .= "
{$languageObject->ok_gameserver_data}
"; $query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=0 LIMIT 1"); @@ -866,7 +866,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) { } } else { - $displayToUser .= "
{$languageObject->error_game_insert} " . count($image) . " ${image[':description']}
"; + $displayToUser .= "
{$languageObject->error_game_insert} " . count($image) . " {$image[':description']}
"; } } @@ -915,7 +915,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) { } } - $displayToUser .= ""; + $displayToUser .= ""; } catch(PDOException $error) { @@ -978,11 +978,11 @@ if ($currentStep == 9 and count($systemCheckError) == 0) { $displayToUser .= "

{$languageObject->cron_internal} (/etc/crontab)

{$languageObject->cron_internal_text}
-0 */1 * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 300 php ./reboot.php >/dev/null 2>&1
-*/5 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./statuscheck.php >/dev/null 2>&1
-*/1 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./startupdates.php >/dev/null 2>&1
-*/5 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./jobs.php >/dev/null 2>&1
-*/10 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./cloud.php >/dev/null 2>&1
"; +0 */1 * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 300 php ./reboot.php >/dev/null 2>&1
+*/5 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./statuscheck.php >/dev/null 2>&1
+*/1 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./startupdates.php >/dev/null 2>&1
+*/5 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./jobs.php >/dev/null 2>&1
+*/10 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./cloud.php >/dev/null 2>&1
"; $displayToUser .= "

{$languageObject->cron_internal} (crontab -e)

{$languageObject->cron_internal_text}
@@ -998,19 +998,19 @@ if ($currentStep == 9 and count($systemCheckError) == 0) { $displayToUser .= "

{$languageObject->cron_external} (/etc/crontab)

{$languageObject->cron_external_text}
-0 */1 * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}reboot.php >/dev/null 2>&1
-*/5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}statuscheck.php >/dev/null 2>&1
-*/1 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}startupdates.php >/dev/null 2>&1
-*/5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}jobs.php >/dev/null 2>&1
-*/10 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}cloud.php >/dev/null 2>&1
"; +0 */1 * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}reboot.php >/dev/null 2>&1
+*/5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}statuscheck.php >/dev/null 2>&1
+*/1 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}startupdates.php >/dev/null 2>&1
+*/5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}jobs.php >/dev/null 2>&1
+*/10 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}cloud.php >/dev/null 2>&1
"; $displayToUser .= "

{$languageObject->cron_external} (crontab -e)

{$languageObject->cron_external_text}
-0 */1 * * * wget -q --no-check-certificate -O - ${pageUrl}reboot.php >/dev/null 2>&1
-*/5 * * * * wget -q --no-check-certificate -O - ${pageUrl}statuscheck.php >/dev/null 2>&1
-*/1 * * * * wget -q --no-check-certificate -O - ${pageUrl}startupdates.php >/dev/null 2>&1
-*/5 * * * * wget -q --no-check-certificate -O - ${pageUrl}jobs.php >/dev/null 2>&1
-*/10 * * * * wget -q --no-check-certificate -O - ${pageUrl}cloud.php >/dev/null 2>&1
"; +0 */1 * * * wget -q --no-check-certificate -O - {$pageUrl}reboot.php >/dev/null 2>&1
+*/5 * * * * wget -q --no-check-certificate -O - {$pageUrl}statuscheck.php >/dev/null 2>&1
+*/1 * * * * wget -q --no-check-certificate -O - {$pageUrl}startupdates.php >/dev/null 2>&1
+*/5 * * * * wget -q --no-check-certificate -O - {$pageUrl}jobs.php >/dev/null 2>&1
+*/10 * * * * wget -q --no-check-certificate -O - {$pageUrl}cloud.php >/dev/null 2>&1
"; } @@ -1018,10 +1018,10 @@ if (strlen($displayToUser) == 0 and count($systemCheckError) > 0) { foreach ($systemCheckError as $v) { if (is_array($v)) { foreach ($v as $v2) { - $displayToUser .= "
${v2}
"; + $displayToUser .= "
{$v2}
"; } } else { - $displayToUser .= "
${v}
"; + $displayToUser .= "
{$v}
"; } } }