@@ -152,8 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | $database = gGetDb(); |
154 | 154 | |
155 | - $database->transactionally(function() use ($database, $useOauthSignup) |
|
156 | - { |
|
155 | + $database->transactionally(function() use ($database, $useOauthSignup) { |
|
157 | 156 | |
158 | 157 | $newUser = new User(); |
159 | 158 | $newUser->setDatabase($database); |
@@ -481,8 +480,7 @@ discard block |
||
481 | 480 | |
482 | 481 | $database = gGetDb(); |
483 | 482 | |
484 | - $database->transactionally(function() use ($database) |
|
485 | - { |
|
483 | + $database->transactionally(function() use ($database) { |
|
486 | 484 | global $smarty; |
487 | 485 | |
488 | 486 | $message = InterfaceMessage::getById($_GET['edit'], $database); |
@@ -570,8 +568,7 @@ discard block |
||
570 | 568 | |
571 | 569 | $database = gGetDb(); |
572 | 570 | |
573 | - $database->transactionally(function() use ($database, $baseurl) |
|
574 | - { |
|
571 | + $database->transactionally(function() use ($database, $baseurl) { |
|
575 | 572 | $template = new WelcomeTemplate(); |
576 | 573 | $template->setDatabase($database); |
577 | 574 | $template->setUserCode($_POST['usercode']); |
@@ -656,8 +653,7 @@ discard block |
||
656 | 653 | die(); |
657 | 654 | } |
658 | 655 | |
659 | - $database->transactionally(function() use($database, $template) |
|
660 | - { |
|
656 | + $database->transactionally(function() use($database, $template) { |
|
661 | 657 | $tid = $template->getId(); |
662 | 658 | |
663 | 659 | $database |
@@ -693,8 +689,7 @@ discard block |
||
693 | 689 | } |
694 | 690 | |
695 | 691 | if (isset($_POST['submit'])) { |
696 | - $database->transactionally(function() use($database, $template) |
|
697 | - { |
|
692 | + $database->transactionally(function() use($database, $template) { |
|
698 | 693 | $template->setUserCode($_POST['usercode']); |
699 | 694 | $template->setBotCode($_POST['botcode']); |
700 | 695 | $template->save(); |
@@ -825,8 +820,7 @@ discard block |
||
825 | 820 | |
826 | 821 | $currentUsername = User::getCurrent()->getUsername(); |
827 | 822 | |
828 | - $database->transactionally(function() use ($database, $ban, $duration, $currentUsername) |
|
829 | - { |
|
823 | + $database->transactionally(function() use ($database, $ban, $duration, $currentUsername) { |
|
830 | 824 | $ban->setDatabase($database); |
831 | 825 | $ban->setActive(1); |
832 | 826 | $ban->setType($_POST['type']); |
@@ -891,8 +885,7 @@ discard block |
||
891 | 885 | else { |
892 | 886 | $database = gGetDb(); |
893 | 887 | |
894 | - $database->transactionally(function() use ($database, $ban) |
|
895 | - { |
|
888 | + $database->transactionally(function() use ($database, $ban) { |
|
896 | 889 | $ban->setActive(0); |
897 | 890 | $ban->save(); |
898 | 891 | |
@@ -1041,8 +1034,7 @@ discard block |
||
1041 | 1034 | } |
1042 | 1035 | |
1043 | 1036 | $database = gGetDb(); |
1044 | - $database->transactionally(function() use ($database, $request) |
|
1045 | - { |
|
1037 | + $database->transactionally(function() use ($database, $request) { |
|
1046 | 1038 | global $availableRequestStates; |
1047 | 1039 | |
1048 | 1040 | $request->setReserved(0); |
@@ -1192,7 +1184,8 @@ discard block |
||
1192 | 1184 | $emailTemplate = EmailTemplate::getById($gem, gGetDb()); |
1193 | 1185 | if ($emailTemplate instanceof EmailTemplate) { |
1194 | 1186 | $isForCreated = $emailTemplate->getDefaultAction() === EmailTemplate::CREATED; |
1195 | - } else { |
|
1187 | + } |
|
1188 | + else { |
|
1196 | 1189 | $isForCreated = false; |
1197 | 1190 | } |
1198 | 1191 | |
@@ -1253,7 +1246,8 @@ discard block |
||
1253 | 1246 | if (isset($_POST['ccmailist']) && $_POST['ccmailist'] == "on") { |
1254 | 1247 | $headers .= 'Cc: [email protected]' . "\r\n"; |
1255 | 1248 | } |
1256 | - } else { |
|
1249 | + } |
|
1250 | + else { |
|
1257 | 1251 | // these people do not. |
1258 | 1252 | $headers .= 'Cc: [email protected]' . "\r\n"; |
1259 | 1253 | } |
@@ -1469,8 +1463,7 @@ discard block |
||
1469 | 1463 | elseif ($action == "reserve") { |
1470 | 1464 | $database = gGetDb(); |
1471 | 1465 | |
1472 | - $database->transactionally(function() use ($database) |
|
1473 | - { |
|
1466 | + $database->transactionally(function() use ($database) { |
|
1474 | 1467 | $request = Request::getById($_GET['resid'], $database); |
1475 | 1468 | |
1476 | 1469 | if ($request == false) { |
@@ -1573,8 +1566,7 @@ discard block |
||
1573 | 1566 | if ($reservedUser->getId() != User::getCurrent()->getId()) { |
1574 | 1567 | if (User::getCurrent()->isAdmin()) { |
1575 | 1568 | if (isset($_GET['confirm']) && $_GET['confirm'] == 1) { |
1576 | - $database->transactionally(function() use($database, $request) |
|
1577 | - { |
|
1569 | + $database->transactionally(function() use($database, $request) { |
|
1578 | 1570 | $request->setReserved(0); |
1579 | 1571 | $request->save(); |
1580 | 1572 | |
@@ -1599,8 +1591,7 @@ discard block |
||
1599 | 1591 | } |
1600 | 1592 | } |
1601 | 1593 | else { |
1602 | - $database->transactionally(function() use ($database, $request) |
|
1603 | - { |
|
1594 | + $database->transactionally(function() use ($database, $request) { |
|
1604 | 1595 | $request->setReserved(0); |
1605 | 1596 | $request->save(); |
1606 | 1597 | |
@@ -1793,8 +1784,7 @@ discard block |
||
1793 | 1784 | |
1794 | 1785 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
1795 | 1786 | $database = gGetDb(); |
1796 | - $database->transactionally(function() use ($database, $comment, $baseurl) |
|
1797 | - { |
|
1787 | + $database->transactionally(function() use ($database, $comment, $baseurl) { |
|
1798 | 1788 | |
1799 | 1789 | $comment->setComment($_POST['newcomment']); |
1800 | 1790 | $comment->setVisibility($_POST['visibility']); |
@@ -1842,8 +1832,7 @@ discard block |
||
1842 | 1832 | die(); |
1843 | 1833 | } |
1844 | 1834 | |
1845 | - $database->transactionally(function() use ($database, $user, $requestObject, $curuser) |
|
1846 | - { |
|
1835 | + $database->transactionally(function() use ($database, $user, $requestObject, $curuser) { |
|
1847 | 1836 | $updateStatement = $database->prepare("UPDATE request SET reserved = :userid WHERE id = :request;"); |
1848 | 1837 | $updateStatement->bindValue(":userid", $user->getId()); |
1849 | 1838 | $updateStatement->bindValue(":request", $requestObject->getId()); |
@@ -1871,8 +1860,7 @@ discard block |
||
1871 | 1860 | } |
1872 | 1861 | if (isset($_POST['submit'])) { |
1873 | 1862 | $database = gGetDb(); |
1874 | - $database->transactionally(function() use ($database) |
|
1875 | - { |
|
1863 | + $database->transactionally(function() use ($database) { |
|
1876 | 1864 | global $baseurl; |
1877 | 1865 | |
1878 | 1866 | $emailTemplate = new EmailTemplate(); |
@@ -1950,8 +1938,7 @@ discard block |
||
1950 | 1938 | die(); |
1951 | 1939 | } |
1952 | 1940 | |
1953 | - $database->transactionally(function() use ($database, $emailTemplate) |
|
1954 | - { |
|
1941 | + $database->transactionally(function() use ($database, $emailTemplate) { |
|
1955 | 1942 | $emailTemplate->save(); |
1956 | 1943 | |
1957 | 1944 | Logger::editedEmail($database, $emailTemplate); |
@@ -2016,8 +2003,7 @@ discard block |
||
2016 | 2003 | } |
2017 | 2004 | elseif ($action == "oauthattach") { |
2018 | 2005 | $database = gGetDb(); |
2019 | - $database->transactionally(function() use ($database) |
|
2020 | - { |
|
2006 | + $database->transactionally(function() use ($database) { |
|
2021 | 2007 | try { |
2022 | 2008 | global $oauthConsumerToken, $oauthSecretToken, $oauthBaseUrl, $oauthBaseUrlInternal; |
2023 | 2009 | |
@@ -2052,7 +2038,8 @@ discard block |
||
2052 | 2038 | |
2053 | 2039 | if ($enableEmailConfirm == 1) { |
2054 | 2040 | $query = "SELECT * FROM request WHERE status = :type AND emailconfirm = 'Confirmed';"; |
2055 | - } else { |
|
2041 | + } |
|
2042 | + else { |
|
2056 | 2043 | $query = "SELECT * FROM request WHERE status = :type;"; |
2057 | 2044 | } |
2058 | 2045 | |
@@ -2072,7 +2059,8 @@ discard block |
||
2072 | 2059 | $smarty->assign("showStatus", false); |
2073 | 2060 | $html = $smarty->fetch("mainpage/requesttable.tpl"); |
2074 | 2061 | echo $html; |
2075 | - } else { |
|
2062 | + } |
|
2063 | + else { |
|
2076 | 2064 | echo defaultpage(); |
2077 | 2065 | } |
2078 | 2066 |