@@ -41,12 +41,10 @@ |
||
| 41 | 41 | |
| 42 | 42 | if ($statement->execute()) { |
| 43 | 43 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 44 | - } |
|
| 45 | - else { |
|
| 44 | + } else { |
|
| 46 | 45 | throw new Exception($statement->errorInfo()); |
| 47 | 46 | } |
| 48 | - } |
|
| 49 | - else { |
|
| 47 | + } else { |
|
| 50 | 48 | throw new Exception("You shouldn't be doing this..."); |
| 51 | 49 | } |
| 52 | 50 | } |
@@ -67,12 +67,10 @@ |
||
| 67 | 67 | |
| 68 | 68 | if ($statement->execute()) { |
| 69 | 69 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 70 | - } |
|
| 71 | - else { |
|
| 70 | + } else { |
|
| 72 | 71 | throw new Exception($statement->errorInfo()); |
| 73 | 72 | } |
| 74 | - } |
|
| 75 | - else { |
|
| 73 | + } else { |
|
| 76 | 74 | // update |
| 77 | 75 | $statement = $this->dbObject->prepare(<<<SQL |
| 78 | 76 | UPDATE `request` SET |
@@ -183,12 +183,10 @@ |
||
| 183 | 183 | |
| 184 | 184 | if ($statement->execute()) { |
| 185 | 185 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 186 | - } |
|
| 187 | - else { |
|
| 186 | + } else { |
|
| 188 | 187 | throw new Exception($statement->errorInfo()); |
| 189 | 188 | } |
| 190 | - } |
|
| 191 | - else { |
|
| 189 | + } else { |
|
| 192 | 190 | // update |
| 193 | 191 | $statement = $this->dbObject->prepare(<<<SQL |
| 194 | 192 | UPDATE `emailtemplate` |
@@ -77,12 +77,10 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | if ($user === false) { |
| 79 | 79 | self::$currentUser = new CommunityUser(); |
| 80 | - } |
|
| 81 | - else { |
|
| 80 | + } else { |
|
| 82 | 81 | self::$currentUser = $user; |
| 83 | 82 | } |
| 84 | - } |
|
| 85 | - else { |
|
| 83 | + } else { |
|
| 86 | 84 | $anonymousCoward = new CommunityUser(); |
| 87 | 85 | |
| 88 | 86 | self::$currentUser = $anonymousCoward; |
@@ -284,12 +282,10 @@ discard block |
||
| 284 | 282 | |
| 285 | 283 | if ($statement->execute()) { |
| 286 | 284 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 287 | - } |
|
| 288 | - else { |
|
| 285 | + } else { |
|
| 289 | 286 | throw new Exception($statement->errorInfo()); |
| 290 | 287 | } |
| 291 | - } |
|
| 292 | - else { |
|
| 288 | + } else { |
|
| 293 | 289 | // update |
| 294 | 290 | $statement = $this->dbObject->prepare(<<<SQL |
| 295 | 291 | UPDATE `user` SET |
@@ -724,12 +720,10 @@ discard block |
||
| 724 | 720 | if ($this->forceidentified === 0 || $this->forceidentified === "0") { |
| 725 | 721 | // User forced to unidentified in the database. |
| 726 | 722 | return false; |
| 727 | - } |
|
| 728 | - elseif ($this->forceidentified === 1 || $this->forceidentified === "1") { |
|
| 723 | + } elseif ($this->forceidentified === 1 || $this->forceidentified === "1") { |
|
| 729 | 724 | // User forced to identified in the database. |
| 730 | 725 | return true; |
| 731 | - } |
|
| 732 | - else { |
|
| 726 | + } else { |
|
| 733 | 727 | // User not forced to any particular identified status; consult IdentificationVerifier |
| 734 | 728 | return $iv->isUserIdentified($this->getOnWikiName()); |
| 735 | 729 | } |
@@ -799,8 +793,7 @@ discard block |
||
| 799 | 793 | |
| 800 | 794 | if ($this->oauthidentitycache == null) { |
| 801 | 795 | $this->identityCache = null; |
| 802 | - } |
|
| 803 | - else { |
|
| 796 | + } else { |
|
| 804 | 797 | $this->identityCache = unserialize($this->oauthidentitycache); |
| 805 | 798 | } |
| 806 | 799 | |
@@ -818,15 +811,13 @@ discard block |
||
| 818 | 811 | ) { |
| 819 | 812 | // Use cached value - it's either valid or we don't care. |
| 820 | 813 | return $this->identityCache; |
| 821 | - } |
|
| 822 | - else { |
|
| 814 | + } else { |
|
| 823 | 815 | // Cache expired and not forcing use of cached value |
| 824 | 816 | $this->getIdentityCache(); |
| 825 | 817 | |
| 826 | 818 | return $this->identityCache; |
| 827 | 819 | } |
| 828 | - } |
|
| 829 | - else { |
|
| 820 | + } else { |
|
| 830 | 821 | // Cache isn't ours or doesn't exist |
| 831 | 822 | $this->getIdentityCache(); |
| 832 | 823 | |
@@ -109,8 +109,7 @@ |
||
| 109 | 109 | |
| 110 | 110 | if ($statement->execute()) { |
| 111 | 111 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 112 | - } |
|
| 113 | - else { |
|
| 112 | + } else { |
|
| 114 | 113 | throw new Exception($statement->errorInfo()); |
| 115 | 114 | } |
| 116 | 115 | } |
@@ -65,12 +65,10 @@ |
||
| 65 | 65 | |
| 66 | 66 | if ($statement->execute()) { |
| 67 | 67 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 68 | - } |
|
| 69 | - else { |
|
| 68 | + } else { |
|
| 70 | 69 | throw new Exception($statement->errorInfo()); |
| 71 | 70 | } |
| 72 | - } |
|
| 73 | - else { |
|
| 71 | + } else { |
|
| 74 | 72 | // update |
| 75 | 73 | $statement = $this->dbObject->prepare(<<<SQL |
| 76 | 74 | UPDATE `welcometemplate` |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | SQL; |
| 44 | 44 | $statement = $database->prepare($query); |
| 45 | 45 | $statement->bindValue(":target", $target); |
| 46 | - } |
|
| 47 | - else { |
|
| 46 | + } else { |
|
| 48 | 47 | $query = "SELECT * FROM ban WHERE (duration > UNIX_TIMESTAMP() OR duration = -1) AND active = 1;"; |
| 49 | 48 | $statement = $database->prepare($query); |
| 50 | 49 | } |
@@ -145,12 +144,10 @@ discard block |
||
| 145 | 144 | |
| 146 | 145 | if ($statement->execute()) { |
| 147 | 146 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 148 | - } |
|
| 149 | - else { |
|
| 147 | + } else { |
|
| 150 | 148 | throw new Exception($statement->errorInfo()); |
| 151 | 149 | } |
| 152 | - } |
|
| 153 | - else { |
|
| 150 | + } else { |
|
| 154 | 151 | // update |
| 155 | 152 | $statement = $this->dbObject->prepare(<<<SQL |
| 156 | 153 | UPDATE `ban` |
@@ -49,12 +49,10 @@ |
||
| 49 | 49 | |
| 50 | 50 | if ($statement->execute()) { |
| 51 | 51 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 52 | - } |
|
| 53 | - else { |
|
| 52 | + } else { |
|
| 54 | 53 | throw new Exception($statement->errorInfo()); |
| 55 | 54 | } |
| 56 | - } |
|
| 57 | - else { |
|
| 55 | + } else { |
|
| 58 | 56 | throw new Exception("Updating logs is not available"); |
| 59 | 57 | } |
| 60 | 58 | } |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | SessionAlert::success("Comment has been saved successfully"); |
| 75 | 75 | |
| 76 | 76 | $this->redirect('viewRequest', null, array('id' => $comment->getRequest())); |
| 77 | - } |
|
| 78 | - else { |
|
| 77 | + } else { |
|
| 79 | 78 | $this->assignCSRFToken(); |
| 80 | 79 | $this->assign('comment', $comment); |
| 81 | 80 | $this->assign('request', $request); |