@@ -13,7 +13,7 @@ |
||
13 | 13 | $err = NULL; |
14 | 14 | |
15 | 15 | if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
16 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
16 | + exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
17 | 17 | |
18 | 18 | if (addtolist ($mysqli,$user,$_POST['value'],$tables["$typedesc"],$_POST['unit'],$_POST['quantity'],$_POST['reason'],$err)) |
19 | 19 | print 'OK '.$_POST["type"].' <'.$_POST['value'].'> first time listed for '.$_POST['quantity'].$_POST['unit'].'.'; |
@@ -1,25 +1,25 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once('config.php'); |
3 | 3 | require_once('function.php'); |
4 | -$typedesc=$_POST['type']; |
|
4 | +$typedesc = $_POST['type']; |
|
5 | 5 | $type = $tables["$typedesc"]['field']; |
6 | 6 | $table = ($tables["$typedesc"]['milter']) ? milterTable($type) : $tables["$typedesc"]['name']; |
7 | 7 | |
8 | 8 | openlog($tag, LOG_PID, $fac); |
9 | 9 | if (empty($_POST['reason'])) die ("<p>Please, specify a reason!</p>"); |
10 | -if (preg_match( '/[^\x20-\x7f]/', $_POST['reason'])) |
|
11 | - exit('<p>ERROR: <'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'> contains NON ASCII chars.</p>'); |
|
10 | +if (preg_match('/[^\x20-\x7f]/', $_POST['reason'])) |
|
11 | + exit('<p>ERROR: <'.htmlentities($_POST['reason'], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'> contains NON ASCII chars.</p>'); |
|
12 | 12 | $user = username(); |
13 | 13 | $err = NULL; |
14 | 14 | |
15 | -if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
|
16 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
15 | +if (($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE) |
|
16 | + exit ($user.': Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error); |
|
17 | 17 | |
18 | -if (addtolist ($mysqli,$user,$_POST['value'],$tables["$typedesc"],$_POST['unit'],$_POST['quantity'],$_POST['reason'],$err)) |
|
18 | +if (addtolist($mysqli, $user, $_POST['value'], $tables["$typedesc"], $_POST['unit'], $_POST['quantity'], $_POST['reason'], $err)) |
|
19 | 19 | print 'OK '.$_POST["type"].' <'.$_POST['value'].'> first time listed for '.$_POST['quantity'].$_POST['unit'].'.'; |
20 | 20 | else |
21 | 21 | print 'List operation ERROR; check log.'; |
22 | -if (!is_null($err) ) print htmlentities(' Error: ' . $err); |
|
22 | +if (!is_null($err)) print htmlentities(' Error: '.$err); |
|
23 | 23 | $mysqli->close(); |
24 | 24 | closelog(); |
25 | 25 | ?> |
@@ -6,20 +6,27 @@ |
||
6 | 6 | $table = ($tables["$typedesc"]['milter']) ? milterTable($type) : $tables["$typedesc"]['name']; |
7 | 7 | |
8 | 8 | openlog($tag, LOG_PID, $fac); |
9 | -if (empty($_POST['reason'])) die ("<p>Please, specify a reason!</p>"); |
|
10 | -if (preg_match( '/[^\x20-\x7f]/', $_POST['reason'])) |
|
9 | +if (empty($_POST['reason'])) { |
|
10 | + die ("<p>Please, specify a reason!</p>"); |
|
11 | +} |
|
12 | +if (preg_match( '/[^\x20-\x7f]/', $_POST['reason'])) { |
|
11 | 13 | exit('<p>ERROR: <'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'> contains NON ASCII chars.</p>'); |
14 | +} |
|
12 | 15 | $user = username(); |
13 | 16 | $err = NULL; |
14 | 17 | |
15 | -if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
|
18 | +if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) { |
|
16 | 19 | exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
20 | +} |
|
17 | 21 | |
18 | -if (addtolist ($mysqli,$user,$_POST['value'],$tables["$typedesc"],$_POST['unit'],$_POST['quantity'],$_POST['reason'],$err)) |
|
22 | +if (addtolist ($mysqli,$user,$_POST['value'],$tables["$typedesc"],$_POST['unit'],$_POST['quantity'],$_POST['reason'],$err)) { |
|
19 | 23 | print 'OK '.$_POST["type"].' <'.$_POST['value'].'> first time listed for '.$_POST['quantity'].$_POST['unit'].'.'; |
20 | -else |
|
24 | +} else { |
|
21 | 25 | print 'List operation ERROR; check log.'; |
22 | -if (!is_null($err) ) print htmlentities(' Error: ' . $err); |
|
26 | +} |
|
27 | +if (!is_null($err) ) { |
|
28 | + print htmlentities(' Error: ' . $err); |
|
29 | +} |
|
23 | 30 | $mysqli->close(); |
24 | 31 | closelog(); |
25 | 32 | ?> |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $user = username(); |
11 | 11 | |
12 | 12 | if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
13 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
13 | + exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
14 | 14 | if (remove ($mysqli,$user,$_POST['value'],$type,$table)) |
15 | 15 | print 'OK '.$typedesc.' <'.$_POST['value'].'> permanently REMOVED!'; |
16 | 16 | else |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once('config.php'); |
3 | 3 | require_once('function.php'); |
4 | -$typedesc=$_POST['type']; |
|
5 | -$type = $tables["$typedesc"]['field']; |
|
4 | +$typedesc = $_POST['type']; |
|
5 | +$type = $tables["$typedesc"]['field']; |
|
6 | 6 | $table = ($tables["$typedesc"]['milter']) ? milterTable($type) : $tables["$typedesc"]['name']; |
7 | 7 | $cl = ($tables["$typedesc"]['milter']) ? 10 : 9; |
8 | 8 | printf('<td colspan="%d" style="text-align: center">', $cl); |
9 | 9 | openlog($tag, LOG_PID, $fac); |
10 | 10 | $user = username(); |
11 | 11 | |
12 | -if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
|
13 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
14 | -if (remove ($mysqli,$user,$_POST['value'],$type,$table)) |
|
12 | +if (($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE) |
|
13 | + exit ($user.': Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error); |
|
14 | +if (remove($mysqli, $user, $_POST['value'], $type, $table)) |
|
15 | 15 | print 'OK '.$typedesc.' <'.$_POST['value'].'> permanently REMOVED!'; |
16 | 16 | else |
17 | 17 | print 'Delete operation ERROR on '.$typedesc.' <'.$_POST['value'].'>; check log.'; |
@@ -9,12 +9,14 @@ |
||
9 | 9 | openlog($tag, LOG_PID, $fac); |
10 | 10 | $user = username(); |
11 | 11 | |
12 | -if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
|
12 | +if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) { |
|
13 | 13 | exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
14 | -if (remove ($mysqli,$user,$_POST['value'],$type,$table)) |
|
14 | +} |
|
15 | +if (remove ($mysqli,$user,$_POST['value'],$type,$table)) { |
|
15 | 16 | print 'OK '.$typedesc.' <'.$_POST['value'].'> permanently REMOVED!'; |
16 | -else |
|
17 | +} else { |
|
17 | 18 | print 'Delete operation ERROR on '.$typedesc.' <'.$_POST['value'].'>; check log.'; |
19 | +} |
|
18 | 20 | print '</td>'; |
19 | 21 | $mysqli->close(); |
20 | 22 | closelog(); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | $adm = unserialize($_POST["adm"]); |
3 | -if (in_array($_POST["user"],array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>'; |
|
3 | +if (in_array($_POST["user"], array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>'; |
|
4 | 4 | else $extopt = NULL; |
5 | 5 | |
6 | 6 | require_once('config.php'); |
7 | -$typedesc=$_POST['type']; |
|
7 | +$typedesc = $_POST['type']; |
|
8 | 8 | $cl = ($tables["$typedesc"]['milter']) ? 10 : 9; |
9 | 9 | ?> |
10 | 10 |
@@ -1,7 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | $adm = unserialize($_POST["adm"]); |
3 | -if (in_array($_POST["user"],array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>'; |
|
4 | -else $extopt = NULL; |
|
3 | +if (in_array($_POST["user"],array_keys(array_filter($adm)))) { |
|
4 | + $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>'; |
|
5 | +} else { |
|
6 | + $extopt = NULL; |
|
7 | +} |
|
5 | 8 | |
6 | 9 | require_once('config.php'); |
7 | 10 | $typedesc=$_POST['type']; |
@@ -12,7 +12,7 @@ |
||
12 | 12 | $user = username(); |
13 | 13 | |
14 | 14 | if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
15 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
15 | + exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
16 | 16 | |
17 | 17 | if (changestatus($mysqli,username(),$_POST['value'],'0',$type,$table)) |
18 | 18 | print 'OK '.$_POST["type"].' <'.$_POST['value'].'> delisted.'; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | require_once('config.php'); |
3 | 3 | require_once('function.php'); |
4 | -$typedesc=$_POST['type']; |
|
4 | +$typedesc = $_POST['type']; |
|
5 | 5 | $type = $tables["$typedesc"]['field']; |
6 | 6 | $table = ($tables["$typedesc"]['milter']) ? milterTable($type) : $tables["$typedesc"]['name']; |
7 | 7 | $cl = ($tables["$typedesc"]['milter']) ? 10 : 9; |
@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | openlog($tag, LOG_PID, $fac); |
12 | 12 | $user = username(); |
13 | 13 | |
14 | -if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
|
15 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
|
14 | +if (($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE) |
|
15 | + exit ($user.': Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error); |
|
16 | 16 | |
17 | -if (changestatus($mysqli,username(),$_POST['value'],'0',$type,$table)) |
|
17 | +if (changestatus($mysqli, username(), $_POST['value'], '0', $type, $table)) |
|
18 | 18 | print 'OK '.$_POST["type"].' <'.$_POST['value'].'> delisted.'; |
19 | 19 | else |
20 | 20 | print 'ERROR in delist <'.$_POST['value'].'>; check log'; |
@@ -11,13 +11,15 @@ |
||
11 | 11 | openlog($tag, LOG_PID, $fac); |
12 | 12 | $user = username(); |
13 | 13 | |
14 | -if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) |
|
14 | +if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user)) === FALSE ) { |
|
15 | 15 | exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); |
16 | +} |
|
16 | 17 | |
17 | -if (changestatus($mysqli,username(),$_POST['value'],'0',$type,$table)) |
|
18 | +if (changestatus($mysqli,username(),$_POST['value'],'0',$type,$table)) { |
|
18 | 19 | print 'OK '.$_POST["type"].' <'.$_POST['value'].'> delisted.'; |
19 | -else |
|
20 | +} else { |
|
20 | 21 | print 'ERROR in delist <'.$_POST['value'].'>; check log'; |
22 | +} |
|
21 | 23 | print '</td>'; |
22 | 24 | $mysqli->close(); |
23 | 25 | closelog(); |