@@ -118,6 +118,6 @@ |
||
| 118 | 118 | |
| 119 | 119 | public function getObjectDescription() |
| 120 | 120 | { |
| 121 | - return '<a href="acc.php?action=messagemgmt&view=' . $this->getId() . '">' . htmlentities($this->description) . "</a>"; |
|
| 121 | + return '<a href="acc.php?action=messagemgmt&view='.$this->getId().'">'.htmlentities($this->description)."</a>"; |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -48,12 +48,10 @@ |
||
| 48 | 48 | if ($statement->execute()) { |
| 49 | 49 | $this->isNew = false; |
| 50 | 50 | $this->id = $this->dbObject->lastInsertId(); |
| 51 | - } |
|
| 52 | - else { |
|
| 51 | + } else { |
|
| 53 | 52 | throw new Exception($statement->errorInfo()); |
| 54 | 53 | } |
| 55 | - } |
|
| 56 | - else { |
|
| 54 | + } else { |
|
| 57 | 55 | // update |
| 58 | 56 | $statement = $this->dbObject->prepare("UPDATE interfacemessage SET type = :type, description = :desc, content = :content, updatecounter = updatecounter + 1 WHERE id = :id;"); |
| 59 | 57 | $statement->bindValue(":id", $this->id); |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | if ($statement->execute()) { |
| 75 | 75 | $this->isNew = false; |
| 76 | 76 | $this->id = $this->dbObject->lastInsertId(); |
| 77 | - } |
|
| 78 | - else { |
|
| 77 | + } else { |
|
| 79 | 78 | throw new Exception($statement->errorInfo()); |
| 80 | 79 | } |
| 81 | 80 | } |
@@ -108,6 +108,6 @@ |
||
| 108 | 108 | |
| 109 | 109 | public function getObjectDescription() |
| 110 | 110 | { |
| 111 | - return '<a href="acc.php?action=templatemgmt&view=' . $this->getId() . '">' . htmlentities($this->usercode) . "</a>"; |
|
| 111 | + return '<a href="acc.php?action=templatemgmt&view='.$this->getId().'">'.htmlentities($this->usercode)."</a>"; |
|
| 112 | 112 | } |
| 113 | 113 | } |
@@ -47,12 +47,10 @@ |
||
| 47 | 47 | if ($statement->execute()) { |
| 48 | 48 | $this->isNew = false; |
| 49 | 49 | $this->id = $this->dbObject->lastInsertId(); |
| 50 | - } |
|
| 51 | - else { |
|
| 50 | + } else { |
|
| 52 | 51 | throw new Exception($statement->errorInfo()); |
| 53 | 52 | } |
| 54 | - } |
|
| 55 | - else { |
|
| 53 | + } else { |
|
| 56 | 54 | // update |
| 57 | 55 | $statement = $this->dbObject->prepare("UPDATE `welcometemplate` SET usercode = :usercode, botcode = :botcode WHERE id = :id;"); |
| 58 | 56 | $statement->bindValue(":id", $this->id); |
@@ -258,6 +258,6 @@ |
||
| 258 | 258 | |
| 259 | 259 | public function getObjectDescription() |
| 260 | 260 | { |
| 261 | - return 'Ban #' . $this->getId() . " (" . htmlentities($this->target) . ")</a>"; |
|
| 261 | + return 'Ban #'.$this->getId()." (".htmlentities($this->target).")</a>"; |
|
| 262 | 262 | } |
| 263 | 263 | } |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | $query = "SELECT * FROM ban WHERE target = :target;"; |
| 30 | 30 | $statement = $database->prepare($query); |
| 31 | 31 | $statement->bindValue(":target", $target); |
| 32 | - } |
|
| 33 | - else { |
|
| 32 | + } else { |
|
| 34 | 33 | $query = "SELECT * FROM ban;"; |
| 35 | 34 | $statement = $database->prepare($query); |
| 36 | 35 | } |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | $query = "SELECT * FROM ban WHERE target = :target AND (duration > UNIX_TIMESTAMP() OR duration = -1) AND active = 1;"; |
| 65 | 64 | $statement = $database->prepare($query); |
| 66 | 65 | $statement->bindValue(":target", $target); |
| 67 | - } |
|
| 68 | - else { |
|
| 66 | + } else { |
|
| 69 | 67 | $query = "SELECT * FROM ban WHERE (duration > UNIX_TIMESTAMP() OR duration = -1) AND active = 1;"; |
| 70 | 68 | $statement = $database->prepare($query); |
| 71 | 69 | } |
@@ -160,12 +158,10 @@ discard block |
||
| 160 | 158 | if ($statement->execute()) { |
| 161 | 159 | $this->isNew = false; |
| 162 | 160 | $this->id = $this->dbObject->lastInsertId(); |
| 163 | - } |
|
| 164 | - else { |
|
| 161 | + } else { |
|
| 165 | 162 | throw new Exception($statement->errorInfo()); |
| 166 | 163 | } |
| 167 | - } |
|
| 168 | - else { |
|
| 164 | + } else { |
|
| 169 | 165 | // update |
| 170 | 166 | $statement = $this->dbObject->prepare("UPDATE `ban` SET duration = :duration, active = :active, user = :user WHERE id = :id;"); |
| 171 | 167 | $statement->bindValue(":id", $this->id); |
@@ -215,8 +211,7 @@ discard block |
||
| 215 | 211 | } |
| 216 | 212 | |
| 217 | 213 | $this->user = $u->getId(); |
| 218 | - } |
|
| 219 | - else { |
|
| 214 | + } else { |
|
| 220 | 215 | $this->user = $user; |
| 221 | 216 | } |
| 222 | 217 | } |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | $object = $type::getById($this->objectid, $this->dbObject); |
| 156 | 156 | |
| 157 | 157 | if ($object === false) { |
| 158 | - return '[' . $this->objecttype . " " . $this->objectid . ']'; |
|
| 158 | + return '['.$this->objecttype." ".$this->objectid.']'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return $object->getObjectDescription(); |
@@ -35,12 +35,10 @@ discard block |
||
| 35 | 35 | if ($statement->execute()) { |
| 36 | 36 | $this->isNew = false; |
| 37 | 37 | $this->id = $this->dbObject->lastInsertId(); |
| 38 | - } |
|
| 39 | - else { |
|
| 38 | + } else { |
|
| 40 | 39 | throw new Exception($statement->errorInfo()); |
| 41 | 40 | } |
| 42 | - } |
|
| 43 | - else { |
|
| 41 | + } else { |
|
| 44 | 42 | throw new Exception("Updating logs is not available"); |
| 45 | 43 | } |
| 46 | 44 | } |
@@ -100,8 +98,7 @@ discard block |
||
| 100 | 98 | { |
| 101 | 99 | if (is_a($user, "User")) { |
| 102 | 100 | $this->user = $user->getId(); |
| 103 | - } |
|
| 104 | - else { |
|
| 101 | + } else { |
|
| 105 | 102 | $this->user = $user; |
| 106 | 103 | } |
| 107 | 104 | } |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | if ($dontUseDb) { |
| 30 | 30 | if ($external) { |
| 31 | 31 | $smarty->display("offline/external.tpl"); |
| 32 | - } |
|
| 33 | - else { |
|
| 32 | + } else { |
|
| 34 | 33 | $smarty->assign("dontUseDbCulprit", $dontUseDbCulprit); |
| 35 | 34 | $smarty->assign("dontUseDbReason", $dontUseDbReason); |
| 36 | 35 | $smarty->assign("alerts", array()); |
@@ -63,8 +62,7 @@ discard block |
||
| 63 | 62 | |
| 64 | 63 | if ($external) { |
| 65 | 64 | return $smarty->fetch("offline/external.tpl"); |
| 66 | - } |
|
| 67 | - else { |
|
| 65 | + } else { |
|
| 68 | 66 | $smarty->assign("dontUseDbCulprit", $dontUseDbCulprit); |
| 69 | 67 | $smarty->assign("dontUseDbReason", $dontUseDbReason); |
| 70 | 68 | $smarty->assign("alerts", array()); |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | public static function Create($pageName) |
| 24 | 24 | { |
| 25 | 25 | // calculate the name of the statistics page |
| 26 | - $statsPage = "Stats" . $pageName; |
|
| 26 | + $statsPage = "Stats".$pageName; |
|
| 27 | 27 | |
| 28 | 28 | global $filepath; |
| 29 | 29 | // check the stats page definition exists... |
| 30 | - if (file_exists($filepath . "/includes/statistics/Stats" . $pageName . ".php")) { |
|
| 30 | + if (file_exists($filepath."/includes/statistics/Stats".$pageName.".php")) { |
|
| 31 | 31 | // and include it. |
| 32 | - require_once($filepath . "/includes/statistics/Stats" . $pageName . ".php"); |
|
| 32 | + require_once($filepath."/includes/statistics/Stats".$pageName.".php"); |
|
| 33 | 33 | } |
| 34 | 34 | else { |
| 35 | 35 | // class def doesn't exist: error |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | else { |
| 58 | 58 | // file exists, but no definition of the class |
| 59 | - die("No definition for statistics page: " . $statsPage); |
|
| 59 | + die("No definition for statistics page: ".$statsPage); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | // not protected or access allowed |
| 148 | - echo '<div class="page-header"><h1>' . $this->getPageTitle() . '</h1></div>'; |
|
| 148 | + echo '<div class="page-header"><h1>'.$this->getPageTitle().'</h1></div>'; |
|
| 149 | 149 | |
| 150 | 150 | if ($this->requiresSimpleHtmlEnvironment()) { |
| 151 | 151 | echo '<div class="row-fluid"><div class="span12">'; |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | if (file_exists($filepath . "/includes/statistics/Stats" . $pageName . ".php")) { |
| 31 | 31 | // and include it. |
| 32 | 32 | require_once($filepath . "/includes/statistics/Stats" . $pageName . ".php"); |
| 33 | - } |
|
| 34 | - else { |
|
| 33 | + } else { |
|
| 35 | 34 | // class def doesn't exist: error |
| 36 | 35 | die("Unknown statistics page"); |
| 37 | 36 | } |
@@ -48,13 +47,11 @@ discard block |
||
| 48 | 47 | if (get_parent_class($object) == "StatisticsPage") { |
| 49 | 48 | // all is good, return the new statistics page object |
| 50 | 49 | return $object; |
| 51 | - } |
|
| 52 | - else { |
|
| 50 | + } else { |
|
| 53 | 51 | // oops. this is our class, named correctly, but it's a bad definition. |
| 54 | 52 | die("Unrecognised statistics page definition."); |
| 55 | 53 | } |
| 56 | - } |
|
| 57 | - else { |
|
| 54 | + } else { |
|
| 58 | 55 | // file exists, but no definition of the class |
| 59 | 56 | die("No definition for statistics page: " . $statsPage); |
| 60 | 57 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | 'bgpview' => 'https://bgpview.io/ip/%DATA%' |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | -if(!isset($_GET['tool']) |
|
| 16 | +if (!isset($_GET['tool']) |
|
| 17 | 17 | || !isset($toolList[$_GET['tool']]) |
| 18 | 18 | || !isset($_GET['data']) |
| 19 | 19 | ) |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | if (isset($_GET['round2'])) { |
| 26 | - echo '<script>window.location.href=' . json_encode(str_replace("%DATA%", urlencode($_GET['data']), $toolList[$_GET['tool']])) . '</script>'; |
|
| 26 | + echo '<script>window.location.href='.json_encode(str_replace("%DATA%", urlencode($_GET['data']), $toolList[$_GET['tool']])).'</script>'; |
|
| 27 | 27 | } |
| 28 | 28 | else { |
| 29 | - header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
|
| 29 | + header("Location: ".$_SERVER["REQUEST_URI"]."&round2=true"); |
|
| 30 | 30 | } |
@@ -16,15 +16,13 @@ |
||
| 16 | 16 | if(!isset($_GET['tool']) |
| 17 | 17 | || !isset($toolList[$_GET['tool']]) |
| 18 | 18 | || !isset($_GET['data']) |
| 19 | -) |
|
| 20 | -{ |
|
| 19 | +) { |
|
| 21 | 20 | header("HTTP/1.1 403 Forbidden"); |
| 22 | 21 | return; |
| 23 | 22 | } |
| 24 | 23 | |
| 25 | 24 | if (isset($_GET['round2'])) { |
| 26 | 25 | echo '<script>window.location.href=' . json_encode(str_replace("%DATA%", urlencode($_GET['data']), $toolList[$_GET['tool']])) . '</script>'; |
| 27 | -} |
|
| 28 | -else { |
|
| 26 | +} else { |
|
| 29 | 27 | header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
| 30 | 28 | } |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | $out .= '<table class="table table-striped table-hover table-condensed"><tr>'; |
| 53 | 53 | |
| 54 | 54 | if ($this->numberedList == true) { |
| 55 | - $out .= "<th>" . $this->numberedListTitle . "</th>"; |
|
| 55 | + $out .= "<th>".$this->numberedListTitle."</th>"; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if ($this->overrideTableTitles != false) { |
| 59 | 59 | foreach ($this->overrideTableTitles as $value) { |
| 60 | - $out .= "<th>" . $value . "</th>"; |
|
| 60 | + $out .= "<th>".$value."</th>"; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | else { |
| 64 | 64 | if (count($results) > 0) { |
| 65 | 65 | foreach ($results[0] as $k => $v) { |
| 66 | - $out .= "<th>" . $k . "</th>"; |
|
| 66 | + $out .= "<th>".$k."</th>"; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | $out .= '<tr>'; |
| 81 | 81 | |
| 82 | 82 | if ($this->numberedList == true) { |
| 83 | - $out .= "<th>" . $currentreq . "</th>"; |
|
| 83 | + $out .= "<th>".$currentreq."</th>"; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | foreach ($row as $cell) { |
| 88 | 88 | |
| 89 | - $out .= "<td>" . $cell . "</td>"; |
|
| 89 | + $out .= "<td>".$cell."</td>"; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | foreach ($this->overrideTableTitles as $value) { |
| 60 | 60 | $out .= "<th>" . $value . "</th>"; |
| 61 | 61 | } |
| 62 | - } |
|
| 63 | - else { |
|
| 62 | + } else { |
|
| 64 | 63 | if (count($results) > 0) { |
| 65 | 64 | foreach ($results[0] as $k => $v) { |
| 66 | 65 | $out .= "<th>" . $k . "</th>"; |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | $currentreq++; |
| 76 | 75 | if (function_exists($this->tableCallbackFunction)) { |
| 77 | 76 | $out .= call_user_func($this->tableCallbackFunction, $row, $currentreq); |
| 78 | - } |
|
| 79 | - else { |
|
| 77 | + } else { |
|
| 80 | 78 | $out .= '<tr>'; |
| 81 | 79 | |
| 82 | 80 | if ($this->numberedList == true) { |