@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $sql = "UPDATE roles SET name = '$name', description = '$description' WHERE id = '$id'"; |
| 31 | 31 | |
| 32 | 32 | if (!mysqli_query(db(), $sql)) { |
| 33 | - exit('Error: '.mysqli_error(db())); |
|
| 33 | + exit('Error: ' . mysqli_error(db())); |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | $sql = "UPDATE groups SET name = '$name' WHERE groupId = '$key'"; |
| 40 | 40 | |
| 41 | 41 | if (!mysqli_query(db(), $sql)) { |
| 42 | - exit('Error: '.mysqli_error(db())); |
|
| 42 | + exit('Error: ' . mysqli_error(db())); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $sql = "UPDATE groups SET description = '$description' WHERE groupId = '$key'"; |
| 46 | 46 | |
| 47 | 47 | if (!mysqli_query(db(), $sql)) { |
| 48 | - exit('Error: '.mysqli_error(db())); |
|
| 48 | + exit('Error: ' . mysqli_error(db())); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $sql = "UPDATE roles SET groupId = '$value' WHERE id = '$roleID'"; |
| 55 | 55 | |
| 56 | 56 | if (!mysqli_query(db(), $sql)) { |
| 57 | - exit('Error: '.mysqli_error(db())); |
|
| 57 | + exit('Error: ' . mysqli_error(db())); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | return $ob->allowRoleSwaps; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - $sql = "SELECT allowRoleSwaps FROM groups WHERE id = '".$ob->groupId."'"; |
|
| 134 | + $sql = "SELECT allowRoleSwaps FROM groups WHERE id = '" . $ob->groupId . "'"; |
|
| 135 | 135 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
| 136 | 136 | $ob = mysqli_fetch_object($result); |
| 137 | 137 | |
@@ -141,12 +141,12 @@ |
||
| 141 | 141 | <tbody> |
| 142 | 142 | <?php |
| 143 | 143 | $sql = "SELECT s.date,s.detail1,s.detail2,s.detail3,s.type,trim(concat(u.firstName,' ',u.lastName)) AS name FROM statistics s INNER JOIN users u ON u.id = s.userid"; |
| 144 | - if (!isAdmin()) { |
|
| 145 | - $sql .= 'WHERE u.ID=s.userID'; |
|
| 146 | - if (!$debug) { |
|
| 147 | - $sql .= " AND s.type = 'system'"; |
|
| 148 | - } |
|
| 149 | - } |
|
| 144 | + if (!isAdmin()) { |
|
| 145 | + $sql .= 'WHERE u.ID=s.userID'; |
|
| 146 | + if (!$debug) { |
|
| 147 | + $sql .= " AND s.type = 'system'"; |
|
| 148 | + } |
|
| 149 | + } |
|
| 150 | 150 | $sql .= ' ORDER BY date desc '.$limit; |
| 151 | 151 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
| 152 | 152 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | if (!isAdmin()) { |
| 19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 20 | 20 | exit; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -28,28 +28,28 @@ discard block |
||
| 28 | 28 | if ($method == 'truncate') { |
| 29 | 29 | $sql = "CREATE TABLE tmp_system_statistics as SELECT * from statistics WHERE type='system'"; |
| 30 | 30 | if (!mysqli_query(db(), $sql)) { |
| 31 | - exit('Error: '.mysqli_error(db())); |
|
| 31 | + exit('Error: ' . mysqli_error(db())); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $sql = ('TRUNCATE TABLE statistics'); |
| 35 | 35 | if (!mysqli_query(db(), $sql)) { |
| 36 | - exit('Error: '.mysqli_error(db())); |
|
| 36 | + exit('Error: ' . mysqli_error(db())); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $sql = ('ALTER TABLE statistics AUTO_INCREMENT = 50'); |
| 40 | 40 | if (!mysqli_query(db(), $sql)) { |
| 41 | - exit('Error: '.mysqli_error(db())); |
|
| 41 | + exit('Error: ' . mysqli_error(db())); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $sql = 'INSERT INTO statistics (userid,date,type,detail1,detail2,detail3,script) '; |
| 45 | - $sql = $sql.'SELECT userid,date,type,detail1,detail2,detail3,script from tmp_system_statistics order by date'; |
|
| 45 | + $sql = $sql . 'SELECT userid,date,type,detail1,detail2,detail3,script from tmp_system_statistics order by date'; |
|
| 46 | 46 | if (!mysqli_query(db(), $sql)) { |
| 47 | - exit('Error: '.mysqli_error(db())); |
|
| 47 | + exit('Error: ' . mysqli_error(db())); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | $sql = 'DROP TABLE tmp_system_statistics'; |
| 51 | 51 | if (!mysqli_query(db(), $sql)) { |
| 52 | - exit('Error: '.mysqli_error(db())); |
|
| 52 | + exit('Error: ' . mysqli_error(db())); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | insertStatistics('system', __FILE__, 'statistics deleted'); |
@@ -105,22 +105,22 @@ discard block |
||
| 105 | 105 | <?php |
| 106 | 106 | |
| 107 | 107 | $sql = 'SELECT VERSION( ) AS mysqli_version'; |
| 108 | - $result = mysqli_query(db(), $sql) or exit('MySQL-Error: '.mysqli_error(db())); |
|
| 108 | + $result = mysqli_query(db(), $sql) or exit('MySQL-Error: ' . mysqli_error(db())); |
|
| 109 | 109 | $dbv = mysqli_fetch_array($result, MYSQLI_ASSOC); |
| 110 | 110 | $mysqli_version = $dbv['mysqli_version']; |
| 111 | 111 | |
| 112 | 112 | if (substr($mysqli_version, 0, 1) == 5) { |
| 113 | - $sql = "SELECT getBrowserInfo(detail3) as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by getBrowserInfo(detail3) order by count desc ".$browserLimit; |
|
| 113 | + $sql = "SELECT getBrowserInfo(detail3) as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by getBrowserInfo(detail3) order by count desc " . $browserLimit; |
|
| 114 | 114 | } else { |
| 115 | - $sql = "SELECT detail3 as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by detail3 order by count desc ".$browserLimit; |
|
| 115 | + $sql = "SELECT detail3 as browser,count(*) as count from statistics where detail1 like 'login%' and detail3!='' group by detail3 order by count desc " . $browserLimit; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
| 119 | 119 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 120 | 120 | extract($row); |
| 121 | 121 | echo '<tr>'; |
| 122 | - echo '<td>'.$browser.'</td>'; |
|
| 123 | - echo '<td>'.$count.'</td>'; |
|
| 122 | + echo '<td>' . $browser . '</td>'; |
|
| 123 | + echo '<td>' . $count . '</td>'; |
|
| 124 | 124 | echo '</tr>'; |
| 125 | 125 | } ?> |
| 126 | 126 | |
@@ -147,16 +147,16 @@ discard block |
||
| 147 | 147 | $sql .= " AND s.type = 'system'"; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | - $sql .= ' ORDER BY date desc '.$limit; |
|
| 150 | + $sql .= ' ORDER BY date desc ' . $limit; |
|
| 151 | 151 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
| 152 | 152 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 153 | 153 | extract($row); |
| 154 | 154 | echo '<tr>'; |
| 155 | - echo '<td>'.$date.'</td>'; |
|
| 156 | - echo '<td>'.$name.'</td>'; |
|
| 157 | - echo '<td>'.$type.'</td>'; |
|
| 158 | - echo '<td>'.$detail1.'</td>'; |
|
| 159 | - echo '<td>'.$detail2.'</td>'; |
|
| 155 | + echo '<td>' . $date . '</td>'; |
|
| 156 | + echo '<td>' . $name . '</td>'; |
|
| 157 | + echo '<td>' . $type . '</td>'; |
|
| 158 | + echo '<td>' . $detail1 . '</td>'; |
|
| 159 | + echo '<td>' . $detail2 . '</td>'; |
|
| 160 | 160 | //echo "<td>".$detail3."</td>"; |
| 161 | 161 | echo '</tr>'; |
| 162 | 162 | } |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | // Start of API |
| 24 | 24 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 25 | 25 | |
| 26 | - require_once __DIR__.'/../../../vendor/autoload.php'; |
|
| 26 | + require_once __DIR__ . '/../../../vendor/autoload.php'; |
|
| 27 | 27 | |
| 28 | - require_once __DIR__.'/../../../generated-conf/config.php'; |
|
| 28 | + require_once __DIR__ . '/../../../generated-conf/config.php'; |
|
| 29 | 29 | |
| 30 | 30 | // Create and configure Slim app |
| 31 | 31 | $app = new \Slim\App(['settings' => $config]); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $container = $app->getContainer(); |
| 38 | 38 | |
| 39 | - $container['db'] = function ($c) { |
|
| 39 | + $container['db'] = function($c) { |
|
| 40 | 40 | $db_config = $c['settings']['db']; |
| 41 | 41 | $db = new Database($db_config); |
| 42 | 42 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~ |
| 51 | 51 | |
| 52 | - $app->post('/series', function ($request, $response, $args) { |
|
| 52 | + $app->post('/series', function($request, $response, $args) { |
|
| 53 | 53 | $postData = $request->getParsedBody(); |
| 54 | 54 | |
| 55 | 55 | $name = filter_var($postData['name'], FILTER_SANITIZE_STRING); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__.'/../config/database.php'; |
|
| 3 | +require __DIR__ . '/../config/database.php'; |
|
| 4 | 4 | $serviceContainer = \Propel\Runtime\Propel::getServiceContainer(); |
| 5 | 5 | $serviceContainer->checkVersion('2.0.0-dev'); |
| 6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
| 9 | 9 | $manager->setConfiguration([ |
| 10 | 10 | 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
| 11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
| 11 | + 'dsn' => 'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], |
|
| 12 | 12 | 'user' => $config['db']['user'], |
| 13 | 13 | 'password' => $config['db']['pass'], |
| 14 | 14 | 'attributes' => [ |