@@ -46,6 +46,9 @@ discard block |
||
| 46 | 46 | return $handle; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | + /** |
|
| 50 | + * @param resource $handle |
|
| 51 | + */ |
|
| 49 | 52 | protected function readLog($handle) |
| 50 | 53 | { |
| 51 | 54 | print("\n[Daemon]: +++ readLog() +++"); |
@@ -116,6 +119,9 @@ discard block |
||
| 116 | 119 | |
| 117 | 120 | } |
| 118 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $buffer |
|
| 124 | + */ |
|
| 119 | 125 | protected function parseIP($buffer) |
| 120 | 126 | { |
| 121 | 127 | $ip = ""; |
@@ -134,6 +140,9 @@ discard block |
||
| 134 | 140 | return $ip; |
| 135 | 141 | } |
| 136 | 142 | |
| 143 | + /** |
|
| 144 | + * @param string $buffer |
|
| 145 | + */ |
|
| 137 | 146 | protected function parseHostname($buffer) |
| 138 | 147 | { |
| 139 | 148 | $hostname = ""; |
@@ -152,6 +161,9 @@ discard block |
||
| 152 | 161 | return $hostname; |
| 153 | 162 | } |
| 154 | 163 | |
| 164 | + /** |
|
| 165 | + * @param string $line |
|
| 166 | + */ |
|
| 155 | 167 | protected function parseExit($line) |
| 156 | 168 | { |
| 157 | 169 | $exit = 0; |
@@ -196,6 +208,9 @@ discard block |
||
| 196 | 208 | |
| 197 | 209 | } |
| 198 | 210 | |
| 211 | + /** |
|
| 212 | + * @param integer $id |
|
| 213 | + */ |
|
| 199 | 214 | protected function sendVncWindowToNuc($id, $vncclient) |
| 200 | 215 | { |
| 201 | 216 | print("\n[Daemon]: +++sendVncWindowToNuc() +++ "); |
@@ -72,18 +72,18 @@ discard block |
||
| 72 | 72 | $hostname = $this->parseHostname($buffer); |
| 73 | 73 | $exit = $this->parseExit($buffer); |
| 74 | 74 | |
| 75 | - if ($ip!="") { |
|
| 75 | + if ($ip != "") { |
|
| 76 | 76 | $client["ip"] = $ip; |
| 77 | 77 | } |
| 78 | - if ($hostname!="") { |
|
| 78 | + if ($hostname != "") { |
|
| 79 | 79 | $client["hostname"] = $hostname; |
| 80 | 80 | } |
| 81 | - if ($exit!=0) { |
|
| 81 | + if ($exit != 0) { |
|
| 82 | 82 | $client["exit"] = $exit; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | if (strstr($buffer, 'create_image') && $client["ip"] != "" && |
| 86 | - $client["hostname"]!="" ) { |
|
| 86 | + $client["hostname"] != "") { |
|
| 87 | 87 | |
| 88 | 88 | // add client |
| 89 | 89 | $this->addClient($client["ip"], $client["hostname"]); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - $halt=$this->_CONNECTIONS; |
|
| 105 | + $halt = $this->_CONNECTIONS; |
|
| 106 | 106 | |
| 107 | 107 | if ($halt == -1) { |
| 108 | 108 | exit(0); |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | $ip = ""; |
| 122 | 122 | $line = $buffer; |
| 123 | 123 | if (strpos($line, "Reverse VNC connection from IP")) { |
| 124 | - $line=trim($line); |
|
| 125 | - $item=explode(":", $line); |
|
| 126 | - $ip=trim($item[1]); |
|
| 127 | - $ip=preg_replace('/\W\W\d{4}\/\d{2}\/\d{2} \d{2}/', '', $ip); |
|
| 124 | + $line = trim($line); |
|
| 125 | + $item = explode(":", $line); |
|
| 126 | + $ip = trim($item[1]); |
|
| 127 | + $ip = preg_replace('/\W\W\d{4}\/\d{2}\/\d{2} \d{2}/', '', $ip); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - if ($ip!="") { |
|
| 130 | + if ($ip != "") { |
|
| 131 | 131 | print("\nFOUND IP: " . $ip . "\n"); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -139,13 +139,13 @@ discard block |
||
| 139 | 139 | $hostname = ""; |
| 140 | 140 | $line = $buffer; |
| 141 | 141 | if (strpos($line, "Hostname")) { |
| 142 | - $line=trim($line); |
|
| 143 | - $item=explode(":", $line); |
|
| 144 | - $hostname=trim($item[1]); |
|
| 145 | - $hostname=preg_replace('/\.uni\-mannheim\.de/', '', $hostname); |
|
| 142 | + $line = trim($line); |
|
| 143 | + $item = explode(":", $line); |
|
| 144 | + $hostname = trim($item[1]); |
|
| 145 | + $hostname = preg_replace('/\.uni\-mannheim\.de/', '', $hostname); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if ($hostname!="") { |
|
| 148 | + if ($hostname != "") { |
|
| 149 | 149 | print("\nFOUND HOSTNAME: " . $hostname . "\n"); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $exit = 1; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - if ($exit!=0) { |
|
| 162 | + if ($exit != 0) { |
|
| 163 | 163 | print("\nCLIENT HAS DISCONNECTED " . $exit . "\n"); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | "exit" => 0 |
| 176 | 176 | ); |
| 177 | 177 | if (count($this->_VNC_CLIENTS) == 0) { |
| 178 | - $id=1; |
|
| 178 | + $id = 1; |
|
| 179 | 179 | } else { |
| 180 | - $id=count($this->_VNC_CLIENTS) + 1; |
|
| 180 | + $id = count($this->_VNC_CLIENTS)+1; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | $this->_VNC_CLIENTS[$id] = $vncclient; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | $this->_CONNECTIONS++; |
| 193 | 193 | |
| 194 | - print("\n active connections: ".$this->_CONNECTIONS+1); |
|
| 194 | + print("\n active connections: " . $this->_CONNECTIONS+1); |
|
| 195 | 195 | print("\n all saved clients: " . serialize($this->_VNC_CLIENTS)); |
| 196 | 196 | |
| 197 | 197 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | foreach ($inactive_vnc_window_ids as $inactive_win_id) { |
| 305 | 305 | // define vnc-id |
| 306 | - $inactive_vnc_id = $db->querySingle("SELECT file FROM window WHERE win_id='".$inactive_win_id."'"); |
|
| 306 | + $inactive_vnc_id = $db->querySingle("SELECT file FROM window WHERE win_id='" . $inactive_win_id . "'"); |
|
| 307 | 307 | |
| 308 | 308 | // delete from database (send to control.php) |
| 309 | 309 | $curl = curl_init(); |
@@ -387,7 +387,7 @@ |
||
| 387 | 387 | // {AFTER | BEFORE} {DELETE | INSERT | UPDATE } ON table |
| 388 | 388 | //~ $db->exec("CREATE TRIGGER dbchange AFTER UPDATE ON user |
| 389 | 389 | //~ BEGIN |
| 390 | - //~ dbModifiedCallback(); |
|
| 390 | + //~ dbModifiedCallback(); |
|
| 391 | 391 | //~ END"); |
| 392 | 392 | //~ $db = new DBConnector('palma.db'); |
| 393 | 393 | echo "Tables=" . $db->querySingle('SELECT count(*) FROM sqlite_master WHERE type="table"') . "\n"; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if (count($next_ids) > 0) { |
| 117 | 117 | $next = $next_ids[0]; |
| 118 | 118 | } else { |
| 119 | - $next = $this->querySingle('SELECT MAX(id) FROM window') + 1; |
|
| 119 | + $next = $this->querySingle('SELECT MAX(id) FROM window')+1; |
|
| 120 | 120 | } |
| 121 | 121 | return $next; |
| 122 | 122 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | // TODO: Support more than one address for a given username. |
| 141 | 141 | $this->exec("INSERT OR IGNORE INTO user VALUES (NULL, '$username', 1, 0)"); |
| 142 | 142 | $usercount = $this->querySingle("SELECT COUNT(*) FROM user"); |
| 143 | - $userid = $this->querySingle("SELECT userid from user where name='".$username."'"); |
|
| 143 | + $userid = $this->querySingle("SELECT userid from user where name='" . $username . "'"); |
|
| 144 | 144 | $this->exec("INSERT INTO address VALUES ('$userid', '$address', '$device')"); |
| 145 | 145 | trace("user $username connected with $device, $usercount user(s) now connected"); |
| 146 | 146 | if ($usercount == 1) { |
@@ -235,13 +235,13 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | public function getWindowState($window_id) |
| 237 | 237 | { |
| 238 | - $state = @$this->querySingle('SELECT state FROM window WHERE win_id="'.$window_id.'"'); |
|
| 238 | + $state = @$this->querySingle('SELECT state FROM window WHERE win_id="' . $window_id . '"'); |
|
| 239 | 239 | return $state; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | public function setWindowState($window_id, $state) |
| 243 | 243 | { |
| 244 | - $this->exec('UPDATE window SET state="'.$state.'" WHERE win_id="'.$window_id.'"'); |
|
| 244 | + $this->exec('UPDATE window SET state="' . $state . '" WHERE win_id="' . $window_id . '"'); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | public function insertWindow($window) |
@@ -259,12 +259,12 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | public function deleteWindow($window_id) |
| 261 | 261 | { |
| 262 | - $this->exec('DELETE FROM window WHERE win_id="'.$window_id.'"'); |
|
| 262 | + $this->exec('DELETE FROM window WHERE win_id="' . $window_id . '"'); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | public function deleteVNCWindow($userid) |
| 266 | 266 | { |
| 267 | - $winid = $this->querySingle('SELECT win_id FROM window WHERE handler="vnc" AND userid="'.$userid.'"'); |
|
| 267 | + $winid = $this->querySingle('SELECT win_id FROM window WHERE handler="vnc" AND userid="' . $userid . '"'); |
|
| 268 | 268 | require_once('control.php'); |
| 269 | 269 | wmClose($winid); |
| 270 | 270 | $this->deleteWindow($winid); |
@@ -273,12 +273,12 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | public function deleteDebug($table, $id, $gt) |
| 275 | 275 | { |
| 276 | - $this->exec('DELETE FROM '.$table.' WHERE '.$id.' >"'.$gt.'"'); |
|
| 276 | + $this->exec('DELETE FROM ' . $table . ' WHERE ' . $id . ' >"' . $gt . '"'); |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | public function updateWindow($window_id, $field, $value) |
| 280 | 280 | { |
| 281 | - $this->exec('UPDATE window SET '.$field.'="'.$value.'" WHERE win_id="'.$window_id.'"'); |
|
| 281 | + $this->exec('UPDATE window SET ' . $field . '="' . $value . '" WHERE win_id="' . $window_id . '"'); |
|
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
@@ -49,18 +49,18 @@ |
||
| 49 | 49 | $f = fopen($targetFile, 'w'); |
| 50 | 50 | if ($f) { |
| 51 | 51 | switch ($error) { |
| 52 | - case UPLOAD_ERR_INI_SIZE: |
|
| 53 | - $message = __("This file is too large."); |
|
| 54 | - break; |
|
| 55 | - case UPLOAD_ERR_FORM_SIZE: |
|
| 56 | - $message = __("Large files are not supported."); |
|
| 57 | - break; |
|
| 58 | - case UPLOAD_ERR_PARTIAL: |
|
| 59 | - $message = __("File was only partially uploaded."); |
|
| 60 | - break; |
|
| 61 | - default: |
|
| 62 | - $message = sprintf(__("Error code %s."), $error); |
|
| 63 | - break; |
|
| 52 | + case UPLOAD_ERR_INI_SIZE: |
|
| 53 | + $message = __("This file is too large."); |
|
| 54 | + break; |
|
| 55 | + case UPLOAD_ERR_FORM_SIZE: |
|
| 56 | + $message = __("Large files are not supported."); |
|
| 57 | + break; |
|
| 58 | + case UPLOAD_ERR_PARTIAL: |
|
| 59 | + $message = __("File was only partially uploaded."); |
|
| 60 | + break; |
|
| 61 | + default: |
|
| 62 | + $message = sprintf(__("Error code %s."), $error); |
|
| 63 | + break; |
|
| 64 | 64 | } |
| 65 | 65 | fprintf($f, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\""); |
| 66 | 66 | fprintf($f, "\"http://www.w3.org/TR/html4/strict.dtd\">"); |
@@ -81,17 +81,17 @@ |
||
| 81 | 81 | $targetFile = "file:///$targetFile"; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - // Get information of application for uploaded file. |
|
| 85 | - require_once ('FileHandler.class.php'); |
|
| 86 | - list ($returnedHandler, $returnedTargetFile) = FileHandler::getFileHandler($targetFile); |
|
| 87 | - $handler = $returnedHandler; |
|
| 88 | - $targetFile = $returnedTargetFile; |
|
| 89 | - trace("file is now $targetFile, its handler is $handler"); |
|
| 84 | + // Get information of application for uploaded file. |
|
| 85 | + require_once ('FileHandler.class.php'); |
|
| 86 | + list ($returnedHandler, $returnedTargetFile) = FileHandler::getFileHandler($targetFile); |
|
| 87 | + $handler = $returnedHandler; |
|
| 88 | + $targetFile = $returnedTargetFile; |
|
| 89 | + trace("file is now $targetFile, its handler is $handler"); |
|
| 90 | 90 | |
| 91 | - // create window object and send to nuc |
|
| 91 | + // create window object and send to nuc |
|
| 92 | 92 | |
| 93 | - $dt = new DateTime(); |
|
| 94 | - $date = $dt->format('Y-m-d H:i:s'); |
|
| 93 | + $dt = new DateTime(); |
|
| 94 | + $date = $dt->format('Y-m-d H:i:s'); |
|
| 95 | 95 | |
| 96 | 96 | $window = array( |
| 97 | 97 | "id" => "", |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | if (is_dir($pictures)) { |
| 93 | 93 | $filelist = scandir($pictures); |
| 94 | 94 | sort($filelist, SORT_NATURAL); |
| 95 | - foreach($filelist as $file) { |
|
| 95 | + foreach ($filelist as $file) { |
|
| 96 | 96 | $picture = "$pictures/$file"; |
| 97 | 97 | if (is_file($picture)) { |
| 98 | 98 | echo("<li style=\"background-image: url('$picture'); background-repeat: no-repeat\"></li>\n"); |
@@ -62,9 +62,9 @@ |
||
| 62 | 62 | function getControls() |
| 63 | 63 | { |
| 64 | 64 | return FileHandler::CURSOR | FileHandler::ZOOM | |
| 65 | - FileHandler::HOME | FileHandler::END | |
|
| 66 | - FileHandler::PRIOR | FileHandler::NEXT | |
|
| 67 | - FileHandler::DOWNLOAD; |
|
| 65 | + FileHandler::HOME | FileHandler::END | |
|
| 66 | + FileHandler::PRIOR | FileHandler::NEXT | |
|
| 67 | + FileHandler::DOWNLOAD; |
|
| 68 | 68 | } |
| 69 | 69 | function show($path) |
| 70 | 70 | { |
@@ -166,6 +166,9 @@ |
||
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | +/** |
|
| 170 | + * @param string $office |
|
| 171 | + */ |
|
| 169 | 172 | function convertOffice($inputFile, $office, $outputDir, $fileName) |
| 170 | 173 | { |
| 171 | 174 | shell_exec("/usr/bin/libreoffice --headless --convert-to pdf:'$office'_pdf_Export --outdir '$outputDir' '$inputFile' >/dev/null 2>&1"); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // Shortcuts for combinations of controls. |
| 91 | 91 | const CURSOR = 15; // UP | DOWN | LEFT | RIGHT |
| 92 | - const ZOOM = 48; // ZOOMIN | ZOOMOUT |
|
| 92 | + const ZOOM = 48; // ZOOMIN | ZOOMOUT |
|
| 93 | 93 | const ALL = 2047; |
| 94 | 94 | |
| 95 | 95 | // up down left right zoomin zoomout home end prior next download |
@@ -120,17 +120,17 @@ discard block |
||
| 120 | 120 | // $params; |
| 121 | 121 | // echo $ftype; |
| 122 | 122 | if ($ftype === 'pdf') { |
| 123 | - $fhandler=$pdfHandler; |
|
| 123 | + $fhandler = $pdfHandler; |
|
| 124 | 124 | |
| 125 | 125 | } elseif ($ftype === 'gif' || $ftype === 'jpg' || $ftype === 'png') { |
| 126 | - $fhandler=$imageHandler; |
|
| 126 | + $fhandler = $imageHandler; |
|
| 127 | 127 | |
| 128 | 128 | } elseif ($ftype === 'html' || $ftype === 'url') { |
| 129 | - $fhandler=$webHandler; |
|
| 129 | + $fhandler = $webHandler; |
|
| 130 | 130 | |
| 131 | 131 | } elseif ($ftype === 'mpg' || $ftype === 'mpeg' || $ftype === 'avi' || |
| 132 | 132 | $ftype === 'mp3' || $ftype === 'mp4') { |
| 133 | - $fhandler=$avHandler; |
|
| 133 | + $fhandler = $avHandler; |
|
| 134 | 134 | |
| 135 | 135 | } else { |
| 136 | 136 | if ($ftype === 'doc' || $ftype === 'docx' || $ftype === 'odt' || $ftype === 'txt') { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | function convertOffice($inputFile, $office, $outputDir, $fileName) |
| 170 | 170 | { |
| 171 | 171 | shell_exec("/usr/bin/libreoffice --headless --convert-to pdf:'$office'_pdf_Export --outdir '$outputDir' '$inputFile' >/dev/null 2>&1"); |
| 172 | - $newFile=$outputDir . '/' . $fileName . '.pdf'; |
|
| 172 | + $newFile = $outputDir . '/' . $fileName . '.pdf'; |
|
| 173 | 173 | if (file_exists($newFile)) { |
| 174 | 174 | return $newFile; |
| 175 | 175 | } else { |
@@ -86,8 +86,7 @@ |
||
| 86 | 86 | |
| 87 | 87 | if (locale_emulation()) { |
| 88 | 88 | print "locale '$locale' is not supported on your system, using custom gettext implementation.\n"; |
| 89 | - } |
|
| 90 | - else { |
|
| 89 | + } else { |
|
| 91 | 90 | print "locale '$locale' is supported on your system, using native gettext implementation.\n"; |
| 92 | 91 | } |
| 93 | 92 | |
@@ -60,25 +60,25 @@ |
||
| 60 | 60 | </div> |
| 61 | 61 | |
| 62 | 62 | <?php |
| 63 | - session_start(); |
|
| 64 | - session_destroy(); |
|
| 63 | + session_start(); |
|
| 64 | + session_destroy(); |
|
| 65 | 65 | |
| 66 | - # TODO: User sessions should be authorized to one display only. |
|
| 67 | - # If they select this page, they must not be allowed to select |
|
| 68 | - # a new display without being logged out. |
|
| 66 | + # TODO: User sessions should be authorized to one display only. |
|
| 67 | + # If they select this page, they must not be allowed to select |
|
| 68 | + # a new display without being logged out. |
|
| 69 | 69 | |
| 70 | - # Show authorized user name and allow logout. |
|
| 71 | - $username = false; |
|
| 72 | - if (isset($_SESSION['username'])) { |
|
| 70 | + # Show authorized user name and allow logout. |
|
| 71 | + $username = false; |
|
| 72 | + if (isset($_SESSION['username'])) { |
|
| 73 | 73 | # PHP session based authorization. |
| 74 | 74 | $username = $_SESSION['username']; |
| 75 | - } elseif (isset($_SERVER["PHP_AUTH_USER"])) { |
|
| 75 | + } elseif (isset($_SERVER["PHP_AUTH_USER"])) { |
|
| 76 | 76 | # .htaccess basic authorization. |
| 77 | 77 | $username = $_SERVER["PHP_AUTH_USER"]; |
| 78 | - } |
|
| 79 | - if ($username) { |
|
| 78 | + } |
|
| 79 | + if ($username) { |
|
| 80 | 80 | echo("<p>$username <a href=\"logout.php\">abmelden</a></p>"); |
| 81 | - } |
|
| 81 | + } |
|
| 82 | 82 | ?> |
| 83 | 83 | |
| 84 | 84 | </body> |
@@ -145,8 +145,7 @@ |
||
| 145 | 145 | if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { |
| 146 | 146 | if (php_sapi_name() == 'cgi') { |
| 147 | 147 | header('Status: 303 See Other'); |
| 148 | - } |
|
| 149 | - else { |
|
| 148 | + } else { |
|
| 150 | 149 | header('HTTP/1.1 303 See Other'); |
| 151 | 150 | } |
| 152 | 151 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | return $device; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - function checkCredentials($username, $password) { |
|
| 50 | + function checkCredentials($username, $password) { |
|
| 51 | 51 | // Check username + password against fixed internal value and |
| 52 | 52 | // external proxy with authentisation. |
| 53 | 53 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $errtext = _('Invalid credentials!'); |
| 105 | 105 | } |
| 106 | 106 | return false; |
| 107 | - } |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | 109 | $username = ''; |
| 110 | 110 | $pin = ''; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $posted_pin = $_REQUEST['pin']; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 116 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 117 | 117 | session_start(); |
| 118 | 118 | $username = escapeshellcmd($_POST['username']); |
| 119 | 119 | $password = ''; |
@@ -141,20 +141,20 @@ discard block |
||
| 141 | 141 | $_SESSION['monitor'] = CONFIG_STATIONNAME; |
| 142 | 142 | $dbcon->addUser($username, $dbcon->ipAddress(), getDevice()); |
| 143 | 143 | |
| 144 | - // Weiterleitung zur geschützten Startseite |
|
| 145 | - if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { |
|
| 144 | + // Weiterleitung zur geschützten Startseite |
|
| 145 | + if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { |
|
| 146 | 146 | if (php_sapi_name() == 'cgi') { |
| 147 | - header('Status: 303 See Other'); |
|
| 148 | - } |
|
| 147 | + header('Status: 303 See Other'); |
|
| 148 | + } |
|
| 149 | 149 | else { |
| 150 | - header('HTTP/1.1 303 See Other'); |
|
| 151 | - } |
|
| 150 | + header('HTTP/1.1 303 See Other'); |
|
| 151 | + } |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | header('Location: ' . CONFIG_START_URL); |
| 155 | 155 | exit; |
| 156 | 156 | } |
| 157 | - } |
|
| 157 | + } |
|
| 158 | 158 | ?> |
| 159 | 159 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 160 | 160 | "http://www.w3.org/TR/html4/strict.dtd"> |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | |
| 349 | 349 | // trying mousemove and click for better vnc control |
| 350 | 350 | displayCommand("xdotool mousemove --window $windowhex 100 100 " . |
| 351 | - "key $key"); |
|
| 351 | + "key $key"); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | if ($windowname && array_key_exists('keydown', $_REQUEST)) { |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | // trying mousemove and click for better vnc control |
| 365 | 365 | displayCommand("xdotool mousemove --window $windowhex 100 100 " . |
| 366 | - "key $key"); |
|
| 366 | + "key $key"); |
|
| 367 | 367 | //~ displayCommand("xdotool windowfocus $windowhex keydown $key"); |
| 368 | 368 | } |
| 369 | 369 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $section = $w['section']; |
| 192 | 192 | if ($section >= 1 && $section <= $maxSection && $enabled) { |
| 193 | 193 | // Show window, set size and position. |
| 194 | - $wi = $section - 1; |
|
| 194 | + $wi = $section-1; |
|
| 195 | 195 | $dx = $screenWidth / $dim[$wi][2]; |
| 196 | 196 | $dy = $screenHeight / $dim[$wi][3]; |
| 197 | 197 | $x = $dim[$wi][0] * $dx; |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | // TODO: check how to insert the userid for all content, not just vnc. |
| 283 | 283 | // Perhaps better add to array in upload.php ? |
| 284 | 284 | $userid = ""; |
| 285 | - $queryid = $db->querySingle('SELECT user.userid FROM user WHERE user.name="' . $new['userid'] .'"'); |
|
| 285 | + $queryid = $db->querySingle('SELECT user.userid FROM user WHERE user.name="' . $new['userid'] . '"'); |
|
| 286 | 286 | if (!empty($queryid)) { |
| 287 | 287 | $userid = $queryid; |
| 288 | 288 | } else { |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | if ($windownumber != 'vncwin') { |
| 340 | 340 | // This is the normal case. |
| 341 | 341 | // Special handling is needed when called with window=vncwin, see below. |
| 342 | - $window = $windownumber - 1; |
|
| 342 | + $window = $windownumber-1; |
|
| 343 | 343 | |
| 344 | 344 | $win_id = $db->getWindowIDBySection($windownumber); |
| 345 | 345 | $windowlist = windowList(); |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | trace("+++ DELETE VNC Client FROM DAEMON +++"); |
| 403 | 403 | // call via daemon: ?window=vncwin&delete=VNC&vncid=123 |
| 404 | 404 | trace("vnc delete in control"); |
| 405 | - $win_id = $_REQUEST['vncid']; // = hexWindow in database, but not on screen |
|
| 405 | + $win_id = $_REQUEST['vncid']; // = hexWindow in database, but not on screen |
|
| 406 | 406 | trace("VNC cia Daemon ... id=$win_id"); |
| 407 | 407 | |
| 408 | 408 | } elseif (strstr($delete, "http")) { |