@@ -822,11 +822,13 @@ |
||
822 | 822 | |
823 | 823 | #endregion |
824 | 824 | |
825 | - public function getForgottenPasswordHash() { |
|
825 | + public function getForgottenPasswordHash() |
|
826 | + { |
|
826 | 827 | return md5($this->username . $this->email . $this->welcome_template . $this->id . $this->password); |
827 | 828 | } |
828 | 829 | |
829 | - public function getApprovalDate() { |
|
830 | + public function getApprovalDate() |
|
831 | + { |
|
830 | 832 | $query = $this->dbObject->prepare(<<<SQL |
831 | 833 | SELECT timestamp |
832 | 834 | FROM log |
@@ -425,8 +425,7 @@ |
||
425 | 425 | ); |
426 | 426 | |
427 | 427 | $statement = $database->query("SELECT CONCAT('Closed ', id) as k, CONCAT('closed (',name,')') as v FROM emailtemplate;"); |
428 | - foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) |
|
429 | - { |
|
428 | + foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) { |
|
430 | 429 | $lookup[$row['k']] = $row['v']; |
431 | 430 | } |
432 | 431 |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | if ($_POST['action'] == EmailTemplate::CREATED || $_POST['action'] == EmailTemplate::NOT_CREATED) { |
1282 | 1282 | $request->setStatus('Closed'); |
1283 | 1283 | |
1284 | - if($_POST['action'] == EmailTemplate::CREATED){ |
|
1284 | + if($_POST['action'] == EmailTemplate::CREATED) { |
|
1285 | 1285 | $gem = 'custom-y'; |
1286 | 1286 | $crea = "Custom, Created"; |
1287 | 1287 | } |
@@ -1331,7 +1331,7 @@ discard block |
||
1331 | 1331 | BootstrapSkin::displayInternalFooter(); |
1332 | 1332 | die(); |
1333 | 1333 | } |
1334 | - else{ |
|
1334 | + else { |
|
1335 | 1335 | // Not a custom close, just a normal close |
1336 | 1336 | |
1337 | 1337 | $request->setStatus('Closed'); |
@@ -10,11 +10,13 @@ |
||
10 | 10 | $this->irc = new IrcColourCode(); |
11 | 11 | } |
12 | 12 | |
13 | - public function tearDown() { |
|
13 | + public function tearDown() |
|
14 | + { |
|
14 | 15 | $this->irc = NULL; |
15 | 16 | } |
16 | 17 | |
17 | - public function test_colorCodes() { |
|
18 | + public function test_colorCodes() |
|
19 | + { |
|
18 | 20 | |
19 | 21 | $i = $this->irc; |
20 | 22 |
@@ -10,11 +10,13 @@ discard block |
||
10 | 10 | $this->e = new StringFunctions(); |
11 | 11 | } |
12 | 12 | |
13 | - public function tearDown() { |
|
13 | + public function tearDown() |
|
14 | + { |
|
14 | 15 | $this->e = NULL; |
15 | 16 | } |
16 | 17 | |
17 | - public function test_formatAsUsername() { |
|
18 | + public function test_formatAsUsername() |
|
19 | + { |
|
18 | 20 | // Happy path |
19 | 21 | $this->assertEquals($this->e->formatAsUsername("this"), "This"); |
20 | 22 | $this->assertEquals($this->e->formatAsUsername("1this"), "1this"); |
@@ -29,7 +31,8 @@ discard block |
||
29 | 31 | $this->assertNotEquals($this->e->formatAsUsername("1this"), "1This"); |
30 | 32 | } |
31 | 33 | |
32 | - public function test_formatAsEmail() { |
|
34 | + public function test_formatAsEmail() |
|
35 | + { |
|
33 | 36 | $this->assertEquals($this->e->formatAsEmail("[email protected]"), "[email protected]"); |
34 | 37 | $this->assertEquals($this->e->formatAsEmail("[email protected]"), "[email protected]"); |
35 | 38 | $this->assertEquals($this->e->formatAsEmail(" [email protected]"), "[email protected]"); |
@@ -10,11 +10,13 @@ discard block |
||
10 | 10 | $this->e = new strings(); |
11 | 11 | } |
12 | 12 | |
13 | - public function tearDown() { |
|
13 | + public function tearDown() |
|
14 | + { |
|
14 | 15 | $this->e = NULL; |
15 | 16 | } |
16 | 17 | |
17 | - public function test_struname() { |
|
18 | + public function test_struname() |
|
19 | + { |
|
18 | 20 | // Happy path |
19 | 21 | $this->assertEquals($this->e->struname("this"), "This"); |
20 | 22 | $this->assertEquals($this->e->struname("1this"), "1this"); |
@@ -29,7 +31,8 @@ discard block |
||
29 | 31 | $this->assertNotEquals($this->e->struname("1this"), "1This"); |
30 | 32 | } |
31 | 33 | |
32 | - public function test_stremail() { |
|
34 | + public function test_stremail() |
|
35 | + { |
|
33 | 36 | $this->assertEquals($this->e->stremail("[email protected]"), "[email protected]"); |
34 | 37 | $this->assertEquals($this->e->stremail("[email protected]"), "[email protected]"); |
35 | 38 | $this->assertEquals($this->e->stremail(" [email protected]"), "[email protected]"); |
@@ -330,7 +330,8 @@ discard block |
||
330 | 330 | * Summary of sentMail |
331 | 331 | * @param Request $request |
332 | 332 | */ |
333 | - public static function sentMail(Request $request) { |
|
333 | + public static function sentMail(Request $request) |
|
334 | + { |
|
334 | 335 | self::send(User::getCurrent()->getUsername() |
335 | 336 | . " sent an email related to Request {$request->getId()} ({$request->getName()})"); |
336 | 337 | } |
@@ -371,7 +372,8 @@ discard block |
||
371 | 372 | * @param Request $request |
372 | 373 | * @param User $target |
373 | 374 | */ |
374 | - public static function requestReservationSent(Request $request, User $target) { |
|
375 | + public static function requestReservationSent(Request $request, User $target) |
|
376 | + { |
|
375 | 377 | self::send( |
376 | 378 | "Reservation of request {$request->getId()} ({$request->getName()}) sent to {$target->getUsername()} by " |
377 | 379 | . User::getCurrent()->getUsername()); |
@@ -48,7 +48,8 @@ discard block |
||
48 | 48 | * Returns a value indicating whether the current request was issued over HTTPSs |
49 | 49 | * @return bool true if HTTPS |
50 | 50 | */ |
51 | -function isHttps() { |
|
51 | +function isHttps() |
|
52 | +{ |
|
52 | 53 | if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { |
53 | 54 | if($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { |
54 | 55 | // Client <=> Proxy is encrypted |
@@ -399,7 +400,8 @@ discard block |
||
399 | 400 | * @param $users string[] Array of usernames as strings |
400 | 401 | * @return string |
401 | 402 | */ |
402 | -function getTypeaheadSource($users) { |
|
403 | +function getTypeaheadSource($users) |
|
404 | +{ |
|
403 | 405 | $userList = ""; |
404 | 406 | foreach ($users as $v) { |
405 | 407 | $userList .= "\"" . htmlentities($v) . "\", "; |
@@ -271,7 +271,9 @@ |
||
271 | 271 | return true; |
272 | 272 | } |
273 | 273 | |
274 | - if (is_null(self::$commentsQuery)) self::$commentsQuery = $this->dbObject->prepare("SELECT COUNT(*) as num FROM comment where request = :id;"); |
|
274 | + if (is_null(self::$commentsQuery)) { |
|
275 | + self::$commentsQuery = $this->dbObject->prepare("SELECT COUNT(*) as num FROM comment where request = :id;"); |
|
276 | + } |
|
275 | 277 | self::$commentsQuery->bindValue(":id", $this->id); |
276 | 278 | |
277 | 279 | self::$commentsQuery->execute(); |