Merge pull request #1348 from alix1383/master

php8.2
This commit is contained in:
Jan 2023-05-22 09:17:13 +02:00 committed by GitHub
commit 4b41092e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
187 changed files with 237 additions and 1822 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
.project .project
stuff/config.php
stuff/keyphrasefile.php

View File

@ -85,13 +85,13 @@ if ($currentStep == 0) {
<div class='col-md-9'> <div class='col-md-9'>
<form class='form-horizontal' role='form' action='install.php' method='get'> <form class='form-horizontal' role='form' action='install.php' method='get'>
<input type='hidden' name='step' value='0' /> <input type='hidden' name='step' value='0' />
<input type='hidden' name='language' value='${menuLanguage}' /> <input type='hidden' name='language' value='{$menuLanguage}' />
<div class='form-group'> <div class='form-group'>
<label for='inputVersion' class='col-sm-2 control-label'>Version</label> <label for='inputVersion' class='col-sm-2 control-label'>Version</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<select class='form-control' name='developer' onChange='this.form.submit()'> <select class='form-control' name='developer' onChange='this.form.submit()'>
<option value='N'>Stable</option> <option value='N'>Stable</option>
<option value='Y' ${selectedDeveloper}>Developer</option> <option value='Y' {$selectedDeveloper}>Developer</option>
</select> </select>
</div> </div>
</div> </div>
@ -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 )) { 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 .= "<div class='col-md-12'><div class='jumbotron'><h2>{$languageObject->welcome_header}</h2><p>{$languageObject->welcome_text}</p><div class='pager'><a href='?step=1${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div></div></div>"; $displayToUser .= "<div class='col-md-12'><div class='jumbotron'><h2>{$languageObject->welcome_header}</h2><p>{$languageObject->welcome_text}</p><div class='pager'><a href='?step=1{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div></div></div>";
} else { } else {
$apiVersion = ($developer == 'Y') ? $json[0]->name : $json->tag_name; $apiVersion = ($developer == 'Y') ? $json[0]->name : $json->tag_name;
$displayToUser .= "<div class='col-md-12'><div class='alert alert-warning'><i class='fa fa-exclamation-triangle'></i> {$languageObject->welcome_old_version}<a href='https://github.com/easy-wi/developer/releases/tag/{$apiVersion}' target='_blank'>{$apiVersion}</a></div><div class='jumbotron'><h2>{$languageObject->welcome_header}</h2><p>{$languageObject->welcome_text}</p><div class='pager'><a href='?step=1${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div></div></div>"; $displayToUser .= "<div class='col-md-12'><div class='alert alert-warning'><i class='fa fa-exclamation-triangle'></i> {$languageObject->welcome_old_version}<a href='https://github.com/easy-wi/developer/releases/tag/{$apiVersion}' target='_blank'>{$apiVersion}</a></div><div class='jumbotron'><h2>{$languageObject->welcome_header}</h2><p>{$languageObject->welcome_text}</p><div class='pager'><a href='?step=1{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div></div></div>";
} }
} else { } else {
@ -171,19 +171,19 @@ if ($currentStep == 0) {
); );
foreach ($folderArray as $folder) { foreach ($folderArray as $folder) {
if (is_dir(EASYWIDIR . "/${folder}")) { if (is_dir(EASYWIDIR . "/{$folder}")) {
$handle = @fopen(EASYWIDIR . "/${folder}test.txt", "w+"); $handle = @fopen(EASYWIDIR . "/{$folder}test.txt", "w+");
if ($handle) { if ($handle) {
fclose($handle); fclose($handle);
unlink(EASYWIDIR . "/${folder}test.txt"); unlink(EASYWIDIR . "/{$folder}test.txt");
$systemCheckOk['folders'][] = "{$languageObject->system_check_ok_folder_1} ${folder} {$languageObject->system_check_ok_folder_2}"; $systemCheckOk['folders'][] = "{$languageObject->system_check_ok_folder_1} {$folder} {$languageObject->system_check_ok_folder_2}";
} else { } 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 { } 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 ($currentStep == 1) {
if (count($systemCheckError) == 0) { if (count($systemCheckError) == 0) {
$displayToUser .= "<div class='pager'><a href='?step=2${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=2{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} }
foreach ($systemCheckError as $v) { foreach ($systemCheckError as $v) {
if (is_array($v)) { if (is_array($v)) {
foreach ($v as $v2) { foreach ($v as $v2) {
$displayToUser .= "<div class='alert alert-danger'>${v2}</div>"; $displayToUser .= "<div class='alert alert-danger'>{$v2}</div>";
} }
} else { } else {
$displayToUser .= "<div class='alert alert-danger'>${v}</div>"; $displayToUser .= "<div class='alert alert-danger'>{$v}</div>";
} }
} }
foreach ($systemCheckOk as $v) { foreach ($systemCheckOk as $v) {
if (is_array($v)) { if (is_array($v)) {
foreach ($v as $v2) { foreach ($v as $v2) {
$displayToUser .= "<div class='alert alert-success'>${v2}</div>"; $displayToUser .= "<div class='alert alert-success'>{$v2}</div>";
} }
} else { } else {
$displayToUser .= "<div class='alert alert-success'>${v}</div>"; $displayToUser .= "<div class='alert alert-success'>{$v}</div>";
} }
} }
if (count($systemCheckError) == 0) { if (count($systemCheckError) == 0) {
$displayToUser .= "<div class='pager'><a href='?step=2${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=2{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} }
} }
@ -237,35 +237,35 @@ if ($currentStep == 2 and count($systemCheckError) == 0) {
} }
$displayToUser = " $displayToUser = "
<form class='form-horizontal' role='form' action='install.php?step=3${languageGetParameter}' method='post'> <form class='form-horizontal' role='form' action='install.php?step=3{$languageGetParameter}' method='post'>
<div class='form-group'> <div class='form-group'>
<label for='inputHost' class='col-sm-2 control-label'>{$languageObject->host}</label> <label for='inputHost' class='col-sm-2 control-label'>{$languageObject->host}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputHost' name='host' value='${host}' required> <input type='text' class='form-control' id='inputHost' name='host' value='{$host}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputDB' class='col-sm-2 control-label'>{$languageObject->db}</label> <label for='inputDB' class='col-sm-2 control-label'>{$languageObject->db}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputDB' name='db' value='${db}' required> <input type='text' class='form-control' id='inputDB' name='db' value='{$db}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputUser' class='col-sm-2 control-label'>{$languageObject->user}</label> <label for='inputUser' class='col-sm-2 control-label'>{$languageObject->user}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputUser' name='user' value='${user}' required> <input type='text' class='form-control' id='inputUser' name='user' value='{$user}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputPassword' class='col-sm-2 control-label'>{$languageObject->passw_1}</label> <label for='inputPassword' class='col-sm-2 control-label'>{$languageObject->passw_1}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='password' class='form-control' id='inputPassword' name='pwd' value='${pwd}' required> <input type='password' class='form-control' id='inputPassword' name='pwd' value='{$pwd}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputAESKey' class='col-sm-2 control-label'>{$languageObject->aeskey}</label> <label for='inputAESKey' class='col-sm-2 control-label'>{$languageObject->aeskey}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputAESKey' name='aeskey' value='${aeskey}' required> <input type='text' class='form-control' id='inputAESKey' name='aeskey' value='{$aeskey}' required>
<p class='help-block'>{$languageObject->aeskey2}</p> <p class='help-block'>{$languageObject->aeskey2}</p>
<p class='help-block'>{$languageObject->aeskey3}</p> <p class='help-block'>{$languageObject->aeskey3}</p>
</div> </div>
@ -284,7 +284,7 @@ if ($currentStep == 2 and count($systemCheckError) == 0) {
try { 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); $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$configFp = @fopen(EASYWIDIR . '/stuff/config.php', "w+"); $configFp = @fopen(EASYWIDIR . '/stuff/config.php', "w+");
@ -356,7 +356,7 @@ $aeskey = "' . addcslashes($_POST['aeskey'], "'") . '";
try { 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); $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $error) { } catch(PDOException $error) {
@ -383,7 +383,7 @@ $aeskey = "' . addcslashes($_POST['aeskey'], "'") . '";
if ($currentStep == 3 and count($systemCheckError) == 0) { if ($currentStep == 3 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_files_created}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_files_created}</div>";
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_db_connect}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_db_connect}</div>";
$displayToUser .= "<div class='pager'><a href='?step=4${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=4{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} }
if ($currentStep == 4 and count($systemCheckError) == 0) { if ($currentStep == 4 and count($systemCheckError) == 0) {
@ -412,7 +412,7 @@ if ($currentStep == 4 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_db_tables_create}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_db_tables_create}</div>";
} }
$displayToUser .= "<div class='pager'><a href='?step=5${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=5{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} catch(PDOException $error) { } catch(PDOException $error) {
$systemCheckError['tables_add.php'] = "<div class='alert alert-danger'>{$error->getMessage()}" . implode("\r\n", $tables->getExecutedSql()) . "</div>"; $systemCheckError['tables_add.php'] = "<div class='alert alert-danger'>{$error->getMessage()}" . implode("\r\n", $tables->getExecutedSql()) . "</div>";
@ -451,7 +451,7 @@ if ($currentStep == 5 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_db_tables_check}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_db_tables_check}</div>";
} }
$displayToUser .= "<div class='pager'><a href='?step=6${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=6{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} }
@ -501,17 +501,17 @@ if ($currentStep == 6 and count($systemCheckError) == 0) {
if (!isset($_POST['passw1']) or strlen($displayToUser) > 0) { if (!isset($_POST['passw1']) or strlen($displayToUser) > 0) {
$displayToUser .= " $displayToUser .= "
<form class='form-horizontal' role='form' action='install.php?step=6${languageGetParameter}' method='post'> <form class='form-horizontal' role='form' action='install.php?step=6{$languageGetParameter}' method='post'>
<div class='form-group'> <div class='form-group'>
<label for='inputUser' class='col-sm-2 control-label'>{$languageObject->user2}</label> <label for='inputUser' class='col-sm-2 control-label'>{$languageObject->user2}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputUser' name='cname' value='${cname}' required> <input type='text' class='form-control' id='inputUser' name='cname' value='{$cname}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputEmail' class='col-sm-2 control-label'>{$languageObject->email}</label> <label for='inputEmail' class='col-sm-2 control-label'>{$languageObject->email}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='email' class='form-control' id='inputEmail' name='email' value='${email}' required> <input type='email' class='form-control' id='inputEmail' name='email' value='{$email}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
@ -552,7 +552,7 @@ if ($currentStep == 6 and count($systemCheckError) == 0) {
$query->execute(); $query->execute();
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_admin_user}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_admin_user}</div>";
$displayToUser .= "<div class='pager'><a href='?step=7${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=7{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} catch(PDOException $error) { } catch(PDOException $error) {
@ -634,7 +634,7 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
$dirs = scandir(EASYWIDIR . "/languages/default/"); $dirs = scandir(EASYWIDIR . "/languages/default/");
foreach ($dirs as $row) { foreach ($dirs as $row) {
if (preg_match("/^[a-z]{2}+$/", $row)) { if (preg_match("/^[a-z]{2}+$/", $row)) {
$languages[] = ($row == $menuLanguage) ? "<option value='${row}' selected='selected'>$row</option>" : "<option value='${row}'>$row</option>"; $languages[] = ($row == $menuLanguage) ? "<option value='{$row}' selected='selected'>$row</option>" : "<option value='{$row}'>$row</option>";
} }
} }
} }
@ -644,11 +644,11 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
if (!isset($_POST['email']) or strlen($displayToUser) > 0) { if (!isset($_POST['email']) or strlen($displayToUser) > 0) {
$displayToUser .= " $displayToUser .= "
<form class='form-horizontal' role='form' action='install.php?step=7${languageGetParameter}' method='post'> <form class='form-horizontal' role='form' action='install.php?step=7{$languageGetParameter}' method='post'>
<div class='form-group'> <div class='form-group'>
<label for='inputInstallUrl' class='col-sm-2 control-label'>{$languageObject->installUrl}</label> <label for='inputInstallUrl' class='col-sm-2 control-label'>{$languageObject->installUrl}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputInstallUrl' name='installUrl' value='${installUrl}' required> <input type='text' class='form-control' id='inputInstallUrl' name='installUrl' value='{$installUrl}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
@ -667,19 +667,19 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
<div class='form-group'> <div class='form-group'>
<label for='inputTitle' class='col-sm-2 control-label'>{$languageObject->title}</label> <label for='inputTitle' class='col-sm-2 control-label'>{$languageObject->title}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputTitle' name='title' value='${title}' required> <input type='text' class='form-control' id='inputTitle' name='title' value='{$title}' required>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputLanguage' class='col-sm-2 control-label'>{$languageObject->language}</label> <label for='inputLanguage' class='col-sm-2 control-label'>{$languageObject->language}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<select name='language' class='form-control' id='inputLanguage'>${languages}</select> <select name='language' class='form-control' id='inputLanguage'>{$languages}</select>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputEmail' class='col-sm-2 control-label'>{$languageObject->email}</label> <label for='inputEmail' class='col-sm-2 control-label'>{$languageObject->email}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='email' class='form-control' id='inputEmail' name='email' value='${email}' required> <input type='email' class='form-control' id='inputEmail' name='email' value='{$email}' required>
<p class='help-block'>{$languageObject->email2}</p> <p class='help-block'>{$languageObject->email2}</p>
</div> </div>
</div> </div>
@ -688,7 +688,7 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
<div class='col-sm-10'> <div class='col-sm-10'>
<select name='captcha' class='form-control' id='inputCaptcha'> <select name='captcha' class='form-control' id='inputCaptcha'>
<option value='0'>{$languageObject->no}</option> <option value='0'>{$languageObject->no}</option>
<option value='1' ${selectedCaptcha}>{$languageObject->yes}</option> <option value='1' {$selectedCaptcha}>{$languageObject->yes}</option>
</select> </select>
<p class='help-block'>{$languageObject->captcha_2}</p> <p class='help-block'>{$languageObject->captcha_2}</p>
</div> </div>
@ -696,14 +696,14 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
<div class='form-group'> <div class='form-group'>
<label for='inputFaillogins' class='col-sm-2 control-label'>{$languageObject->faillogins}</label> <label for='inputFaillogins' class='col-sm-2 control-label'>{$languageObject->faillogins}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='number' class='form-control' id='inputFaillogins' name='faillogins' value='${faillogins}' required> <input type='number' class='form-control' id='inputFaillogins' name='faillogins' value='{$faillogins}' required>
<p class='help-block'>{$languageObject->faillogins2}</p> <p class='help-block'>{$languageObject->faillogins2}</p>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputBrandname' class='col-sm-2 control-label'>{$languageObject->brandname}</label> <label for='inputBrandname' class='col-sm-2 control-label'>{$languageObject->brandname}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputBrandname' name='brandname' value='${brandname}' required> <input type='text' class='form-control' id='inputBrandname' name='brandname' value='{$brandname}' required>
<p class='help-block'>{$languageObject->brandname2}</p> <p class='help-block'>{$languageObject->brandname2}</p>
</div> </div>
</div> </div>
@ -712,14 +712,14 @@ if ($currentStep == 7 and count($systemCheckError) == 0) {
<div class='col-sm-10'> <div class='col-sm-10'>
<select name='prefix1' class='form-control' id='inputPrefix1'> <select name='prefix1' class='form-control' id='inputPrefix1'>
<option value='N'>{$languageObject->no}</option> <option value='N'>{$languageObject->no}</option>
<option value='Y' ${selectedPrefix}>{$languageObject->yes}</option> <option value='Y' {$selectedPrefix}>{$languageObject->yes}</option>
</select> </select>
</div> </div>
</div> </div>
<div class='form-group'> <div class='form-group'>
<label for='inputPrefix' class='col-sm-2 control-label'>{$languageObject->prefix3}</label> <label for='inputPrefix' class='col-sm-2 control-label'>{$languageObject->prefix3}</label>
<div class='col-sm-10'> <div class='col-sm-10'>
<input type='text' class='form-control' id='inputPrefix' name='prefix2' value='${prefix2}' required> <input type='text' class='form-control' id='inputPrefix' name='prefix2' value='{$prefix2}' required>
<p class='help-block'>{$languageObject->prefix2}</p> <p class='help-block'>{$languageObject->prefix2}</p>
</div> </div>
</div> </div>
@ -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 = $sql->prepare("INSERT INTO `traffic_settings` (`id`,`type`) VALUES (1,'mysql') ON DUPLICATE KEY UPDATE `type`=`type`");
$query->execute(); $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->execute();
$query = $sql->prepare("INSERT INTO `page_pages` (`id`,`authorid`,`type`) VALUES (1,0,'about') ON DUPLICATE KEY UPDATE `id`=`id`"); $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 .= "<div class='alert alert-success'>{$languageObject->ok_configuration}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_configuration}</div>";
$displayToUser .= "<div class='pager'><a href='?step=8${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=8{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} catch(PDOException $error) { } catch(PDOException $error) {
@ -825,7 +825,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'>{$languageObject->games_insert}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->games_insert}</div>";
$displayToUser .= " $displayToUser .= "
<form class='form-horizontal' role='form' action='install.php?step=8${languageGetParameter}' method='post'> <form class='form-horizontal' role='form' action='install.php?step=8{$languageGetParameter}' method='post'>
<div class='form-group'> <div class='form-group'>
<div class='col-sm-offset-2 col-sm-10'> <div class='col-sm-offset-2 col-sm-10'>
<button type='submit' name='submit' class='btn btn-primary btn-lg pull-right'>{$languageObject->continue}</button> <button type='submit' name='submit' class='btn btn-primary btn-lg pull-right'>{$languageObject->continue}</button>
@ -840,7 +840,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) {
include(EASYWIDIR . '/stuff/data/gameslist.php'); include(EASYWIDIR . '/stuff/data/gameslist.php');
$displayToUser .= "<div class='pager'><a href='?step=9${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=9{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
$displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_gameserver_data}</div>"; $displayToUser .= "<div class='alert alert-success'>{$languageObject->ok_gameserver_data}</div>";
$query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=0 LIMIT 1"); $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 { } else {
$displayToUser .= "<div class='alert alert-danger'>{$languageObject->error_game_insert} " . count($image) . " ${image[':description']}</div>"; $displayToUser .= "<div class='alert alert-danger'>{$languageObject->error_game_insert} " . count($image) . " {$image[':description']}</div>";
} }
} }
@ -915,7 +915,7 @@ if ($currentStep == 8 and count($systemCheckError) == 0) {
} }
} }
$displayToUser .= "<div class='pager'><a href='?step=9${languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>"; $displayToUser .= "<div class='pager'><a href='?step=9{$languageGetParameter}' class='pull-right'><span class='btn btn-primary btn-lg'>{$languageObject->continue}</span></a></div>";
} catch(PDOException $error) { } catch(PDOException $error) {
@ -978,11 +978,11 @@ if ($currentStep == 9 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_internal} (/etc/crontab)</h4> $displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_internal} (/etc/crontab)</h4>
<strong>{$languageObject->cron_internal_text}</strong><br> <strong>{$languageObject->cron_internal_text}</strong><br>
0 */1 * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 300 php ./reboot.php >/dev/null 2>&1<br> 0 */1 * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 300 php ./reboot.php >/dev/null 2>&1<br>
*/5 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./statuscheck.php >/dev/null 2>&1<br> */5 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./statuscheck.php >/dev/null 2>&1<br>
*/1 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./startupdates.php >/dev/null 2>&1<br> */1 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./startupdates.php >/dev/null 2>&1<br>
*/5 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./jobs.php >/dev/null 2>&1<br> */5 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./jobs.php >/dev/null 2>&1<br>
*/10 * * * * ${displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./cloud.php >/dev/null 2>&1</div>"; */10 * * * * {$displayPHPUser} cd " . EASYWIDIR . " && timeout 290 php ./cloud.php >/dev/null 2>&1</div>";
$displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_internal} (crontab -e)</h4> $displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_internal} (crontab -e)</h4>
<strong>{$languageObject->cron_internal_text}</strong><br> <strong>{$languageObject->cron_internal_text}</strong><br>
@ -998,19 +998,19 @@ if ($currentStep == 9 and count($systemCheckError) == 0) {
$displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_external} (/etc/crontab)</h4> $displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_external} (/etc/crontab)</h4>
<strong>{$languageObject->cron_external_text}</strong><br> <strong>{$languageObject->cron_external_text}</strong><br>
0 */1 * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}reboot.php >/dev/null 2>&1<br> 0 */1 * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}reboot.php >/dev/null 2>&1<br>
*/5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}statuscheck.php >/dev/null 2>&1<br> */5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}statuscheck.php >/dev/null 2>&1<br>
*/1 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}startupdates.php >/dev/null 2>&1<br> */1 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}startupdates.php >/dev/null 2>&1<br>
*/5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}jobs.php >/dev/null 2>&1<br> */5 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}jobs.php >/dev/null 2>&1<br>
*/10 * * * * ExternalSSH2User wget -q --no-check-certificate -O - ${pageUrl}cloud.php >/dev/null 2>&1</div>"; */10 * * * * ExternalSSH2User wget -q --no-check-certificate -O - {$pageUrl}cloud.php >/dev/null 2>&1</div>";
$displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_external} (crontab -e)</h4> $displayToUser .= "<div class='alert alert-success'><h4>{$languageObject->cron_external} (crontab -e)</h4>
<strong>{$languageObject->cron_external_text}</strong><br> <strong>{$languageObject->cron_external_text}</strong><br>
0 */1 * * * wget -q --no-check-certificate -O - ${pageUrl}reboot.php >/dev/null 2>&1<br> 0 */1 * * * wget -q --no-check-certificate -O - {$pageUrl}reboot.php >/dev/null 2>&1<br>
*/5 * * * * wget -q --no-check-certificate -O - ${pageUrl}statuscheck.php >/dev/null 2>&1<br> */5 * * * * wget -q --no-check-certificate -O - {$pageUrl}statuscheck.php >/dev/null 2>&1<br>
*/1 * * * * wget -q --no-check-certificate -O - ${pageUrl}startupdates.php >/dev/null 2>&1<br> */1 * * * * wget -q --no-check-certificate -O - {$pageUrl}startupdates.php >/dev/null 2>&1<br>
*/5 * * * * wget -q --no-check-certificate -O - ${pageUrl}jobs.php >/dev/null 2>&1<br> */5 * * * * wget -q --no-check-certificate -O - {$pageUrl}jobs.php >/dev/null 2>&1<br>
*/10 * * * * wget -q --no-check-certificate -O - ${pageUrl}cloud.php >/dev/null 2>&1</div>"; */10 * * * * wget -q --no-check-certificate -O - {$pageUrl}cloud.php >/dev/null 2>&1</div>";
} }
@ -1018,10 +1018,10 @@ if (strlen($displayToUser) == 0 and count($systemCheckError) > 0) {
foreach ($systemCheckError as $v) { foreach ($systemCheckError as $v) {
if (is_array($v)) { if (is_array($v)) {
foreach ($v as $v2) { foreach ($v as $v2) {
$displayToUser .= "<div class='alert alert-danger'>${v2}</div>"; $displayToUser .= "<div class='alert alert-danger'>{$v2}</div>";
} }
} else { } else {
$displayToUser .= "<div class='alert alert-danger'>${v}</div>"; $displayToUser .= "<div class='alert alert-danger'>{$v}</div>";
} }
} }
} }

View File

@ -347,7 +347,7 @@ if (true or !isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_ar
} }
} else if ($autorestart == 'Y') { } else if ($autorestart == 'Y') {
print "<br><br>Do not restart TS3/TSDNS ${queryip} since failcount is only ${ts3masternotified} and ${down_checks} is required for restart \r\n"; print "<br><br>Do not restart TS3/TSDNS {$queryip} since failcount is only {$ts3masternotified} and {$down_checks} is required for restart \r\n";
} }
} }

View File

@ -80,7 +80,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$currentHour = date('G'); $currentHour = date('G');
$currentMinute = (int) date('i'); $currentMinute = (int) date('i');
echo "Start Syncs and Updates. Hour is ${currentHour} and minute is ${currentMinute}\r\n"; echo "Start Syncs and Updates. Hour is {$currentHour} and minute is {$currentMinute}\r\n";
if ($allRoots) { if ($allRoots) {
@ -98,13 +98,13 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$query = $sql->prepare("UPDATE `settings` SET `lastUpdateRun`=? WHERE `resellerid`=0 LIMIT 1"); $query = $sql->prepare("UPDATE `settings` SET `lastUpdateRun`=? WHERE `resellerid`=0 LIMIT 1");
$query->execute(array($currentMinute)); $query->execute(array($currentMinute));
echo "Checking for servers to be updated and or synced at hour ${currentHour} and between minutes ${lastUpdateRun} and ${currentMinute}\r\n"; echo "Checking for servers to be updated and or synced at hour {$currentHour} and between minutes {$lastUpdateRun} and {$currentMinute}\r\n";
// avoid less/more OR equal in SQL. We want only less/more to eliminate the OR comparison // avoid less/more OR equal in SQL. We want only less/more to eliminate the OR comparison
$currentMinute++; $currentMinute++;
$lastUpdateRun--; $lastUpdateRun--;
echo "Altered minutes for running a more efficient query will be updateMinute > ${lastUpdateRun} AND updateMinute < ${currentMinute}\r\n"; echo "Altered minutes for running a more efficient query will be updateMinute > {$lastUpdateRun} AND updateMinute < {$currentMinute}\r\n";
$query = $sql->prepare("SELECT `id`,`updates` FROM `rserverdata` WHERE (`alreadyStartedAt` IS NULL OR `alreadyStartedAt`!=?) AND `updateMinute`>? AND `updateMinute`<? AND `active`!='N'"); $query = $sql->prepare("SELECT `id`,`updates` FROM `rserverdata` WHERE (`alreadyStartedAt` IS NULL OR `alreadyStartedAt`!=?) AND `updateMinute`>? AND `updateMinute`<? AND `active`!='N'");
$query->execute(array($currentHour, $lastUpdateRun, $currentMinute)); $query->execute(array($currentHour, $lastUpdateRun, $currentMinute));

View File

@ -721,7 +721,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
} else { } else {
print "TSDNS ${row['ssh2ip']} is up and running\r\n"; print "TSDNS {$row['ssh2ip']} is up and running\r\n";
$query3 = $sql->prepare("UPDATE `voice_tsdns` SET `notified`=0 WHERE `id`=? LIMIT 1"); $query3 = $sql->prepare("UPDATE `voice_tsdns` SET `notified`=0 WHERE `id`=? LIMIT 1");
$query3->execute(array($row['id'])); $query3->execute(array($row['id']));
@ -1117,7 +1117,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
if (isset($ts3id, $lendserver) and (($lendserver == 'N' and $slots < $server['virtualserver_maxclients']) or ($lendserver == 'Y' and $lendslots < $server['virtualserver_maxclients']))) { if (isset($ts3id, $lendserver) and (($lendserver == 'N' and $slots < $server['virtualserver_maxclients']) or ($lendserver == 'Y' and $lendslots < $server['virtualserver_maxclients']))) {
$showSlots = ($lendserver == 'Y') ? $lendslots : $slots; $showSlots = ($lendserver == 'Y') ? $lendslots : $slots;
print $vrow['type'] . " server $address virtualserver_maxclients ${sd['virtualserver_maxclients']}!= " . $showSlots . ". The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n"; print $vrow['type'] . " server $address virtualserver_maxclients {$sd['virtualserver_maxclients']}!= " . $showSlots . ". The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n";
if (isset($rulebreak)) { if (isset($rulebreak)) {
$rulebreak .= '<br />virtualserver_maxclients ' . $vosprache->isnot . ' ' . $showSlots; $rulebreak .= '<br />virtualserver_maxclients ' . $vosprache->isnot . ' ' . $showSlots;
@ -1140,7 +1140,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
if (isset($changeSlots)) { if (isset($changeSlots)) {
print $vrow['type'] . " server $address Changing Flex Slots to ${changeSlots}. The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n"; print $vrow['type'] . " server $address Changing Flex Slots to {$changeSlots}. The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n";
$connection->ImportModServer($virtualserver_id, $changeSlots, $vrow2['ip'], $vrow2['port'], array()); $connection->ImportModServer($virtualserver_id, $changeSlots, $vrow2['ip'], $vrow2['port'], array());

View File

@ -90,7 +90,7 @@ if ($ui->w('action',4, 'post') and !token(true)) {
if (isset($addon)) { if (isset($addon)) {
header("Cache-Control: public"); header("Cache-Control: public");
header("Content-Description: File Transfer"); header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename = ${addon}.xml"); header("Content-Disposition: attachment; filename = {$addon}.xml");
header("Content-Type: text/xml; charset=UTF-8"); header("Content-Type: text/xml; charset=UTF-8");
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
$xml->formatOutput = true; $xml->formatOutput = true;

View File

@ -43,7 +43,6 @@ if ((!isset($admin_id) or $main != 1) or (isset($admin_id) and !$pa['gimages']))
include(EASYWIDIR . '/stuff/keyphrasefile.php'); include(EASYWIDIR . '/stuff/keyphrasefile.php');
include(EASYWIDIR . '/third_party/gameq/GameQ/Autoloader.php'); include(EASYWIDIR . '/third_party/gameq/GameQ/Autoloader.php');
include(EASYWIDIR . '/third_party/gameq_v2/GameQ.php');
include(EASYWIDIR . '/stuff/methods/functions_gs.php'); include(EASYWIDIR . '/stuff/methods/functions_gs.php');
$sprache = getlanguagefile('images', $user_language, $resellerLockupID); $sprache = getlanguagefile('images', $user_language, $resellerLockupID);
@ -94,7 +93,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
header("Cache-Control: public"); header("Cache-Control: public");
header("Content-Description: File Transfer"); header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename = ${shorten}.xml"); header("Content-Disposition: attachment; filename = {$shorten}.xml");
header("Content-Type: text/xml; charset=UTF-8"); header("Content-Type: text/xml; charset=UTF-8");
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");

View File

@ -70,7 +70,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query->execute(array($ui->w('activeGS', 1, 'post'), $ui->w('activeVS', 1, 'post'), $ui->id('mintime', 3, 'post'), $ui->id('maxtime', 4, 'post'), $ui->id('timesteps', 3, 'post'), $ui->id('minplayer', 3, 'post'), $maxplayer = $ui->id('maxplayer', 3, 'post'), $ui->id('playersteps', 3, 'post'), $ui->id('mintimeRegistered', 3, 'post'), $ui->id('maxtimeRegistered', 4, 'post'), $ui->id('timestepsRegistered', 3, 'post'), $ui->id('minplayerRegistered', 3, 'post'), $ui->id('maxplayerRegistered', 3, 'post'), $ui->id('playerstepsRegistered', 3, 'post'), $vomintime = $ui->id('vomintime', 3, 'post'), $ui->id('vomaxtime', 4, 'post'), $ui->id('votimesteps', 3, 'post'), $ui->id('vominplayer', 3, 'post'), $ui->id('vomaxplayer', 3, 'post'), $ui->id('voplayersteps', 3, 'post'), $ui->id('vomintimeRegistered', 3, 'post'), $ui->id('vomaxtimeRegistered', 4, 'post'), $ui->id('votimestepsRegistered', 3, 'post'), $ui->id('vominplayerRegistered', 3, 'post'), $ui->id('vomaxplayerRegistered', 3, 'post'), $ui->id('voplayerstepsRegistered', 3, 'post'), $ui->active('shutdownempty', 'post'), $ui->id('shutdownemptytime', 4, 'post'), $ui->w('ftpupload', 1, 'post'), $ui->url('ftpuploadpath', 'post'), $aeskey, $ui->id('lendaccess', 1, 'post'), $resellerLockupID)); $query->execute(array($ui->w('activeGS', 1, 'post'), $ui->w('activeVS', 1, 'post'), $ui->id('mintime', 3, 'post'), $ui->id('maxtime', 4, 'post'), $ui->id('timesteps', 3, 'post'), $ui->id('minplayer', 3, 'post'), $maxplayer = $ui->id('maxplayer', 3, 'post'), $ui->id('playersteps', 3, 'post'), $ui->id('mintimeRegistered', 3, 'post'), $ui->id('maxtimeRegistered', 4, 'post'), $ui->id('timestepsRegistered', 3, 'post'), $ui->id('minplayerRegistered', 3, 'post'), $ui->id('maxplayerRegistered', 3, 'post'), $ui->id('playerstepsRegistered', 3, 'post'), $vomintime = $ui->id('vomintime', 3, 'post'), $ui->id('vomaxtime', 4, 'post'), $ui->id('votimesteps', 3, 'post'), $ui->id('vominplayer', 3, 'post'), $ui->id('vomaxplayer', 3, 'post'), $ui->id('voplayersteps', 3, 'post'), $ui->id('vomintimeRegistered', 3, 'post'), $ui->id('vomaxtimeRegistered', 4, 'post'), $ui->id('votimestepsRegistered', 3, 'post'), $ui->id('vominplayerRegistered', 3, 'post'), $ui->id('vomaxplayerRegistered', 3, 'post'), $ui->id('voplayerstepsRegistered', 3, 'post'), $ui->active('shutdownempty', 'post'), $ui->id('shutdownemptytime', 4, 'post'), $ui->w('ftpupload', 1, 'post'), $ui->url('ftpuploadpath', 'post'), $aeskey, $ui->id('lendaccess', 1, 'post'), $resellerLockupID));
$template_file = ($query->rowCount() > 0) ? $spracheResponse->table_add : $spracheResponse->error_table;; $template_file = ($query->rowCount() > 0) ? $spracheResponse->table_add : $spracheResponse->error_table;;
} else { } else {
$query = $sql->prepare("SELECT *,AES_DECRYPT(`ftpuploadpath`,?) AS `decyptedftpuploadpath` FROM `lendsettings` WHERE `resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT *,AES_DECRYPT(`ftpuploadpath`,?) AS `decyptedftpuploadpath` FROM `lendsettings` WHERE `resellerid`=? LIMIT 1");
@ -111,7 +110,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = 'admin_lendserver_settings.tpl'; $template_file = 'admin_lendserver_settings.tpl';
} }
} else if ($ui->st('d', 'get') == 'st' and $pa['lendserver']) { } else if ($ui->st('d', 'get') == 'st' and $pa['lendserver']) {
$statistic = array(); $statistic = array();
@ -139,7 +137,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} }
$template_file = $stats; $template_file = $stats;
} else if ($pa['lendserver']) { } else if ($pa['lendserver']) {
if ($ui->id('id', 19, 'post')) { if ($ui->id('id', 19, 'post')) {
@ -161,7 +158,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$appServer->stopApp(); $appServer->stopApp();
$appServer->execute(); $appServer->execute();
} }
} else if (isset($servertype) and $servertype == 'v') { } else if (isset($servertype) and $servertype == 'v') {
$query = $sql->prepare("SELECT v.`localserverid`,m.`ssh2ip`,m.`rootid`,m.`addedby`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`id`=? AND v.`resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT v.`localserverid`,m.`ssh2ip`,m.`rootid`,m.`addedby`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`id`=? AND v.`resellerid`=? LIMIT 1");
@ -194,7 +190,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query->execute(array($ui->id('id', 19, 'post'), $resellerLockupID)); $query->execute(array($ui->id('id', 19, 'post'), $resellerLockupID));
$template_file = ($query->rowCount() > 0) ? $spracheResponse->table_del : $spracheResponse->error_table; $template_file = ($query->rowCount() > 0) ? $spracheResponse->table_del : $spracheResponse->error_table;
} else { } else {
$htmlExtraInformation['css'][] = '<link href="css/default/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css">'; $htmlExtraInformation['css'][] = '<link href="css/default/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css">';
@ -275,9 +270,24 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$nextfree = 0; $nextfree = 0;
} }
$query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`queryName`,v.`dns`,v.`usedslots`,v.`slots` AS `availableSlots`,l.`password`,l.`slots`,l.`started`,l.`lendtime`,CURRENT_TIMESTAMP AS `now`,l.`id` AS `lend_id` FROM `voice_server` v LEFT JOIN `lendedserver` l ON v.`id`=l.`serverid` AND l.`servertype`='v' WHERE v.`lendserver`='Y' AND v.`active`='Y' AND v.`resellerid`=0"); $encryptionKey = '';
$query2 = $sql->prepare("SELECT v.`localserverid`,m.`ssh2ip`,m.`rootid`,m.`addedby`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`id`=? AND v.`resellerid`=? LIMIT 1"); $serverId = '';
$resellerId = '';
$query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`queryName`,v.`dns`,v.`usedslots`,v.`slots` AS `availableSlots`,l.`password`,l.`slots`,l.`started`,l.`lendtime`,CURRENT_TIMESTAMP AS `now`,l.`id` AS `lend_id`
FROM `voice_server` v
LEFT JOIN `lendedserver` l ON v.`id`=l.`serverid` AND l.`servertype`='v'
WHERE v.`lendserver`='Y' AND v.`active`='Y' AND v.`resellerid`=?
");
$query->execute(array($resellerLockupID)); $query->execute(array($resellerLockupID));
$query2 = $sql->prepare("SELECT v.`localserverid`,m.`ssh2ip`,m.`rootid`,m.`addedby`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword`
FROM `voice_server` v
LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id`
WHERE v.`id`=? AND v.`resellerid`=?
LIMIT 1");
$query2->execute(array($encryptionKey, $serverId, $resellerId));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
$time = 0; $time = 0;

View File

@ -253,7 +253,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query = $sql->prepare("DELETE FROM `translations` WHERE `type`='pd' AND `transID`=? AND `resellerID`=?"); $query = $sql->prepare("DELETE FROM `translations` WHERE `type`='pd' AND `transID`=? AND `resellerID`=?");
$query->execute(array($id, $reseller_id)); $query->execute(array($id, $reseller_id));
@unlink(EASYWIDIR . "/downloads/${id}/${fileExtension}"); @unlink(EASYWIDIR . "/downloads/{$id}/{$fileExtension}");
$template_file = $spracheResponse->table_del; $template_file = $spracheResponse->table_del;
} else { } else {

View File

@ -95,14 +95,14 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name)); $query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name));
$id = $sql->lastInsertId(); $id = $sql->lastInsertId();
$loguseraction = "%add% Custom Column ${name}"; $loguseraction = "%add% Custom Column {$name}";
} else if ($ui->id('id', 10, 'get') and $ui->st('d', 'get') == 'md') { } else if ($ui->id('id', 10, 'get') and $ui->st('d', 'get') == 'md') {
$query = $sql->prepare("UPDATE `custom_columns_settings` SET `active`=?,`item`=?,`type`=?,`length`=?,`name`=? WHERE `customID`=? LIMIT 1"); $query = $sql->prepare("UPDATE `custom_columns_settings` SET `active`=?,`item`=?,`type`=?,`length`=?,`name`=? WHERE `customID`=? LIMIT 1");
$query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name, $id)); $query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name, $id));
$loguseraction = "%mod% Custom Column ${name}"; $loguseraction = "%mod% Custom Column {$name}";
} else { } else {
$template_file = 'admin_404.tpl'; $template_file = 'admin_404.tpl';
@ -228,7 +228,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query = $sql->prepare("DELETE FROM `translations` WHERE `type`='cc' AND `transID`=?"); $query = $sql->prepare("DELETE FROM `translations` WHERE `type`='cc' AND `transID`=?");
$query->execute(array($id)); $query->execute(array($id));
$loguseraction = "%del% Custom Column ${name}"; $loguseraction = "%del% Custom Column {$name}";
$insertlog->execute(); $insertlog->execute();
$template_file = $spracheResponse->table_del; $template_file = $spracheResponse->table_del;

View File

@ -65,14 +65,14 @@ foreach ($modules as $module) {
} }
$functions = array('fopen'); $functions = array('fopen');
$systemCheckOk = array();
$systemCheckError = array();
foreach ($functions as $function) { foreach ($functions as $function) {
if (function_exists($function)) { if (function_exists($function)) {
$okField = "system_ok_$function"; $systemCheckOk[$function] = true;
$systemCheckOk[$function] = $function->$okField;
} else { } else {
$errorField = "error_system_$function"; $systemCheckError[$function] = "The function $function does not exist.";
$systemCheckError[$function] = $sprache->$errorField;
} }
} }
@ -106,19 +106,19 @@ $folderArray = array(
); );
foreach ($folderArray as $folder) { foreach ($folderArray as $folder) {
if (is_dir(EASYWIDIR . "/${folder}")) { if (is_dir(EASYWIDIR . "/{$folder}")) {
$handle = @fopen(EASYWIDIR . "/${folder}test.txt", "w+"); $handle = @fopen(EASYWIDIR . "/{$folder}test.txt", "w+");
if ($handle) { if ($handle) {
fclose($handle); fclose($handle);
unlink(EASYWIDIR . "/${folder}test.txt"); unlink(EASYWIDIR . "/{$folder}test.txt");
$systemCheckOk['folders'][] = "Folder exists and can write to: ${folder}"; $systemCheckOk['folders'][] = "Folder exists and can write to: {$folder}";
} else { } else {
$systemCheckError['folders'][] = "Folder exists but cannot edit files: ${folder}"; $systemCheckError['folders'][] = "Folder exists but cannot edit files: {$folder}";
} }
} else { } else {
$systemCheckError['folders'][] = "Folder does not exist or cannot access: ${folder}"; $systemCheckError['folders'][] = "Folder does not exist or cannot access: {$folder}";
} }
} }

View File

@ -520,8 +520,8 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$temp=' AND ('; $temp=' AND (';
$i = 0; $i = 0;
foreach ($selected as $get) { foreach ($selected as $get) {
if ($i==0) $temp.="`state`='${get}'"; if ($i==0) $temp.="`state`='{$get}'";
else $temp.=" OR `state`='${get}'"; else $temp.=" OR `state`='{$get}'";
if (!in_array($get,$selected)) $selected[] = $get; if (!in_array($get,$selected)) $selected[] = $get;
$i++; $i++;
} }

View File

@ -235,8 +235,8 @@ if ($ui->st('d', 'get') == 'ad') {
$temp=' AND ('; $temp=' AND (';
$i = 0; $i = 0;
foreach ($selected as $get) { foreach ($selected as $get) {
if ($i==0) $temp.="`state`='${get}'"; if ($i==0) $temp.="`state`='{$get}'";
else $temp.=" OR `state`='${get}'"; else $temp.=" OR `state`='{$get}'";
$selected[] = $get; $selected[] = $get;
$i++; $i++;
} }

View File

@ -342,43 +342,43 @@ if ($ui->w('action',4, 'post') and !token(true)) {
foreach ($dnsList as $dns) { foreach ($dnsList as $dns) {
$lookUp = str_replace('.', '_', $dns); $lookUp = str_replace('.', '_', $dns);
$ex = explode(':', $ui->ipport("${lookUp}-address", 'post')); $ex = explode(':', $ui->ipport("{$lookUp}-address", 'post'));
if ($ui->active("${lookUp}-import", 'post') == 'Y' and isset($ex[1]) and port($ex[1])) { if ($ui->active("{$lookUp}-import", 'post') == 'Y' and isset($ex[1]) and port($ex[1])) {
$ip = $ex[0]; $ip = $ex[0];
$port = $ex[1]; $port = $ex[1];
$customer = $ui->id("${lookUp}-customer", 19, 'post'); $customer = $ui->id("{$lookUp}-customer", 19, 'post');
if ($customer == 0 or $customer == false or $customer == null) { if ($customer == 0 or $customer == false or $customer == null) {
$usernew = true; $usernew = true;
if ($ui->username("${lookUp}-username",50, 'post') and $ui->ismail("${lookUp}-email", 'post')) { if ($ui->username("{$lookUp}-username",50, 'post') and $ui->ismail("{$lookUp}-email", 'post')) {
$query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
$usernew = false; $usernew = false;
$customer = $row['id']; $customer = $row['id'];
$cnamenew = $ui->username("${lookUp}-username",50, 'post'); $cnamenew = $ui->username("{$lookUp}-username",50, 'post');
} }
if ($usernew == true) { if ($usernew == true) {
$newHash = passwordCreate($ui->username("${lookUp}-username",50, 'post'), passwordgenerate(10)); $newHash = passwordCreate($ui->username("{$lookUp}-username",50, 'post'), passwordgenerate(10));
if (is_array($newHash)) { if (is_array($newHash)) {
$query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`salt`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,?,'u',?)"); $query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`salt`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,?,'u',?)");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $newHash['hash'], $newHash['salt'], $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $newHash['hash'], $newHash['salt'], $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
} else { } else {
$query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,'u',?)"); $query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,'u',?)");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $newHash, $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $newHash, $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
} }
$query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? ORDER BY `id` DESC LIMIT 1"); $query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? ORDER BY `id` DESC LIMIT 1");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
$customer = $row['id']; $customer = $row['id'];
$cnamenew = $ui->username("${lookUp}-username",50, 'post'); $cnamenew = $ui->username("{$lookUp}-username",50, 'post');
sendmail('emailuseradd', $customer, $cnamenew, $initialpassword); sendmail('emailuseradd', $customer, $cnamenew, $initialpassword);
} }
} }

View File

@ -63,7 +63,7 @@ if (isset($downloadID)) {
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}")))) { if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}")))) {
if (isset($startDownload)) { if (isset($startDownload)) {
@ -74,26 +74,26 @@ if (isset($downloadID)) {
if ($row['external'] == 'N') { if ($row['external'] == 'N') {
$fileWithPath = EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}"; $fileWithPath = EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}";
$finfo = finfo_open(FILEINFO_MIME_TYPE); $finfo = finfo_open(FILEINFO_MIME_TYPE);
$contentType = finfo_file($finfo, $fileWithPath); $contentType = finfo_file($finfo, $fileWithPath);
finfo_close($finfo); finfo_close($finfo);
header("Content-Type: ${contentType}"); header("Content-Type: {$contentType}");
if (strpos(strtolower($ui->server['SERVER_SOFTWARE']),'nginx') !== false) { if (strpos(strtolower($ui->server['SERVER_SOFTWARE']),'nginx') !== false) {
header('Content-Length: ' . (string) (filesize($fileWithPath))); header('Content-Length: ' . (string) (filesize($fileWithPath)));
header('Cache-Control: public, must-revalidate'); header('Cache-Control: public, must-revalidate');
header('Pragma: no-cache'); header('Pragma: no-cache');
header("Content-Disposition: attachment; filename=\"${row['fileName']}.${row['fileExtension']}\""); header("Content-Disposition: attachment; filename=\"{$row['fileName']}.{$row['fileExtension']}\"");
header('Content-Transfer-Encoding: binary'); header('Content-Transfer-Encoding: binary');
header("X-Accel-Redirect: /downloads/${row['fileID']}.${row['fileExtension']}"); header("X-Accel-Redirect: /downloads/{$row['fileID']}.{$row['fileExtension']}");
} else { } else {
header("Content-Disposition: attachment; filename=\"${row['fileName']}.${row['fileExtension']}\""); header("Content-Disposition: attachment; filename=\"{$row['fileName']}.{$row['fileExtension']}\"");
set_time_limit(0); set_time_limit(0);
$fp = @fopen(EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}","rb"); $fp = @fopen(EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}","rb");
while(!feof($fp)) { while(!feof($fp)) {
print(@fread($fp, 1024)); print(@fread($fp, 1024));
ob_flush(); ob_flush();
@ -101,7 +101,7 @@ if (isset($downloadID)) {
} }
} }
} else { } else {
header("location: ${row['externalURL']}"); header("location: {$row['externalURL']}");
} }
die; die;
@ -123,7 +123,7 @@ if (isset($downloadID)) {
$query = $sql->prepare("SELECT d.*,t.`text` FROM `page_downloads` d LEFT JOIN `translations` t ON t.`type`='pd' AND t.`transID`=d.`fileID` AND t.`lang`=? ORDER BY d.`order`,d.`fileID`"); $query = $sql->prepare("SELECT d.*,t.`text` FROM `page_downloads` d LEFT JOIN `translations` t ON t.`type`='pd' AND t.`transID`=d.`fileID` AND t.`lang`=? ORDER BY d.`order`,d.`fileID`");
$query->execute(array($user_language)); $query->execute(array($user_language));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}")))) { if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}")))) {
$table[] = array('id' => $row['fileID'], 'description' => $row['description'], 'link' => (isset($seo) and $seo == 'Y') ? $page_data->pages['downloads']['link'].'get/'.$row['fileID'].'/' : $page_data->pages['downloads']['link'].'&amp;action=get&amp;id='.$row['fileID'], 'text' => $row['text']); $table[] = array('id' => $row['fileID'], 'description' => $row['description'], 'link' => (isset($seo) and $seo == 'Y') ? $page_data->pages['downloads']['link'].'get/'.$row['fileID'].'/' : $page_data->pages['downloads']['link'].'&amp;action=get&amp;id='.$row['fileID'], 'text' => $row['text']);
} }
} }

View File

@ -438,7 +438,7 @@ class AppServer {
$this->shellScripts['user'] .= 'CONFIGUSERID=' . $this->appMasterServerDetails['configUserID'] . "\n"; $this->shellScripts['user'] .= 'CONFIGUSERID=' . $this->appMasterServerDetails['configUserID'] . "\n";
$this->shellScripts['user'] .= 'USER=`ls -la /var/run/screen | grep S-' . $userName . ' | head -n 1 | awk \'{print $3}\'`' . "\n"; $this->shellScripts['user'] .= 'USER=`ls -la /var/run/screen | grep S-' . $userName . ' | head -n 1 | awk \'{print $3}\'`' . "\n";
$this->shellScripts['user'] .= 'if [ "$USER" != "" -a $USER -eq $USER 2> /dev/null ]; then CONFIGUSERID=$USER; fi' . "\n"; $this->shellScripts['user'] .= 'if [ "$USER" != "" -a $USER -eq $USER 2> /dev/null ]; then CONFIGUSERID=$USER; fi' . "\n";
$this->shellScripts['user'] .= 'USERID=`getent passwd | cut -f3 -d: | sort -un | awk \'BEGIN { id=\'${CONFIGUSERID}\' } $1 == id { id++ } $1 > id { print id; exit }\'`' . "\n"; $this->shellScripts['user'] .= 'USERID=`getent passwd | cut -f3 -d: | sort -un | awk \'BEGIN { id=\'{$CONFIGUSERID}\' } $1 == id { id++ } $1 > id { print id; exit }\'`' . "\n";
$this->shellScripts['user'] .= 'if [ "`ls -la /var/run/screen | awk \'{print $3}\' | grep $USERID`" == "" -a "`grep \"x:$USERID:\" /etc/passwd`" == "" ]; then' . "\n"; $this->shellScripts['user'] .= 'if [ "`ls -la /var/run/screen | awk \'{print $3}\' | grep $USERID`" == "" -a "`grep \"x:$USERID:\" /etc/passwd`" == "" ]; then' . "\n";
$this->shellScripts['user'] .= 'if [ "`lsb_release -i 2> /dev/null | grep \'Distributor\' | awk \'{print tolower($3)}\'`" == "centos" ] || [ "`grep \'\bNAME=\b\' /etc/os-release | sed -n \'s/^.*NAME=//p\' | sed -e \'s/\(.*\)/\L\1/\'`" == "slackware" ]; then' . "\n"; $this->shellScripts['user'] .= 'if [ "`lsb_release -i 2> /dev/null | grep \'Distributor\' | awk \'{print tolower($3)}\'`" == "centos" ] || [ "`grep \'\bNAME=\b\' /etc/os-release | sed -n \'s/^.*NAME=//p\' | sed -e \'s/\(.*\)/\L\1/\'`" == "slackware" ]; then' . "\n";
$this->shellScripts['user'] .= 'sudo /usr/sbin/useradd -m -p `perl -e \'print crypt("\'' . $password . '\'","Sa")\'` -d ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $userNameHome) . ' -g ' . $this->appMasterServerDetails['ssh2User'] . ' -s /bin/false $USERID ' . $userName . ' 2>/dev/null' . "\n"; $this->shellScripts['user'] .= 'sudo /usr/sbin/useradd -m -p `perl -e \'print crypt("\'' . $password . '\'","Sa")\'` -d ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $userNameHome) . ' -g ' . $this->appMasterServerDetails['ssh2User'] . ' -s /bin/false $USERID ' . $userName . ' 2>/dev/null' . "\n";
@ -481,7 +481,7 @@ class AppServer {
private function linuxDeleteUserGenerate ($userName) { private function linuxDeleteUserGenerate ($userName) {
$this->shellScripts['user'] .= 'sudo pkill -u ' . $userName . "\n"; $this->shellScripts['user'] .= 'sudo pkill -u ' . $userName . "\n";
$this->shellScripts['user'] .= 'if [ "`id ' . $userName . ' 2>/dev/null`" != "" ]; then' . "\n"; $this->shellScripts['user'] .= 'if [ "`id ' . $userName . ' 2>/dev/null`" != "" ]; then' . "\n";
$this->shellScripts['user'] .= '${IONICE}nice -n +19 sudo /usr/sbin/userdel -fr ' . $userName . ' > /dev/null 2>&1 ' . "\n"; $this->shellScripts['user'] .= '{$IONICE}nice -n +19 sudo /usr/sbin/userdel -fr ' . $userName . ' > /dev/null 2>&1 ' . "\n";
$this->addLogline('user.log', 'User ' . $userName . ' deleted'); $this->addLogline('user.log', 'User ' . $userName . ' deleted');
$this->shellScripts['user'] .= 'fi' . "\n"; $this->shellScripts['user'] .= 'fi' . "\n";
@ -605,7 +605,7 @@ class AppServer {
// Migrate old folder structure with ip_port as sub folder to structure without // Migrate old folder structure with ip_port as sub folder to structure without
$script .= 'if [ -d ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . ' ]; then' . "\n"; $script .= 'if [ -d ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . ' ]; then' . "\n";
$script .= 'mv ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '/* ' . $absolutePath . "\n"; $script .= 'mv ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '/* ' . $absolutePath . "\n";
$script .= '${IONICE}nice -n +19 rm -rf ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . "\n"; $script .= '{$IONICE}nice -n +19 rm -rf ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . "\n";
$script .= 'fi' . "\n"; $script .= 'fi' . "\n";
foreach ($templates as $template) { foreach ($templates as $template) {
@ -622,11 +622,11 @@ class AppServer {
} }
$script .= 'FILEFOUND=(`find -mindepth 1 -type f \( -iname "*.' . implode('" -or -iname "*.', $copyFileExtensions) . '" \) | grep -v -E "$PATTERN"`)' . "\n"; $script .= 'FILEFOUND=(`find -mindepth 1 -type f \( -iname "*.' . implode('" -or -iname "*.', $copyFileExtensions) . '" \) | grep -v -E "$PATTERN"`)' . "\n";
$script .= 'for FILTEREDFILES in ${FILEFOUND[@]}; do' . "\n"; $script .= 'for FILTEREDFILES in {$FILEFOUND[@]}; do' . "\n";
$script .= 'FOLDERNAME=`dirname "$FILTEREDFILES"`' . "\n"; $script .= 'FOLDERNAME=`dirname "$FILTEREDFILES"`' . "\n";
$script .= 'if ([[ `find "$FOLDERNAME" -maxdepth 0 -type d` ]] && [[ ! -d "' . $absoluteTargetTemplatePath . '$FOLDERNAME" ]]); then mkdir -p "' . $absoluteTargetTemplatePath . '$FOLDERNAME"; fi' . "\n"; $script .= 'if ([[ `find "$FOLDERNAME" -maxdepth 0 -type d` ]] && [[ ! -d "' . $absoluteTargetTemplatePath . '$FOLDERNAME" ]]); then mkdir -p "' . $absoluteTargetTemplatePath . '$FOLDERNAME"; fi' . "\n";
$script .= 'if [ -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then find "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" -maxdepth 1 -type l -delete; fi' . "\n"; $script .= 'if [ -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then find "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" -maxdepth 1 -type l -delete; fi' . "\n";
$script .= 'if [ ! -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then ${IONICE}cp "' . $absoluteSourceTemplatePath . '$FILTEREDFILES" "' . $absoluteTargetTemplatePath . '$FILTEREDFILES"; fi' . "\n"; $script .= 'if [ ! -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then {$IONICE}cp "' . $absoluteSourceTemplatePath . '$FILTEREDFILES" "' . $absoluteTargetTemplatePath . '$FILTEREDFILES"; fi' . "\n";
$script .= 'done' . "\n"; $script .= 'done' . "\n";
$script .= 'cp -sr ' . $absoluteSourceTemplatePath . '* ' . $absoluteTargetTemplatePath . ' > /dev/null 2>&1' . "\n"; $script .= 'cp -sr ' . $absoluteSourceTemplatePath . '* ' . $absoluteTargetTemplatePath . ' > /dev/null 2>&1' . "\n";
@ -640,15 +640,15 @@ class AppServer {
$dirChmod = 750; $dirChmod = 750;
$fileChmod = 640; $fileChmod = 640;
} }
$script .= '${IONICE}nice -n +19 find ' . $absolutePath . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $absolutePath . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n";
if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) { if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) {
$script .= '${IONICE}nice -n +19 find ' . $absolutePath . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $absolutePath . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $absolutePath . ' -type f -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $absolutePath . ' -type f -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} }
$script .= '${IONICE}nice -n +19 find -L ' . $absolutePath . ' -type l -delete' . "\n"; $script .= '{$IONICE}nice -n +19 find -L ' . $absolutePath . ' -type l -delete' . "\n";
if ($standalone and isset($scriptName)) { if ($standalone and isset($scriptName)) {
$this->addLinuxScript($scriptName, $script); $this->addLinuxScript($scriptName, $script);
@ -722,7 +722,7 @@ class AppServer {
$script .= 'TARGET_FOLDER="`dirname ' . $spareFile . '`"' . "\n"; $script .= 'TARGET_FOLDER="`dirname ' . $spareFile . '`"' . "\n";
$script .= 'if [ ! -d "../sparefiles/${TARGET_FOLDER}" ]; then mkdir -p "../sparefiles/${TARGET_FOLDER}"' . "\n"; $script .= 'if [ ! -d "../sparefiles/{$TARGET_FOLDER}" ]; then mkdir -p "../sparefiles/{$TARGET_FOLDER}"' . "\n";
$script .= 'cp "' . $spareFile . '" "../sparefiles/' . $spareFile . '"' . "\n"; $script .= 'cp "' . $spareFile . '" "../sparefiles/' . $spareFile . '"' . "\n";
} }
@ -756,7 +756,7 @@ class AppServer {
$script .= $this->backUpSpareFiles($template, $spareFiles); $script .= $this->backUpSpareFiles($template, $spareFiles);
$script .= 'if [ -d "' . $template . '" ]; then ${IONICE}rm -rf "' . $template . '"; fi' . "\n"; $script .= 'if [ -d "' . $template . '" ]; then {$IONICE}rm -rf "' . $template . '"; fi' . "\n";
$this->addLogline('app_server.log', 'Server template ' . $serverDir . $template . ' owned by user ' . $this->appServerDetails['userNameExecute'] . ' deleted'); $this->addLogline('app_server.log', 'Server template ' . $serverDir . $template . ' owned by user ' . $this->appServerDetails['userNameExecute'] . ' deleted');
$script .= $this->restoreSpareFiles($template); $script .= $this->restoreSpareFiles($template);
@ -1628,7 +1628,7 @@ class AppServer {
$startCommand = str_replace($replaceSettings['placeholder'], $replaceSettings['replacePlaceholderWith'], $startCommand); $startCommand = str_replace($replaceSettings['placeholder'], $replaceSettings['replacePlaceholderWith'], $startCommand);
foreach (customColumns('G', $this->appServerDetails['id']) as $customColumn) { foreach (customColumns('G', $this->appServerDetails['id']) as $customColumn) {
$startCommand = str_replace("%${customColumn['name']}%", $customColumn['value'], $startCommand); $startCommand = str_replace("%{$customColumn['name']}%", $customColumn['value'], $startCommand);
} }
//If a template is set up for both OS, we might need to alter the start of the command //If a template is set up for both OS, we might need to alter the start of the command
@ -1692,7 +1692,7 @@ class AppServer {
$script .= $this->linuxStopApp(false, $scriptName); $script .= $this->linuxStopApp(false, $scriptName);
$script .= '${IONICE}find -L ' . $serverDir . ' -type l -delete' . "\n"; $script .= '{$IONICE}find -L ' . $serverDir . ' -type l -delete' . "\n";
$dirChmod = 700; $dirChmod = 700;
$fileChmod = 600; $fileChmod = 600;
@ -1701,34 +1701,34 @@ class AppServer {
$dirChmod = 750; $dirChmod = 750;
$fileChmod = 640; $fileChmod = 640;
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n";
if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) { if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n";
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} }
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n";
if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) { if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n";
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} }
// Remove files where they do not belong // Remove files where they do not belong
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \) -delete' . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \) -delete' . "\n";
$script .= '${IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \)'; $script .= '{$IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \)';
$script .= ' ! -name ".profile" ! -name ".bashrc" ! -name ".bash_logout" -delete' . "\n"; $script .= ' ! -name ".profile" ! -name ".bashrc" ! -name ".bash_logout" -delete' . "\n";
// Remove folders where they do not belong // Remove folders where they do not belong
$script .= '${IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 -type d'; $script .= '{$IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 -type d';
$script .= ' ! -name ".steam" ! -name "pserver" ! -name "backup" ! -name "fdl_data" ! -name "server" -print0 | xargs -0 rm -rf' . "\n"; $script .= ' ! -name ".steam" ! -name "pserver" ! -name "backup" ! -name "fdl_data" ! -name "server" -print0 | xargs -0 rm -rf' . "\n";
$script .= '${IONICE}nice -n +19 find /home/' . $this->appMasterServerDetails['ssh2User'] . '/fdl_data -type f -user `whoami` ! -name "*.bz2" -delete' . "\n"; $script .= '{$IONICE}nice -n +19 find /home/' . $this->appMasterServerDetails['ssh2User'] . '/fdl_data -type f -user `whoami` ! -name "*.bz2" -delete' . "\n";
} }
if ($this->appServerDetails['template']['steamgame'] == 'S') { if ($this->appServerDetails['template']['steamgame'] == 'S') {
@ -1753,7 +1753,7 @@ class AppServer {
$script .= '`)' . "\n"; $script .= '`)' . "\n";
$script .= 'for BADFILE in ${FILESFOUND[@]}; do' . "\n"; $script .= 'for BADFILE in {$FILESFOUND[@]}; do' . "\n";
$script .= 'chmod 666 $BADFILE > /dev/null 2>&1' . "\n"; $script .= 'chmod 666 $BADFILE > /dev/null 2>&1' . "\n";
$script .= 'rm -f $BADFILE > /dev/null 2>&1' . "\n"; $script .= 'rm -f $BADFILE > /dev/null 2>&1' . "\n";
$script .= 'if [ -f $BADFILE ]; then exit 0; fi' . "\n"; $script .= 'if [ -f $BADFILE ]; then exit 0; fi' . "\n";
@ -1761,19 +1761,19 @@ class AppServer {
} }
if ($this->appMasterServerDetails['configBadTime'] > 0 and count($this->appMasterServerDetails['configBadFiles']) > 0) { if ($this->appMasterServerDetails['configBadTime'] > 0 and count($this->appMasterServerDetails['configBadFiles']) > 0) {
$script .= '${IONICE}find ' . $serverDir . ' -type f \( -iname "*.' . implode('" -or -iname "*.', $this->appMasterServerDetails['configBadFiles']) . '" \) -mtime +' . $this->appMasterServerDetails['configBadTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverDir . ' -type f \( -iname "*.' . implode('" -or -iname "*.', $this->appMasterServerDetails['configBadFiles']) . '" \) -mtime +' . $this->appMasterServerDetails['configBadTime'] . ' -delete' . "\n";
} }
if ($this->appMasterServerDetails['configDemoTime'] > 0) { if ($this->appMasterServerDetails['configDemoTime'] > 0) {
$script .= '${IONICE}find ' . $serverTemplateDir . ' -type f -name "*.dem" -mtime +' . $this->appMasterServerDetails['configDemoTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverTemplateDir . ' -type f -name "*.dem" -mtime +' . $this->appMasterServerDetails['configDemoTime'] . ' -delete' . "\n";
} }
if ($this->appMasterServerDetails['configLogTime'] > 0) { if ($this->appMasterServerDetails['configLogTime'] > 0) {
$script .= '${IONICE}find ' . $serverTemplateDir . ' -type f -name "*.log" -mtime +' . $this->appMasterServerDetails['configLogTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverTemplateDir . ' -type f -name "*.log" -mtime +' . $this->appMasterServerDetails['configLogTime'] . ' -delete' . "\n";
} }
if ($this->appMasterServerDetails['configZtmpTime'] > 0) { if ($this->appMasterServerDetails['configZtmpTime'] > 0) {
$script .= '${IONICE}find ' . $serverTemplateDir . ' -type f -name "*.ztmp" -mtime +' . $this->appMasterServerDetails['configZtmpTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverTemplateDir . ' -type f -name "*.ztmp" -mtime +' . $this->appMasterServerDetails['configZtmpTime'] . ' -delete' . "\n";
} }
$script .= 'cd ' . $this->appServerDetails['absolutePath'] . "\n"; $script .= 'cd ' . $this->appServerDetails['absolutePath'] . "\n";
@ -1868,14 +1868,14 @@ class AppServer {
$uploadScript = 'if [[ `which zip` ]]; then' . "\n"; $uploadScript = 'if [[ `which zip` ]]; then' . "\n";
$uploadScript .= 'if [ "$KEEP" == "" ]; then KEEP="-m"; fi' . "\n"; $uploadScript .= 'if [ "$KEEP" == "" ]; then KEEP="-m"; fi' . "\n";
$uploadScript .= '${IONICE}nice -n +19 zip -q $KEEP $DEMOPATH/$DEMO.zip $DEMOPATH/$DEMO' . "\n"; $uploadScript .= '{$IONICE}nice -n +19 zip -q $KEEP $DEMOPATH/$DEMO.zip $DEMOPATH/$DEMO' . "\n";
$uploadScript .= 'ZIP="zip"' . "\n"; $uploadScript .= 'ZIP="zip"' . "\n";
$uploadScript .= 'elif [[ `which bzip2` ]]; then' . "\n"; $uploadScript .= 'elif [[ `which bzip2` ]]; then' . "\n";
$uploadScript .= '${IONICE}nice -n +19 bzip2 -s -q -9 $KEEP $DEMOPATH/$DEMO' . "\n"; $uploadScript .= '{$IONICE}nice -n +19 bzip2 -s -q -9 $KEEP $DEMOPATH/$DEMO' . "\n";
$uploadScript .= 'ZIP="bz2"' . "\n"; $uploadScript .= 'ZIP="bz2"' . "\n";
$uploadScript .= 'fi' . "\n"; $uploadScript .= 'fi' . "\n";
$uploadScript .= 'DEMOANDPATH="$DEMOPATH/$DEMO.$ZIP"' . "\n"; $uploadScript .= 'DEMOANDPATH="$DEMOPATH/$DEMO.$ZIP"' . "\n";
$uploadScript .= 'wput -q --limit-rate=1024K --remove-source-files --tries 3 --basename="${DEMOPATH/\/\///}" "${DEMOANDPATH/\/\///}" "' . $this->appServerDetails['app']['uploadDir'] . '"' . "\n"; $uploadScript .= 'wput -q --limit-rate=1024K --remove-source-files --tries 3 --basename="{$DEMOPATH/\/\///}" "{$DEMOANDPATH/\/\///}" "' . $this->appServerDetails['app']['uploadDir'] . '"' . "\n";
// 2 and 3 are one time run (manuel mode) // 2 and 3 are one time run (manuel mode)
if (in_array($this->appServerDetails['app']['upload'], array(2, 3))) { if (in_array($this->appServerDetails['app']['upload'], array(2, 3))) {
@ -2213,7 +2213,7 @@ class AppServer {
$script = $this->shellScriptHeader; $script = $this->shellScriptHeader;
$script .= 'rm -f ' . $scriptName . "\n"; $script .= 'rm -f ' . $scriptName . "\n";
$script .= 'if [ -d "' . $serverDir . '" ]; then ${IONICE}rm -rf "' . $serverDir . '"; fi' . "\n"; $script .= 'if [ -d "' . $serverDir . '" ]; then {$IONICE}rm -rf "' . $serverDir . '"; fi' . "\n";
$script .= $this->linuxAddApp(array($targetTemplate), false); $script .= $this->linuxAddApp(array($targetTemplate), false);
@ -2304,7 +2304,7 @@ class AppServer {
$script .= 'find usermaps/ mods/ -type l -or -type f \( -iname "*.ff" -or -iname "*.iwd" \) 2> /dev/null | grep -v "' . $excludePattern . '" | while read FOUNDFILE; do' . "\n"; $script .= 'find usermaps/ mods/ -type l -or -type f \( -iname "*.ff" -or -iname "*.iwd" \) 2> /dev/null | grep -v "' . $excludePattern . '" | while read FOUNDFILE; do' . "\n";
} }
$script .= 'FILTEREDFILE=${FOUNDFILE//\.\//}' . "\n"; $script .= 'FILTEREDFILE={$FOUNDFILE//\.\//}' . "\n";
$script .= 'if [[ ! `grep "$FILTEREDFILE" "' . $fdlFileList . '"` ]]; then' . "\n"; $script .= 'if [[ ! `grep "$FILTEREDFILE" "' . $fdlFileList . '"` ]]; then' . "\n";
$script .= 'FILENAME=`basename $FILTEREDFILE`' . "\n"; $script .= 'FILENAME=`basename $FILTEREDFILE`' . "\n";
@ -2315,14 +2315,14 @@ class AppServer {
$script .= 'FDLDATADIR=' . $fdlMasterFolder . '`dirname "$FILTEREDFILE"`' . "\n"; $script .= 'FDLDATADIR=' . $fdlMasterFolder . '`dirname "$FILTEREDFILE"`' . "\n";
$script .= 'if [ ! -d $FDLDATADIR ]; then mkdir -p $FDLDATADIR; chmod 770 $FDLDATADIR; fi' . "\n"; $script .= 'if [ ! -d $FDLDATADIR ]; then mkdir -p $FDLDATADIR; chmod 770 $FDLDATADIR; fi' . "\n";
$script .= 'FDLDATAFILENAME="$FDLDATADIR/$FILENAME"' . "\n"; $script .= 'FDLDATAFILENAME="$FDLDATADIR/$FILENAME"' . "\n";
$script .= 'CHECKSUMNEW=`${IONICE}nice -n +19 md5sum "$ABSOLUTEFILTEREDFILE" | awk \'{print $1}\'`' . "\n"; $script .= 'CHECKSUMNEW=`{$IONICE}nice -n +19 md5sum "$ABSOLUTEFILTEREDFILE" | awk \'{print $1}\'`' . "\n";
$script .= 'if [ -f "$FDLDATAFILENAME.stat" -a -f "$FDLDATAFILENAME.bz2" ]; then' . "\n"; $script .= 'if [ -f "$FDLDATAFILENAME.stat" -a -f "$FDLDATAFILENAME.bz2" ]; then' . "\n";
$script .= 'CHECKSUMOLD=`head -n 1 "$FDLDATAFILENAME.stat" 2> /dev/null`' . "\n"; $script .= 'CHECKSUMOLD=`head -n 1 "$FDLDATAFILENAME.stat" 2> /dev/null`' . "\n";
$script .= 'else' . "\n"; $script .= 'else' . "\n";
$script .= 'CHECKSUMOLD=""' . "\n"; $script .= 'CHECKSUMOLD=""' . "\n";
$script .= 'fi' . "\n"; $script .= 'fi' . "\n";
$script .= 'if [ "$CHECKSUMOLD" != "$CHECKSUMNEW" ]; then' . "\n"; $script .= 'if [ "$CHECKSUMOLD" != "$CHECKSUMNEW" ]; then' . "\n";
$script .= '${IONICE}nice -n +19 bzip2 -k -s -q -9 -f -c "$ABSOLUTEFILTEREDFILE" > "$FDLDATAFILENAME.bz2"' . "\n"; $script .= '{$IONICE}nice -n +19 bzip2 -k -s -q -9 -f -c "$ABSOLUTEFILTEREDFILE" > "$FDLDATAFILENAME.bz2"' . "\n";
$script .= 'echo $CHECKSUMNEW > "$FDLDATAFILENAME.stat"' . "\n"; $script .= 'echo $CHECKSUMNEW > "$FDLDATAFILENAME.stat"' . "\n";
$script .= 'chmod 660 "$FDLDATAFILENAME.stat" "$FDLDATAFILENAME.bz2"' . "\n"; $script .= 'chmod 660 "$FDLDATAFILENAME.stat" "$FDLDATAFILENAME.bz2"' . "\n";
$script .= 'fi' . "\n"; $script .= 'fi' . "\n";
@ -2394,7 +2394,7 @@ class AppServer {
$script .= 'if [[ `lsof -f -- "' . $backUpFile . '" 2>/dev/null` ]]; then continue; fi' . "\n"; $script .= 'if [[ `lsof -f -- "' . $backUpFile . '" 2>/dev/null` ]]; then continue; fi' . "\n";
$script .= 'if [ -f "' . $backUpFile . '" ]; then rm -f "' . $backUpFile . '"; fi' . "\n"; $script .= 'if [ -f "' . $backUpFile . '" ]; then rm -f "' . $backUpFile . '"; fi' . "\n";
$script .= 'cd "' . $serverDir . '/$GAMETEMPLATE"' . "\n"; $script .= 'cd "' . $serverDir . '/$GAMETEMPLATE"' . "\n";
$script .= '${IONICE}nice -n +19 tar cfj "' . $backUpFile . '" .' . "\n"; $script .= '{$IONICE}nice -n +19 tar cfj "' . $backUpFile . '" .' . "\n";
if (strlen($ftpUploadString) > 0) { if (strlen($ftpUploadString) > 0) {
$script .= 'wput -q --limit-rate=4098 --basename="' . $backupDir . '" "' . $backUpFile . '" "' . $ftpUploadString . '"' . "\n"; $script .= 'wput -q --limit-rate=4098 --basename="' . $backupDir . '" "' . $backUpFile . '" "' . $ftpUploadString . '"' . "\n";
@ -2445,7 +2445,7 @@ class AppServer {
$script .= 'if [ ! -d "' . $this->removeSlashes($serverDir . '/' . $template) . '" ]; then mkdir -p "' . $this->removeSlashes($serverDir . '/' . $template) . '"; fi' . "\n"; $script .= 'if [ ! -d "' . $this->removeSlashes($serverDir . '/' . $template) . '" ]; then mkdir -p "' . $this->removeSlashes($serverDir . '/' . $template) . '"; fi' . "\n";
$script .= '${IONICE}nice -n +19 tar -C "' . $this->removeSlashes($serverDir . '/' . $template) . '" -xjf "' . $this->removeSlashes($backupDir . '/' . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '-' . $template . '.tar.bz2"') . "\n"; $script .= '{$IONICE}nice -n +19 tar -C "' . $this->removeSlashes($serverDir . '/' . $template) . '" -xjf "' . $this->removeSlashes($backupDir . '/' . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '-' . $template . '.tar.bz2"') . "\n";
$script .= 'wget -q --no-check-certificate -O - ' . webhostdomain($resellerLockupID) . '/get_password.php?w=rb\\&shorten=`id -un`\\id=' . $this->appServerDetails['port'] . '\\&ip=' . $this->appServerDetails['serverIP'] . "\n"; $script .= 'wget -q --no-check-certificate -O - ' . webhostdomain($resellerLockupID) . '/get_password.php?w=rb\\&shorten=`id -un`\\id=' . $this->appServerDetails['port'] . '\\&ip=' . $this->appServerDetails['serverIP'] . "\n";
$this->addLinuxScript($scriptName, $script); $this->addLinuxScript($scriptName, $script);
@ -2515,7 +2515,7 @@ class AppServer {
// While we keep on counting up, the mail is send only once to prevent spam // While we keep on counting up, the mail is send only once to prevent spam
if (($this->appMasterServerDetails['notified'] + 1) == $rSA['down_checks']) { if (($this->appMasterServerDetails['notified'] + 1) == $rSA['down_checks']) {
$query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`=${$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'"); $query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`={$$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'");
$query->execute(); $query->execute();
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row['mail_serverdown'] == 'Y') { if ($row['mail_serverdown'] == 'Y') {

View File

@ -277,7 +277,7 @@ class masterServer {
$this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' ' . $this->masterserverDir . ' > ' . $updateLog . "\n"; $this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' ' . $this->masterserverDir . ' > ' . $updateLog . "\n";
$this->shellScript .= 'elif [ "$SYNCTOOL" == "wget" ]; then' . "\n"; $this->shellScript .= 'elif [ "$SYNCTOOL" == "wget" ]; then' . "\n";
$this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' > ' . $updateLog . "\n"; $this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' > ' . $updateLog . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $this->masterserverDir . $shorten . '/ -type f -name "*.listing" -delete' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $this->masterserverDir . $shorten . '/ -type f -name "*.listing" -delete' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";
} else { } else {
@ -292,21 +292,21 @@ class masterServer {
private function houseKeeping ($absoluteGamePath) { private function houseKeeping ($absoluteGamePath) {
// Workaround for another valve chaos. If the files exist, mapgroups will not work properly // Workaround for another valve chaos. If the files exist, mapgroups will not work properly
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -maxdepth 2 -type f -name "subscribed_file_ids.txt" -o -name "subscribed_collection_ids.txt" -delete' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -maxdepth 2 -type f -name "subscribed_file_ids.txt" -o -name "subscribed_collection_ids.txt" -delete' . "\n";
// Chmods should be aligned or else the server install for customer will not work // Chmods should be aligned or else the server install for customer will not work
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.0" -or -iname "*.1" -or -iname "*.2" -or -iname "*.3" -or -iname "*.3ds" -or -iname "*.4" -or -iname "*.5" -or -iname "*.6" -or -iname "*.7" -or -iname "*.8" -or -iname "*.9" -or -iname "*.amx" -or -iname "*.asi" -or -iname "*.asm" -or -iname "*.bin" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.0" -or -iname "*.1" -or -iname "*.2" -or -iname "*.3" -or -iname "*.3ds" -or -iname "*.4" -or -iname "*.5" -or -iname "*.6" -or -iname "*.7" -or -iname "*.8" -or -iname "*.9" -or -iname "*.amx" -or -iname "*.asi" -or -iname "*.asm" -or -iname "*.bin" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.bmp" -or -iname "*.BMP" -or -iname "*.bsp" -or -iname "*.bz2" -or -iname "*.c" -or -iname "*.cab" -or -iname "*.cache" -or -iname "*.cfg" -or -iname "*.cmake" -or -iname "*.col" -or -iname "*.conf" -or -iname "*.cpp" -or -iname "*.css" -or -iname "*.csv" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.bmp" -or -iname "*.BMP" -or -iname "*.bsp" -or -iname "*.bz2" -or -iname "*.c" -or -iname "*.cab" -or -iname "*.cache" -or -iname "*.cfg" -or -iname "*.cmake" -or -iname "*.col" -or -iname "*.conf" -or -iname "*.cpp" -or -iname "*.css" -or -iname "*.csv" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.cur" -or -iname "*.dat" -or -iname "*.db" -or -iname "*.dds" -or -iname "*.def" -or -iname "*.dff" -or -iname "*.dll" -or -iname "*.doc" -or -iname "*.dsp" -or -iname "*.dxf" -or -iname "*.dylib" -or -iname "*.edf" -or -iname "*.ekv" -or -iname "*.example" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.cur" -or -iname "*.dat" -or -iname "*.db" -or -iname "*.dds" -or -iname "*.def" -or -iname "*.dff" -or -iname "*.dll" -or -iname "*.doc" -or -iname "*.dsp" -or -iname "*.dxf" -or -iname "*.dylib" -or -iname "*.edf" -or -iname "*.ekv" -or -iname "*.example" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.exe" -or -iname "*.exp" -or -iname "*.fgd" -or -iname "*.flt" -or -iname "*.fx" -or -iname "*.gam" -or -iname "*.Gbx" -or -iname "*.gif" -or -iname "*.h" -or -iname "*.hpp" -or -iname "*.htm" -or -iname "*.html" -or -iname "*.icns" -or -iname "*.ico" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.exe" -or -iname "*.exp" -or -iname "*.fgd" -or -iname "*.flt" -or -iname "*.fx" -or -iname "*.gam" -or -iname "*.Gbx" -or -iname "*.gif" -or -iname "*.h" -or -iname "*.hpp" -or -iname "*.htm" -or -iname "*.html" -or -iname "*.icns" -or -iname "*.ico" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.image" -or -iname "*.inc" -or -iname "*.inf" -or -iname "*.ini" -or -iname "*.installed" -or -iname "*.jpg" -or -iname "*.js" -or -iname "*.key" -or -iname "*.kv" -or -iname "*.lib" -or -iname "*.lmp" -or -iname "*.lst" -or -iname "*.lua" -or -iname "*.LUA" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.image" -or -iname "*.inc" -or -iname "*.inf" -or -iname "*.ini" -or -iname "*.installed" -or -iname "*.jpg" -or -iname "*.js" -or -iname "*.key" -or -iname "*.kv" -or -iname "*.lib" -or -iname "*.lmp" -or -iname "*.lst" -or -iname "*.lua" -or -iname "*.LUA" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.manifest" -or -iname "*.map" -or -iname "*.mapRACE" -or -iname "*.mdl" -or -iname "*.mix" -or -iname "*.mp3" -or -iname "*.nav" -or -iname "*.nod" -or -iname "*.nut" -or -iname "*.pak" -or -iname "*.pcx" -or -iname "*.pem" -or -iname "*.pl" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.manifest" -or -iname "*.map" -or -iname "*.mapRACE" -or -iname "*.mdl" -or -iname "*.mix" -or -iname "*.mp3" -or -iname "*.nav" -or -iname "*.nod" -or -iname "*.nut" -or -iname "*.pak" -or -iname "*.pcx" -or -iname "*.pem" -or -iname "*.pl" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.png" -or -iname "*.properties" -or -iname "*.psd" -or -iname "*.pwn" -or -iname "*.rad" -or -iname "*.raw" -or -iname "*.rc" -or -iname "*.rec" -or -iname "*.res" -or -iname "*.rules" -or -iname "*.sc" -or -iname "*.scr" -or -iname "*.sfk" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.png" -or -iname "*.properties" -or -iname "*.psd" -or -iname "*.pwn" -or -iname "*.rad" -or -iname "*.raw" -or -iname "*.rc" -or -iname "*.rec" -or -iname "*.res" -or -iname "*.rules" -or -iname "*.sc" -or -iname "*.scr" -or -iname "*.sfk" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.sln" -or -iname "*.so" -or -iname "*.spr" -or -iname "*.suo" -or -iname "*.swf" -or -iname "*.tar" -or -iname "*.tga" -or -iname "*.ttf" -or -iname "*.txd" -or -iname "*.txt" -or -iname "*.vbf" -or -iname "*.vcproj" -or -iname "*.vcs" -or -iname "*.vdf" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.sln" -or -iname "*.so" -or -iname "*.spr" -or -iname "*.suo" -or -iname "*.swf" -or -iname "*.tar" -or -iname "*.tga" -or -iname "*.ttf" -or -iname "*.txd" -or -iname "*.txt" -or -iname "*.vbf" -or -iname "*.vcproj" -or -iname "*.vcs" -or -iname "*.vdf" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.vfe" -or -iname "*.vfont" -or -iname "*.vmf" -or -iname "*.vmt" -or -iname "*.vpk" -or -iname "*.vtf" -or -iname "*.wad" -or -iname "*.wav" -or -iname "*.wv" -or -iname "*.xml" -or -iname "*.xsc" -or -iname "*.yml" -or -iname "*.zip" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.vfe" -or -iname "*.vfont" -or -iname "*.vmf" -or -iname "*.vmt" -or -iname "*.vpk" -or -iname "*.vtf" -or -iname "*.wad" -or -iname "*.wav" -or -iname "*.wv" -or -iname "*.xml" -or -iname "*.xsc" -or -iname "*.yml" -or -iname "*.zip" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f -name "srcds_*" -o -name "hlds_*" -o -name "*.run" -o -name "*.sh" -o -name "*.jar" -exec chmod 750 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f -name "srcds_*" -o -name "hlds_*" -o -name "*.run" -o -name "*.sh" -o -name "*.jar" -exec chmod 750 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f ! -perm -750 ! -perm -755 -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f ! -perm -750 ! -perm -755 -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type d -exec chmod 750 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type d -exec chmod 750 {} \;' . "\n";
// Check for temp files belonging to the steam updater // Check for temp files belonging to the steam updater
$this->shellScript .= 'ls ' . $absoluteGamePath . ' | while read dir; do' . "\n"; $this->shellScript .= 'ls ' . $absoluteGamePath . ' | while read dir; do' . "\n";
@ -338,7 +338,7 @@ class masterServer {
$this->shellScript .= 'SEARCH=1' . "\n"; $this->shellScript .= 'SEARCH=1' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";
$this->shellScript .= 'if [ "$SEARCH" == "1" ]; then' . "\n"; $this->shellScript .= 'if [ "$SEARCH" == "1" ]; then' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find $SEARCHFOLDERS -type f 2> /dev/null | grep -v "$PATTERN" | sed \'s/\.\///g\' | while read FILTEREDFILES; do' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find $SEARCHFOLDERS -type f 2> /dev/null | grep -v "$PATTERN" | sed \'s/\.\///g\' | while read FILTEREDFILES; do' . "\n";
$this->shellScript .= 'echo $FILTEREDFILES >> ' . $fastDownloadList . "\n"; $this->shellScript .= 'echo $FILTEREDFILES >> ' . $fastDownloadList . "\n";
$this->shellScript .= 'done' . "\n"; $this->shellScript .= 'done' . "\n";
$this->shellScript .= 'if [ -f ' . $fastDownloadList . ' ]; then chmod 640 ' . $fastDownloadList . '; fi' . "\n"; $this->shellScript .= 'if [ -f ' . $fastDownloadList . ' ]; then chmod 640 ' . $fastDownloadList . '; fi' . "\n";
@ -411,7 +411,7 @@ class masterServer {
$this->shellScript .= 'cd /home/' . $this->sshuser . '/masterserver/steamCMD/'. "\n"; $this->shellScript .= 'cd /home/' . $this->sshuser . '/masterserver/steamCMD/'. "\n";
$this->shellScript .= 'taskset -c 0 ${IONICE}nice -n +19 ./steamcmd.sh +force_install_dir ' . $absoluteGamePath . ' +login '; $this->shellScript .= 'taskset -c 0 {$IONICE}nice -n +19 ./steamcmd.sh +force_install_dir ' . $absoluteGamePath . ' +login ';
if (strlen($this->steamAccount) > 0) { if (strlen($this->steamAccount) > 0) {
$this->shellScript .= $this->steamAccount . ' ' . $this->steamPassword; $this->shellScript .= $this->steamAccount . ' ' . $this->steamPassword;
@ -642,7 +642,7 @@ class masterServer {
// While we keep on counting up, the mail is send only once to prevent spam // While we keep on counting up, the mail is send only once to prevent spam
if (($this->rootNotifiedCount + 1) == $rSA['down_checks']) { if (($this->rootNotifiedCount + 1) == $rSA['down_checks']) {
$query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`=${$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'"); $query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`={$$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'");
$query->execute(); $query->execute();
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row['mail_serverdown'] == 'Y') { if ($row['mail_serverdown'] == 'Y') {
@ -771,14 +771,14 @@ class masterServer {
// When the logfile is missing the update is still running // When the logfile is missing the update is still running
$this->shellScript .= 'if [ ! -f ' . $updateLog . ' ]; then' . "\n"; $this->shellScript .= 'if [ ! -f ' . $updateLog . ' ]; then' . "\n";
$this->shellScript .= 'UPDATESTATUS="${UPDATESTATUS};' . $shorten . '=1"' . "\n"; $this->shellScript .= 'UPDATESTATUS="{$UPDATESTATUS};' . $shorten . '=1"' . "\n";
$this->shellScript .= 'else' . "\n"; $this->shellScript .= 'else' . "\n";
// If it exists and the update is not running, the update is finished // If it exists and the update is not running, the update is finished
$this->shellScript .= 'if [ "`ps fx | grep \'masterserver/' . $shorten . '\' | grep -v grep | head -n 1`" ]; then' . "\n"; $this->shellScript .= 'if [ "`ps fx | grep \'masterserver/' . $shorten . '\' | grep -v grep | head -n 1`" ]; then' . "\n";
$this->shellScript .= 'UPDATESTATUS="${UPDATESTATUS};' . $shorten . '=1"' . "\n"; $this->shellScript .= 'UPDATESTATUS="{$UPDATESTATUS};' . $shorten . '=1"' . "\n";
$this->shellScript .= 'else' . "\n"; $this->shellScript .= 'else' . "\n";
$this->shellScript .= 'UPDATESTATUS="${UPDATESTATUS};' . $shorten . '=0"' . "\n"; $this->shellScript .= 'UPDATESTATUS="{$UPDATESTATUS};' . $shorten . '=0"' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";

View File

@ -85,7 +85,7 @@ class TS3 {
$metaData = stream_get_meta_data($this->socket); $metaData = stream_get_meta_data($this->socket);
} }
if ($this->debug == true) { if ($this->debug == true) {
print "Raw query return: ${response}\r\n"; print "Raw query return: {$response}\r\n";
} }
@list($databody, $errorcode) = explode('error id=', str_replace(array("\r", "\n"), '', $response)); @list($databody, $errorcode) = explode('error id=', str_replace(array("\r", "\n"), '', $response));

View File

@ -85,7 +85,7 @@ if (isset($newsInclude) and $newsInclude == true) {
$theCount = 0; $theCount = 0;
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Getting Feed Updates for Steamgame with AppID ${lookUpAppID}\r\n"; print "Getting Feed Updates for Steamgame with AppID {$lookUpAppID}\r\n";
} }
foreach ($json->appnews->newsitems as $item) { foreach ($json->appnews->newsitems as $item) {
@ -108,7 +108,7 @@ if (isset($newsInclude) and $newsInclude == true) {
} else { } else {
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Failed getting Feed Updates for Steamgame with AppID ${lookUpAppID}\r\n"; print "Failed getting Feed Updates for Steamgame with AppID {$lookUpAppID}\r\n";
} }
} }
} }
@ -203,7 +203,7 @@ if (isset($newsInclude) and $newsInclude == true) {
if ($twitter == 'Y') { if ($twitter == 'Y') {
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Getting Updates for Twitter Feed ${row2['loginName']}\r\n"; print "Getting Updates for Twitter Feed {$row2['loginName']}\r\n";
} }
/** /**
* Twitter API 1.1 * Twitter API 1.1
@ -248,7 +248,7 @@ if (isset($newsInclude) and $newsInclude == true) {
} else { } else {
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Getting Feed Updates for Feed ${row2['feedUrl']}\r\n"; print "Getting Feed Updates for Feed {$row2['feedUrl']}\r\n";
} }
$port = 80; $port = 80;

View File

@ -1024,7 +1024,7 @@ if (!function_exists('passwordgenerate')) {
global $sql; global $sql;
$typeQuery = ($type != null) ? " AND `type`='${type}'" : ''; $typeQuery = ($type != null) ? " AND `type`='{$type}'" : '';
$query = $sql->prepare("SELECT `type`,`affectedID` FROM `jobs` WHERE (`status` IS NULL OR `status`=1) AND `action`=? $typeQuery GROUP BY `type`,`affectedID`"); $query = $sql->prepare("SELECT `type`,`affectedID` FROM `jobs` WHERE (`status` IS NULL OR `status`=1) AND `action`=? $typeQuery GROUP BY `type`,`affectedID`");
$query->execute(array($action)); $query->execute(array($action));
@ -1108,18 +1108,18 @@ if (!function_exists('passwordgenerate')) {
$i++; $i++;
} }
$send = "POST /${file} HTTP/1.1\r\n"; $send = "POST /{$file} HTTP/1.1\r\n";
} else { } else {
if (strlen($file) == 0) { if (strlen($file) == 0) {
$file = '/'; $file = '/';
} }
$send = "GET ${file} HTTP/1.1\r\n"; $send = "GET {$file} HTTP/1.1\r\n";
} }
$send .= "Host: ${domain}\r\n"; $send .= "Host: {$domain}\r\n";
$send .= "User-Agent: ${useragent}\r\n"; $send .= "User-Agent: {$useragent}\r\n";
$send .= "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n"; $send .= "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n";
if (isset($postData) and is_array($postParams) and count($postParams) > 0) { if (isset($postData) and is_array($postParams) and count($postParams) > 0) {
@ -1427,7 +1427,7 @@ if (!function_exists('passwordgenerate')) {
$query3->execute(array($row['customID'], $id)); $query3->execute(array($row['customID'], $id));
$value = ($id == 0) ? '' : $query3->fetchColumn(); $value = ($id == 0) ? '' : $query3->fetchColumn();
$return[] = array('customID' => $row['customID'], 'menu' => $text, 'name' => $row['name'], 'length' => $row['length'], 'type' => $row['type'], 'input' => "<input id='inputCustom-${row['customID']}' type='${type}' name='${row['name']}' maxlength='${row['length']}' value='${value}' >", 'value' => $value); $return[] = array('customID' => $row['customID'], 'menu' => $text, 'name' => $row['name'], 'length' => $row['length'], 'type' => $row['type'], 'input' => "<input id='inputCustom-{$row['customID']}' type='{$type}' name='{$row['name']}' maxlength='{$row['length']}' value='{$value}' >", 'value' => $value);
} }
} else if ($action == 'save') { } else if ($action == 'save') {
@ -1684,7 +1684,7 @@ $(function() {
* @return string * @return string
*/ */
function getLoginHeader($valueOfTitle){ function getLoginHeader($valueOfTitle){
return preg_replace('/(.+)[\s](.+)/i', '<b>${1}</b> $2', $valueOfTitle, -1, $count); return preg_replace('/(.+)[\s](.+)/i', '<b>{$1}</b> $2', $valueOfTitle, -1, $count);
} }
function parseHeaders($data) function parseHeaders($data)

View File

@ -110,7 +110,7 @@ if (!function_exists('eacchange')) {
$mysql_port = (port($mysql_port)) ? $mysql_port : 3306; $mysql_port = (port($mysql_port)) ? $mysql_port : 3306;
$eacSql = new PDO("mysql:host=${mysql_server};dbname=${mysql_db};port=${mysql_port}", $mysql_user, $mysql_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); $eacSql = new PDO("mysql:host={$mysql_server};dbname={$mysql_db};port={$mysql_port}", $mysql_user, $mysql_password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
if ($dbConnect['debug'] == 1) { if ($dbConnect['debug'] == 1) {
$eacSql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $eacSql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@ -269,7 +269,7 @@ if (!function_exists('eacchange')) {
$protocols = array(); $protocols = array();
// Protocol list code taken from https://github.com/Austinb/GameQ/blob/v2/examples/list.php // Protocol list code taken from https://github.com/Austinb/GameQ/blob/v2/examples/list.php
$protocols_path = GAMEQ_BASE . 'gameq/protocols/'; $protocols_path = 'third_party/gameq/GameQ/Protocols';
// Grab the dir with all the classes available // Grab the dir with all the classes available
$dir = dir($protocols_path); $dir = dir($protocols_path);

View File

@ -118,7 +118,7 @@ if (!function_exists('ssh2_execute')) {
} }
if ($notified == $rSA['down_checks']) { if ($notified == $rSA['down_checks']) {
$query = ($resellerID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`=${resellerID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'"); $query = ($resellerID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`={$resellerID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'");
$query->execute(); $query->execute();
while ($row2 = $query->fetch(PDO::FETCH_ASSOC)) { while ($row2 = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row2['mail_serverdown'] == 'Y') { if ($row2['mail_serverdown'] == 'Y') {

View File

@ -76,7 +76,7 @@ if (isset($debug) and $debug == 1) {
$dbConnect['debug'] = 0; $dbConnect['debug'] = 0;
} }
try { try {
$dbConnect['connect']="${dbConnect['type']}:host=${dbConnect['host']};dbname=${dbConnect['db']};charset=${dbConnect['charset']}"; $dbConnect['connect']="{$dbConnect['type']}:host={$dbConnect['host']};dbname={$dbConnect['db']};charset={$dbConnect['charset']}";
$sql = new \PDO($dbConnect['connect'], $dbConnect['user'], $dbConnect['pwd']); $sql = new \PDO($dbConnect['connect'], $dbConnect['user'], $dbConnect['pwd']);
if ($dbConnect['debug'] == 1) { if ($dbConnect['debug'] == 1) {

View File

@ -480,21 +480,21 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$oldServerTemplate = $row['servertemplate']; $oldServerTemplate = $row['servertemplate'];
$fps = ($row['userfps'] == 'Y' and $ui->id("fps_${switchID}", 4, 'post')) ? $ui->id("fps_${switchID}", 4, 'post') : $row['fps']; $fps = ($row['userfps'] == 'Y' and $ui->id("fps_{$switchID}", 4, 'post')) ? $ui->id("fps_{$switchID}", 4, 'post') : $row['fps'];
$tic = ($row['usertick'] == 'Y' and $ui->id("tic_${switchID}", 4, 'post')) ? $ui->id("tic_${switchID}", 4, 'post') : $row['tic']; $tic = ($row['usertick'] == 'Y' and $ui->id("tic_{$switchID}", 4, 'post')) ? $ui->id("tic_{$switchID}", 4, 'post') : $row['tic'];
$map = ($row['usermap'] == 'Y' and $ui->mapname("map_${switchID}", 'post')) ? $ui->mapname("map_${switchID}", 'post') : $row['map']; $map = ($row['usermap'] == 'Y' and $ui->mapname("map_{$switchID}", 'post')) ? $ui->mapname("map_{$switchID}", 'post') : $row['map'];
$mapGroup = ($row['usermap'] == 'Y' and $ui->mapname("mapGroup_${switchID}", 'post')) ? $ui->mapname("mapGroup_${switchID}", 'post') : $row['mapGroup']; $mapGroup = ($row['usermap'] == 'Y' and $ui->mapname("mapGroup_{$switchID}", 'post')) ? $ui->mapname("mapGroup_{$switchID}", 'post') : $row['mapGroup'];
$uploaddir = ($row['user_uploaddir'] == 'Y' and $row['upload'] > 1 and $row['upload'] < 4) ? $ui->url("uploaddir_${switchID}", 'post') : $row['decypteduploaddir']; $uploaddir = ($row['user_uploaddir'] == 'Y' and $row['upload'] > 1 and $row['upload'] < 4) ? $ui->url("uploaddir_{$switchID}", 'post') : $row['decypteduploaddir'];
$serverTemplate = ($ui->id("servertemplate_${switchID}", 1, 'post')) ? $ui->id("servertemplate_${switchID}", 1, 'post') : 1; $serverTemplate = ($ui->id("servertemplate_{$switchID}", 1, 'post')) ? $ui->id("servertemplate_{$switchID}", 1, 'post') : 1;
$modcmd = $ui->escaped("mod_${switchID}", 'post'); $modcmd = $ui->escaped("mod_{$switchID}", 'post');
$workShop = ($ui->active("workShop_${switchID}", 'post')) ? $ui->active("workShop_${switchID}", 'post') : 'Y'; $workShop = ($ui->active("workShop_{$switchID}", 'post')) ? $ui->active("workShop_{$switchID}", 'post') : 'Y';
$workshopCollection = $ui->id("workshopCollection_${switchID}", 10, 'post') ? $ui->id("workshopCollection_${switchID}", 10, 'post') : null; $workshopCollection = $ui->id("workshopCollection_{$switchID}", 10, 'post') ? $ui->id("workshopCollection_{$switchID}", 10, 'post') : null;
$webapiAuthkey = $ui->w("webapiAuthkey_${switchID}", 32, 'post'); $webapiAuthkey = $ui->w("webapiAuthkey_{$switchID}", 32, 'post');
$steamServerToken = $ui->w("steamServerToken_${switchID}", 32, 'post'); $steamServerToken = $ui->w("steamServerToken_{$switchID}", 32, 'post');
if ($ui->id("anticheat_${switchID}", 1, 'post')) { if ($ui->id("anticheat_{$switchID}", 1, 'post')) {
$anticheat=($ui->id("anticheat_${switchID}", 1, 'post')>0) ? $ui->id("anticheat_${switchID}", 1, 'post') : 1; $anticheat=($ui->id("anticheat_{$switchID}", 1, 'post')>0) ? $ui->id("anticheat_{$switchID}", 1, 'post') : 1;
if ($row['shorten'] == 'cstrike' or $row['shorten'] == 'czero') { if ($row['shorten'] == 'cstrike' or $row['shorten'] == 'czero') {

View File

@ -365,7 +365,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
foreach ($selected as $get) { foreach ($selected as $get) {
$temp .= ($i == 0) ? "`state`='${get}'" : " OR `state`='${get}'"; $temp .= ($i == 0) ? "`state`='{$get}'" : " OR `state`='{$get}'";
$selected[] = $get; $selected[] = $get;

Some files were not shown because too many files have changed in this diff Show More