diff --git a/web/admin.php b/web/admin.php
index ef682a94..ea24c8f0 100644
--- a/web/admin.php
+++ b/web/admin.php
@@ -1,4 +1,5 @@
smallletters('w', 255, 'get') and isset($what_to_be_included_array[$ui->smallletters('w', 255, 'get')]) and is_file((EASYWIDIR . '/stuff/' . $what_to_be_included_array[$ui->smallletters('w', 255, 'get')]))) {
+ include(EASYWIDIR . '/stuff/' . $what_to_be_included_array[$ui->smallletters('w', 255, 'get')]);
unset($dbConnect);
} else {
unset($dbConnect);
diff --git a/web/ajax.php b/web/ajax.php
index 09585ee4..55c51b7a 100644
--- a/web/ajax.php
+++ b/web/ajax.php
@@ -37,13 +37,13 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-define('EASYWIDIR',dirname(__FILE__));
+define('EASYWIDIR', dirname(__FILE__));
if (is_dir(EASYWIDIR.'/install')) die('Please remove the "install" folder');
-include(EASYWIDIR.'/stuff/functions.php');
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR.'/stuff/config.php');
-include(EASYWIDIR.'/stuff/settings.php');
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/config.php');
+include(EASYWIDIR . '/stuff/settings.php');
if (isset($admin_id)) {
$permissionid=(isset($_SESSION['oldid'])) ? (isset($_SESSION['oldadminid'])) ? $_SESSION['oldadminid'] : $_SESSION['oldid'] : $admin_id;
$userpermissionquery=$sql->prepare("SELECT * FROM `userpermissions` WHERE `userid`=? LIMIT 1");
diff --git a/web/api.php b/web/api.php
index e383040e..4b551df9 100644
--- a/web/api.php
+++ b/web/api.php
@@ -38,13 +38,13 @@
*/
-define('EASYWIDIR',dirname(__FILE__));
+define('EASYWIDIR', dirname(__FILE__));
if (is_dir(EASYWIDIR.'/install')) die('Please remove the "install" folder');
$logininclude=true;
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/functions.php');
-include(EASYWIDIR.'/stuff/settings.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/settings.php');
if ($ui->ip4('REMOTE_ADDR','server') and $ui->names('user',255,'post')) {
$query=$sql->prepare("SELECT `ip`,`active`,`pwd`,`salt`,`user`,i.`resellerID` FROM `api_ips` i LEFT JOIN `api_settings` s ON i.`resellerID`=s.`resellerID` WHERE `ip`=?");
$query->execute(array($ui->ip4('REMOTE_ADDR','server')));
@@ -111,19 +111,19 @@ if (isset($resellerIDs) and count($resellerIDs)==1 and passwordhash($ui->passwor
$voModule=(is_numeric($licenceDetails['mVo']) and $licenceDetails['mVo']==0) ? false : true;
$dModule=(is_numeric($licenceDetails['mD']) and $licenceDetails['mD']==0) ? false : true;
if ($type=='user') {
- include(EASYWIDIR.'/stuff/api_users.php');
+ include(EASYWIDIR . '/stuff/api_users.php');
} else if ($type=='voice') {
if ($voModule==true) {
- include(EASYWIDIR.'/stuff/api_voice.php');
+ include(EASYWIDIR . '/stuff/api_voice.php');
} else {
header('HTTP/1.1 403 Forbidden');
die('403 Forbidden: Voice module is inactive');
}
} else if ($type=='mysql') {
- include(EASYWIDIR.'/stuff/api_mysql.php');
+ include(EASYWIDIR . '/stuff/api_mysql.php');
} else if ($type=='gserver') {
if ($gsModule==true) {
- include(EASYWIDIR.'/stuff/api_gserver.php');
+ include(EASYWIDIR . '/stuff/api_gserver.php');
} else {
header('HTTP/1.1 403 Forbidden');
die('403 Forbidden: Gameserver module is inactive');
diff --git a/web/cloud.php b/web/cloud.php
index 2dfc4aab..bc859c7c 100644
--- a/web/cloud.php
+++ b/web/cloud.php
@@ -49,7 +49,7 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
}
set_time_limit($timelimit);
if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
- define('EASYWIDIR',dirname(__FILE__));
+ define('EASYWIDIR', dirname(__FILE__));
function printText ($text) {
echo $text."\r\n";
}
@@ -61,10 +61,10 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
return '';
}
printText('Cloud jobs started');
- include('stuff/vorlage.php');
- include('stuff/functions.php');
- include('stuff/class_validator.php');
- include('stuff/settings.php');
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/settings.php');
printText('File include and parameters fetched. Start connecting to external systems.');
$query=$sql->prepare("SELECT * FROM `api_import` WHERE `active`='Y'");
$query2=$sql->prepare("UPDATE `userdata` SET `salutation`=?,`mail`=?,`cname`=?,`name`=?,`vname`=?,`birthday`=?,`country`=?,`phone`=?,`fax`=?,`handy`=?,`city`=?,`cityn`=?,`street`=?,`streetn`=? WHERE `sourceSystemID`=? AND `externalID`=? AND `resellerid`=? LIMIT 1");
diff --git a/web/get_password.php b/web/get_password.php
index c9409ee6..1bbd9890 100644
--- a/web/get_password.php
+++ b/web/get_password.php
@@ -38,14 +38,13 @@
*/
-define('EASYWIDIR',dirname(__FILE__));
-include(EASYWIDIR."/stuff/vorlage.php");
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR."/stuff/config.php");
-include(EASYWIDIR."/stuff/functions.php");
-include(EASYWIDIR."/stuff/settings.php");
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+define('EASYWIDIR', dirname(__FILE__));
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/config.php');
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/settings.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$ip=$_SERVER['REMOTE_ADDR'];
if ($ui->st('w','get')=='ms' and $ui->username('shorten','50','get')) {
$query=$sql->prepare("SELECT r.`id`,r.`resellerid`,r.`installing`,r.`updating`,d.`resellerid` AS `userid`,s.`steamVersion`,r.`localVersion` FROM `rservermasterg` r INNER JOIN `rserverdata` d ON r.`serverid`=d.`id` INNER JOIN `servertypes` s ON r.`servertypeid`=s.`id` WHERE s.`shorten`=? AND (d.`ip`=? OR d.`altips` LIKE ?) LIMIT 1");
diff --git a/web/images.php b/web/images.php
index f6051f63..37286c92 100644
--- a/web/images.php
+++ b/web/images.php
@@ -38,11 +38,11 @@
*/
-define('EASYWIDIR',dirname(__FILE__));
-include(EASYWIDIR."/stuff/functions.php");
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR."/stuff/settings.php");
+define('EASYWIDIR', dirname(__FILE__));
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/settings.php');
if (isset($admin_id) and $ui->st('img','get')) {
$pa=User_Permissions($admin_id);
if ($ui->st('img','get')=='tr' and ($pa['traffic'] or $pa['root'])) {
diff --git a/web/index.php b/web/index.php
index 8323c5fe..a07e5055 100644
--- a/web/index.php
+++ b/web/index.php
@@ -39,19 +39,19 @@
$main=1;
$page_include=1;
-define('EASYWIDIR',dirname(__FILE__));
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/functions.php');
-include(EASYWIDIR.'/stuff/settings.php');
+define('EASYWIDIR', dirname(__FILE__));
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/settings.php');
if (isset ($page_active) and $page_active=='Y') {
- include(EASYWIDIR.'/stuff/init_page.php');
+ include(EASYWIDIR . '/stuff/init_page.php');
if (isset($throw404)) {
$template_file='page_404.tpl';
} else if (isset($what_to_be_included_array[$s]) and is_file(EASYWIDIR.'/stuff/'.$what_to_be_included_array[$s])) {
- include(EASYWIDIR.'/stuff/'.$what_to_be_included_array[$s]);
+ include(EASYWIDIR . '/stuff/'.$what_to_be_included_array[$s]);
} else if (isset($what_to_be_included_array[$s]) and is_file(EASYWIDIR.'/'.$what_to_be_included_array[$s])) {
- include(EASYWIDIR.'/'.$what_to_be_included_array[$s]);
+ include(EASYWIDIR . '/'.$what_to_be_included_array[$s]);
} else if (isset($s) and !isset($what_to_be_included_array[$s])) {
$template_file='page_404.tpl';
} else {
diff --git a/web/install/install.php b/web/install/install.php
index e7f7f4c3..4b02b302 100644
--- a/web/install/install.php
+++ b/web/install/install.php
@@ -39,6 +39,7 @@
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
+define('EASYWIDIR', dirname(dirname(__FILE__)));
?>
@@ -229,35 +230,6 @@ function passwordhash($username,$password){
$hash = hash('sha512', sha1($usernamea[0].md5($passworda[0].$usernamea[1]).$passworda[1]));
return $hash;
}
-function getconfigcvars($file) {
- $fp= @fopen($file,'r');
- if ($fp == true) {
- $configfile="";
- while (!feof($fp)){
- $line=fgets($fp);
- if(strpos(strtolower($line), strtolower("")) === false) {
- $configfile .="$line\r\n";
- }
- }
- fclose($fp);
- $lines=explode("\r\n", $configfile);
- foreach ($lines as $line) {
- if(strpos(strtolower($line), strtolower("//")) === false and strpos(strtolower($line), strtolower("=")) == true) {
- $data=explode("=", $line);
- $cvar=preg_replace('/\s+/', '', $data[0]);
- $cvar=str_replace('$', "", $cvar);
- $data2=explode(";", $data[1]);
- $stringlenght=strlen($data2[0]);
- $stop=$stringlenght-2;
- $value=substr($data2[0],"1",$stop);
- $vars[$cvar]=$value;
- }
- }
- return $vars;
- } else {
- die("No configdata!");
- }
-}
$lang_detect=strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],"0","2"));
if (file_exists("$lang_detect.xml")) {
$sprache=simplexml_load_file("$lang_detect.xml");
@@ -354,13 +326,7 @@ $aeskey="'.$_POST['aeskey'].'";
?>';
@fwrite($config, $configdata) or die("Can not write the configdata");
fclose($config);
- $panelcfgcvars=getconfigcvars('../stuff/config.php');
- if (!isset($panelcfgcvars['databanktype']) or !isset($panelcfgcvars['host']) or !isset($panelcfgcvars['db']) or !isset($panelcfgcvars['user']) or !isset($panelcfgcvars['pwd'])) die ("Can not read the configdata");
- $databanktype=$panelcfgcvars['databanktype'];
- $host=$panelcfgcvars['host'];
- $db=$panelcfgcvars['db'];
- $user=$panelcfgcvars['user'];
- $pwd=$panelcfgcvars['pwd'];
+ include(EASYWIDIR . '/stuff/config.php');
try {
$sql=new PDO("$databanktype:host=$host;dbname=$db",$user,$pwd,array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SET NAMES utf8"));
}
@@ -526,13 +492,7 @@ $aeskey="'.$_POST['aeskey'].'";
$emessage .="Adminname";
}
if ($fail!="1") {
- #include("../stuff/config.php");
- $panelcfgcvars=getconfigcvars('../stuff/config.php');
- $databanktype=$panelcfgcvars['databanktype'];
- $host=$panelcfgcvars['host'];
- $db=$panelcfgcvars['db'];
- $user=$panelcfgcvars['user'];
- $pwd=$panelcfgcvars['pwd'];
+ include(EASYWIDIR . '/stuff/config.php');
try {
$sql=new PDO("$databanktype:host=$host;dbname=$db", $user, $pwd,array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SET NAMES utf8"));
$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@@ -571,8 +531,7 @@ $aeskey="'.$_POST['aeskey'].'";
$imageserver="0";
$language=small_letters_check($_POST['language'],'2');
$faillogins=isid($_POST['faillogins'],'2');
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$insert_usergroups=$sql->prepare("INSERT INTO `usergroups` (`defaultgroup`,`name`,`grouptype`,`root`,`miniroot`) VALUES
('Y','Admin Default','a','Y','N'),
('Y','Reseller Default','r','Y','N'),
diff --git a/web/install/update.php b/web/install/update.php
index 9746435a..5982fb74 100644
--- a/web/install/update.php
+++ b/web/install/update.php
@@ -42,36 +42,7 @@
if (!isset($updateinclude) or $updateinclude==false) {
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
- define('EASYWIDIR',$_SERVER['DOCUMENT_ROOT'].'/');
- function getconfigcvars($file) {
- $fp= @fopen($file, 'rb');
- if ($fp == true) {
- $configfile="";
- while (!feof($fp)){
- $line=fgets($fp);
- if(strpos(strtolower($line), strtolower("")) === false) {
- $configfile .="$line\r\n";
- }
- }
- fclose($fp);
- $lines=explode("\r\n", $configfile);
- foreach ($lines as $line) {
- if(strpos(strtolower($line), strtolower("//")) === false and strpos(strtolower($line), strtolower("=")) == true) {
- $data=explode("=", $line);
- $cvar=preg_replace('/\s+/', '', $data[0]);
- $cvar=str_replace('$', "", $cvar);
- $data2=explode(";", $data[1]);
- $stringlenght=strlen($data2[0]);
- $stop=$stringlenght-2;
- $value=substr($data2[0],"1",$stop);
- $vars[$cvar]=$value;
- }
- }
- return $vars;
- } else {
- die("No configdata!");
- }
- }
+ define('EASYWIDIR', dirname(dirname(__FILE__)));
function isinteger($value) {
if(preg_match("/^[\d+(.\d+|$)]+$/", $value) or $value=="0") {
return true;
@@ -92,14 +63,7 @@ if (!isset($updateinclude) or $updateinclude==false) {
unset($this->response);
}
}
- $panelcfgcvars=getconfigcvars("../stuff/config.php");
- $databanktype=$panelcfgcvars['databanktype'];
- $host=$panelcfgcvars['host'];
- $db=$panelcfgcvars['db'];
- $user=$panelcfgcvars['user'];
- $pwd=$panelcfgcvars['pwd'];
- $captcha=$panelcfgcvars['captcha'];
- $title=$panelcfgcvars['title'];
+ include(EASYWIDIR . '/stuff/config.php');
try {
$sql=new PDO("$databanktype:host=$host;dbname=$db",$user,$pwd,array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SET NAMES utf8"));
}
@@ -109,7 +73,7 @@ if (!isset($updateinclude) or $updateinclude==false) {
}
$response=new UpdateResponse();
} else if (!defined('EASYWIDIR')) {
- define('EASYWIDIR',$_SERVER['DOCUMENT_ROOT'].'/');
+ define('EASYWIDIR', dirname(dirname(__FILE__)));
}
function versioncheck ($current,$new,$file,$response,$sql) {
$include=true;
@@ -117,10 +81,10 @@ function versioncheck ($current,$new,$file,$response,$sql) {
$response->add("Upgrading Databe from $current to $new ");
if (is_file(EASYWIDIR.'/'.$file)) {
$response->add("Found updaterfile ".$file.". Executing it now ");
- include(EASYWIDIR.'/'.$file);
+ include(EASYWIDIR . '/'.$file);
} else if (is_file(EASYWIDIR.'/install/'.$file)) {
$response->add("Found updaterfile ".'install/'.$file.". Executing it now ");
- include(EASYWIDIR.'/install/'.$file);
+ include(EASYWIDIR . '/install/'.$file);
} else {
die("File $file is missing ");
}
@@ -151,6 +115,7 @@ if (isset($error[2]) and $error[2]!="" and $error[2]!=null and !isinteger($error
} else {
$response->add("Current database version: $version ");
}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
if (versioncheck ($version,'2.00','update_1x-20.php',$response,$sql)) $version='2.00';
if (versioncheck ($version,'2.01','update_200-201.php',$response,$sql)) $version='2.01';
if (versioncheck ($version,'2.02','update_201-202.php',$response,$sql)) $version='2.02';
@@ -162,8 +127,7 @@ if (versioncheck ($version,'2.07','update_206-207.php',$response,$sql)) $version
if (versioncheck ($version,'2.08','update_207-208.php',$response,$sql)) $version='2.08';
if (versioncheck ($version,'2.09','update_208-209.php',$response,$sql)) $version='2.09';
if (versioncheck ($version,'2.10','update_209-210.php',$response,$sql)) $version='2.10';
-if (!isset($updateinclude) or $updateinclude==false) include('../stuff/tables_add.php');
-else include(EASYWIDIR.'/stuff/tables_add.php');
+include(EASYWIDIR . '/stuff/tables_add.php');
if (versioncheck ($version,'2.11','update_210-211.php',$response,$sql)) $version='2.11';
if (versioncheck ($version,'3.00','update_211-300.php',$response,$sql)) $version='3.00';
if (versioncheck ($version,'3.01','update_300-301.php',$response,$sql)) $version='3.01';
@@ -183,8 +147,8 @@ if (versioncheck ($version,'3.60','update_340-360.php',$response,$sql)) $version
if (versioncheck ($version,'3.70','update_360-370.php',$response,$sql)) $version='3.70';
if (versioncheck ($version,'4.00','update_370-400.php',$response,$sql)) $version='4.00';
$response->add('Repairing tables if needed.');
-if (!isset($updateinclude) or $updateinclude==false) include('../stuff/tables_repair.php');
-else include(EASYWIDIR.'/stuff/tables_repair.php');
+
+include(EASYWIDIR . '/stuff/tables_repair.php');
# Ende
if (!isset($updateinclude) or $updateinclude==false) {
diff --git a/web/install/update_302-303.php b/web/install/update_302-303.php
index 9ffc49eb..f25fd777 100644
--- a/web/install/update_302-303.php
+++ b/web/install/update_302-303.php
@@ -37,16 +37,6 @@
*/
if (isset($include) and $include==true) {
-if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-}
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.03','06.08.2012
Neuerungen und Änderungen:
diff --git a/web/install/update_306-307.php b/web/install/update_306-307.php
index 8a153bd8..9d722aeb 100644
--- a/web/install/update_306-307.php
+++ b/web/install/update_306-307.php
@@ -37,16 +37,6 @@
*/
if (isset($include) and $include==true) {
-if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file('stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file('keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-}
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.07','01.11.2012
Änderungen:
diff --git a/web/install/update_307-308.php b/web/install/update_307-308.php
index 580a46cd..0ecb654c 100644
--- a/web/install/update_307-308.php
+++ b/web/install/update_307-308.php
@@ -37,16 +37,6 @@
*/
if (isset($include) and $include==true) {
-if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-}
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.08','03.12.2012
Änderungen:
diff --git a/web/install/update_308-309.php b/web/install/update_308-309.php
index 24768578..504c9fdf 100644
--- a/web/install/update_308-309.php
+++ b/web/install/update_308-309.php
@@ -37,16 +37,6 @@
*/
if (isset($include) and $include==true) {
-if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-}
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.09','01.01.2013
Änderungen:
diff --git a/web/install/update_309-310.php b/web/install/update_309-310.php
index 62d646fd..6a19c5ec 100644
--- a/web/install/update_309-310.php
+++ b/web/install/update_309-310.php
@@ -37,16 +37,6 @@
*/
if (isset($include) and $include==true) {
-if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-} else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
-}
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.10','03.02.2013
Änderungen:
diff --git a/web/install/update_310-320.php b/web/install/update_310-320.php
index a5777052..503fd7a0 100644
--- a/web/install/update_310-320.php
+++ b/web/install/update_310-320.php
@@ -38,16 +38,6 @@
*/
if (isset($include) and $include==true) {
- if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- }
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.20','11.03.2013
Änderungen:
diff --git a/web/install/update_320-330.php b/web/install/update_320-330.php
index 92361263..4b8ae0fc 100644
--- a/web/install/update_320-330.php
+++ b/web/install/update_320-330.php
@@ -38,16 +38,6 @@
*/
if (isset($include) and $include==true) {
- if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- }
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.30','04.04.2013
Änderungen:
diff --git a/web/install/update_330-340.php b/web/install/update_330-340.php
index 3cc49877..60ea5710 100644
--- a/web/install/update_330-340.php
+++ b/web/install/update_330-340.php
@@ -37,16 +37,6 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
if (isset($include) and $include==true) {
- if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- }
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.40','09.05.2013
Änderungen:
diff --git a/web/install/update_340-360.php b/web/install/update_340-360.php
index 8d15715b..1f7c7969 100644
--- a/web/install/update_340-360.php
+++ b/web/install/update_340-360.php
@@ -38,16 +38,6 @@
*/
if (isset($include) and $include==true) {
- if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- }
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.60','21.07.2013
Änderungen:
diff --git a/web/install/update_360-370.php b/web/install/update_360-370.php
index 64eb7d24..1f902af4 100644
--- a/web/install/update_360-370.php
+++ b/web/install/update_360-370.php
@@ -38,16 +38,6 @@
*/
if (isset($include) and $include==true) {
- if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- }
$insert_easywi_version=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('3.70','18.08.2013
Änderungen:
diff --git a/web/install/update_370-400.php b/web/install/update_370-400.php
index 3dbdd0a9..bc32b00f 100644
--- a/web/install/update_370-400.php
+++ b/web/install/update_370-400.php
@@ -38,13 +38,6 @@
*/
if (isset($include) and $include==true) {
- if (@is_file('../stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars('../stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- } else if (@is_file(EASYWIDIR.'/stuff/keyphrasefile.php')){
- $aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
- $aeskey=$aesfilecvar['aeskey'];
- }
$query=$sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
('4.00','31.08.2013
Änderungen:
diff --git a/web/jobs.php b/web/jobs.php
index 8ad6a972..27eb8372 100644
--- a/web/jobs.php
+++ b/web/jobs.php
@@ -64,17 +64,16 @@ if (isset($argv)) {
if(!isset($sleep)) $sleep=60;
}
if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
- define('EASYWIDIR',dirname(__FILE__));
- include('stuff/vorlage.php');
- include('stuff/functions.php');
- include('stuff/class_validator.php');
- include('stuff/class_rootserver.php');
- include('stuff/settings.php');
- include('stuff/ssh_exec.php');
- include('stuff/class_voice.php');
- include('stuff/mysql_functions.php');
- $aesfilecvar=getconfigcvars("stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ define('EASYWIDIR', dirname(__FILE__));
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/class_rootserver.php');
+ include(EASYWIDIR . '/stuff/settings.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/class_voice.php');
+ include(EASYWIDIR . '/stuff/mysql_functions.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$gsprache=getlanguagefile('general','uk',0);
class runGraph {
private $jobsDone=0;
@@ -158,43 +157,43 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
$startTime=strtotime('now');
$theOutput=new runGraph($jobCount,$newLine);
# us > vo > gs > my > vs
- include('stuff/jobs_user.php');
+ include(EASYWIDIR . '/stuff/jobs_user.php');
$countp->execute();
$jobCount=$countp->rowCount();
$theOutput->updateCount($jobCount);
print "\r\n".'Total jobs open after user cleanup jobs are done: '.$jobCount."\r\n";
print 'Executing voice jobs'."\r\n";
- include('stuff/jobs_voice.php');
+ include(EASYWIDIR . '/stuff/jobs_voice.php');
$countp->execute();
$jobCount=$countp->rowCount();
$theOutput->updateCount($jobCount);
print "\r\n".'Total jobs open after voice jobs are done: '.$jobCount."\r\n";
print 'Executing TS DNS jobs'."\r\n";
- include('stuff/jobs_tsdns.php');
+ include(EASYWIDIR . '/stuff/jobs_tsdns.php');
$countp->execute();
$jobCount=$countp->rowCount();
$theOutput->updateCount($jobCount);
print "\r\n".'Total jobs open after TS DNS jobs are done: '.$jobCount."\r\n";
print 'Executing mysql jobs'."\r\n";
- include('stuff/jobs_mysql.php');
+ include(EASYWIDIR . '/stuff/jobs_mysql.php');
$countp->execute();
$jobCount=$countp->rowCount();
$theOutput->updateCount($jobCount);
print "\r\n".'Total jobs open after mysql jobs are done: '.$jobCount."\r\n";
print 'Executing gameserver jobs'."\r\n";
- include('stuff/jobs_gserver.php');
+ include(EASYWIDIR . '/stuff/jobs_gserver.php');
$countp->execute();
$jobCount=$countp->rowCount();
$theOutput->updateCount($jobCount);
print "\r\n".'Total jobs open after gameserver jobs are done: '.$jobCount."\r\n";
print 'Executing root server jobs'."\r\n";
- include('stuff/jobs_roots.php');
+ include(EASYWIDIR . '/stuff/jobs_roots.php');
$countp->execute();
$jobCount=$countp->rowCount();
$theOutput->updateCount($jobCount);
print "\r\n".'Total jobs open after root server jobs are done: '.$jobCount."\r\n";
print 'Executing user remove jobs'."\r\n";
- include('stuff/jobs_user_rm.php');
+ include(EASYWIDIR . '/stuff/jobs_user_rm.php');
print "\n";
$test='ech';
if ($deamon==true) {
diff --git a/web/languages/default/de/general.xml b/web/languages/default/de/general.xml
index 5b816b57..038433a2 100644
--- a/web/languages/default/de/general.xml
+++ b/web/languages/default/de/general.xml
@@ -39,6 +39,7 @@
Master
Umzugsservice
Ändern
+ Module
News
Nein
Übersicht
diff --git a/web/languages/default/de/modules.xml b/web/languages/default/de/modules.xml
new file mode 100644
index 00000000..18836048
--- /dev/null
+++ b/web/languages/default/de/modules.xml
@@ -0,0 +1,15 @@
+
+
+ Aktivieren
+ Beschreibung
+ Fehler: Easy-WI Core Module können nicht gelöscht werden
+ Datei
+ GET Wert
+ Name
+ Menüblock
+ Modul Typ
+ Adminpanel
+ CMS
+ Easy-WI Core
+ Userpanel
+
\ No newline at end of file
diff --git a/web/languages/default/uk/general.xml b/web/languages/default/uk/general.xml
index f76ee192..ffe666f6 100644
--- a/web/languages/default/uk/general.xml
+++ b/web/languages/default/uk/general.xml
@@ -39,6 +39,7 @@
Master
Migration Service
Modify
+ Modules
News
No
Overview
diff --git a/web/languages/default/uk/modules.xml b/web/languages/default/uk/modules.xml
new file mode 100644
index 00000000..f9d435f3
--- /dev/null
+++ b/web/languages/default/uk/modules.xml
@@ -0,0 +1,15 @@
+
+
+ Activate
+ Description
+ Error: Easy-WI core modules cannot be deleted
+ File
+ GET Value
+ Name
+ Menu
+ Modul type
+ Adminpanel
+ CMS
+ Easy-WI core
+ Userpanel
+
\ No newline at end of file
diff --git a/web/lend.php b/web/lend.php
index 740ae3b4..2fd2f3d2 100644
--- a/web/lend.php
+++ b/web/lend.php
@@ -39,19 +39,19 @@
if (isset($page_include)) {
$reseller_id=0;
} else {
- define('EASYWIDIR',dirname(__FILE__));
+ define('EASYWIDIR', dirname(__FILE__));
if (is_dir(EASYWIDIR."/install")) die('Please remove the "install" folder');
if (is_file(EASYWIDIR."update.php")) die('Please remove the file "update.php"');
$logininclude=1;
- include(EASYWIDIR.'/stuff/vorlage.php');
- include(EASYWIDIR.'/stuff/class_validator.php');
- include(EASYWIDIR."/stuff/functions.php");
- include(EASYWIDIR."/stuff/settings.php");
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/settings.php');
$query=$sql->prepare("SELECT `language` FROM `settings` WHERE `resellerid`=0 LIMIT 1");
$user_language=$query->fetchColumn();
if (!small_letters_check($user_language,2)) $user_language='en';
}
-include(EASYWIDIR.'/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$validacces=false;
if ($ui->ip4('REMOTE_ADDR','server') and $ui->names('user',255,'post') and !isset($page_include)) {
$query=$sql->prepare("SELECT `active`,`pwd`,`salt`,`user`,i.`resellerID` FROM `api_ips` i LEFT JOIN `api_settings` s ON i.`resellerID`=s.`resellerID` WHERE `ip`=?");
@@ -218,7 +218,7 @@ if(isset($servertype)) {
$query2->execute(array($row['id'],$reseller_id));
if ($servertype=='g') {
unset($_SESSION['lend']['gs']);
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$query1->execute(array($serverid,$reseller_id));
foreach($query1->fetchAll(PDO::FETCH_ASSOC) as $row1) {
$cmds=gsrestart($row1['switchID'],'so',$aeskey,$reseller_id);
@@ -226,7 +226,7 @@ if(isset($servertype)) {
}
} else if ($servertype=='v') {
unset($_SESSION['lend']['vs']);
- include(EASYWIDIR.'/stuff/class_voice.php');
+ include(EASYWIDIR . '/stuff/class_voice.php');
$query3->execute(array($aeskey,$serverid,$reseller_id));
foreach ($query3->fetchall(PDO::FETCH_ASSOC) as $row2) {
$queryport=$row2['queryport'];
@@ -648,7 +648,7 @@ if((!isset($servertype) and isset($page_include) and $ui->id('xml',1,'post')!=1)
}
$query=$insert=$sql->prepare("UPDATE `gsswitch` SET `serverid`=? WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($serverid,$updateID,$reseller_id));
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$cmds=gsrestart($updateID,'re',$aeskey,$reseller_id);
ssh2_execute('gs',$rootID,$cmds);
if (!isset($page_include) and $ui->id('xml',1,'post')==1) {
@@ -677,11 +677,11 @@ XML;
$template_file='page_lenddata.tpl';
} else {
if (is_file(EASYWIDIR.'/template/'.$template_to_use.'/lenddata.tpl')) {
- include(EASYWIDIR.'/template/'.$template_to_use.'/lenddata.tpl');
+ include(EASYWIDIR . '/template/'.$template_to_use.'/lenddata.tpl');
} else if (is_file(EASYWIDIR.'/template/default/lenddata.tpl')) {
- include(EASYWIDIR.'/template/default/lenddata.tpl');
+ include(EASYWIDIR . '/template/default/lenddata.tpl');
} else {
- include(EASYWIDIR.'/template/lenddata.tpl');
+ include(EASYWIDIR . '/template/lenddata.tpl');
}
}
}
@@ -707,11 +707,11 @@ XML;
$template_file='page_lend.tpl';
} else {
if (is_file(EASYWIDIR.'/template/'.$template_to_use.'/lend.tpl')) {
- include(EASYWIDIR.'/template/'.$template_to_use.'/lend.tpl');
+ include(EASYWIDIR . '/template/'.$template_to_use.'/lend.tpl');
} else if (is_file(EASYWIDIR.'/template/default/lend.tpl')) {
- include(EASYWIDIR.'/template/default/lend.tpl');
+ include(EASYWIDIR . '/template/default/lend.tpl');
} else {
- include(EASYWIDIR.'/template/lend.tpl');
+ include(EASYWIDIR . '/template/lend.tpl');
}
}
} else if (!isset($page_include) and ($lendaccess==1 or $lendaccess==3) and $ui->id('xml',1,'post')==1) {
@@ -857,7 +857,7 @@ XML;
$queryip=$vrow2['ip'];
}
}
- include(EASYWIDIR."/stuff/class_voice.php");
+ include(EASYWIDIR . '/stuff/class_voice.php');
$connection=new TS3($queryip,$queryport,'serveradmin',$querypassword);
$errorcode=$connection->errorcode;
if (strpos($errorcode,'error id=0') === false) {
@@ -921,11 +921,11 @@ XML;
$template_file='page_lenddata.tpl';
} else {
if (is_file(EASYWIDIR.'/template/'.$template_to_use.'/lenddata.tpl')) {
- include(EASYWIDIR.'/template/'.$template_to_use.'/lenddata.tpl');
+ include(EASYWIDIR . '/template/'.$template_to_use.'/lenddata.tpl');
} else if (is_file(EASYWIDIR.'/template/default/lenddata.tpl')) {
- include(EASYWIDIR.'/template/default/lenddata.tpl');
+ include(EASYWIDIR . '/template/default/lenddata.tpl');
} else {
- include(EASYWIDIR.'/template/lenddata.tpl');
+ include(EASYWIDIR . '/template/lenddata.tpl');
}
}
}
@@ -946,11 +946,11 @@ XML;
$template_file='page_lend.tpl';
} else {
if (is_file(EASYWIDIR.'/template/'.$template_to_use.'/lend.tpl')) {
- include(EASYWIDIR.'/template/'.$template_to_use.'/lend.tpl');
+ include(EASYWIDIR . '/template/'.$template_to_use.'/lend.tpl');
} else if (is_file(EASYWIDIR.'/template/default/lend.tpl')) {
- include(EASYWIDIR.'/template/default/lend.tpl');
+ include(EASYWIDIR . '/template/default/lend.tpl');
} else {
- include(EASYWIDIR.'/template/lend.tpl');
+ include(EASYWIDIR . '/template/lend.tpl');
}
}
} else if (!isset($page_include) and ($lendaccess==1 or $lendaccess==3) and $ui->id('xml',1,'post')==1) {
diff --git a/web/login.php b/web/login.php
index 0894ebf1..2cce8ec2 100644
--- a/web/login.php
+++ b/web/login.php
@@ -41,13 +41,13 @@ if (count($s)>1) {
unset($s[(count($s)-1)]);
$ewInstallPath=implode('/',$s).'/';
}
-define('EASYWIDIR',dirname(__FILE__));
+define('EASYWIDIR', dirname(__FILE__));
if (is_dir(EASYWIDIR.'/install')) die('Please remove the "install" folder');
if ((!isset($ui->get['w']) and isset($ui->post['username'])) or (isset($ui->get['w']) and $ui->get['w']!='pr')) $logininclude=true;
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/functions.php');
-include(EASYWIDIR.'/stuff/settings.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/settings.php');
if ($ui->ismail('email','post')) {
$fullday=date('Y-m-d H:i:s',strtotime("+1 day"));
$query=$sql->prepare("SELECT `id` FROM `badips` WHERE `badip`=? LIMIT 1");
@@ -129,8 +129,7 @@ if ($w=='lo') {
$query->execute(array($ui->w('token',32,'get')));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$username=$row['cname'];
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$salt=md5(mt_rand().date('Y-m-d H:i:s:u'));
$password=createHash($username,$ui->password('password1',255,'post'),$salt,$aeskey);
$query=$sql->prepare("UPDATE `userdata` SET `token`='',`security`=?,`salt`=? WHERE `id`=? LIMIT 1");
@@ -213,7 +212,7 @@ if ($w=='lo') {
$include='passwordrecovery.tpl';
}
} else {
- include(EASYWIDIR.'/stuff/keyphrasefile.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
if (!$ui->username('username',255,'post') and !$ui->ismail('username',255,'post') and !$ui->password('password',255,'post') and !isset($_SESSION['sessionid'])) {
$include='login.tpl';
} else if (($ui->username('username',255,'post') or $ui->ismail('username','post')) and $ui->password('password',255,'post') and !isset($_SESSION['sessionid'])) {
diff --git a/web/reboot.php b/web/reboot.php
index 49a7f6d1..e0c8cf49 100644
--- a/web/reboot.php
+++ b/web/reboot.php
@@ -48,15 +48,15 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
}
set_time_limit($timelimit);
if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
- define('EASYWIDIR',dirname(__FILE__));
+ define('EASYWIDIR', dirname(__FILE__));
echo "Reboot and Updater started\r\n";
- include('stuff/vorlage.php');
- include('stuff/class_validator.php');
- include('stuff/functions.php');
- include('stuff/settings.php');
- include('stuff/ssh_exec.php');
- include('stuff/class_masterserver.php');
- include('stuff/class_voice.php');
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/settings.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/class_masterserver.php');
+ include(EASYWIDIR . '/stuff/class_voice.php');
if (version_compare(PHP_VERSION,'5.3.0')>=0){
$currentTime=new DateTime(date('Y-m-d H:i:s'));
} else {
@@ -65,8 +65,7 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
$currentHour=date('G');
}
$now=date('Y-m-d',strtotime("now"));
- $aesfilecvar=getconfigcvars("stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('gserver','uk',0);
echo "Fetch version for valves appIDs\r\n";
$query=$sql->prepare("SELECT t.`appID`,t.`shorten` FROM `servertypes` t LEFT JOIN `rservermasterg` r ON t.`id`=r.`servertypeid` WHERE r.`id` IS NOT NULL AND t.`appID` IS NOT NULL AND t.`steamgame`!='N' GROUP BY t.`appID` ORDER BY t.`appID`");
@@ -465,7 +464,7 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
$newsInclude=true;
$printToConsole=true;
print "Check for new news feeds\r\n";
- include('stuff/feeds_function.php');
+ include(EASYWIDIR . '/stuff/feeds_function.php');
if (isset($template_file)) print $template_file."\r\n";
$chunkSize=(isset($argv[1]) and is_numeric($argv[1])) ? $argv[1] : 500;
print "Cleaning Up hourly data. Chunksize is ${chunkSize}\r\n";
diff --git a/web/serverallocation.php b/web/serverallocation.php
index 8c4a2237..a6180d45 100644
--- a/web/serverallocation.php
+++ b/web/serverallocation.php
@@ -35,12 +35,12 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-define('EASYWIDIR',dirname(__FILE__));
-include(EASYWIDIR."/stuff/functions.php");
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR."/stuff/config.php");
-include(EASYWIDIR."/stuff/settings.php");
+define('EASYWIDIR', dirname(__FILE__));
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/config.php');
+include(EASYWIDIR . '/stuff/settings.php');
$die=false;
if (!isset($admin_id) and !isset($user_id)) {
redirect('login.php');
@@ -343,10 +343,9 @@ if ($ui->smallletters('w',5,'get')=='check') {
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
- include(EASYWIDIR.'/stuff/ssh_exec.php');
- include(EASYWIDIR.'/stuff/class_masterserver.php');
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/class_masterserver.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$rootServer=new masterServer($ui->id('id',10,'get'),$aeskey);
$games=explode("_",$ui->username('gamestring','50','get'));
$i=1;
diff --git a/web/serverlog.php b/web/serverlog.php
index 182b7f9d..906778a3 100644
--- a/web/serverlog.php
+++ b/web/serverlog.php
@@ -35,18 +35,17 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-define('EASYWIDIR',dirname(__FILE__));
-include(EASYWIDIR."/stuff/functions.php");
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR."/stuff/settings.php");
+define('EASYWIDIR', dirname(__FILE__));
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/settings.php');
if (!isset($user_id) and !isset($admin_id)) {
header('Location: login.php');
die('Please allow redirection');
}
if (isset($server_id)) {
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
if ($reseller_id!="0" and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
diff --git a/web/startupdates.php b/web/startupdates.php
index 053ac8ad..6ce2534e 100644
--- a/web/startupdates.php
+++ b/web/startupdates.php
@@ -48,16 +48,15 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
}
set_time_limit($timelimit);
if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
- define('EASYWIDIR',dirname(__FILE__));
+ define('EASYWIDIR', dirname(__FILE__));
echo "Start Syncs and Updates loading...\r\n";
- include('stuff/vorlage.php');
- include('stuff/class_validator.php');
- include('stuff/functions.php');
- include('stuff/settings.php');
- include('stuff/ssh_exec.php');
- include('stuff/class_masterserver.php');
- $aesfilecvar=getconfigcvars("stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/settings.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/class_masterserver.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$currentHour=date('G');
$currentMinute=(int)date('i');
$query=$sql->prepare("SELECT `lastUpdateRun` FROM `settings` WHERE `resellerid`=0 LIMIT 1");
diff --git a/web/statuscheck.php b/web/statuscheck.php
index 9dc549da..182a2d20 100644
--- a/web/statuscheck.php
+++ b/web/statuscheck.php
@@ -64,21 +64,20 @@ if (isset($checkTypeOfServer)) {
}
set_time_limit($timelimit);
if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
- define('EASYWIDIR',dirname(__FILE__));
- include('stuff/vorlage.php');
- include('stuff/functions.php');
- include('stuff/class_validator.php');
- include('stuff/settings.php');
- include('stuff/ssh_exec.php');
- include('stuff/class_voice.php');
- include('stuff/queries.php');
+ define('EASYWIDIR', dirname(__FILE__));
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/settings.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/class_voice.php');
+ include(EASYWIDIR . '/stuff/queries.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$dayAndHour=date('Y-m-d H:').'00:00';
$dayAndZeroHour=date('Y-m-d').' 00:00:00';
$ssprache=getlanguagefile('settings','uk',0);
$vosprache=getlanguagefile('voice','uk',0);
$sprache=getlanguagefile('gserver','uk',0);
- $aesfilecvar=getconfigcvars("stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
# Pick up Reseller and Lend Settings
$resellersettings=array();
diff --git a/web/stuff/admin_modules.php b/web/stuff/admin_modules.php
new file mode 100644
index 00000000..94a8b176
--- /dev/null
+++ b/web/stuff/admin_modules.php
@@ -0,0 +1,282 @@
+
+ *
+ * This file is part of Easy-WI.
+ *
+ * Easy-WI is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Easy-WI is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Easy-WI. If not, see .
+ *
+ * Diese Datei ist Teil von Easy-WI.
+ *
+ * Easy-WI ist Freie Software: Sie koennen es unter den Bedingungen
+ * der GNU General Public License, wie von der Free Software Foundation,
+ * Version 3 der Lizenz oder (nach Ihrer Wahl) jeder spaeteren
+ * veroeffentlichten Version, weiterverbreiten und/oder modifizieren.
+ *
+ * Easy-WI wird in der Hoffnung, dass es nuetzlich sein wird, aber
+ * OHNE JEDE GEWAEHELEISTUNG, bereitgestellt; sogar ohne die implizite
+ * Gewaehrleistung der MARKTFAEHIGKEIT oder EIGNUNG FUER EINEN BESTIMMTEN ZWECK.
+ * Siehe die GNU General Public License fuer weitere Details.
+ *
+ * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
+ * Programm erhalten haben. Wenn nicht, siehe .
+ */
+
+if (!isset($admin_id) or !isset($reseller_id) or (isset($reseller_id) and $reseller_id!=0) or (isset($admin_id) and isset($pa) and !$pa['root'])) {
+ header('Location: login.php');
+ die;
+}
+$loguserid = $admin_id;
+$logusername = getusername($admin_id);
+$logusertype = 'admin';
+$logreseller = 0;
+$logsubuser = 0;
+$sprache = getlanguagefile('modules',$user_language,$reseller_id);
+
+unset($name);
+
+# array with easy-wi core modules to prevent legacy issues and users from removing
+$table = array(
+ 1 => array('id' =>1, 'active' => 'Y', 'name' => $gsprache->gameserver, 'sub' => 'gs', 'type' => $sprache->type_core),
+ 2 => array('id' =>2, 'active' => 'Y', 'name' => 'Easy Anti Cheat', 'sub' => 'ea', 'type' => $sprache->type_core),
+ 3 => array('id' =>3, 'active' => 'Y', 'name' => 'MYSQL', 'sub' => 'my', 'type' => $sprache->type_core),
+ 4 => array('id' =>4, 'active' => 'Y', 'name' => $gsprache->voiceserver, 'sub' => 'vo', 'type' => $sprache->type_core),
+ 5 => array('id' =>5, 'active' => 'Y', 'name' => $gsprache->lendserver, 'sub' => 'le', 'type' => $sprache->type_core),
+ 6 => array('id' =>6, 'active' => 'Y', 'name' => $gsprache->support, 'sub' => 'ti', 'type' => $sprache->type_core),
+ 7 => array('id' =>7, 'active' => 'Y', 'name' => 'Rootserver', 'sub' => 'ro', 'type' => $sprache->type_core)
+);
+
+if ($ui->st('action', 'post') and !token(true)) {
+ $template_file = $spracheResponse->token;
+} else if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
+
+ $id = $ui->id('id', 10, 'get');
+ $active = ($ui->active('active', 'post')) ? $ui->active('active', 'post') : 'Y';
+ $langAvailable = getlanguages($template_to_use);
+
+ // Easy-WI core modules should only be (de)activated
+ if ($ui->st('d', 'get') == 'md' and $ui->st('action', 'post') == 'md' and $id < 1001) {
+
+ $query = $sql->prepare("INSERT INTO `modules` (`id`,`file`,`get`,`sub`,`type`,`active`) VALUES (?,'',?,'','C',?) ON DUPLICATE KEY UPDATE `active`=VALUES(`active`)");
+ $query->execute(array($id, (isset($table[$id]['sub'])) ? $table[$id]['sub'] : '', $active));
+
+ $template_file = ($query->rowCount() == 0) ? $spracheResponse->error_table : $spracheResponse->table_add;
+
+ } else if ($ui->st('d', 'get') == 'md' and !$ui->st('action', 'post') and $id < 1001) {
+
+ $name = (isset($table[$id]['name'])) ? $table[$id]['name'] : '';
+ $query = $sql->prepare("SELECT `active` FROM `modules` WHERE `id`=? LIMIT 1");
+ $query->execute(array($id));
+ $active = $query->fetchColumn();
+ if ($query->rowCount() == 0) {
+ $active = 'Y';
+ }
+ $template_file = (isset($table[$id])) ? 'admin_modules_md.tpl' : 'admin_404.tpl';
+
+ // Custom Modules
+ } else if ($id > 1000 or $id === null) {
+
+ $errors = array();
+ $dbSuccess = false;
+ $file = $ui->config('file', 'post');
+ $sub = $ui->st('sub', 'post');
+ $get = $ui->smallletters('get', 255, 'post');
+ $type = $ui->w('type', 1, 'post');
+
+ if ($ui->st('action', 'post')) {
+
+ if (!$sub or !in_array($sub, array('gs', 'mo', 'my', 'ro', 'ti', 'us', 'vo', 'pa')) ) {
+ $errors['sub'] = $sprache->sub;
+ }
+
+ if (!$type or !in_array($type, array('A','P','U')) ) {
+ $errors['type'] = $sprache->type;
+ }
+
+ if ($get and strlen($get) != 2) {
+ $query = $sql->prepare("SELECT 1 FROM `modules` WHERE `get`=? AND `id`!=? LIMIT 1");
+ $query->execute(array($get, $id));
+ if ($query->rowCount()>0) {
+ $errors['get'] = $sprache->get;
+ }
+ } else {
+ $errors['get'] = $sprache->get;
+ }
+
+ if ($file and substr(strtolower($file), -4) == '.php') {
+ $query = $sql->prepare("SELECT 1 FROM `modules` WHERE `file`=? AND `id`!=? LIMIT 1");
+ $query->execute(array($file, $id));
+ if ($query->rowCount()>0) {
+ $errors['file'] = $sprache->file;
+ }
+ } else {
+ $errors['file'] = $sprache->file;
+ }
+
+ if (count($errors) == 0) {
+ if ($ui->st('action', 'post') == 'md') {
+ $query = $sql->prepare("UPDATE `modules` SET `get`=?,`file`=?,`sub`=?,`active`=?,`type`=? WHERE `id`=? LIMIT 1");
+ $query->execute(array($get, $file, $sub, $active, $type, $id));
+ if ($query->rowCount() > 0) {
+ $dbSuccess = true;
+ }
+ } else if (count($errors) == 0 and $ui->st('action', 'post') == 'ad') {
+ $query = $sql->prepare("INSERT INTO `modules` (`get`,`file`,`sub`,`active`,`type`) VALUES (?,?,?,?,?)");
+ $query->execute(array($get, $file, $sub, $active, $type));
+ if ($query->rowCount() > 0) {
+ $dbSuccess = true;
+ }
+ $id = $sql->lastInsertId();
+ }
+ if ($ui->smallletters('lang', 2, 'post')) {
+ $array = (array) $ui->smallletters('lang', 2, 'post');
+ $query = $sql->prepare("INSERT INTO `translations` (`type`,`transID`,`lang`,`text`,`resellerID`) VALUES ('mo',?,?,?,?) ON DUPLICATE KEY UPDATE `text`=VALUES(`text`)");
+ foreach($array as $lang) {
+ if (small_letters_check($lang, 2)) {
+ $query->execute(array($id, $lang, $ui->description('translation', 'post', $lang), 0));
+ if ($dbSuccess === false and $query->rowCount() > 0) {
+ $dbSuccess = true;
+ }
+ }
+ }
+ $query = $sql->prepare("SELECT `lang` FROM `translations` WHERE `type`='mo' AND `transID`=? AND `resellerID`=?");
+ $query2 = $sql->prepare("DELETE FROM `translations` WHERE `type`='mo' AND `transID`=? AND `lang`=? AND `resellerID`=? LIMIT 1");
+ $query->execute(array($id, 0));
+ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ if (!in_array($row['lang'],$array)) {
+ $query2->execute(array($id, $row['lang'], 0));
+ if ($dbSuccess === false and $query2->rowCount() > 0) {
+ $dbSuccess = true;
+ }
+ }
+ }
+ } else {
+ $query = $sql->prepare("DELETE FROM `translations` WHERE `type`='mo' AND `transID`=? AND `resellerID`=?");
+ $query->execute(array($id, 0));
+ if ($dbSuccess === false and $query->rowCount() > 0) {
+ $dbSuccess = true;
+ }
+ }
+
+ if ($dbSuccess === true) {
+ $loguseraction = ($ui->st('d', 'get') == 'md') ? '%mod% %modules% '.$file : '%add% %modules% '.$file;
+ $insertlog->execute();
+ $template_file = $spracheResponse->table_add;
+ } else {
+ $template_file = $spracheResponse->error_table;
+ }
+ } else {
+ unset($header, $text);
+ $template_file = ($ui->st('d', 'get') == 'ad') ? 'admin_modules_ad.tpl' : 'admin_modules_md.tpl';
+ }
+
+ } else {
+ if ($ui->st('d', 'get') == 'md') {
+ $query = $sql->prepare("SELECT * FROM `modules` WHERE `id`=? LIMIT 1");
+ $query->execute(array($id));
+ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ $file = $row['file'];
+ $sub = $row['sub'];
+ $get = $row['get'];
+ $type = $row['type'];
+ $found = true;
+ }
+ $languageTexts = array();
+ foreach ($langAvailable as $lg) {
+ $languageTexts[$lg] = '';
+ }
+
+ if (isset($found)) {
+ $query = $sql->prepare("SELECT `text`,`lang` FROM `translations` WHERE `type`='mo' AND `transID`=?");
+ $query->execute(array($id));
+ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ if ($row['lang'] == $rSA['language']) {
+ $name = $row['text'];
+ }
+ $languageTexts[$row['lang']] = $row['text'];
+ }
+ if(!isset($name)) {
+ $name = $file;
+ }
+ $template_file = 'admin_modules_md.tpl';
+ } else {
+ $template_file = 'admin_404.tpl';
+ }
+ } else {
+ $template_file = 'admin_modules_ad.tpl';
+ }
+ }
+ }
+} else if ($ui->st('d', 'get') == 'dl' and $ui->id('id',10, 'get')) {
+ $id=$ui->id('id',10, 'get');
+ if ($id < 1001) {
+ $template_file = $sprache->error_core;
+ } else {
+ $query = $sql->prepare("SELECT `file` FROM `modules` WHERE `id`=? LIMIT 1");
+ $query->execute(array($id));
+ $moduleFile = $query->fetchColumn();
+ if ($query->rowCount() > 0) {
+ if ($ui->st('action', 'post') == 'dl') {
+ $query = $sql->prepare("DELETE FROM `modules` WHERE `id`=? LIMIT 1");
+ $query->execute(array($id));
+ if ($query->rowCount() > 0) {
+ $template_file = $spracheResponse->table_del;
+ $loguseraction = '%del% %modules% '.$moduleFile;
+ $insertlog->execute();
+ } else {
+ $template_file = $spracheResponse->error_table;
+ }
+ } else {
+ $template_file = 'admin_modules_dl.tpl';
+ }
+ } else {
+ $template_file = 'admin_404.tpl';
+ }
+ }
+} else {
+ $query = $sql->prepare("SELECT * FROM `modules`");
+ $query2 = $sql->prepare("SELECT `text` FROM `translations` WHERE `type`='mo' AND `transID`=? AND `lang`=? LIMIT 1");
+ $query->execute();
+ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ if (isset($table[$row['id']])) {
+ $table[$row['id']]['active'] = $row['active'];
+ } else {
+ $query2->execute(array($row['id'], $user_language));
+ $name = $query2->fetchColumn();
+ if (strlen($name) == 0) {
+ $query2->execute(array($row['id'], $rSA['language']));
+ $name = $query2->fetchColumn();
+ }
+ if (strlen($name) == 0) {
+ $name = $row['file'];
+ }
+ $type = '';
+ if ($row['type'] == 'A') {
+ $type = $sprache->type_admin;
+ } else if ($row['type'] == 'P') {
+ $type = $sprache->type_cms;
+ } else if ($row['type'] == 'U') {
+ $type = $sprache->type_user;
+ }
+ $table[$row['id']] = array('id' => $row['id'], 'active' => $row['active'], 'name' => $name, 'type' => $type);
+ }
+ }
+ $template_file = 'admin_modules_list.tpl';
+}
\ No newline at end of file
diff --git a/web/stuff/api_external_auth.php b/web/stuff/api_external_auth.php
index 706ee47a..c07ea2eb 100644
--- a/web/stuff/api_external_auth.php
+++ b/web/stuff/api_external_auth.php
@@ -41,12 +41,11 @@ if ($main!=1 or !isset($admin_id) or (isset($admin_id) and !$pa['apiSettings']))
header('Location: admin.php');
die('No acces');
}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('api',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype='admin';
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype='admin';
diff --git a/web/stuff/api_gserver.php b/web/stuff/api_gserver.php
index 85ff87f8..cb8eedba 100644
--- a/web/stuff/api_gserver.php
+++ b/web/stuff/api_gserver.php
@@ -37,6 +37,7 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$minimumArray=array('action','identify_server_by','server_local_id','server_external_id');
$editArray=array('active','private','slots','shorten','identify_user_by','user_localid','user_externalid','username');
foreach ($minimumArray as $key) {
@@ -51,8 +52,6 @@ if (array_key_exists('action',$data) and $data['action']!='gs') {
}
}
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
$active='';
$private='';
$shorten='';
diff --git a/web/stuff/api_import_users.php b/web/stuff/api_import_users.php
index 8e8a9d75..fc25d4c9 100644
--- a/web/stuff/api_import_users.php
+++ b/web/stuff/api_import_users.php
@@ -40,12 +40,11 @@ if ($main!=1 or !isset($admin_id) or (isset($admin_id) and !$pa['apiSettings']))
header('Location: admin.php');
die('No acces');
}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('api',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype='admin';
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype='admin';
diff --git a/web/stuff/api_mysql.php b/web/stuff/api_mysql.php
index a3010fe5..1b287a04 100644
--- a/web/stuff/api_mysql.php
+++ b/web/stuff/api_mysql.php
@@ -37,16 +37,12 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
foreach (array('active','action','identify_server_by','server_local_id','server_external_id','identify_user_by','user_localid','user_externalid','username') as $key) {
if (!array_key_exists($key,$data)) {
$success['false'][]='Data key does not exist: '.$key;
}
}
-if (!isset($success['false'])) {
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
-}
if (!isset($success['false']) and array_value_exists('action','add',$data)) {
if (dataExist('identify_user_by',$data)) {
$active=active_check($data['active']);
diff --git a/web/stuff/api_users.php b/web/stuff/api_users.php
index 696e1ea9..d685509d 100644
--- a/web/stuff/api_users.php
+++ b/web/stuff/api_users.php
@@ -36,6 +36,8 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe .
*/
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$username='';
$externalID='';
@@ -168,8 +170,6 @@ if (array_value_exists('action','add',$data)) {
}
if (!isset($success) and isset($localID) and isset($insert) and $insert==true) {
if (!isset($data['password']) or in_array($data['password'],$bad)) $password=passwordgenerate(10);
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
$passwordhash=createHash($username,$password,$salt,$aeskey);
$query=$sql->prepare("UPDATE `userdata` SET `cname`=?,`security`=? WHERE `id`=? LIMIT 1");
$query->execute(array($username,$passwordhash,$localID));
@@ -200,8 +200,6 @@ if (array_value_exists('action','add',$data)) {
$what=array();
if (isset($data['password']) and !in_array($data['password'],$bad)) {
$password=$data['password'];
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
$salt=md5(mt_rand().date('Y-m-d H:i:s:u'));
$security=createHash($name,$data['password'],$salt,$aeskey);
$what['security']=$security;
diff --git a/web/stuff/eac.php b/web/stuff/eac.php
index da40754e..132293f7 100644
--- a/web/stuff/eac.php
+++ b/web/stuff/eac.php
@@ -39,7 +39,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['eac'])) {
header('Location: admin.php');
die('No acces');
}
-include(EASYWIDIR.'/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('roots',$user_language,$reseller_id);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid=$admin_id;
diff --git a/web/stuff/feeds.php b/web/stuff/feeds.php
index ea16554c..a6866cf6 100644
--- a/web/stuff/feeds.php
+++ b/web/stuff/feeds.php
@@ -36,13 +36,13 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe .
*/
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('feeds',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype='admin';
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if ($reseller_id==0) {
$logreseller=0;
$logsubuser=0;
diff --git a/web/stuff/feeds_entries.php b/web/stuff/feeds_entries.php
index 49e87771..a7743010 100644
--- a/web/stuff/feeds_entries.php
+++ b/web/stuff/feeds_entries.php
@@ -37,12 +37,12 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('feeds',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype='admin';
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if ($reseller_id==0) {
$logreseller=0;
$logsubuser=0;
@@ -53,7 +53,7 @@ if ($reseller_id==0) {
$lookUpID=($reseller_id!=0 and $admin_id!=$reseller_id) ? $admin_id: $reseller_id;
if ($ui->st('d','get')=='ud') {
$newsInclude=true;
- include(EASYWIDIR.'/stuff/feeds_function.php');
+ include(EASYWIDIR . '/stuff/feeds_function.php');
} else if ($ui->st('d','get')=='md') {
$ids=(array)$ui->active('ids','post');
$delete=$sql->prepare("DELETE FROM `feeds_news` WHERE `newsID`=? AND `resellerID`=? LIMIT 1");
diff --git a/web/stuff/functions.php b/web/stuff/functions.php
index 286541d0..477b2b6a 100644
--- a/web/stuff/functions.php
+++ b/web/stuff/functions.php
@@ -262,17 +262,17 @@ if (!function_exists('passwordgenerate')) {
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$default_language=$row['language'];
$template=$row['template'];
- if (file_exists(EASYWIDIR.'/languages/'.$template.'/'.$user_language.'/'.$filename.'.xml')) {
+ if (file_exists(EASYWIDIR . '/languages/'.$template.'/'.$user_language.'/'.$filename.'.xml')) {
$sprache=simplexml_load_file(EASYWIDIR.'/languages/'.$template.'/'.$user_language.'/'.$filename.'.xml');
- } else if (file_exists(EASYWIDIR.'/languages/'.$template.'/'.$default_language.'/'.$filename.'.xml')) {
+ } else if (file_exists(EASYWIDIR . '/languages/'.$template.'/'.$default_language.'/'.$filename.'.xml')) {
$sprache=simplexml_load_file(EASYWIDIR.'/languages/'.$template.'/'.$default_language.'/'.$filename.'.xml');
- } else if (file_exists(EASYWIDIR.'/languages/default/'.$user_language.'/'.$filename.'.xml')) {
+ } else if (file_exists(EASYWIDIR . '/languages/default/'.$user_language.'/'.$filename.'.xml')) {
$sprache=simplexml_load_file(EASYWIDIR.'/languages/default/'.$user_language.'/'.$filename.'.xml');
- } else if (file_exists(EASYWIDIR.'/languages/default/'.$default_language.'/'.$filename.'.xml')) {
+ } else if (file_exists(EASYWIDIR . '/languages/default/'.$default_language.'/'.$filename.'.xml')) {
$sprache=simplexml_load_file(EASYWIDIR.'/languages/default/'.$default_language.'/'.$filename.'.xml');
- } else if (file_exists(EASYWIDIR.'/languages/'.$user_language.'/'.$filename.'.xml')) {
+ } else if (file_exists(EASYWIDIR . '/languages/'.$user_language.'/'.$filename.'.xml')) {
$sprache=simplexml_load_file(EASYWIDIR."/languages/$user_language/$filename.xml");
- } else if (file_exists(EASYWIDIR.'/languages/'.$default_language.'/'.$filename.'.xml')) {
+ } else if (file_exists(EASYWIDIR . '/languages/'.$default_language.'/'.$filename.'.xml')) {
$sprache=simplexml_load_file(EASYWIDIR."/languages/$default_language/$filename.xml");
}
}
@@ -371,36 +371,6 @@ if (!function_exists('passwordgenerate')) {
natsort($checkedips);
return $checkedips;
}
- function getconfigcvars($file) {
- $fp= @fopen($file,'rb');
- if ($fp == true) {
- $vars=array();
- $configfile="";
- while (!feof($fp)){
- $line=fgets($fp);
- if(strpos(strtolower($line), strtolower("")) === false) {
- $configfile .="$line\r\n";
- }
- }
- fclose($fp);
- $lines=explode("\r\n", $configfile);
- foreach ($lines as $line) {
- if(strpos(strtolower($line), strtolower("//")) === false and strpos(strtolower($line), strtolower("=")) == true) {
- $data=explode("=", $line);
- $cvar=preg_replace('/\s+/', '', $data[0]);
- $cvar=str_replace('$', "", $cvar);
- $data2=explode(";", $data[1]);
- $stringlenght=strlen($data2[0]);
- $stop=$stringlenght-2;
- $value=substr($data2[0],1,$stop);
- $vars[$cvar]=$value;
- }
- }
- return $vars;
- } else {
- die("No configdata!");
- }
- }
function eacchange($what,$serverid,$rcon,$reseller_id) {
global $sql;
$query=$sql->prepare("SELECT `active`,`cfgdir` FROM `eac` WHERE `resellerid`=? LIMIT 1");
@@ -429,7 +399,7 @@ if (!function_exists('passwordgenerate')) {
if ($what=='change') $ssh2cmd='echo "'.$gsip.':'.$gsport.'-'.$rcon.$parameter.'" > '.$file;
else if ($what=="remove") $ssh2cmd='rm -f '.$file;
if (isset($ssh2cmd) and $active=='Y') {
- if (!function_exists('ssh2_execute')) include(EASYWIDIR.'/stuff/ssh_exec.php');
+ if (!function_exists('ssh2_execute')) include(EASYWIDIR . '/stuff/ssh_exec.php');
if (isset($ssh2cmd)) ssh2_execute('eac',$reseller_id,$ssh2cmd);
}
}
@@ -850,8 +820,9 @@ if (!function_exists('passwordgenerate')) {
}
function sendmail($template,$userid,$server,$shorten) {
global $sql;
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ if (!isset($aeskey)) {
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
+ }
if ($template=='emailnewticket') {
$writerid=$shorten[1];
$shorten=$shorten[0];
diff --git a/web/stuff/global_userdata.php b/web/stuff/global_userdata.php
index a53f7e3a..3d7ec1dd 100644
--- a/web/stuff/global_userdata.php
+++ b/web/stuff/global_userdata.php
@@ -34,6 +34,8 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe .
*/
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
if ($ui->st('w','get')=='se') {
if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['usersettings'])) {
@@ -70,8 +72,6 @@ if ($ui->st('w','get')=='se') {
if ($reseller_id!=0 and $admin_id!=$reseller_id) $reseller_id=$admin_id;
}
$sprache=getlanguagefile('user',$user_language,$reseller_id);
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
$lookUpID=($ui->st('w','get')=='se') ? $user_id : $admin_id;
if ($ui->st('d','get')=='pw') {
if (!$ui->smallletters('action',2,'post')) {
diff --git a/web/stuff/gserver.php b/web/stuff/gserver.php
index 0cd19374..cb3c6527 100644
--- a/web/stuff/gserver.php
+++ b/web/stuff/gserver.php
@@ -39,12 +39,11 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['gserver'])) {
header('Location: admin.php');
die;
}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('gserver',$user_language,$reseller_id);
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$loguserid=$admin_id;
$logusername=getusername($admin_id);
$logusertype="admin";
-$aeskey=$aesfilecvar['aeskey'];
if ($reseller_id==0) {
$logreseller=0;
$logsubuser=0;
@@ -345,7 +344,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$query=$sql->prepare("SELECT `id` FROM `gsswitch` WHERE `rootID`=? AND `serverip`=? AND `port`=? AND `userid`!=? AND `resellerid`=? LIMIT 1");
$query->execute(array($serverid,$serverip,$port,$customer,$reseller_id));
if ($query->rowCount()==0) {
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$gamestring=array();
$template_file='';
$rdata=serverdata('root',$serverid,$aeskey);
@@ -790,7 +789,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$pallowed=($ui->active('pallowed','post')) ? $ui->active('pallowed','post') : 'N';
$ftppass=$ui->password('password',50,'post');
$pallowed=$ui->active('pallowed','post');
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$query=$sql->prepare("SELECT `newlayout`,`userid`,AES_DECRYPT(`ftppassword`,?) AS `ftp`,AES_DECRYPT(`ppassword`,?) AS `ppass`,`active`,`rootID`,`serverip`,`port`,`port2`,`port3`,`port4`,`port5`,`userid`,`slots` FROM `gsswitch` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$aeskey,$server_id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@@ -1018,7 +1017,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
}
}
if (count($gamestring)>0 and $ui->active('type','post')) {
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$gamestring=count($gamestring).'_'.implode('_',$gamestring);
$rdata=serverdata('root',$serverid,$aeskey);
$sship=$rdata['ip'];
@@ -1060,7 +1059,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$rootID=$row['rootID'];
}
if (isset($gsip) and isset($port)) {
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
if ($ui->st('d','get')=='rs') {
$template_file='Restart done';
$cmds=gsrestart($id,'re',$aeskey,$reseller_id);
diff --git a/web/stuff/images.php b/web/stuff/images.php
index 0d140f01..8b4fab35 100644
--- a/web/stuff/images.php
+++ b/web/stuff/images.php
@@ -39,6 +39,7 @@ if ((!isset($admin_id) or !$main == "1") or (isset($admin_id) and !$pa['gimages'
header('Location: admin.php');
die('No acces');
}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('images',$user_language,$reseller_id);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid=$admin_id;
@@ -58,8 +59,6 @@ if ($reseller_id=="0") {
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ex' and $ui->id('id',10,'get')) {
diff --git a/web/stuff/init_admin.php b/web/stuff/init_admin.php
index ec47f8c9..7dda82ae 100644
--- a/web/stuff/init_admin.php
+++ b/web/stuff/init_admin.php
@@ -37,50 +37,130 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-if (!isset($admin_id) or !isset($reseller_id)) redirect('login.php');
-$pa=User_Permissions($admin_id);
-if (!isanyadmin($admin_id) and count($pa)==0) redirect('login.php');
+if (!isset($admin_id) or !isset($reseller_id)) {
+ header('Location: login.php');
+ die;
+}
+
+$pa = User_Permissions($admin_id);
+if (!isanyadmin($admin_id) and count($pa) == 0) {
+ redirect('login.php');
+}
$licenceDetails=serverAmount($reseller_id);
-$gserver_module=(is_numeric($licenceDetails['mG']) and $licenceDetails['mG']==0) ? false : true;
-$vserver_module=(is_numeric($licenceDetails['mVs']) and $licenceDetails['mVs']==0) ? false : true;
-$voserver_module=(is_numeric($licenceDetails['mVo']) and $licenceDetails['mVo']==0) ? false : true;
-$dediserver_module=(is_numeric($licenceDetails['mD']) and $licenceDetails['mD']==0) ? false : true;
-$ewVersions['files']='4.00';
+$gserver_module = (is_numeric($licenceDetails['mG']) and $licenceDetails['mG'] == 0) ? false : true;
+$vserver_module = (is_numeric($licenceDetails['mVs']) and $licenceDetails['mVs'] == 0) ? false : true;
+$voserver_module = (is_numeric($licenceDetails['mVo']) and $licenceDetails['mVo'] == 0) ? false : true;
+$dediserver_module = (is_numeric($licenceDetails['mD']) and $licenceDetails['mD'] == 0) ? false : true;
+
+$ewVersions['files'] = '4.00';
+
$vcsprache=getlanguagefile('versioncheck',$user_language,$reseller_id);
-$query=$sql->prepare("SELECT `version` FROM `easywi_version` ORDER BY `id` DESC LIMIT 1");
+$query = $sql->prepare("SELECT `version` FROM `easywi_version` ORDER BY `id` DESC LIMIT 1");
$query->execute();
-$ewVersions['cVersion']=$query->fetchColumn();
-$query=$sql->prepare("SELECT `version`,`releasenotesDE`,`releasenotesEN` FROM `settings` WHERE `resellerid`=0 LIMIT 1");
+$ewVersions['cVersion'] = $query->fetchColumn();
+
+$query = $sql->prepare("SELECT `version`,`releasenotesDE`,`releasenotesEN` FROM `settings` WHERE `resellerid`=0 LIMIT 1");
$query->execute();
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
- $ewVersions['version']=$row['version'];
- $ewVersions['releasenotesDE']=$row['releasenotesDE'];
- $ewVersions['releasenotesEN']=$row['releasenotesEN'];
+ $ewVersions['version'] = $row['version'];
+ $ewVersions['releasenotesDE'] = $row['releasenotesDE'];
+ $ewVersions['releasenotesEN'] = $row['releasenotesEN'];
}
-if ($reseller_id==0 and $ui->st('w','get')!='vc' and ($ewVersions['cVersion']<$ewVersions['version'] or $ewVersions['files']<$ewVersions['version'])) $toooldversion=$vcsprache->newversion.$ewVersions['version'];
-$query=$sql->prepare("SELECT `name`,`vname`,`lastlogin` FROM `userdata` WHERE `id`=? LIMIT 1");
+
+if ($reseller_id == 0 and $ui->st('w', 'get') != 'vc' and ($ewVersions['cVersion']<$ewVersions['version'] or $ewVersions['files']<$ewVersions['version'])) {
+ $toooldversion = $vcsprache->newversion.$ewVersions['version'];
+}
+
+$query = $sql->prepare("SELECT `name`,`vname`,`lastlogin` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($admin_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
- $great_name=$row['name'];
- $great_vname=$row['vname'];
- if ($row['lastlogin']!=null and $row['lastlogin']!='0000-00-00 00:00:00' and $user_language=='de') $great_last=date('d.m.Y H:i:s',strtotime($row['lastlogin']));
- else if ($row['lastlogin']!=null and $row['lastlogin']!='0000-00-00 00:00:00') $great_last=$row['lastlogin'];
- else if ($user_language=='de') $great_last='Niemals';
- else $great_last='Never';
+ $great_name = $row['name'];
+ $great_vname = $row['vname'];
+ if ($row['lastlogin'] != null and $row['lastlogin'] != '0000-00-00 00:00:00' and $user_language == 'de') {
+ $great_last=date('d.m.Y H:i:s',strtotime($row['lastlogin']));
+ } else if ($row['lastlogin'] != null and $row['lastlogin'] != '0000-00-00 00:00:00') {
+ $great_last = $row['lastlogin'];
+ } else if ($user_language == 'de') {
+ $great_last = 'Niemals';
+ } else {
+ $great_last = 'Never';
+ }
}
-$what_to_be_included_array=array('ro'=>'roots.php',
- 'fe'=>'feeds.php','fn'=>'feeds_entries.php',
- 'ap'=>'api_settings.php','aa'=>'api_external_auth.php','ui'=>'api_import_users.php','jb'=>'jobs_list.php','bu'=>'mysql_root.php',
- 'ma'=>'masterserver.php','gs'=>'gserver.php','ad'=>'addons.php','im'=>'images.php','ea'=>'eac.php',
- 'vc'=>'versioncheck.php','ib'=>'ip_bans.php','se'=>'panel_settings.php','cc'=>'panel_settings_columns.php','sm'=>'panel_settings_email.php','lo'=>'logdata.php','ml'=>'maillog.php','sr'=>'admin_search.php',
- 'us'=>'user.php','ug'=>'user_groups.php',
- 'vu'=>'voice_usage.php','vo'=>'voice.php','vd'=>'voice_tsdns.php','vr'=>'voice_tsdnsrecords.php','vm'=>'voice_master.php',
- 'le'=>'lendserver.php',
- 'ps'=>'page_settings.php','pp'=>'page_pages.php','pn'=>'page_news_edit.php','pc'=>'page_comments.php','pd'=>'page_downloads.php',
- 'ip'=>'imprint.php','su'=>'global_userdata.php',
- 'rh'=>'root_dedicated.php','rd'=>'root_dhcp.php','rp'=>'root_pxe.php','vh'=>'root_virtual_hosts.php','vs'=>'root_virtual_server.php','ot'=>'roots_os_templates.php','tf'=>'traffic.php',
- 'my'=>'mysql_server.php',
- 'ti'=>'tickets.php','tr'=>'tickets_reseller.php'
+
+# https://github.com/easy-wi/developer/issues/61 modules management
+$what_to_be_included_array = array(
+ 'fe' => 'feeds.php', 'fn' => 'feeds_entries.php',
+ 'ap' => 'api_settings.php', 'aa' => 'api_external_auth.php', 'ui' => 'api_import_users.php', 'jb' => 'jobs_list.php', 'bu' => 'mysql_root.php',
+ 'vc' => 'versioncheck.php', 'ib' => 'ip_bans.php', 'se' => 'panel_settings.php', 'cc' => 'panel_settings_columns.php', 'sm' => 'panel_settings_email.php', 'lo' => 'logdata.php', 'ml' => 'maillog.php', 'sr' => 'admin_search.php',
+ 'us' => 'user.php', 'ug' => 'user_groups.php',
+ 'ip' => 'imprint.php', 'su' => 'global_userdata.php'
);
-# hier dann w = 4 buchstaben custom
\ No newline at end of file
+if ($reseller_id == 0) {
+ $what_to_be_included_array['mo'] = 'admin_modules.php';
+ $what_to_be_included_array['ps'] = 'page_settings.php';
+ $what_to_be_included_array['pp'] = 'page_pages.php';
+ $what_to_be_included_array['pn'] = 'page_news_edit.php';
+ $what_to_be_included_array['pc'] = 'page_comments.php';
+ $what_to_be_included_array['pd'] = 'page_downloads.php';
+}
+
+$easywiModules = array('gs' => true, 'ea' => true, 'my' => true, 'ro' => true, 'ti' => true, 'le' => true, 'vo' => true);
+$customModules = array('gs' => array(), 'mo' => array(), 'my' => array(), 'ro' => array(), 'ti' => array(), 'us' => array(), 'vo' => array(), 'pa' => array());
+
+$query = $sql->prepare("SELECT * FROM `modules` WHERE `type` IN ('A','C')");
+$query2 = $sql->prepare("SELECT `text` FROM `translations` WHERE `type`='mo' AND `transID`=? AND `lang`=? LIMIT 1");
+$query->execute();
+foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ if ($row['active'] == 'Y' and $row['type'] == 'A' and is_file(EASYWIDIR.'/stuff/'.$row['file'])) {
+ $query2->execute(array($row['id'], $user_language));
+ $name = $query2->fetchColumn();
+ if (strlen($name) == 0) {
+ $query2->execute(array($row['id'], $rSA['language']));
+ $name = $query2->fetchColumn();
+ }
+ if (strlen($name) == 0) {
+ $name = $row['file'];
+ }
+ $customModules[$row['sub']][$row['get']] = $name;
+ $what_to_be_included_array[$row['get']] = $row['file'];
+ } else if ($row['type'] == 'C' and $row['active'] == 'N') {
+ $easywiModules[$row['get']] = false;
+ }
+}
+if ($easywiModules['gs'] === true) {
+ $what_to_be_included_array['ro'] = 'roots.php';
+ $what_to_be_included_array['ma'] = 'masterserver.php';
+ $what_to_be_included_array['gs'] = 'gserver.php';
+ $what_to_be_included_array['ad'] = 'addons.php';
+ $what_to_be_included_array['im'] = 'images.php';
+}
+if ($easywiModules['ea'] === true) {
+ $what_to_be_included_array['ea'] = 'eac.php';
+}
+if ($easywiModules['my'] === true) {
+ $what_to_be_included_array['my'] = 'mysql_server.php';
+}
+if ($easywiModules['ro'] === true) {
+ $what_to_be_included_array['rh'] = 'root_dedicated.php';
+ $what_to_be_included_array['rd'] = 'root_dhcp.php';
+ $what_to_be_included_array['rp'] = 'root_pxe.php';
+ $what_to_be_included_array['vh'] = 'root_virtual_hosts.php';
+ $what_to_be_included_array['vs'] = 'root_virtual_server.php';
+ $what_to_be_included_array['ot'] = 'roots_os_templates.php';
+ $what_to_be_included_array['tf'] = 'traffic.php';
+}
+if ($easywiModules['ti'] === true) {
+ $what_to_be_included_array['ti'] = 'tickets.php';
+ $what_to_be_included_array['tr'] = 'tickets_reseller.php';
+}
+if ($easywiModules['le'] === true) {
+ $what_to_be_included_array['le'] = 'lendserver.php';
+}
+if ($easywiModules['vo'] === true) {
+ $what_to_be_included_array['vu'] = 'voice_usage.php';
+ $what_to_be_included_array['vo'] = 'voice.php';
+ $what_to_be_included_array['vd'] = 'voice_tsdns.php';
+ $what_to_be_included_array['vr'] = 'voice_tsdnsrecords.php';
+ $what_to_be_included_array['vm'] = 'voice_master.php';
+}
\ No newline at end of file
diff --git a/web/stuff/init_page.php b/web/stuff/init_page.php
index eb21b56c..8703a8d0 100644
--- a/web/stuff/init_page.php
+++ b/web/stuff/init_page.php
@@ -41,7 +41,7 @@
$pages=array();
if (!isset($user_language)) $user_language=$default_language;
$page_sprache=getlanguagefile('page',$user_language,0);
-include(EASYWIDIR.'/stuff/class_page_settings.php');
+include(EASYWIDIR . '/stuff/class_page_settings.php');
if (!isurl($pageurl) or (!isdomain($pageurl) and (!isurl($pageurl)))) $pageurl=$page_url;
$page_data=new PageSettings($user_language,$pageurl,$seo);
$query=$sql->prepare("SELECT `active`,`activeGS`,`activeVS` FROM `lendsettings` WHERE `resellerid`=0 LIMIT 1");
diff --git a/web/stuff/init_user.php b/web/stuff/init_user.php
index 87847b2e..287eac11 100644
--- a/web/stuff/init_user.php
+++ b/web/stuff/init_user.php
@@ -45,76 +45,109 @@ $pa=User_Permissions($user_id);
# https://github.com/easy-wi/developer/issues/2
if (isset($_SESSION['sID'])) {
- $substituteAccess=array('gs'=>array(),'db'=>array(),'vo'=>array(),'vd'=>array(),'vs'=>array(),'ro'=>array());
- $query=$sql->prepare("SELECT `oID`,`oType` FROM `userdata_substitutes_servers` WHERE `sID`=?");
- $query->execute(array($_SESSION['sID']));
- foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) $substituteAccess[$row['oType']][]=$row['oID'];
- $query=$sql->prepare("SELECT `name`,`vname`,`lastlogin` FROM `userdata_substitutes` WHERE `sID`=? LIMIT 1");
+ $substituteAccess = array('gs'=>array(),'db'=>array(),'vo'=>array(),'vd'=>array(),'vs'=>array(),'ro'=>array());
+ $query = $sql->prepare("SELECT `oID`,`oType` FROM `userdata_substitutes_servers` WHERE `sID`=?");
$query->execute(array($_SESSION['sID']));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
- $great_name=$row['name'];
- $great_vname=$row['vname'];
- $lastlogin=$row['lastlogin'];
+ $substituteAccess[$row['oType']][] = $row['oID'];
}
- $gscount=count($substituteAccess['gs']);
- $voicecount=count($substituteAccess['vo']);
- $tsdnscount=count($substituteAccess['vd']);
- $dbcount=count($substituteAccess['db']);
- $rootcount=count($substituteAccess['ro']);
- $virtualcount=count($substituteAccess['vs']);
+ $query = $sql->prepare("SELECT `name`,`vname`,`lastlogin` FROM `userdata_substitutes` WHERE `sID`=? LIMIT 1");
+ $query->execute(array($_SESSION['sID']));
+ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ $great_name = $row['name'];
+ $great_vname = $row['vname'];
+ $lastlogin = $row['lastlogin'];
+ }
+ $gscount = count($substituteAccess['gs']);
+ $voicecount = count($substituteAccess['vo']);
+ $tsdnscount = count($substituteAccess['vd']);
+ $dbcount = count($substituteAccess['db']);
+ $rootcount = count($substituteAccess['ro']);
+ $virtualcount = count($substituteAccess['vs']);
} else {
- $query=$sql->prepare("SELECT `name`,`vname`,`lastlogin` FROM `userdata` WHERE `id`=? LIMIT 1");
+ $query = $sql->prepare("SELECT `name`,`vname`,`lastlogin` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($user_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
- $great_name=$row['name'];
- $great_vname=$row['vname'];
- $lastlogin=$row['lastlogin'];
+ $great_name = $row['name'];
+ $great_vname = $row['vname'];
+ $lastlogin = $row['lastlogin'];
}
- $query=$sql->prepare("SELECT COUNT(g.`id`) AS `amount` FROM `gsswitch` g INNER JOIN `rserverdata` r ON g.`rootID`=r.`id` WHERE r.`active`='Y' AND g.`active`='Y' AND g.`userid`=? LIMIT 1");
+ $query = $sql->prepare("SELECT COUNT(g.`id`) AS `amount` FROM `gsswitch` g INNER JOIN `rserverdata` r ON g.`rootID`=r.`id` WHERE r.`active`='Y' AND g.`active`='Y' AND g.`userid`=? LIMIT 1");
$query->execute(array($user_id));
- $gscount=$query->fetchColumn();
- $query=$sql->prepare("SELECT COUNT(v.`id`) AS `amount` FROM `voice_server` v INNER JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`userid`=? LIMIT 1");
+ $gscount = $query->fetchColumn();
+ $query = $sql->prepare("SELECT COUNT(v.`id`) AS `amount` FROM `voice_server` v INNER JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`userid`=? LIMIT 1");
$query->execute(array($user_id));
- $voicecount=$query->fetchColumn();
- $query=$sql->prepare("SELECT COUNT(e.`id`) AS `amount` FROM `mysql_external_dbs` e INNER JOIN `mysql_external_servers` s ON e.`sid`=s.`id` WHERE e.`active`='Y' AND s.`active`='Y' AND e.`uid`=? LIMIT 1");
+ $voicecount = $query->fetchColumn();
+ $query = $sql->prepare("SELECT COUNT(e.`id`) AS `amount` FROM `mysql_external_dbs` e INNER JOIN `mysql_external_servers` s ON e.`sid`=s.`id` WHERE e.`active`='Y' AND s.`active`='Y' AND e.`uid`=? LIMIT 1");
$query->execute(array($user_id));
- $dbcount=$query->fetchColumn();
- $query=$sql->prepare("SELECT COUNT(d.`dnsID`) AS `amount` FROM `voice_dns` d INNER JOIN `voice_tsdns` s ON d.`tsdnsID`=s.`id` WHERE d.`active`='Y' AND s.`active`='Y' AND d.`userID`=? LIMIT 1");
+ $dbcount = $query->fetchColumn();
+ $query = $sql->prepare("SELECT COUNT(d.`dnsID`) AS `amount` FROM `voice_dns` d INNER JOIN `voice_tsdns` s ON d.`tsdnsID`=s.`id` WHERE d.`active`='Y' AND s.`active`='Y' AND d.`userID`=? LIMIT 1");
$query->execute(array($user_id));
- $tsdnscount=$query->fetchColumn();
- $query=$sql->prepare("SELECT COUNT(`dedicatedID`) AS `amount` FROM `rootsDedicated` WHERE `active`='Y' AND `userID`=? LIMIT 1");
+ $tsdnscount = $query->fetchColumn();
+ $query = $sql->prepare("SELECT COUNT(`dedicatedID`) AS `amount` FROM `rootsDedicated` WHERE `active`='Y' AND `userID`=? LIMIT 1");
$query->execute(array($user_id));
- $rootcount=$query->fetchColumn();
- $query=$sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `virtualcontainer` WHERE `active`='Y' AND `userid`=? LIMIT 1");
+ $rootcount = $query->fetchColumn();
+ $query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `virtualcontainer` WHERE `active`='Y' AND `userid`=? LIMIT 1");
$query->execute(array($user_id));
- $virtualcount=$query->fetchColumn();
+ $virtualcount = $query->fetchColumn();
+}
+if ($lastlogin!=null and $lastlogin!='0000-00-00 00:00:00' and $user_language=='de') {
+ $great_last=date('d.m.Y H:m:s',strtotime($lastlogin));
+} else if ($lastlogin!=null and $lastlogin!='0000-00-00 00:00:00') {
+ $great_last = $lastlogin;
+} else if ($user_language == 'de') {
+ $great_last='Niemals';
+} else {
+ $great_last='Never';
}
-if ($lastlogin!=null and $lastlogin!='0000-00-00 00:00:00' and $user_language=='de') $great_last=date('d.m.Y H:m:s',strtotime($lastlogin));
-else if ($lastlogin!=null and $lastlogin!='0000-00-00 00:00:00') $great_last=$lastlogin;
-else if ($user_language=='de') $great_last='Niemals';
-else $great_last='Never';
-# basic controler array. available at any time to anyone
-$what_to_be_included_array=array('ip'=>'imprint.php','lo'=>'userpanel_logdata.php','ti'=>'userpanel_tickets.php');
+# https://github.com/easy-wi/developer/issues/61
+# basic modules array. available at any time to anyone
+$what_to_be_included_array = array('ip'=>'imprint.php','lo'=>'userpanel_logdata.php','ti'=>'userpanel_tickets.php');
-# controlers meant only for user only
+
+$easywiModules = array('gs' => true, 'my' => true, 'ro' => true, 'ti' => true, 'le' => true, 'vo' => true);
+$customModules = array('gs' => array(), 'mo' => array(), 'my' => array(), 'ro' => array(), 'ti' => array(), 'us' => array(), 'vo' => array());
+
+$query = $sql->prepare("SELECT * FROM `modules` WHERE `type` IN ('U','C')");
+$query2 = $sql->prepare("SELECT `text` FROM `translations` WHERE `type`='mo' AND `transID`=? AND `lang`=? LIMIT 1");
+$query->execute();
+foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ if ($row['active'] == 'Y' and $row['type'] == 'U' and is_file(EASYWIDIR.'/stuff/'.$row['file'])) {
+ $query2->execute(array($row['id'], $user_language));
+ $name = $query2->fetchColumn();
+ if (strlen($name) == 0) {
+ $query2->execute(array($row['id'], $rSA['language']));
+ $name = $query2->fetchColumn();
+ }
+ if (strlen($name) == 0) {
+ $name = $row['file'];
+ }
+ $customModules[$row['sub']][$row['get']] = $name;
+ $what_to_be_included_array[$row['get']] = $row['file'];
+ } else if ($row['type'] == 'C' and $row['active'] == 'N') {
+ $easywiModules[$row['get']] = false;
+ }
+}
+
+# modules meant only for user only
if (!isset($_SESSION['sID'])) {
- $what_to_be_included_array['su']='userpanel_substitutes.php';
- $what_to_be_included_array['se']='global_userdata.php';
+ $what_to_be_included_array['su'] = 'userpanel_substitutes.php';
+ $what_to_be_included_array['se'] = 'global_userdata.php';
}
-# controler based on count. No servers, no controler
-if ($gscount>0) {
- $what_to_be_included_array['gs']='userpanel_gserver.php';
- $what_to_be_included_array['fd']='userpanel_fdl.php';
- $what_to_be_included_array['ao']='userpanel_ao.php';
- $what_to_be_included_array['ca']='userpanel_restartcalendar.php';
- $what_to_be_included_array['pr']='userpanel_protectionmode.php';
- $what_to_be_included_array['bu']='userpanel_backup.php';
- $what_to_be_included_array['ms']='userpanel_migration.php';
+# modules based on count. No servers, no modules
+if ($gscount > 0 and $easywiModules['gs'] === true) {
+ $what_to_be_included_array['gs'] = 'userpanel_gserver.php';
+ $what_to_be_included_array['fd'] = 'userpanel_fdl.php';
+ $what_to_be_included_array['ao'] = 'userpanel_ao.php';
+ $what_to_be_included_array['ca'] = 'userpanel_restartcalendar.php';
+ $what_to_be_included_array['pr'] = 'userpanel_protectionmode.php';
+ $what_to_be_included_array['bu'] = 'userpanel_backup.php';
+ $what_to_be_included_array['ms'] = 'userpanel_migration.php';
}
-if ($voicecount>0) $what_to_be_included_array['vo']='userpanel_voice.php';
-if ($tsdnscount>0) $what_to_be_included_array['vd']='userpanel_voice_dns.php';
-if ($rootcount>0) $what_to_be_included_array['de']='userpanel_dedicated.php';
-if ($virtualcount>0) $what_to_be_included_array['vm']='userpanel_virtual.php';
-if ($dbcount>0) $what_to_be_included_array['my']='userpanel_mysql.php';
\ No newline at end of file
+if ($voicecount > 0 and $easywiModules['vo'] === true) $what_to_be_included_array['vo'] = 'userpanel_voice.php';
+if ($tsdnscount > 0 and $easywiModules['vo'] === true) $what_to_be_included_array['vd'] = 'userpanel_voice_dns.php';
+if ($rootcount > 0 and $easywiModules['ro'] === true) $what_to_be_included_array['de'] = 'userpanel_dedicated.php';
+if ($virtualcount > 0 and $easywiModules['ro'] === true) $what_to_be_included_array['vm'] = 'userpanel_virtual.php';
+if ($dbcount > 0 and $easywiModules['my'] === true) $what_to_be_included_array['my'] = 'userpanel_mysql.php';
\ No newline at end of file
diff --git a/web/stuff/lendserver.php b/web/stuff/lendserver.php
index c012f68e..65c47fc9 100644
--- a/web/stuff/lendserver.php
+++ b/web/stuff/lendserver.php
@@ -39,6 +39,9 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and (!isset($pa) or (!$
redirect('Location: admin.php');
die;
}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/ssh_exec.php');
+include(EASYWIDIR . '/stuff/class_voice.php');
$sprache=getlanguagefile('lendserver',$user_language,$reseller_id);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid=$admin_id;
@@ -51,10 +54,6 @@ if ($reseller_id==0) {
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
$logreseller=0;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
-include(EASYWIDIR.'/stuff/ssh_exec.php');
-include(EASYWIDIR.'/stuff/class_voice.php');
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=="se" and $pa['lendserverSettings']) {
diff --git a/web/stuff/logdata.php b/web/stuff/logdata.php
index a7886cec..a1c72d54 100644
--- a/web/stuff/logdata.php
+++ b/web/stuff/logdata.php
@@ -107,8 +107,8 @@ foreach ($pselect->fetchall() as $row) {
$placeholders=array('%%','%add%','%dl%','%del%','%mod%','%start%','%restart%','%stop%','%upd%','%fail%','%ok%','%psw%','%cfg%','%import%','%reinstall%','%backup%','%use%');
$replace=array('',$gsprache->add.': ',$gsprache->del.': ',$gsprache->del.': ',$gsprache->mod.': ',$gsprache->start.': ',$gsprache->start.': ',$gsprache->stop.': ',$gsprache->update.': ','','',$gssprache->password.': ',$gssprache->config.': ',$gsprache->import.': ',$gssprache->reinstall.': ',$gsprache->backup,$gsprache->use.': ');
$replacedpics=str_replace($placeholders,$replace,$useraction);
- $placeholders=array('%voserver%','%gserver%','%user%','%group%','%fastdl%','%master%','%user%','%root%','%addon%','%settings%','%vserver%','%ticket_subject%','%reseller%','%virtual%','%eac%','%resync%','%virtualimage%','%template%','%voserver%','%emailsettings%','%dns%','%tsdns%','%pmode%','%comment%');
- $replace=array($gsprache->voiceserver,$gsprache->gameserver,$gsprache->user,$gsprache->groups,$gsprache->fastdownload,$gsprache->master,$gsprache->user,$gsprache->root,$gsprache->addon2,$gsprache->settings,$gsprache->virtual,$gsprache->support,$gsprache->reseller,$gsprache->hostsystem,'Easy Anti Cheat',$gssprache->resync,$gsprache->virtual.' '.$gsprache->template,$gsprache->template,$gsprache->voiceserver,'E-Mail '.$gsprache->settings,'TSDNS','TSDNS',$gssprache->protect,$gsprache->comments);
+ $placeholders=array('%modules%','%voserver%','%gserver%','%user%','%group%','%fastdl%','%master%','%user%','%root%','%addon%','%settings%','%vserver%','%ticket_subject%','%reseller%','%virtual%','%eac%','%resync%','%virtualimage%','%template%','%voserver%','%emailsettings%','%dns%','%tsdns%','%pmode%','%comment%');
+ $replace=array($gsprache->modules,$gsprache->voiceserver,$gsprache->gameserver,$gsprache->user,$gsprache->groups,$gsprache->fastdownload,$gsprache->master,$gsprache->user,$gsprache->root,$gsprache->addon2,$gsprache->settings,$gsprache->virtual,$gsprache->support,$gsprache->reseller,$gsprache->hostsystem,'Easy Anti Cheat',$gssprache->resync,$gsprache->virtual.' '.$gsprache->template,$gsprache->template,$gsprache->voiceserver,'E-Mail '.$gsprache->settings,'TSDNS','TSDNS',$gssprache->protect,$gsprache->comments);
$replacedwords=str_replace($placeholders,$replace,$replacedpics);
$logdate=explode(' ', $row['logdate']);
$table[]=array('logday'=>$logdate[0],'loghour'=>$logdate[1],'ip'=>$ip,'hostname'=>$hostname,'username'=>$username,'useraction'=>$replacedwords);
diff --git a/web/stuff/masterserver.php b/web/stuff/masterserver.php
index 3025359d..c734a668 100644
--- a/web/stuff/masterserver.php
+++ b/web/stuff/masterserver.php
@@ -39,8 +39,10 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['masterServer'
header('Location: admin.php');
die('No acces');
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/class_masterserver.php');
+
$sprache=getlanguagefile('roots',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
@@ -55,12 +57,11 @@ if ($reseller_id==0) {
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
-include(EASYWIDIR.'/stuff/class_masterserver.php');
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ad') {
if ($ui->smallletters('action',2,'post')=='ad'){
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$serverid=$ui->id('id',10,'get');
$rootServer=new masterServer($serverid,$aeskey);
if($ui->id('id',19,'post')) {
@@ -111,7 +112,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
} else if ($ui->st('d','get')=='dl' and $ui->id('id',19,'get')) {
if ($ui->smallletters('action',2,'post')=='dl'){
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$serverid=$ui->id('id',19,'get');
$rdata=serverdata('root',$serverid,$aeskey);
$sship=$rdata['ip'];
@@ -163,7 +164,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
} else if ($ui->st('d','get')=='md'){
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$o=$ui->st('o','get');
if ($ui->st('o','get')=='ar') {
$orderby='`resellerid` ASC';
diff --git a/web/stuff/mysql_root.php b/web/stuff/mysql_root.php
index 34da24ad..679fb4b5 100644
--- a/web/stuff/mysql_root.php
+++ b/web/stuff/mysql_root.php
@@ -44,7 +44,7 @@ if (!isset($admin_id) or $main!=1 or $reseller_id!=0 or !$pa['root']) {
if ($ui->st('d','get')=='bu' and $ui->st('action','post')=='bu') {
$createBackup=true;
- include(EASYWIDIR.'/stuff/mysql_backup_class.php');
+ include(EASYWIDIR . '/stuff/mysql_backup_class.php');
$theBackup=new createDBDump($dbConnect['db'],$ewVersions['version'],$sql);
header('Content-type: application/sql; charset=utf-8');
header('Content-Description: Downloaded File');
@@ -73,11 +73,11 @@ if ($ui->st('d','get')=='bu' and $ui->st('action','post')=='bu') {
$sql->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING);
if (!isset($alreadyRepaired)) {
$response->add('Adding tables if needed.');
- include(EASYWIDIR.'/stuff/tables_add.php');
+ include(EASYWIDIR . '/stuff/tables_add.php');
}
if (!isset($alreadyRepaired)) {
$response->add('Repairing tables if needed.');
- include(EASYWIDIR.'/stuff/tables_repair.php');
+ include(EASYWIDIR . '/stuff/tables_repair.php');
}
$template_file=$response->printresponse();
} else {
diff --git a/web/stuff/mysql_server.php b/web/stuff/mysql_server.php
index 9cc0dd97..61c3bbfc 100644
--- a/web/stuff/mysql_server.php
+++ b/web/stuff/mysql_server.php
@@ -39,9 +39,10 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['mysql_setting
header('Location: login.php');
die;
}
-include(EASYWIDIR.'/stuff/mysql_functions.php');
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+
+include(EASYWIDIR . '/stuff/mysql_functions.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('mysql',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
diff --git a/web/stuff/page_register.php b/web/stuff/page_register.php
index de7f348a..4e50c391 100644
--- a/web/stuff/page_register.php
+++ b/web/stuff/page_register.php
@@ -152,8 +152,7 @@ if (isset($registration) and in_array($registration,array('A','M','D'))) {
// personal Salt and activation md5
$userSalt=md5(date('Y-d-m H:i:s u').md5(mt_rand()));
$activeHash=uniqid();
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
// insert data
$query=$sql->prepare("INSERT INTO `userdata` (`accounttype`,`active`,`mail`,`token`,`creationTime`,`updateTime`,`salutation`,`country`,`name`,`vname`,`birthday`,`phone`,`fax`,`handy`,`city`,`cityn`,`street`,`streetn`) VALUES ('u','R',?,?,NOW(),NOW(),?,?,?,?,?,?,?,?,?,?,?,?)");
diff --git a/web/stuff/panel_settings.php b/web/stuff/panel_settings.php
index 644c8bbb..57502302 100644
--- a/web/stuff/panel_settings.php
+++ b/web/stuff/panel_settings.php
@@ -1,4 +1,5 @@
w('action',4,'post') and !token(true)) {
$pinsert=$sql->prepare("INSERT INTO `virtualhosts` (`active`,`esxi`,`ip`,`port`,`user`,`pass`,`os`,`description`,`publickey`,`keyname`,`cpu`,`cores`,`mhz`,`ram`,`maxserver`,`thin`,`thinquota`,`resellerid`) VALUES (:active, :esxi, :ip, AES_ENCRYPT(:port, :aeskey),AES_ENCRYPT(:user, :aeskey),AES_ENCRYPT(:pass, :aeskey),:os, :description, :publickey, :keyname, :cpu, :cores, :mhz, :ram, :maxserver, :thin, :thinquota, :reseller)");
$pinsert->execute(array(':active'=>$active,':esxi'=>$esxi,':ip'=>$ip,':port'=>$port,':aeskey'=>$aeskey,':user'=>$user,':pass'=>$pass,':os'=>$os,':description'=>$description,':publickey'=>$publickey,':keyname'=>$keyname, ':cpu'=>$cpu, ':cores'=>$cores,':mhz'=>$mhz,':ram'=>$ram,':maxserver'=>$maxserver,':thin'=>$thin,':thinquota'=>$thinquota,':reseller'=>$reseller));
$serverid=$sql->lastInsertId();
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$uidb=ssh2_execute('vh',$serverid,'cd /vmfs/volumes; S=""; for U in `ls -la | grep "drwxr-xr-t" | awk \'{print $9}\'`; do C=`vmkfstools -Ph $U 2> /dev/null | grep "Capacity" | awk \'{print $2$3}\'`; S="$S$U:$C;"; done; for U in `ls -la | grep "drwxrwxrwx" | awk \'{print $9}\'`; do C=`vmkfstools -Ph $U 2> /dev/null | grep "Capacity" | awk \'{print $2$3}\'`; S="$S$U:$C;"; done; echo $S');
if ($uidb!="" and $uidb!==false) {
$uiddata=explode(";",$uidb);
diff --git a/web/stuff/root_virtual_server.php b/web/stuff/root_virtual_server.php
index e09fd777..fe37b359 100644
--- a/web/stuff/root_virtual_server.php
+++ b/web/stuff/root_virtual_server.php
@@ -40,8 +40,9 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['addvserver']
header('Location: admin.php');
die;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
diff --git a/web/stuff/roots.php b/web/stuff/roots.php
index 22f392cd..ea62da37 100644
--- a/web/stuff/roots.php
+++ b/web/stuff/roots.php
@@ -38,8 +38,9 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['roots'])) {
header('Location: admin.php');
die('No acces');
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('roots',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
diff --git a/web/stuff/roots_os_templates.php b/web/stuff/roots_os_templates.php
index 0e1701e3..858af632 100644
--- a/web/stuff/roots_os_templates.php
+++ b/web/stuff/roots_os_templates.php
@@ -41,8 +41,9 @@ if (!isset($admin_id) or $main!=1 or $reseller_id!=0 or !$pa['resellertemplates'
header('Location: admin.php');
die;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
diff --git a/web/stuff/settings.php b/web/stuff/settings.php
index 81e0bb59..0c0b9397 100644
--- a/web/stuff/settings.php
+++ b/web/stuff/settings.php
@@ -42,18 +42,15 @@ if (isset($_SERVER['QUERY_STRING'])) {
}
$ui=new ValidateUserinput($_GET,$_POST,$_SERVER,array(),$_ENV);
unset($_GET,$_POST,$_SERVER,$_ENV);
-$panelcfgcvars=getconfigcvars(EASYWIDIR."/stuff/config.php");
-$dbConnect['type']=$panelcfgcvars['databanktype'];
-$dbConnect['host']=$panelcfgcvars['host'];
-$dbConnect['db']=$panelcfgcvars['db'];
-$dbConnect['user']=$panelcfgcvars['user'];
-$dbConnect['pwd']=$panelcfgcvars['pwd'];
-$captcha=$panelcfgcvars['captcha'];
-$title=$panelcfgcvars['title'];
+include(EASYWIDIR . '/stuff/config.php');
$ewCfg['captcha']=$captcha;
$ewCfg['title']=$title;
-$dbConnect['debug']=0;
-if (isset($panelcfgcvars['debug']) and $panelcfgcvars['debug']==1) {
+$dbConnect['type']=(!isset($type) or $type == '') ? 'mysql' : $type;
+$dbConnect['host']=$host;
+$dbConnect['user']=$user;
+$dbConnect['pwd']=$pwd;
+$dbConnect['db']=$db;
+if (isset($debug) and $debug==1) {
$dbConnect['debug']=1;
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
@@ -207,8 +204,8 @@ if ($loguserip!='localhost') {
$default_language=(!empty($user_language)) ? $user_language : $rSA['language'];
if (!isset($user_language) or empty($user_language)) $user_language=$default_language;
$_SESSION['language']=$user_language;
- $gsprache=(isset($reseller_id)) ? getlanguagefile('general',$default_language,$reseller_id) : getlanguagefile('general',$default_language,0);
- $spracheResponse=(isset($reseller_id)) ? getlanguagefile('response',$default_language,$reseller_id) : getlanguagefile('response',$default_language,0);
+ $gsprache=(isset($reseller_id)) ? getlanguagefile('general',$user_language,$reseller_id) : getlanguagefile('general',$user_language,0);
+ $spracheResponse=(isset($reseller_id)) ? getlanguagefile('response',$user_language,$reseller_id) : getlanguagefile('response',$user_language,0);
}
if (isset($logininclude) and $logininclude==true) {
$query=$sql->prepare("DELETE FROM `badips` WHERE `bantime` <= ?");
@@ -228,21 +225,8 @@ if($ui->st('r','get')) {
$r=$ui->st('r','get');
$pagename=$ui->escaped('SCRIPT_NAME','server');
$header=' ';
- if (!isset($user_language)) {
- $user_language=$rSA['language'];
- }
- if (isset($user_language) and is_file("languages/$template_to_use/$user_language/redirect.xml")) {
- $rsprache=simplexml_load_file("languages/$template_to_use/$user_language/redirect.xml");
- } else if (isset($user_language) and is_file("languages/default/$user_language/redirect.xml")) {
- $rsprache=simplexml_load_file("languages/default/$user_language/redirect.xml");
- } else if (isset($user_language) and is_file("languages/$user_language/redirect.xml")) {
- $rsprache=simplexml_load_file("languages/$user_language/redirect.xml");
- } else if (is_file("languages/default/$default_language/redirect.xml")) {
- $rsprache=simplexml_load_file("languages/default/$default_language/redirect.xml");
- } else {
- $user_language=$default_language;
- $rsprache=simplexml_load_file("languages/$default_language/redirect.xml");
- }
+ if (!isset($user_language)) $user_language=$rSA['language'];
+ $rsprache=getlanguagefile('redirect',$user_language,0);
$text=$rsprache->refresh;
}
if($ui->username('distro','50','get')) $get_distro=$ui->username('distro','50','get');
diff --git a/web/stuff/tables_add.php b/web/stuff/tables_add.php
index bcbce352..27a32aa6 100644
--- a/web/stuff/tables_add.php
+++ b/web/stuff/tables_add.php
@@ -422,6 +422,19 @@ $query="CREATE TABLE IF NOT EXISTS `mail_log` (
$add=$sql->prepare($query);
$add->execute();
+#https://github.com/easy-wi/developer/issues/61 add module management
+$query="CREATE TABLE IF NOT EXISTS `modules` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `get` varchar(255) NOT NULL,
+ `file` varchar(255) NOT NULL,
+ `sub` varchar(2) NOT NULL,
+ `active` enum('Y','N') DEFAULT 'Y',
+ `type` enum('A','C','P','U') DEFAULT 'A',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1001;";
+$add=$sql->prepare($query);
+$add->execute();
+
#https://github.com/easy-wi/developer/issues/42 column description added
$query="CREATE TABLE IF NOT EXISTS `mysql_external_dbs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
diff --git a/web/stuff/tables_repair.php b/web/stuff/tables_repair.php
index 46b17a58..d4a948c0 100644
--- a/web/stuff/tables_repair.php
+++ b/web/stuff/tables_repair.php
@@ -395,6 +395,15 @@ $defined['mail_log']=array('id'=>array("Type"=>"bigint(19) unsigned","Null"=>"NO
'resellerid'=>array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"MUL","Default"=>"0","Extra"=>"")
);
+#https://github.com/easy-wi/developer/issues/61 add module management
+$defined['modules']=array('id'=>array("Type"=>"int(10) unsigned","Null"=>"NO","Key"=>"PRI","Default"=>"","Extra"=>"auto_increment"),
+ 'get'=>array("Type"=>"varchar(255)","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
+ 'file'=>array("Type"=>"varchar(255)","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
+ 'sub'=>array("Type"=>"varchar(2)","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
+ 'active'=>array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"Y","Extra"=>""),
+ 'type'=>array("Type"=>"enum('A','C','P','U')","Null"=>"YES","Key"=>"","Default"=>"A","Extra"=>"")
+);
+
#https://github.com/easy-wi/developer/issues/42 column description added
$defined['mysql_external_dbs']=array('id'=>array("Type"=>"int(10) unsigned","Null"=>"NO","Key"=>"PRI","Default"=>"","Extra"=>"auto_increment"),
'active'=>array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"Y","Extra"=>""),
diff --git a/web/stuff/traffic.php b/web/stuff/traffic.php
index 9678df5c..8c6d89e8 100644
--- a/web/stuff/traffic.php
+++ b/web/stuff/traffic.php
@@ -40,8 +40,9 @@ if(!isset($admin_id) or !$main == "1" or (isset($admin_id) and !$pa['traffic']))
}
$sprache=getlanguagefile('traffic',$user_language,$reseller_id);
if ($d=='se' and $reseller_id==0) {
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if (isset($ui->post['type']) and $ui->w('action',4,'post')=='md') {
diff --git a/web/stuff/user.php b/web/stuff/user.php
index 95b133ff..abdf30b9 100644
--- a/web/stuff/user.php
+++ b/web/stuff/user.php
@@ -38,7 +38,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['user'] and !$
header('Location: admin.php');
die();
}
-include(EASYWIDIR.'/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache=getlanguagefile('user',$user_language,$reseller_id);
$rsprache=getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid=$admin_id;
diff --git a/web/stuff/userpanel_ao.php b/web/stuff/userpanel_ao.php
index 68de7aa9..65ea3201 100644
--- a/web/stuff/userpanel_ao.php
+++ b/web/stuff/userpanel_ao.php
@@ -61,9 +61,8 @@ if (isset($admin_id)) {
$logsubuser=0;
}
if ($ui->id('id',10,'get') and $ui->id('adid',10,'get') and in_array($ui->smallletters('action',2,'get'),array('ad','dl')) and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
- include(EASYWIDIR.'/stuff/ssh_exec.php');
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$gameserverid=$ui->id('id',19,'get');
$addonid=$ui->id('adid',10,'get');
$action=$ui->smallletters('action',2,'get');
diff --git a/web/stuff/userpanel_backup.php b/web/stuff/userpanel_backup.php
index 0ce2e05d..deed1941 100644
--- a/web/stuff/userpanel_backup.php
+++ b/web/stuff/userpanel_backup.php
@@ -43,8 +43,7 @@ if (isset($admin_id) and $reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
$customer=getusername($user_id);
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
$id=(int)$ui->id('id',10,'get');
$query=$sql->prepare("SELECT g.`serverip`,g.`port`,g.`rootID`,g.`newlayout`,s.`map`,t.`shorten`,AES_DECRYPT(g.`ftppassword`,?) AS `dftppassword`,u.`cname`,AES_DECRYPT(u.`ftpbackup`,?) AS `ftp` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` LEFT JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
@@ -65,7 +64,7 @@ if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id
if (!$ui->w('action',3,'post')) {
$template_file="userpanel_gserver_backup.tpl";
} else if ($ui->w('action',3,'post')=='mb'){
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
@@ -96,7 +95,7 @@ if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id
}
$template_file="userpanel_gserver_backup_rb.tpl";
} else if ($ui->w('action',3,'post')=='rb2' and $ui->gamestring('template','post')){
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
diff --git a/web/stuff/userpanel_dedicated.php b/web/stuff/userpanel_dedicated.php
index 48f4e0dd..6a5771ae 100644
--- a/web/stuff/userpanel_dedicated.php
+++ b/web/stuff/userpanel_dedicated.php
@@ -41,6 +41,9 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
header('Location: userpanel.php');
die('No acces');
}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid=$user_id;
$logusername=getusername($user_id);
@@ -50,8 +53,6 @@ $logsubuser=0;
if (isset($admin_id)) $logsubuser=$admin_id;
else if (isset($subuser_id)) $logsubuser=$subuser_id;
if (isset($admin_id) and $reseller_id!=0) $reseller_id=$admin_id;
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ri'and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['ro']))) {
diff --git a/web/stuff/userpanel_gserver.php b/web/stuff/userpanel_gserver.php
index 21e2a41e..75b77010 100644
--- a/web/stuff/userpanel_gserver.php
+++ b/web/stuff/userpanel_gserver.php
@@ -38,6 +38,10 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
header('Location: userpanel.php');
die('No acces');
}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/ssh_exec.php');
+
$sprache=getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid=$user_id;
$logusername=getusername($user_id);
@@ -54,9 +58,6 @@ if (isset($admin_id)) {
if (isset($admin_id) and $reseller_id!=0) {
$reseller_id=$admin_id;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
-include(EASYWIDIR.'/stuff/ssh_exec.php');
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ri' and !$ui->id('id',10,'get')) {
diff --git a/web/stuff/userpanel_migration.php b/web/stuff/userpanel_migration.php
index 9c19079f..56c589b8 100644
--- a/web/stuff/userpanel_migration.php
+++ b/web/stuff/userpanel_migration.php
@@ -41,9 +41,10 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
header('Location: userpanel.php');
die;
}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('gserver',$user_language,$reseller_id);
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
$loguserid=$user_id;
$logusername=getusername($user_id);
$logusertype="user";
@@ -202,7 +203,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (!in_array($sprache->ftp_port,$error)) $error[]=$sprache->ftp_port;
}
if (count($error)==0 and isset($rootID)) {
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
diff --git a/web/stuff/userpanel_mysql.php b/web/stuff/userpanel_mysql.php
index c971552e..39fbe390 100644
--- a/web/stuff/userpanel_mysql.php
+++ b/web/stuff/userpanel_mysql.php
@@ -38,13 +38,14 @@ if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['mysql'])) {
header('Location: userpanel.php');
die;
}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('mysql',$user_language,$reseller_id);
$loguserid=$user_id;
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if (isset($admin_id)) {
$logsubuser=$admin_id;
} else if (isset($subuser_id)) {
@@ -74,7 +75,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$template_file=(isset($dbname)) ? 'userpanel_mysql_db_md.tpl' : 'userpanel_404.tpl';
} else if ($ui->smallletters('action',2,'post')=='md'){
if ($ui->password('password',40,'post')) {
- include(EASYWIDIR.'/stuff/mysql_functions.php');
+ include(EASYWIDIR . '/stuff/mysql_functions.php');
$password=$ui->password('password',40,'post');
$ips=$ui->ips('ips','post');
$query=$sql->prepare("SELECT e.`dbname`,AES_DECRYPT(e.`password`,?) AS `decryptedpassword`,e.`ips`,e.`max_queries_per_hour`,e.`max_connections_per_hour`,e.`max_updates_per_hour`,e.`max_userconnections_per_hour`,s.`ip`,AES_DECRYPT(s.`password`,?) AS `decryptedpassword2`,s.`port`,s.`user`,u.`cname` FROM `mysql_external_dbs` e LEFT JOIN `mysql_external_servers` s ON e.`sid`=s.`id` LEFT JOIN `userdata` u ON e.`uid`=u.`id` WHERE e.`id`=? AND e.`active`='Y' AND s.`active`='Y' AND e.`uid`=? AND e.`resellerid`=? LIMIT 1");
diff --git a/web/stuff/userpanel_protectionmode.php b/web/stuff/userpanel_protectionmode.php
index dfb5d026..3e95ef82 100644
--- a/web/stuff/userpanel_protectionmode.php
+++ b/web/stuff/userpanel_protectionmode.php
@@ -34,7 +34,13 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe .
*/
-if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id',10,'get')) redirect('userpanel.php');
+if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id',10,'get')) {
+ header('Location: userpanel.php');
+ die;
+}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid=$user_id;
$logusername=getusername($user_id);
@@ -48,8 +54,6 @@ if (isset($admin_id)) {
$logsubuser=0;
}
if (isset($admin_id) and $reseller_id!=0 and $admin_id!=$reseller_id) $reseller_id=$admin_id;
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
$files=array();
$query=$sql->prepare("SELECT g.*,AES_DECRYPT(g.`ftppassword`,?) AS `dftppassword`,AES_DECRYPT(g.`ppassword`,?) AS `dpftppassword`,t.`protected` AS `tpallowed`,t.`shorten`,t.`protectedSaveCFGs`,t.`gamebinary`,t.`binarydir`,t.`modfolder`,u.`cname`,s.`servertemplate` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` INNER JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`id`=? AND g.`userid`=? AND s.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$aeskey,$ui->id('id',10,'get'),$user_id,$reseller_id));
@@ -78,7 +82,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if ($query->rowCount()==0 or (isset($pallowed) and $pallowed=='N') or (isset($_SESSION['sID']) and !in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
redirect('userpanel.php');
} else if (isset($rootid)) {
- include(EASYWIDIR.'/stuff/ssh_exec.php');
+ include(EASYWIDIR . '/stuff/ssh_exec.php');
function cfgTransfer ($pserverRead,$customerRead,$ftppassRead,$readFTPShorten,$pserverWrite,$customerWrite,$ftppassWrite,$writeFTPShorten) {
global $sship,$ftpport,$gsfolder,$gamePath,$files;
foreach ($files as $cfg) {
diff --git a/web/stuff/userpanel_substitutes.php b/web/stuff/userpanel_substitutes.php
index 165c169f..db6d2471 100644
--- a/web/stuff/userpanel_substitutes.php
+++ b/web/stuff/userpanel_substitutes.php
@@ -42,8 +42,9 @@ if (!isset($main) or $main!=1 or !isset($user_id) or !isset($user_language) or !
header('Location: userpanel.php');
die;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR.'/stuff/keyphrasefile.php');
-$aeskey=$aesfilecvar['aeskey'];
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('user',$user_language,$reseller_id);
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
diff --git a/web/stuff/userpanel_virtual.php b/web/stuff/userpanel_virtual.php
index 54f0fce5..6dbfb7a5 100644
--- a/web/stuff/userpanel_virtual.php
+++ b/web/stuff/userpanel_virtual.php
@@ -42,6 +42,9 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
header('Location: userpanel.php');
die('No acces');
}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid=$user_id;
$logusername=getusername($user_id);
@@ -51,8 +54,6 @@ $logsubuser=0;
if (isset($admin_id)) $logsubuser=$admin_id;
else if (isset($subuser_id)) $logsubuser=$subuser_id;
if (isset($admin_id) and $reseller_id!=0) $reseller_id=$admin_id;
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ri'and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['vs']))) {
diff --git a/web/stuff/userpanel_voice.php b/web/stuff/userpanel_voice.php
index 36724fee..9b628b24 100644
--- a/web/stuff/userpanel_voice.php
+++ b/web/stuff/userpanel_voice.php
@@ -51,9 +51,8 @@ if (isset($admin_id)) {
} else {
$logsubuser=0;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
-include(EASYWIDIR."/stuff/class_voice.php");
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/class_voice.php');
if ($ui->st('d','get')=='bu' and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['vo']))) {
$id=$ui->id('id',10,'get');
$query=$sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,v.`localserverid`,m.`type`,m.`queryport`,AES_DECRYPT(m.`querypassword`,:aeskey) AS `decryptedquerypassword`,m.`rootid`,m.`addedby`,m.`ssh2ip`,m.`type`,m.`usedns`,m.`publickey`,m.`ssh2ip`,AES_DECRYPT(m.`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(m.`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(m.`ssh2password`,:aeskey) AS `decryptedssh2password`,m.`serverdir`,m.`keyname`,m.`notified` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`backup`='Y' AND v.`id`=:server_id AND v.`userid`=:user_id AND v.`resellerid`=:reseller_id LIMIT 1");
diff --git a/web/stuff/userpanel_voice_dns.php b/web/stuff/userpanel_voice_dns.php
index 053d2d65..eacfef77 100644
--- a/web/stuff/userpanel_voice_dns.php
+++ b/web/stuff/userpanel_voice_dns.php
@@ -48,7 +48,7 @@ if (isset($admin_id)) {
} else {
$logsubuser=0;
}
-include(EASYWIDIR."/stuff/class_voice.php");
+include(EASYWIDIR . '/stuff/class_voice.php');
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if($ui->st('d','get')=='md' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['vd']))) {
@@ -101,8 +101,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (count($error)>0) {
$template_file='Error: '.implode(' ',$error);
} else {
- $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$query=$sql->prepare("SELECT *,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_tsdns` WHERE `active`='Y' AND `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':aeskey'=>$aeskey,':id'=>$tsdnsID,':reseller_id'=>$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
diff --git a/web/stuff/versioncheck.php b/web/stuff/versioncheck.php
index 06ecb548..2ee44e3f 100644
--- a/web/stuff/versioncheck.php
+++ b/web/stuff/versioncheck.php
@@ -145,12 +145,12 @@ if ($ui->st('d','get')=='ud' and $reseller_id==0 and $pa['updateEW'] and ($ewVer
$sql->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING);
if (!isset($alreadyRepaired)) {
$response->add('Adding tables if needed.');
- include(EASYWIDIR.'/stuff/tables_add.php');
+ include(EASYWIDIR . '/stuff/tables_add.php');
}
- if ($ewVersions['cVersion']<$ewVersions['version']) include(EASYWIDIR.'/install/update.php');
+ if ($ewVersions['cVersion']<$ewVersions['version']) include(EASYWIDIR . '/install/update.php');
if (!isset($alreadyRepaired)) {
$response->add('Repairing tables if needed.');
- include(EASYWIDIR.'/stuff/tables_repair.php');
+ include(EASYWIDIR . '/stuff/tables_repair.php');
}
} else {
$response->add('Error: could not retrieve the update');
diff --git a/web/stuff/voice.php b/web/stuff/voice.php
index c416c9f6..3a139f90 100644
--- a/web/stuff/voice.php
+++ b/web/stuff/voice.php
@@ -36,8 +36,13 @@
*/
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) {
- redirect('admin.php');
+ header('Location: admin.php');
+ die;
}
+
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/class_voice.php');
+
$sprache=getlanguagefile('voice',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
@@ -52,9 +57,6 @@ if ($reseller_id==0) {
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
-include(EASYWIDIR."/stuff/class_voice.php");
if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lVo']) and $licenceDetails['lVo']>0 and $licenceDetails['left']>0 and !is_numeric($licenceDetails['left'])) {
$template_file=$gsprache->licence;
} else if ($ui->w('action',4,'post') and !token(true)) {
diff --git a/web/stuff/voice_master.php b/web/stuff/voice_master.php
index 2ced29a3..4780ddd5 100644
--- a/web/stuff/voice_master.php
+++ b/web/stuff/voice_master.php
@@ -52,8 +52,8 @@ if ($reseller_id==0) {
$logreseller=0;
}
if ($reseller_id!=0 and $admin_id!=$reseller_id) $reseller_id=$admin_id;
-include(EASYWIDIR.'/stuff/keyphrasefile.php');
-include(EASYWIDIR.'/stuff/class_voice.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/class_voice.php');
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ad' or (($ui->st('d','get')=='ri' or $ui->st('d','get')=='md')and $id=$ui->id('id',10,'get'))) {
@@ -454,7 +454,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$sshkey=removePub($row['keyname']);
$pubkey=EASYWIDIR.'/keys/'.$sshkey.'.pub';
$key=EASYWIDIR.'/keys/'.$sshkey;
-
+
if (file_exists($pubkey) and file_exists($key)) {
$ssh2= @ssh2_connect($queryip,$row['decryptedssh2port'],array('hostkey'=>'ssh-rsa'));
} else {
@@ -843,7 +843,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
// https://github.com/easy-wi/developer/issues/36 managedServer,managedForID added
$query=$sql->prepare("SELECT m.*,COUNT(s.`id`) AS `installedserver`,SUM(s.`slots`) AS `installedslots`,SUM(s.`usedslots`) AS `uslots` FROM `voice_masterserver` m LEFT JOIN `voice_server` s ON m.`id`=s.`masterserver` WHERE (m.`resellerid`=? OR m.`managedForID`=?) GROUP BY m.`id` ORDER BY $orderby LIMIT $start,$amount");
$query2=$sql->prepare("SELECT `ip` FROM `rserverdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
- $query3=$sql->prepare("SELECT `id`,`active`,`uptime`,CONCAT(`ip`,':',`port`) AS `address` FROM `voice_server` WHERE `masterserver`=? AND `resellerid`=?");
+ $query3=$sql->prepare("SELECT `id`,`active`,`uptime`,`queryName`,CONCAT(`ip`,':',`port`) AS `address` FROM `voice_server` WHERE `masterserver`=? AND `resellerid`=?");
$query->execute(array($reseller_id,$admin_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$id=$row['id'];
@@ -870,11 +870,11 @@ if ($ui->w('action',4,'post') and !token(true)) {
$uslots=($row['uslots']==null) ? 0 : $row['uslots'];
$vs=array();
$query3->execute(array($id,$row['resellerid']));
- foreach ($query3->fetchAll(PDO::FETCH_ASSOC) as $row2) {
- if ($row2['active']=='N' or $row2['uptime']==1) $vsStatus=2;
- else if ($row2['active']=='Y' and $row2['uptime']<1) $vsStatus=3;
+ foreach ($query3->fetchAll(PDO::FETCH_ASSOC) as $row3) {
+ if ($row3['active']=='N' or $row3['uptime']==1) $vsStatus=2;
+ else if ($row3['active']=='Y' and $row3['uptime']<1) $vsStatus=3;
else $vsStatus=1;
- $vs[]=array('id'=>$row2['id'],'address'=>$row2['address'],'name'=>$row2['queryName'],'status'=>$vsStatus);
+ $vs[]=array('id'=>$row3['id'],'address'=>$row3['address'],'name'=>$row3['queryName'],'status'=>$vsStatus);
}
$table[]=array('id'=>$id,'active'=>$row['active'],'managedServer'=>$row['managedServer'],'img'=>$imgName,'alt'=>$imgAlt,'ip'=>$ip,'type'=>$type,'defaultdns'=>$defaultdns,'installedserver'=>$row['installedserver']."/".$row['maxserver'],'installedslots'=>$uslots."/".$installedslots."/".$row['maxslots'],'server'=>$vs);
}
diff --git a/web/stuff/voice_tsdns.php b/web/stuff/voice_tsdns.php
index ee77f0d4..517955ca 100644
--- a/web/stuff/voice_tsdns.php
+++ b/web/stuff/voice_tsdns.php
@@ -37,7 +37,13 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) redirect('admin.php');
+if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) {
+ header('Location: admin.php');
+ die;
+}
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+include(EASYWIDIR . '/stuff/class_voice.php');
+
$sprache=getlanguagefile('voice',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
@@ -56,9 +62,6 @@ if ($reseller_id==0) {
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
-include(EASYWIDIR."/stuff/class_voice.php");
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ad' or $ui->st('d','get')=='md') {
diff --git a/web/stuff/voice_tsdnsrecords.php b/web/stuff/voice_tsdnsrecords.php
index 2ed7856b..8b596867 100644
--- a/web/stuff/voice_tsdnsrecords.php
+++ b/web/stuff/voice_tsdnsrecords.php
@@ -37,7 +37,13 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) redirect('admin.php');
+if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) {
+ header('Location: admin.php');
+ die;
+}
+include(EASYWIDIR . '/stuff/class_voice.php');
+include(EASYWIDIR . '/stuff/keyphrasefile.php');
+
$sprache=getlanguagefile('voice',$user_language,$reseller_id);
$loguserid=$admin_id;
$logusername=getusername($admin_id);
@@ -50,9 +56,6 @@ if ($reseller_id==0) {
$logreseller=0;
}
if ($reseller_id!=0 and $admin_id!=$reseller_id) $reseller_id=$admin_id;
-include(EASYWIDIR."/stuff/class_voice.php");
-$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
-$aeskey=$aesfilecvar['aeskey'];
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ad' or $ui->st('d','get')=='md') {
diff --git a/web/switch.php b/web/switch.php
index 8b237aa6..4c3494db 100644
--- a/web/switch.php
+++ b/web/switch.php
@@ -35,11 +35,11 @@
* Programm erhalten haben. Wenn nicht, siehe .
*/
-define('EASYWIDIR',dirname(__FILE__));
-include(EASYWIDIR."/stuff/functions.php");
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR."/stuff/settings.php");
+define('EASYWIDIR', dirname(__FILE__));
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/settings.php');
$pa=User_Permissions($admin_id);
if ((isset($admin_id) and !$pa['user'] and !$pa['gserver'] and !$pa['root']) or !isset($admin_id)) {
die('No access');
diff --git a/web/template/default/admin_header.tpl b/web/template/default/admin_header.tpl
index 99536dfb..8c97ad30 100644
--- a/web/template/default/admin_header.tpl
+++ b/web/template/default/admin_header.tpl
@@ -89,16 +89,16 @@
-
+
- >Dashboard
- >IP Bans
+ smallletters('w',255,'get')=='da' or $ui->smallletters('w',255,'get')=='ho') echo 'class="active"';?>>Dashboard
+ smallletters('w',255,'get')=='ib') echo 'class="active"';?>>IP Bans
- >logs;?>
- >Mail logs;?>
+ smallletters('w',255,'get')=='lo') echo 'class="active"';?>>logs;?>
+ smallletters('w',255,'get')=='ml') echo 'class="active"';?>>Mail logs;?>
- >imprint;?>
+ smallletters('w',255,'get')=='ip') echo 'class="active"';?>>imprint;?>
@@ -112,19 +112,20 @@
-
+
- >settings;?>
- >E-Mail settings;?>
+ smallletters('w',255,'get')=='se') echo 'class="active"';?>>settings;?>
+ smallletters('w',255,'get')=='sm') echo 'class="active"';?>>E-Mail settings;?>
- >versioncheck;?>
+ smallletters('w',255,'get')=='vc') echo 'class="active"';?>>versioncheck;?>
- >columns;?>
+ smallletters('w',255,'get')=='cc') echo 'class="active"';?>>columns;?>
- >databases;?>
+ smallletters('w',255,'get')=='mo') echo 'class="active"';?>>modules;?>
+ smallletters('w',255,'get')=='bu') echo 'class="active"';?>>databases;?>
@@ -135,14 +136,14 @@
-
+
@@ -154,12 +155,12 @@
-
+
@@ -170,53 +171,55 @@
-
+
- >news;?>
- >comments;?>
+ smallletters('w',255,'get')=='pn') echo 'class="active"';?>>news;?>
+ smallletters('w',255,'get')=='pc') echo 'class="active"';?>>comments;?>
- >pages;?>
- >downloads;?>
+ smallletters('w',255,'get')=='pp') echo 'class="active"';?>>pages;?>
+ smallletters('w',255,'get')=='pd') echo 'class="active"';?>>downloads;?>
- >settings;?>
+ smallletters('w',255,'get')=='ps') echo 'class="active"';?>>settings;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
-
+
- >databases;?>
+ smallletters('w',255,'get')=='my' and !in_array($d,array('ms','as','ds'))) echo 'class="active"';?>>databases;?>
- >Server
+ smallletters('w',255,'get')=='my' and in_array($d,array('ms','as','ds'))) echo 'class="active"';?>>Server
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
-
+
@@ -227,144 +230,163 @@
-
+
- >overview;?>
+ smallletters('w',255,'get')=='us') echo 'class="active"';?>>overview;?>
- >groups;?>
+ smallletters('w',255,'get')=='ug') echo 'class="active"';?>>groups;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
-
-
+
-
+
- >overview;?>
+ smallletters('w',255,'get')=='gs') echo 'class="active"';?>>overview;?>
-
- >Easy Anti Cheat
+
+ smallletters('w',255,'get')=='ea') echo 'class="active"';?>>Easy Anti Cheat
- >template;?>
+ smallletters('w',255,'get')=='im') echo 'class="active"';?>>template;?>
- >addon;?>
+ smallletters('w',255,'get')=='ad') echo 'class="active"';?>>addon;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
-
+
- >overview;?>
+ smallletters('w',255,'get')=='vo') echo 'class="active"';?>>overview;?>
- >master;?>
+ smallletters('w',255,'get')=='vm') echo 'class="active"';?>>master;?>
- >TSDNS overview;?>
+ smallletters('w',255,'get')=='vr') echo 'class="active"';?>>TSDNS overview;?>
- >TSDNS master;?>
+ smallletters('w',255,'get')=='vd') echo 'class="active"';?>>TSDNS master;?>
- >stats;?>
+ smallletters('w',255,'get')=='vu' and $d!='se') echo 'class="active"';?>>stats;?>
- >settings;?>
+ smallletters('w',255,'get')=='vu' and $d=='se') echo 'class="active"';?>>settings;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
-
-
+
-
+
- >overview;?>
- >settings;?>
+ smallletters('w',255,'get')=='ti' and $d!='mt') echo 'class="active"';?>>overview;?>
+ smallletters('w',255,'get')=='ti' and $d=='mt') echo 'class="active"';?>>settings;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
-
+
- >virtual;?>
- >dedicated;?>
- >traffic;?>
- >ESX(I) Host
- >DHCP
- >PXE
- >template;?>
- >traffic.' '.$gsprache->settings;?>
+ smallletters('w',255,'get')=='vs') echo 'class="active"';?>>virtual;?>
+ smallletters('w',255,'get')=='rh') echo 'class="active"';?>>dedicated;?>
+ smallletters('w',255,'get')=='tf' and $d!='se') echo 'class="active"';?>>traffic;?>
+ smallletters('w',255,'get')=='vh') echo 'class="active"';?>>ESX(I) Host
+ smallletters('w',255,'get')=='rd') echo 'class="active"';?>>DHCP
+ smallletters('w',255,'get')=='rp') echo 'class="active"';?>>PXE
+ smallletters('w',255,'get')=='ot') echo 'class="active"';?>>template;?>
+ smallletters('w',255,'get')=='tf' and $d=='se') echo 'class="active"';?>>traffic.' '.$gsprache->settings;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
+
+
+
+
+
+ 0) { ?>
+
+
+
+
+
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
diff --git a/web/template/default/admin_modules_ad.tpl b/web/template/default/admin_modules_ad.tpl
new file mode 100644
index 00000000..e4301f86
--- /dev/null
+++ b/web/template/default/admin_modules_ad.tpl
@@ -0,0 +1,87 @@
+
+0){ ?>
+
+ ×
+
Error(s)
+
+
+
+
+
\ No newline at end of file
diff --git a/web/template/default/admin_modules_dl.tpl b/web/template/default/admin_modules_dl.tpl
new file mode 100644
index 00000000..ad2518d7
--- /dev/null
+++ b/web/template/default/admin_modules_dl.tpl
@@ -0,0 +1,32 @@
+
+
+
\ No newline at end of file
diff --git a/web/template/default/admin_modules_list.tpl b/web/template/default/admin_modules_list.tpl
new file mode 100644
index 00000000..2d4328c8
--- /dev/null
+++ b/web/template/default/admin_modules_list.tpl
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+ name;?>
+ type;?>
+ del;?>
+ mod;?>
+
+
+
+
+
+
+
+ 1000) { ?>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/template/default/admin_modules_md.tpl b/web/template/default/admin_modules_md.tpl
new file mode 100644
index 00000000..61aa4ded
--- /dev/null
+++ b/web/template/default/admin_modules_md.tpl
@@ -0,0 +1,94 @@
+
+0){ ?>
+
+ ×
+
Error(s)
+
+
+
+
+
\ No newline at end of file
diff --git a/web/template/default/admin_user_add.tpl b/web/template/default/admin_user_add.tpl
index 4d148909..22fb2822 100644
--- a/web/template/default/admin_user_add.tpl
+++ b/web/template/default/admin_user_add.tpl
@@ -264,13 +264,13 @@
-
max." ".$gsprache->mhz;?>
+
max." ".$rsprache->mhz;?>
-
max." ".$gsprache->ram;?>
+
max." ".$rsprache->ram;?>
diff --git a/web/template/default/admin_user_md.tpl b/web/template/default/admin_user_md.tpl
index 0ae5cb47..c435c449 100644
--- a/web/template/default/admin_user_md.tpl
+++ b/web/template/default/admin_user_md.tpl
@@ -213,13 +213,13 @@
-
max." ".$gsprache->mhz;?>
+
max." ".$rsprache->mhz;?>
-
max." ".$gsprache->ram;?>
+
max." ".$rsprache->ram;?>
diff --git a/web/template/default/userpanel_header.tpl b/web/template/default/userpanel_header.tpl
index bbb81ec1..301505ef 100644
--- a/web/template/default/userpanel_header.tpl
+++ b/web/template/default/userpanel_header.tpl
@@ -97,11 +97,12 @@
>substitutes;?>
>logs;?>
>imprint;?>
+ $v) { echo '
smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
-
+
- 0 and $pa['restart']) { ?>
+ 0 and $pa['restart']) { ?>
- 0 or $tsdnscount>0) and $pa['voiceserver']) { ?>
+ 0 or $tsdnscount>0) and $pa['voiceserver']) { ?>
- 0 and ($pa['mysql'] or $pa['mysql'])) { ?>
+ 0 and ($pa['mysql'] or $pa['mysql'])) { ?>
MYSQL
@@ -162,12 +166,13 @@
>overview;?>
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
- 0 and $pa['roots']) { ?>
+ 0 and $pa['roots']) { ?>
+
+
+ 0) { ?>
+
+
+
+
+
+ $v) { echo 'smallletters('w',255,'get')==$k) ? 'class="active"' : ''; echo '>'.$v.' '; }; ?>
diff --git a/web/trafficdata.php b/web/trafficdata.php
index 9df74cfe..950b002d 100644
--- a/web/trafficdata.php
+++ b/web/trafficdata.php
@@ -57,13 +57,12 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
print "The memory limit is now: ".ini_get('memory_limit')."\r\n";
}
if (!isset($remoteip) or $_SERVER['SERVER_ADDR']==$remoteip) {
- define('EASYWIDIR',dirname(__FILE__));
- include('stuff/vorlage.php');
- include('stuff/class_validator.php');
- include("stuff/functions.php");
- include("stuff/settings.php");
- $aesfilecvar=getconfigcvars("stuff/keyphrasefile.php");
- $aeskey=$aesfilecvar['aeskey'];
+ define('EASYWIDIR', dirname(__FILE__));
+ include(EASYWIDIR . '/stuff/vorlage.php');
+ include(EASYWIDIR . '/stuff/class_validator.php');
+ include(EASYWIDIR . '/stuff/functions.php');
+ include(EASYWIDIR . '/stuff/settings.php');
+ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$query=$sql->prepare("SELECT `type`,`statip`,AES_DECRYPT(`dbname`,:aeskey) AS `decpteddbname`,AES_DECRYPT(`dbuser`,:aeskey) AS `decpteddbuser`,AES_DECRYPT(`dbpassword`,:aeskey) AS `decpteddbpassword`,`table_name`,`column_sourceip`,`column_destip`,`column_byte`,`column_date` FROM `traffic_settings` LIMIT 1");
$query->execute(array(':aeskey'=>$aeskey));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
diff --git a/web/userpanel.php b/web/userpanel.php
index 8ac0b193..064b78c4 100644
--- a/web/userpanel.php
+++ b/web/userpanel.php
@@ -36,16 +36,16 @@
*/
$main=1;
-define('EASYWIDIR',dirname(__FILE__));
+define('EASYWIDIR', dirname(__FILE__));
if (is_dir(EASYWIDIR.'/install')) die('Please remove the "install" folder');
-include(EASYWIDIR.'/stuff/functions.php');
-include(EASYWIDIR.'/stuff/class_validator.php');
-include(EASYWIDIR.'/stuff/vorlage.php');
-include(EASYWIDIR.'/stuff/settings.php');
-include(EASYWIDIR.'/stuff/init_user.php');
-include(EASYWIDIR.'/stuff/userpanel_home.php');
+include(EASYWIDIR . '/stuff/functions.php');
+include(EASYWIDIR . '/stuff/class_validator.php');
+include(EASYWIDIR . '/stuff/vorlage.php');
+include(EASYWIDIR . '/stuff/settings.php');
+include(EASYWIDIR . '/stuff/init_user.php');
+include(EASYWIDIR . '/stuff/userpanel_home.php');
if (isset($what_to_be_included_array[$w])) {
- include('stuff/'.$what_to_be_included_array[$w]);
+ include(EASYWIDIR . '/stuff/'.$what_to_be_included_array[$w]);
unset($dbConnect);
} else {
unset($dbConnect);