diff --git a/check_database.php b/check_database.php index 5ebd6f4..c03d5d2 100644 --- a/check_database.php +++ b/check_database.php @@ -67,7 +67,7 @@ }; if(substr(sprintf('%o', fileperms('config.php')), -4) != $wantedFilePermissions || substr(sprintf('%o', fileperms('config_instanz.php')), -4) != $wantedFilePermissions || substr(sprintf('%o', fileperms('TicketBereich.txt')), -4) != $wantedFilePermissions - || substr(sprintf('%o', fileperms('logs/system.log')), -4) != $wantedFilePermissions || substr(sprintf('%o', fileperms('logs/user.log')), -4) != $wantedFilePermissions || substr(sprintf('%o', fileperms('shell/teamspeakCommands.sh')), -4) != "0777") + || substr(sprintf('%o', fileperms('logs/system.log')), -4) != $wantedFilePermissions || substr(sprintf('%o', fileperms('logs/user.log')), -4) != $wantedFilePermissions || !is_executable('shell/teamspeakCommands.sh')) { $permissions = false; }; @@ -100,7 +100,7 @@ }; $installFolderExists = file_exists("install"); - if($verbindung != 'done' || !$users || !$permissions || $installFolderExists) + if($verbindung != 'done' || !$users || !$permissions || $installFolderExists || !extension_loaded("soap")) { ?> @@ -300,6 +300,22 @@ + +
+
+
+
+
+ SOAP +
+
+

+ +
+
+
+
+
diff --git a/functions.php b/functions.php index b00e049..c3deceb 100644 --- a/functions.php +++ b/functions.php @@ -22,7 +22,7 @@ /* Installed Webinterface version */ - define("INTERFACE_VERSION", "1.1.7-OPEN-BETA"); + define("INTERFACE_VERSION", "1.1.8-OPEN-BETA"); /* Session start @@ -118,7 +118,7 @@ function writeInLog($loglevel, $logtext, $userlog = false) $loghandle = fopen($file.".log", 'a'); fwrite($loghandle, $input); - if (filesize($file) > 10242880) // 10MB + if (filesize($file.".log") > 10242880) // 10MB { fwrite($loghandle, $date."\tNOTICE\t\tLogfile filesie of 10 MiB reached.. Rotate logfile.\n"); @@ -142,9 +142,12 @@ function writeInLog($loglevel, $logtext, $userlog = false) unlink($file.".log"); }; - if (filesize($file.".zip") > 20485760) // 20 MB + if(file_exists($file.".zip")) { - unlink($file.".zip"); + if (filesize($file.".zip") > 20485760) // 20 MB + { + unlink($file.".zip"); + }; }; }; @@ -509,8 +512,14 @@ function getCheckedClientServerEditRights($pk, $instanz, $port) foreach($databaseKeys AS $keyname => $key) { - - if(!in_array($key, $clientKeys) && strpos($clientKeys[$key][$instanz], $port) !== false) + if(!empty($clientKeys)) + { + if(!in_array($key, $clientKeys) && strpos($clientKeys[$key][$instanz], $port) !== false) + { + unset($returnKeys[$keyname]); + }; + } + else { unset($returnKeys[$keyname]); }; diff --git a/iframeServerView.php b/iframeServerView.php index 7d8be13..6f54d36 100644 --- a/iframeServerView.php +++ b/iframeServerView.php @@ -50,8 +50,8 @@ - -
+ +


+ + +
@@ -323,6 +353,9 @@
+ + +
@@ -352,6 +385,20 @@ $('[data-tooltip="tooltip"]').tooltip(); }); + $('#modalAdminQueryInstanz').on('show.bs.modal', function (event) + { + var button = $(event.relatedTarget); + var instanz = button.data('instanz'); + + document.getElementById('addServerAdminQuery').addEventListener("click", function(){ + $('#commandInput'+instanz).val('servergroupaddclient sgid=2 cldbid=MY_CLIENT_DATABASEID'); + }); + + document.getElementById('delServerAdminQuery').addEventListener("click", function(){ + $('#commandInput'+instanz).val('servergroupdelclient sgid=2 cldbid=MY_CLIENT_DATABASEID'); + }); + }); + $('#modalDeleteInstanz').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); diff --git a/web_main.php b/web_main.php index 452bc89..5cbf997 100644 --- a/web_main.php +++ b/web_main.php @@ -44,31 +44,47 @@ /* Get Client Permissions */ - $user_right = getUserRightsWithTime(getUserRights('pk', $_SESSION['user']['id'])); + if(isSet($_SESSION['user']['id'])) + { + $user_right = getUserRightsWithTime(getUserRights('pk', $_SESSION['user']['id'])); + }; + /* Check if user get the updateinfo */ $hasPermission = "true"; - if($_SESSION['login'] != $mysql_keys['login_key']) + if(!isSet($_SESSION['login'])) { $hasPermission = "false"; } else { - if($user_right['right_hp_main'] != $mysql_keys['right_hp_main']) + if($_SESSION['login'] != $mysql_keys['login_key']) { $hasPermission = "false"; + } + else + { + if($user_right['right_hp_main'] != $mysql_keys['right_hp_main']) + { + $hasPermission = "false"; + }; }; }; /* Check Link */ - $urlData = explode("?", $_SERVER['HTTP_REFERER']); - $serverInstanz = $urlData[2]; - $serverId = $urlData[3]; + $uri = ""; + + if(isSet($_SERVER['HTTP_REFERER'])) + { + $urlData = explode("?", $_SERVER['REQUEST_URI']); + $serverInstanz = $urlData[2]; + $serverId = $urlData[3]; + }; if($is_logged && $serverInstanz != "" && $serverId != "") { diff --git a/web_profil_dashboard.php b/web_profil_dashboard.php index 948e100..4a79291 100644 --- a/web_profil_dashboard.php +++ b/web_profil_dashboard.php @@ -62,43 +62,6 @@ function sys_getloadavg_hack() return $avs; }; - // written by cjmwid https://r4p3.net/members/cjmwid.5528/ - if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') - { - $tmp = 'WindowsStats.tmp'; - if(file_exists($tmp) && (filemtime($tmp) > (time() - 60 * DASHBOARD_REFRESHTIME ))) - { - $file = file($tmp); - } - else - { - exec('systeminfo', $retval); - $time = substr($retval[11] ,17); - $uparr = explode(",",$time); - $uptime = strtotime($uparr[0].$uparr[1]); - $ut = time() - $uptime; - $dtF = new \DateTime('@0'); - $dtT = new \DateTime("@$ut"); - $data = $dtF->diff($dtT)->format('%a ').$language['days'].$dtF->diff($dtT)->format(' %h ').$language['hours'].$dtF->diff($dtT)->format(' %i ').$language['minutes'].PHP_EOL; - $ram = shell_exec('systeminfo | find "In Use:"'); - $data .= substr($ram,27); - $load = array(); - $wmi = new COM("Winmgmts://"); - $server = $wmi->execquery("SELECT LoadPercentage FROM Win32_Processor"); - $cpu_num = 0; - $load_total = 0; - foreach($server as $cpu) - { - $cpu_num++; - $load_total+= $cpu->loadpercentage; - }; - $load[] = round($load_total/$cpu_num); - $data .= implode(' ',$load)."%"; - file_put_contents($tmp, $data); - $file = file($tmp); - }; - }; - /* For the Diagramms */ @@ -107,101 +70,16 @@ function sys_getloadavg_hack()
- - -
-
-

-
-
- - - - - - - - - - - - - - - -
- : - - -
- RAM : - - -
- CPU : - - -
-
+
+
+

Hey !

- -
-
-

Hey !

-
-
-

-

-

-
+
+

+

+

- +