Skip to content
Permalink
Browse files

Fix some CGL issues

  • Loading branch information...
andygrunwald committed May 26, 2018
1 parent 671d567 commit fb9b14f67f08fa6b74dcd1834ce283c10097d91c
@@ -9,7 +9,8 @@
*
* @todo Change uniqkey from md5(password) to an extra Field
*/
class Auth {
class Auth
{
/**
* Userdata
@@ -99,7 +100,8 @@ class Auth {
* auth constructor.
* @param string $frmwrkmode Frameworkmode for switch Stats
*/
public function __construct($frmwrkmode = "") {
public function __construct($frmwrkmode = "")
{
global $db;
$this->auth["sessid"] = session_id();
@@ -141,7 +143,6 @@ public function __construct($frmwrkmode = "") {
// and there the user is active, it will count as an online user.
if ($row['online'] > 0) {
$this->online_users[] = $row['userid'];
} else {
$this->away_users[] = $row['userid'];
}
@@ -221,15 +222,12 @@ public function login($email, $password, $show_confirmation = 1)
if ($tmp_login_email == "") {
$func->information(t('Bitte gib deine E-Mail-Adresse oder deine Lansuite-ID ein.'), '', 1);
} elseif ($tmp_login_pass == "") {
$func->information(t('Bitte gib dein Kennwort ein.'), '', 1);
} else {
$is_email = strstr($tmp_login_email, '@');
if (!$is_email) {
$is_email = 0;
} else {
$is_email = 1;
}
@@ -387,10 +385,8 @@ private function login_cookie($userid, $uniquekey)
if ($userid == "") {
$func->information(t('Keine Userid beim Login via Cookie erkannt.'), '', 1);
} elseif ($uniquekey == "") {
$func->information(t('Kein Uniquekey beim Login via Cookie erkannt.'), '', 1);
} else {
$this->login($userid, $uniquekey, 0);
}
@@ -456,7 +452,6 @@ public function switchto($target_id)
$db->qry('UPDATE %prefix%stats_auth SET userid=%int%, login=\'1\' WHERE sessid=%string%', $target_id, $this->auth["sessid"]);
$func->confirmation(t('Benutzerwechsel erfolgreich. Die Änderungen werden beim laden der nächsten Seite wirksam.'), '', 1); //FIX meldungen auserhalb/standart?!?
} else {
$func->error(t('Dein Benutzerlevel ist geringer, als das des Ziel-Benutzers. Ein Wechsel ist daher untersagt'), '', 1); //FIX meldungen auserhalb/standart?!
}
@@ -489,11 +484,9 @@ public function switchback()
$this->cookie_set();
$func->confirmation(t('Benutzerwechsel erfolgreich. Die Änderungen werden beim laden der nächsten Seite wirksam.'), '', 1);
} else {
$func->information(t('Fehler: Falscher switch back code! Das kann daran liegen, dass dein Browser keine Cookies unterstützt.'), '', 1);
}
} else {
$func->information(t('Fehler: Keine Switchbackdaten gefunden! Das kann daran liegen, dass dein Browser keine Cookies unterstützt.'), '', 1);
}
@@ -514,7 +507,6 @@ public function authorized($requirement)
case 1:
if ($this->auth['login']) {
return true;
} else {
$func->information('NO_LOGIN');
}
@@ -524,10 +516,8 @@ public function authorized($requirement)
case 2:
if ($this->auth['type'] > 1) {
return true;
} elseif (!$this->auth['login']) {
$func->information('NO_LOGIN');
} else {
$func->information('ACCESS_DENIED');
}
@@ -537,10 +527,8 @@ public function authorized($requirement)
case 3:
if ($this->auth['type'] > 2) {
return true;
} elseif (!$this->auth['login']) {
$func->information('NO_LOGIN');
} else {
$func->information('ACCESS_DENIED');
}
@@ -550,7 +538,6 @@ public function authorized($requirement)
case 4:
if ($this->auth['type'] < 2) {
return true;
} else {
$func->information('ACCESS_DENIED');
}
@@ -560,7 +547,6 @@ public function authorized($requirement)
case 5:
if (!$this->auth['login']) {
return true;
} else {
$func->information('ACCESS_DENIED');
}
@@ -832,16 +832,16 @@ public function _codaBarcode($barnumber, $scale = 1, $file = "")
Check digit, encoded using encoding table below.
Final frame bar, encoded as a single 1.
0 11000
1 00011
2 00101
3 00110
4 01001
5 01010
6 01100
7 10001
8 10010
9 10100
0 11000
1 00011
2 00101
3 00110
4 01001
5 01010
6 01100
7 10001
8 10010
9 10100
*/
public function _postEncode($barnumber)
@@ -952,17 +952,17 @@ public function _postBarcode($barnumber, $scale = 1, $file = "")
Data characters properly encoded (see encoding table below).
Stop character, encoded as 11010110.
ASCII BARCODE
0 NNWWN
1 WNNNW
2 NWNNW
3 WWNNN
4 NNWNW
5 WNWNN
6 NWWNN
7 NNNWW
8 WNNWN
9 NWNWN
ASCII BARCODE
0 NNWWN
1 WNNNW
2 NWNNW
3 WWNNN
4 NNWNW
5 WNWNN
6 NWWNN
7 NNNWW
8 WNNWN
9 NWNWN
*/
public function _i25Encode($barnumber)
@@ -1089,17 +1089,17 @@ public function _i25Barcode($barnumber, $scale = 1, $file = "")
Data characters properly encoded (see encoding table below).
Stop character, encoded as 11010110.
ASCII BARCODE
0 NNWWN
1 WNNNW
2 NWNNW
3 WWNNN
4 NNWNW
5 WNWNN
6 NWWNN
7 NNNWW
8 WNNWN
9 NWNWN
ASCII BARCODE
0 NNWWN
1 WNNNW
2 NWNNW
3 WWNNN
4 NNWNW
5 WNWNN
6 NWWNN
7 NNNWW
8 WNNWN
9 NWNWN
*/
public function _so25Encode($barnumber)
@@ -1577,17 +1577,17 @@ public function _ean13CheckDigit($barnumber)
SYSTEM DIGIT PARITY TO ENCODE WITH
SECOND NUMBER
SYSTEM DIGIT MANUFACTURER CODE CHARACTERS
1 2 3 4 5
0 (UPC-A) Odd Odd Odd Odd Odd Odd
1 Odd Odd Even Odd Even Even
2 Odd Odd Even Even Odd Even
3 Odd Odd Even Even Even Odd
4 Odd Even Odd Odd Even Even
5 Odd Even Even Odd Odd Even
6 Odd Even Even Even Odd Odd
7 Odd Even Odd Even Odd Even
8 Odd Even Odd Even Even Odd
9 Odd Even Even Odd Even Odd
1 2 3 4 5
0 (UPC-A) Odd Odd Odd Odd Odd Odd
1 Odd Odd Even Odd Even Even
2 Odd Odd Even Even Odd Even
3 Odd Odd Even Even Even Odd
4 Odd Even Odd Odd Even Even
5 Odd Even Even Odd Odd Even
6 Odd Even Even Even Odd Odd
7 Odd Even Odd Even Odd Even
8 Odd Even Odd Even Even Odd
9 Odd Even Even Odd Even Odd
*/
@@ -88,11 +88,9 @@ private function escape($match)
if ($match[0] == '%int%') {
return (int)$CurrentArg;
} elseif ($match[0] == '%string%') {
$CurrentArg = stripslashes($CurrentArg);
return "'". mysqli_real_escape_string($this->link_id, (string)$CurrentArg) ."'";
} elseif ($match[0] == '%plain%') {
return $CurrentArg;
}
@@ -121,7 +119,6 @@ public function connect($save = false)
$this->connectfailure = 1;
$this->success = false;
return false;
} else {
echo HTML_FONT_ERROR . t('Die Verbindung zur Datenbank ist fehlgeschlagen. Lansuite wird abgebrochen. Zurückgegebener MySQL-Fehler: ' . mysqli_connect_error()) . HTML_FONT_END;
exit();
@@ -145,7 +142,6 @@ public function connect($save = false)
// Set encoding based on config file
if (!empty($charset)) {
$this->link_id->set_charset($charset);
} else {
$this->link_id->set_charset('utf8');
}
@@ -359,7 +355,8 @@ public function qry_first_rows()
/**
* @return string
*/
public function client_info() {
public function client_info()
{
return mysqli_get_client_info();
}
@@ -368,7 +365,8 @@ public function client_info() {
*
* @return string|bool
*/
public function getServerInfo() {
public function getServerInfo()
{
if ($this->link_id) {
return mysqli_get_server_info($this->link_id);
}
@@ -388,4 +386,4 @@ public function DisplayErrors()
$this->errors = '';
}
}
}
}
@@ -159,7 +159,6 @@ public function addvar($key, $value)
if ($this->mode > 0) {
if (is_string($key)) {
$this->debugvars[$key] = $value;
} else {
$this->debugvars["debugvar_".count($this->debugvars)] = $value;
}
@@ -196,7 +195,8 @@ private function query_fetchlist()
*/
private function sort_array_by_col($array)
{
function compare($wert_a, $wert_b) {
function compare($wert_a, $wert_b)
{
$a = $wert_a[0];
$b = $wert_b[0];
if ($a == $b) {
@@ -268,22 +268,18 @@ private function row_array($array, $array_node = null, $array_level = 0)
if ($array_level==0) {
$caption = $key;
} else {
$caption = "[".$key."]";
};
if (is_array($value)) {
$out .= debug::row_double($shift.$array_node.$caption, "(".gettype($value).")");
$out .= $this->row_array($value, $array_node.$caption, $array_level+1);
} elseif (is_object($value)) {
$out .= debug::row_double($shift.$array_node.$caption, "(".gettype($value).")&nbsp;");
$out .= $this->row_array(get_object_vars($value), $array_node.$caption, $array_level+1);
} elseif (is_scalar($value)) {
$out .= debug::row_double($shift.$array_node.$caption, "(".gettype($value).")&nbsp;".htmlentities($value));
} else {
$out .= debug::row_double($shift.$array_node.$caption, "(".gettype($value).")&nbsp;Error: Can not display Debug- Value!!!");
}
@@ -97,7 +97,6 @@ public function AddContentLine($content)
$smarty->assign('content', $content);
$MainContent .= $smarty->fetch('design/templates/ls_row_firstline.htm');
$this->FirstLine = 0;
} else {
$smarty->assign('content', $content);
$MainContent .= $smarty->fetch('design/templates/ls_row_line.htm');
@@ -492,13 +491,11 @@ public function AddTableRow($table)
$rows = '';
if (!is_array($table)) {
$func->error(t('AddTableRow: First argument needs to be array'));
} else {
foreach ($table as $y => $row) {
$cells = '';
if (!is_array($row)) {
$func->error(t('AddTableRow: First argument needs to be 2-dimension-array'));
} else {
foreach ($row as $x => $cell) {
if ($cell['link']) {
@@ -864,14 +861,12 @@ public function AddDateTimeRow($name, $key, $time, $errortext, $values = null, $
$year = date("Y", $time);
$hour = date("H", $time);
$min = date("i", $time);
} elseif ($values['day'] != "" and $values['month'] != "" and $values['year'] != "") {
$day = $values['day'];
$month = $values['month'];
$year = $values['year'];
$hour = $values['hour'];
$min = $values['min'];
} else {
$day = date("d");
$month = date("m");
@@ -1036,10 +1031,8 @@ public function AddFileSelectRow($name, $key, $errortext, $size = null, $maxleng
$maxfilesize = ini_get('upload_max_filesize');
if (strpos($maxfilesize, 'M') > 0) {
$maxfilesize = (int)$maxfilesize * 1024 * 1024;
} elseif (strpos($maxfilesize, 'K') > 0) {
$maxfilesize = (int)$maxfilesize * 1024;
} else {
$maxfilesize = (int)$maxfilesize;
}
@@ -1149,7 +1142,6 @@ public function FetchAttachmentRow($file)
$gd->CreateThumb($file, $FileThumb, '300', '300');
return HTML_NEWLINE . HTML_NEWLINE. '<a href="'. $file .'" target="_blank"><img src="'. $FileThumb .'" border="0" /></a>';
}
return HTML_NEWLINE . HTML_NEWLINE. $this->FetchIcon('download', $file) .' ('. t('Angehängte Datei herunterladen').')';
Oops, something went wrong.

0 comments on commit fb9b14f

Please sign in to comment.
You can’t perform that action at this time.