@@ -123,12 +123,10 @@ |
||
| 123 | 123 | if ($statement->execute()) { |
| 124 | 124 | $this->isNew = false; |
| 125 | 125 | $this->id = $this->dbObject->lastInsertId(); |
| 126 | - } |
|
| 127 | - else { |
|
| 126 | + } else { |
|
| 128 | 127 | throw new Exception($statement->errorInfo()); |
| 129 | 128 | } |
| 130 | - } |
|
| 131 | - else { |
|
| 129 | + } else { |
|
| 132 | 130 | // update |
| 133 | 131 | $statement = $this->dbObject->prepare(<<<SQL |
| 134 | 132 | UPDATE `emailtemplate` |
@@ -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 | } |
@@ -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); |
@@ -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 | } |
@@ -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()); |
@@ -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 | } |
@@ -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 | } |