@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $url->insert(['gl' => $glossary->next_term['glossary_id']]); |
| 46 | 46 | $next_link = $url->generate('url'); |
| 47 | 47 | |
| 48 | - $nextprev = [ |
|
| 48 | + $nextprev = [ |
|
| 49 | 49 | 'next' => [ |
| 50 | 50 | 'url' => $next_link, |
| 51 | 51 | 'title' => 'Next term', |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | <p>It seems we already have <?= ngettext('a definition', 'some definitions', $glossary->num_search_matches) ?> for that. Would you care to see <?= ngettext('it', 'them', $glossary->num_search_matches) ?>?</p> |
| 22 | 22 | <ul class="glossary"> |
| 23 | 23 | <?php |
| 24 | - foreach ($glossary->search_matches as $match) { |
|
| 25 | - $URL = new \MySociety\TheyWorkForYou\Url('glossary'); |
|
| 26 | - $URL->insert(['gl' => $match['glossary_id']]); |
|
| 27 | - $URL->remove(['g']); |
|
| 28 | - $term_link = $URL->generate('url'); |
|
| 29 | - ?> |
|
| 24 | + foreach ($glossary->search_matches as $match) { |
|
| 25 | + $URL = new \MySociety\TheyWorkForYou\Url('glossary'); |
|
| 26 | + $URL->insert(['gl' => $match['glossary_id']]); |
|
| 27 | + $URL->remove(['g']); |
|
| 28 | + $term_link = $URL->generate('url'); |
|
| 29 | + ?> |
|
| 30 | 30 | <li> |
| 31 | 31 | <a href="<?= $term_link ?>"><?= $match['title']?></a> |
| 32 | 32 | </li> |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $url->insert(['gl' => $glossary->next_term['glossary_id']]); |
| 46 | 46 | $next_link = $url->generate('url'); |
| 47 | 47 | |
| 48 | - $nextprev = [ |
|
| 48 | + $nextprev = [ |
|
| 49 | 49 | 'next' => [ |
| 50 | 50 | 'url' => $next_link, |
| 51 | 51 | 'title' => 'Next term', |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $THISPAGE = new \MySociety\TheyWorkForYou\Url($this_page); |
| 52 | 52 | |
| 53 | 53 | $LOGINURL = new \MySociety\TheyWorkForYou\Url('userlogin'); |
| 54 | - $LOGINURL->insert(['ret' => $THISPAGE->generate('none') ]); |
|
| 54 | + $LOGINURL->insert(['ret' => $THISPAGE->generate('none')]); |
|
| 55 | 55 | |
| 56 | 56 | $text = "<a href=\"" . $LOGINURL->generate() . '">' . gettext('You’d better sign in!') . '</a>'; |
| 57 | 57 | } else { |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (is_string($message)) { |
| 392 | 392 | // Sometimes we're just sending a single line to this function |
| 393 | 393 | // rather like the bigger array... |
| 394 | - $message = [ |
|
| 394 | + $message = [ |
|
| 395 | 395 | 'text' => $message, |
| 396 | 396 | ]; |
| 397 | 397 | } |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | if (!isset($page_errors)) { |
| 406 | 406 | $page_errors = []; |
| 407 | 407 | } |
| 408 | - $page_errors[] = $message; |
|
| 408 | + $page_errors[] = $message; |
|
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | if ($fatal) { |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | |
| 1023 | 1023 | $body = trim_characters($report['body'], 0, 40); |
| 1024 | 1024 | |
| 1025 | - $tabledata['rows'][] = [ |
|
| 1025 | + $tabledata['rows'][] = [ |
|
| 1026 | 1026 | _htmlentities($report['firstname'] . ' ' . $report['lastname']), |
| 1027 | 1027 | _htmlentities($body), |
| 1028 | 1028 | $report['reported'], |
@@ -1104,11 +1104,11 @@ discard block |
||
| 1104 | 1104 | // Returns HTML suitable for putting in the sidebar on Admin pages. |
| 1105 | 1105 | global $this_page, $DATA; |
| 1106 | 1106 | |
| 1107 | - $pages = ['admin_home', |
|
| 1107 | + $pages = ['admin_home', |
|
| 1108 | 1108 | 'admin_comments', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches', |
| 1109 | 1109 | 'alert_stats', 'admin_statistics', 'admin_reportstats', |
| 1110 | 1110 | 'admin_commentreports', 'admin_glossary', 'admin_glossary_pending', 'admin_badusers', |
| 1111 | - 'admin_profile_message', 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_announcement','admin_featured', 'admin_topics', |
|
| 1111 | + 'admin_profile_message', 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_announcement', 'admin_featured', 'admin_topics', |
|
| 1112 | 1112 | 'admin_wikipedia', |
| 1113 | 1113 | ]; |
| 1114 | 1114 | |
@@ -55,23 +55,23 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | |
| 57 | 57 | class USER { |
| 58 | - public $user_id = "0"; // So we have an ID for non-logged in users reporting comments etc. |
|
| 59 | - public $firstname = "Guest"; // So we have something to print for non-logged in users. |
|
| 58 | + public $user_id = "0"; // So we have an ID for non-logged in users reporting comments etc. |
|
| 59 | + public $firstname = "Guest"; // So we have something to print for non-logged in users. |
|
| 60 | 60 | public $lastname = ""; |
| 61 | - public $password = ""; // This will be a hashed version of a plaintext pw. |
|
| 61 | + public $password = ""; // This will be a hashed version of a plaintext pw. |
|
| 62 | 62 | public $email = ""; |
| 63 | 63 | public $postcode = ""; |
| 64 | 64 | public $url = ""; |
| 65 | - public $lastvisit = ""; // Last time the logged-in user loaded a page (GMT). |
|
| 65 | + public $lastvisit = ""; // Last time the logged-in user loaded a page (GMT). |
|
| 66 | 66 | public $registrationtime = ""; // When they registered (GMT). |
| 67 | - public $registrationip = ""; // Where they registered from. |
|
| 68 | - public $optin = ""; // Int containing multiple binary opt-ins. (See top of User.php) |
|
| 69 | - public $deleted = ""; // User can't log in or have their info displayed. |
|
| 70 | - public $confirmed = ''; // boolean - Has the user confirmed via email? |
|
| 71 | - public $facebook_id = ''; // Facebook ID for users who login with FB |
|
| 72 | - public $facebook_token = ''; // Facebook token for users who login with FB |
|
| 73 | - public $can_annotate = false; // Can the user add annotations |
|
| 74 | - public $organisation = ''; // The organisation the user belongs to |
|
| 67 | + public $registrationip = ""; // Where they registered from. |
|
| 68 | + public $optin = ""; // Int containing multiple binary opt-ins. (See top of User.php) |
|
| 69 | + public $deleted = ""; // User can't log in or have their info displayed. |
|
| 70 | + public $confirmed = ''; // boolean - Has the user confirmed via email? |
|
| 71 | + public $facebook_id = ''; // Facebook ID for users who login with FB |
|
| 72 | + public $facebook_token = ''; // Facebook token for users who login with FB |
|
| 73 | + public $can_annotate = false; // Can the user add annotations |
|
| 74 | + public $organisation = ''; // The organisation the user belongs to |
|
| 75 | 75 | // Don't use the status to check access privileges - use the is_able_to() function. |
| 76 | 76 | public $status = "Viewer"; |
| 77 | 77 | |
@@ -324,12 +324,12 @@ discard block |
||
| 324 | 324 | $confirmurl = 'https://' . DOMAIN . '/E/' . $urltoken; |
| 325 | 325 | |
| 326 | 326 | // Arrays we need to send a templated email. |
| 327 | - $data = [ |
|
| 327 | + $data = [ |
|
| 328 | 328 | 'to' => $details['email'], |
| 329 | 329 | 'template' => 'email_confirmation', |
| 330 | 330 | ]; |
| 331 | 331 | |
| 332 | - $merge = [ |
|
| 332 | + $merge = [ |
|
| 333 | 333 | 'CONFIRMURL' => $confirmurl, |
| 334 | 334 | ]; |
| 335 | 335 | |
@@ -367,12 +367,12 @@ discard block |
||
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | // Arrays we need to send a templated email. |
| 370 | - $data = [ |
|
| 370 | + $data = [ |
|
| 371 | 371 | 'to' => $details['email'], |
| 372 | 372 | 'template' => 'join_confirmation', |
| 373 | 373 | ]; |
| 374 | 374 | |
| 375 | - $merge = [ |
|
| 375 | + $merge = [ |
|
| 376 | 376 | 'CONFIRMURL' => $confirmurl, |
| 377 | 377 | ]; |
| 378 | 378 | |
@@ -504,14 +504,14 @@ discard block |
||
| 504 | 504 | return false; |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | - $data = [ |
|
| 507 | + $data = [ |
|
| 508 | 508 | 'to' => $this->email(), |
| 509 | 509 | 'template' => 'new_password', |
| 510 | 510 | ]; |
| 511 | 511 | |
| 512 | 512 | $URL = new \MySociety\TheyWorkForYou\Url("userlogin"); |
| 513 | 513 | |
| 514 | - $merge = [ |
|
| 514 | + $merge = [ |
|
| 515 | 515 | 'EMAIL' => $this->email(), |
| 516 | 516 | 'LOGINURL' => "https://" . DOMAIN . $URL->generate(), |
| 517 | 517 | 'PASSWORD' => $this->password(), |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | // Maybe there's a way of fetching these from the DB, |
| 684 | 684 | // so we don't duplicate them here...? |
| 685 | 685 | |
| 686 | - $statuses = ["Viewer", "User", "Moderator", "Administrator", "Superuser"]; |
|
| 686 | + $statuses = ["Viewer", "User", "Moderator", "Administrator", "Superuser"]; |
|
| 687 | 687 | |
| 688 | 688 | return $statuses; |
| 689 | 689 | |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | $date_now = gmdate("Y-m-d H:i:s"); |
| 1028 | 1028 | $this->db->query( |
| 1029 | 1029 | "UPDATE users SET lastvisit = :lastvisit WHERE user_id = :user_id", |
| 1030 | - [ ':lastvisit' => $date_now, ':user_id' => $this->user_id() ] |
|
| 1030 | + [':lastvisit' => $date_now, ':user_id' => $this->user_id()] |
|
| 1031 | 1031 | ); |
| 1032 | 1032 | |
| 1033 | 1033 | $this->lastvisit = $date_now; |
@@ -1423,7 +1423,7 @@ discard block |
||
| 1423 | 1423 | |
| 1424 | 1424 | twfy_debug("THEUSER", "User with ID found to confirm: " . $this->user_id()); |
| 1425 | 1425 | // We'll need these to be set before logging the user in. |
| 1426 | - $this->email = $q['email']; |
|
| 1426 | + $this->email = $q['email']; |
|
| 1427 | 1427 | |
| 1428 | 1428 | // Set that they're confirmed in the DB. |
| 1429 | 1429 | $r = $this->db->query("UPDATE users |