Skip to content

Commit

Permalink
Update PHP_CodeSniffer configuration and clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
jmechnich committed Jul 3, 2023
1 parent 883432c commit 44778e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 0 additions & 5 deletions .phpcs.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
./theme/demo/simple/screensaver.php
./theme/ub-mannheim/common/screensaver.php
./theme/ub-mannheim/be/screensaver.php
./theme/ub-mannheim/be/console.php
./theme/ub-mannheim/lc/screensaver.php
./theme/ub-mannheim/lc/console.php
./theme/ub-mannheim/a3/screensaver.php
./theme/ub-mannheim/a3/console.php
./theme/ub-mannheim/a5/screensaver.php
./theme/ub-mannheim/a5/console.php
./theme/ub-mannheim/bwl/screensaver.php
./theme/ub-mannheim/bwl/console.php
./auth.php
./upload.php
./SSVNCDaemon.php
Expand Down
2 changes: 1 addition & 1 deletion SSVNCDaemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function readLog($handle)
}

if (strstr($buffer, 'create_image') && $client["ip"] != "" &&
$client["hostname"]!="" ) {
$client["hostname"]!="") {
// add client
$this->addClient($client["ip"], $client["hostname"]);

Expand Down
3 changes: 2 additions & 1 deletion auth.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

function showLogin() {
function showLogin()
{
//if (isset($_SERVER['HTTP_REFERER'])) {
// error_log("auth.php referred by " . $_SERVER['HTTP_REFERER']);
//}
Expand Down
10 changes: 5 additions & 5 deletions control.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function setLayout($layout)
}

// Make sure $layout is valid
if (!array_key_exists($layout, $geom)){
if (!array_key_exists($layout, $geom)) {
trace("layout invalid!");
} else {
$db->exec("UPDATE setting SET value='$layout' WHERE key='layout'");
Expand Down Expand Up @@ -442,7 +442,7 @@ function processRequests($db)
$file_in_db = $db->querySingle("SELECT id FROM window WHERE file='$delete'");
$delete = str_replace(" ", "\ ", $delete);
trace("file in db: $file_in_db");
if ($file_in_db){
if ($file_in_db) {
if (file_exists($delete)) {
trace("+++ DELETE FILE FROM WEBINTERFACE +++");
unlink($delete);
Expand Down Expand Up @@ -543,14 +543,14 @@ function processRequests($db)

// If URL leads to pdf file, download it and treat as upload
$headers = get_headers($openURL, 1);
if ($headers["Content-Type"] == "application/pdf"){
if ($headers["Content-Type"] == "application/pdf") {
trace("url seems to lead to a pdf file, so downloading it...");
$temp_name = basename($openURL);
$temp_dir = "/tmp";
file_put_contents("$temp_dir/$temp_name", file_get_contents($openURL));
$mimetype = mime_content_type("$temp_dir/$temp_name");
trace("mimetype is $mimetype");
if ($mimetype == "application/pdf"){
if ($mimetype == "application/pdf") {
$_FILES['file']['name'] = "$temp_name";
$_FILES['file']['tmp_name'] = "$temp_dir/$temp_name";
$_FILES['file']['error'] = "downloaded_from_url";
Expand All @@ -569,7 +569,7 @@ function processRequests($db)
"section" => "",
"state" => "",
"file" => $openURL,
"handler" => "palma-browser",
"handler" => "palma-browser",
"userid" => "",
"date" => $date
);
Expand Down

0 comments on commit 44778e3

Please sign in to comment.