Permalink
Browse files

Fix Coding Styleguide issues

  • Loading branch information...
andygrunwald committed Jun 7, 2018
1 parent cf943a3 commit 9e8ba8145bd813b66be6f445695f160ac9068ba9
@@ -1,6 +1,7 @@
<?php
namespace LanSuite;
use LanSuite\AzDGCrypt;
/**
@@ -14,7 +14,8 @@
ini_set('url_rewriter.tags', '');
}
function myErrorHandler($errno, $errstr, $errfile, $errline) {
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
global $PHPErrors, $PHPErrorsFound, $db, $auth;
// Only show errors, which sould be reported according to error_reporting
@@ -97,7 +98,8 @@ function myErrorHandler($errno, $errstr, $errfile, $errline) {
// Write to DB-Log
if (isset($db) and $db->success) {
$db->qry('
$db->qry(
'
INSERT INTO %prefix%log
SET date = NOW(),
userid = %int%,
@@ -154,7 +156,6 @@ function myErrorHandler($errno, $errstr, $errfile, $errline) {
foreach ($_GET as $key => $val) {
if (!is_array($_GET[$key])) {
$_GET[$key] = $func->NoHTML($_GET[$key], 1);
} else {
foreach ($_GET[$key] as $key2 => $val2) {
if (!is_array($_GET[$key][$key2])) {
@@ -292,7 +293,6 @@ function myErrorHandler($errno, $errstr, $errfile, $errline) {
if ($_GET["action"] == "wizard" && isset($_GET["step"]) && $_GET["step"] > 3) {
$cfg = $func->read_db_config();
}
} else {
// Normal auth cycle and Database-init
$db->connect(0);
@@ -5,11 +5,11 @@
// Execute install.php only if dependencies are met
$preCheckResult = dependencyPreCheck();
if ($preCheckResult){
// Issue(s) found, show text to user
echo $preCheckResult;
if ($preCheckResult) {
// Issue(s) found, show text to user
echo $preCheckResult;
} else {
// No issues found, continue execution
$_GET["mod"] = "install";
include_once("index.php");
// No issues found, continue execution
$_GET["mod"] = "install";
include_once("index.php");
}
@@ -32,8 +32,8 @@
md5($_POST["password"]),
$_POST["email"]
);
} // If not found, insert
else {
// If not found, insert
} else {
$db->qry(
"INSERT INTO %prefix%user SET username = 'ADMIN', firstname = 'ADMIN', name = 'ADMIN', email=%string%, password = %string%, type = '3'",
$_POST["email"],
@@ -658,14 +658,14 @@ public function DrawPlan($blockid, $mode, $linktarget = '', $selected_user = fal
// If free and user has not paid-> Possibility to mark this seat
if ($seat_state[$y][$x] == 1 and !$user_paid['paid']) {
$link = "index.php?mod=seating&action=show&step=12&blockid=$blockid&row=$y&col=$x";
} // If free, or marked for another one -> Possibility to reserve this seat
elseif ($seat_state[$y][$x] == 1 or ($seat_state[$y][$x] == 3 and $seat_userid[$y][$x] != $auth['userid'])) {
// If free, or marked for another one -> Possibility to reserve this seat
} elseif ($seat_state[$y][$x] == 1 or ($seat_state[$y][$x] == 3 and $seat_userid[$y][$x] != $auth['userid'])) {
$link = "index.php?mod=seating&action=show&step=10&blockid=$blockid&row=$y&col=$x";
} // If assigned to me, or marked for me -> Possibility to free this seat again
elseif (($seat_state[$y][$x] == 2 or $seat_state[$y][$x] == 3) and $seat_userid[$y][$x] == $auth['userid']) {
// If assigned to me, or marked for me -> Possibility to free this seat again
} elseif (($seat_state[$y][$x] == 2 or $seat_state[$y][$x] == 3) and $seat_userid[$y][$x] == $auth['userid']) {
$link = "index.php?mod=seating&action=show&step=20&blockid=$blockid&row=$y&col=$x";
} // If assigned and user is admin -> Possibility to free this seat
elseif ($seat_state[$y][$x] == 2 and $auth['type'] > 1) {
// If assigned and user is admin -> Possibility to free this seat
} elseif ($seat_state[$y][$x] == 2 and $auth['type'] > 1) {
#$link = "index.php?mod=seating&action=show&step=30&blockid=$blockid&row=$y&col=$x";
}
}
@@ -757,14 +757,14 @@ public function DrawPlan($blockid, $mode, $linktarget = '', $selected_user = fal
if ($seat_userid[$y][$x] == $userid) {
$seat_state[$y][$x] = 4;
} // My Seat
elseif (in_array($seat_userid[$y][$x], $my_clanmates)) {
// My Seat
} elseif (in_array($seat_userid[$y][$x], $my_clanmates)) {
$seat_state[$y][$x] = 5;
} // Clanmate
elseif ($seat_user_checkout[$y][$x] and $seat_user_checkout[$y][$x] != '0000-00-00 00:00:00') {
// Clanmate
} elseif ($seat_user_checkout[$y][$x] and $seat_user_checkout[$y][$x] != '0000-00-00 00:00:00') {
$seat_state[$y][$x] = 6;
} // Checked out
elseif ($seat_user_checkin[$y][$x] and $seat_user_checkin[$y][$x] != '0000-00-00 00:00:00') {
// Checked out
} elseif ($seat_user_checkin[$y][$x] and $seat_user_checkin[$y][$x] != '0000-00-00 00:00:00') {
$seat_state[$y][$x] = 8;
} // Checked in
// else = 2 -> Normal occupied seat
@@ -47,14 +47,14 @@
// Check paid
if (!$user_data['paid'] and $cfg['seating_paid_only'] and !$cfg['seating_not_paid_mark']) {
$func->information(t('Du musst zuerst für diese Party bezahlen, bevor du dir einen Sitzplatz reservieren darfst.'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // Check seat availability
elseif ($seat_user['status'] == 2) {
// Check seat availability
} elseif ($seat_user['status'] == 2) {
$func->error(t('Dieser Sitzplatz ist bereits vergeben'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // Check seat availability
elseif ($seat_user['status'] == 0 or $seat_user['status'] > 9) {
// Check seat availability
} elseif ($seat_user['status'] == 0 or $seat_user['status'] > 9) {
$func->error(t('Dieser Sitzplatz existiert nicht'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // No errors
else {
// No errors
} else {
// Get number of marked seats of this user
$marked_seats = $db->qry_first("
SELECT COUNT(*) AS anz
@@ -166,20 +166,20 @@
// Check paid
if (!$user_data['paid'] and $cfg['seating_paid_only']) {
$func->information(t('Du musst zuerst für diese Party bezahlen, bevor du dir einen Sitzplatz reservieren darfst.'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // Check Group ID
elseif ($block_data['group_id'] and $user['group_id'] != $block_data['group_id']) {
// Check Group ID
} elseif ($block_data['group_id'] and $user['group_id'] != $block_data['group_id']) {
$func->information(t('Du gehörst nicht der richtigen Gruppe an, um in diesem Block einen Sitz zu reservieren'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // Check Price ID
elseif ($block_data['price_id'] and $user_data['price_id'] != $block_data['price_id']) {
// Check Price ID
} elseif ($block_data['price_id'] and $user_data['price_id'] != $block_data['price_id']) {
$func->information(t('Du bist nicht dem richtigen Eintrittspreis zugeordnet, um in diesem Block einen Sitz zu reservieren'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // Check seat availability
elseif ($seat_user['status'] == 2) {
// Check seat availability
} elseif ($seat_user['status'] == 2) {
$func->error(t('Dieser Sitzplatz ist bereits vergeben'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // Check is a seat
elseif ($seat_user['status'] == 0 or $seat_user['status'] > 9) {
// Check is a seat
} elseif ($seat_user['status'] == 0 or $seat_user['status'] > 9) {
$func->error(t('Dieser Sitzplatz existiert nicht'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
} // No errors
else {
// No errors
} else {
$seat2->AssignSeat($_GET['userid'], $_GET['blockid'], $_GET['row'], $_GET['col']);
$func->confirmation(t('Der Sitzplatz wurde erfolgreich reserviert'), "index.php?mod=seating&action=show&step=2&blockid={$_GET['blockid']}");
}
@@ -44,23 +44,23 @@
<table border="0" width="<?php echo $cfg['tabellenbreite'] ?>" bgcolor = "<?php echo $cfg['hintergrund'] ?>">
<tr>
<td>
<?php
<?php
// Display the Teamspeak server
$teamspeakDisplay->displayTeamspeakEx($settings);
echo('<br />');
$teamspeakDisplay->displayTeamspeakEx($settings);
echo('<br />');
// Display autorefresh status and control link:
if ($autorefresh == 0) {
echo('<img src="ext_inc/teamspeak2/refresh_off.gif"><b>Autorefresh:</b> <font color=red><b>'. t('AUS') .'</b></font> (<a href="'. $_SERVER["PHP_SELF"] . '?mod=teamspeak2&autorefresh=1">'. t('Aktivieren') .'</a>)');
} else {
echo('<img src="ext_inc/teamspeak2/refresh_on.gif"><b>Autorefresh:</b> <font color=green><b>'. t('AN') .'</b></font> (<a href="'. $_SERVER["PHP_SELF"] . '?mod=teamspeak2&autorefresh=0">'. t('Deaktivieren') .'</a>)');
} ?>
if ($autorefresh == 0) {
echo('<img src="ext_inc/teamspeak2/refresh_off.gif"><b>Autorefresh:</b> <font color=red><b>'. t('AUS') .'</b></font> (<a href="'. $_SERVER["PHP_SELF"] . '?mod=teamspeak2&autorefresh=1">'. t('Aktivieren') .'</a>)');
} else {
echo('<img src="ext_inc/teamspeak2/refresh_on.gif"><b>Autorefresh:</b> <font color=green><b>'. t('AN') .'</b></font> (<a href="'. $_SERVER["PHP_SELF"] . '?mod=teamspeak2&autorefresh=0">'. t('Deaktivieren') .'</a>)');
} ?>
</td>
</tr>
</table>
<?php
$dsp->AddSingleRow(ob_get_contents());
ob_end_clean();
<?php
$dsp->AddSingleRow(ob_get_contents());
ob_end_clean();
}
?>
@@ -30,11 +30,11 @@
$rowtest = $db->qry_first("SELECT COUNT(*) AS n FROM %prefix%troubleticket WHERE ttid = %int%", $tt_id);
$numrows = $rowtest["n"];
// Prüfen ob ticketid leer ist
// Check if ticketid is empty
if ($tt_id == "") {
$func->information(t('Es wurde keine Troubleticket-ID übergeben. Aufruf inkorrekt.'));
} // Prüfen ob ticketid gültig ist
elseif ($numrows == "") {
// Check if ticket is is valid
} elseif ($numrows == "") {
$func->information(t('Es wurde keine Troubleticket-ID übergeben. Aufruf inkorrekt.'));
} else {
$dsp->NewContent(t('Troubleticket bearbeiten'), "");
@@ -11,11 +11,11 @@
$rowtest = $db->qry_first("SELECT COUNT(*) AS n FROM %prefix%troubleticket WHERE ttid = %int%", $tt_id);
$numrows = $rowtest["n"];
// Prüfen ob ticketid leer ist
// Check if ticketid is empty
if ($tt_id == "") {
$func->information(t('Es wurde keine Troubleticket-ID übergeben. Aufruf inkorrekt.'));
} // Prüfen ob ticketid gültig ist
elseif ($numrows == "") {
// Check if ticketid is valid
} elseif ($numrows == "") {
$func->information(t('Es wurde keine Troubleticket-ID übergeben. Aufruf inkorrekt.'));
} else {
$dsp->NewContent(t('Troubleticket anzeigen'), t('Hier siehst du alle Informationen zu diesem Ticket'));
@@ -106,8 +106,8 @@ public function CheckPerso($code)
if ((strlen($code) != 36) ||
(strlen($perso_block[0]) != 11) || (strlen($perso_block[2]) != 7) || (strlen($perso_block[3]) != 7) || (strlen($perso_block[10]) != 1)) {
return 2;
} // Chechsum Check
else {
// Chechsum Check
} else {
$multiplier = array("7", "3", "1");
$cs1 = 0;
@@ -187,8 +187,8 @@
if ($seat['status'] == 1 or $seat['status'] == 3) {
$_GET['step'] = 10;
} //Status vorreserviert oder frei
elseif ($seat['status'] == 2) {
// Status pre reserverd or free
} elseif ($seat['status'] == 2) {
$questionarray = array();
$linkarray = array();

0 comments on commit 9e8ba81

Please sign in to comment.