@@ -22,7 +22,7 @@ |
||
| 22 | 22 | foreach ($user_scores as $user_score) { |
| 23 | 23 | $name = $user_score['name']; |
| 24 | 24 | $score = $user_score['score']; |
| 25 | - if ($score_prev > $score){ |
|
| 25 | + if ($score_prev > $score) { |
|
| 26 | 26 | $score_prev = $score; |
| 27 | 27 | $rank += 1; |
| 28 | 28 | } |
@@ -37,9 +37,12 @@ |
||
| 37 | 37 | <a href="<?= $file['slug'] ?>"> |
| 38 | 38 | <?php if ($file['type'] == 'file'): ?> |
| 39 | 39 | <i class="fa fa-file-text-o"></i> |
| 40 | - <?php else: ?> |
|
| 40 | + <?php else { |
|
| 41 | + : ?> |
|
| 41 | 42 | <i class="fa fa-folder-o"></i> |
| 42 | - <?php endif; ?> |
|
| 43 | + <?php endif; |
|
| 44 | +} |
|
| 45 | +?> |
|
| 43 | 46 | <?= $file['slug'] ?> |
| 44 | 47 | </a> |
| 45 | 48 | </li> |
@@ -148,7 +148,9 @@ |
||
| 148 | 148 | $data = $this->jugaad_model->get_file_data($file_id, $template_meta, $this->user, true); |
| 149 | 149 | |
| 150 | 150 | foreach ($data as $value) { |
| 151 | - if (!$value) continue; |
|
| 151 | + if (!$value) { |
|
| 152 | + continue; |
|
| 153 | + } |
|
| 152 | 154 | if (is_array($value)) { |
| 153 | 155 | foreach ($value as $val) { |
| 154 | 156 | $strings[] = $val; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!function_exists('getallheaders')) { |
|
| 2 | +if (!function_exists('getallheaders')) { |
|
| 3 | 3 | function getallheaders() { |
| 4 | 4 | if (!is_array($_SERVER)) { |
| 5 | 5 | return array(); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @return string The token |
| 21 | 21 | */ |
| 22 | 22 | public function new_csrf_token() { |
| 23 | - if (! isset($_SESSION['csrf_token'])) { |
|
| 23 | + if (!isset($_SESSION['csrf_token'])) { |
|
| 24 | 24 | $_SESSION['csrf_token'] = self::generate_token(); |
| 25 | 25 | } |
| 26 | 26 | return $_SESSION['csrf_token']; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * loads the 400 view and quits. |
| 40 | 40 | */ |
| 41 | 41 | public function check_csrf_token($value) { |
| 42 | - if (! isset($_SESSION['csrf_token']) |
|
| 42 | + if (!isset($_SESSION['csrf_token']) |
|
| 43 | 43 | || $value !== $_SESSION['csrf_token'] |
| 44 | 44 | ) { |
| 45 | 45 | // If no CSRF token is set, or the $value does not match it, error |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $dedicated_view = $this->load_view($view_name, [ |
| 12 | 12 | 'error_code' => $code, |
| 13 | 13 | ]); |
| 14 | - if (! $dedicated_view) { |
|
| 14 | + if (!$dedicated_view) { |
|
| 15 | 15 | $this->load_view('http_error', [ |
| 16 | 16 | 'error_code' => $code, |
| 17 | 17 | ]); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | -$text_input = function ($name, $large_text=false) use ($errors) { |
|
| 2 | +$text_input = function($name, $large_text = false) use ($errors) { |
|
| 3 | 3 | ?> |
| 4 | 4 | <?php if ($large_text): ?> |
| 5 | 5 | <textarea name="<?= $name ?>" class="pure-input-1" required=""><?= isset($_POST[$name]) ? $_POST[$name] : '' ?></textarea> |
| 6 | - <?php else: ?> |
|
| 6 | + <?php else : ?> |
|
| 7 | 7 | <input |
| 8 | 8 | name="<?= $name ?>" |
| 9 | 9 | value="<?= isset($_POST[$name]) ? $_POST[$name] : '' ?>" |
@@ -3,14 +3,17 @@ discard block |
||
| 3 | 3 | ?> |
| 4 | 4 | <?php if ($large_text): ?> |
| 5 | 5 | <textarea name="<?= $name ?>" class="pure-input-1" required=""><?= isset($_POST[$name]) ? $_POST[$name] : '' ?></textarea> |
| 6 | - <?php else: ?> |
|
| 6 | + <?php else { |
|
| 7 | + : ?> |
|
| 7 | 8 | <input |
| 8 | 9 | name="<?= $name ?>" |
| 9 | 10 | value="<?= isset($_POST[$name]) ? $_POST[$name] : '' ?>" |
| 10 | 11 | required="" |
| 11 | 12 | type="text" |
| 12 | 13 | class="pure-input-1"> |
| 13 | - <?php endif; ?> |
|
| 14 | + <?php endif; |
|
| 15 | +} |
|
| 16 | +?> |
|
| 14 | 17 | |
| 15 | 18 | <?php if (isset($errors[$name])): ?> |
| 16 | 19 | <div class="error pure-input-1-1"><?= $errors[$name] ?></div> |
@@ -39,7 +42,8 @@ discard block |
||
| 39 | 42 | But your payment is unsuccessful. If you think this is a mistake, please email us at <a href="mailto:[email protected]" class="underlined">[email protected]</a> |
| 40 | 43 | </p> |
| 41 | 44 | <a class="btn" href="<?= locale_base_url() ?>talks-and-workshops/mun/pay_again/"> Click here to pay again.</a> |
| 42 | - <?php else: ?> |
|
| 45 | + <?php else { |
|
| 46 | + : ?> |
|
| 43 | 47 | <p class="text-center lead success"> |
| 44 | 48 | Payment Successful. You're registered for the event. |
| 45 | 49 | </p> |
@@ -47,13 +51,18 @@ discard block |
||
| 47 | 51 | Kindly carry your payment receipt which is mailed to you while atteding workshop.<br/> |
| 48 | 52 | If you think this is a mistake, please email us at <a href="mailto:[email protected]" class="underlined">[email protected]</a> |
| 49 | 53 | </p> |
| 50 | - <?php endif; ?> |
|
| 51 | - <?php else: ?> |
|
| 54 | + <?php endif; |
|
| 55 | +} |
|
| 56 | +?> |
|
| 57 | + <?php else { |
|
| 58 | + : ?> |
|
| 52 | 59 | <form class="pure-form pure-form-stacked row" method="post" action=""> |
| 53 | 60 | <fieldset class="offset3 col6"> |
| 54 | 61 | <?php if (isset($errors['common'])): ?> |
| 55 | 62 | <div class="error pure-input-1-1"><?= $errors['common'] ?></div> |
| 56 | - <?php endif; ?> |
|
| 63 | + <?php endif; |
|
| 64 | +} |
|
| 65 | +?> |
|
| 57 | 66 | |
| 58 | 67 | <label><?= __('Contact number') ?></label> |
| 59 | 68 | <?php $text_input('contact_number'); ?> |
@@ -7,19 +7,19 @@ |
||
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | public function login() { |
| 10 | - $this->http_lib->redirect( locale_base_url() . 'oidc/login/' ); |
|
| 10 | + $this->http_lib->redirect(locale_base_url() . 'oidc/login/'); |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | public function logout() { |
| 14 | - $this->http_lib->redirect( locale_base_url() . 'oidc/logout/' ); |
|
| 14 | + $this->http_lib->redirect(locale_base_url() . 'oidc/logout/'); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function register() { |
| 18 | - $this->http_lib->redirect( locale_base_url() . 'oidc/login/' ); |
|
| 18 | + $this->http_lib->redirect(locale_base_url() . 'oidc/login/'); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function wdw() { |
| 22 | - $this->http_lib->redirect( locale_base_url() . 'talks-and-workshops/web-development/' ); |
|
| 22 | + $this->http_lib->redirect(locale_base_url() . 'talks-and-workshops/web-development/'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function codecraft() { |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function logout() { |
| 30 | 30 | $oidc = $this->construct_oidc(); |
| 31 | 31 | // XXX: Hack to logout from kong, i.e. unset lua_resty_session cookies |
| 32 | - setcookie('session', '', time() - 3600, '/'); |
|
| 32 | + setcookie('session', '', time() - 3600, '/'); |
|
| 33 | 33 | setcookie('session_2', '', time() - 3600, '/'); |
| 34 | 34 | setcookie('session_3', '', time() - 3600, '/'); |
| 35 | 35 | $oidc->signOut($oidc->getAccessToken(), base_url()); |
@@ -45,9 +45,9 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | private function admin_details() { |
| 48 | - $object = new stdClass(); |
|
| 49 | - $object->preferred_username = "admin"; |
|
| 50 | - return $object; |
|
| 48 | + $object = new stdClass(); |
|
| 49 | + $object->preferred_username = "admin"; |
|
| 50 | + return $object; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function get_user_details() { |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function force_authentication() { |
| 20 | - if ($this->is_authenticated()) return; |
|
| 20 | + if ($this->is_authenticated()) { |
|
| 21 | + return; |
|
| 22 | + } |
|
| 21 | 23 | $oidc = $this->construct_oidc(); |
| 22 | 24 | $oidc->authenticate(); |
| 23 | 25 | } |
@@ -52,7 +54,9 @@ discard block |
||
| 52 | 54 | |
| 53 | 55 | public function get_user_details() { |
| 54 | 56 | global $cfg; |
| 55 | - if ($cfg['debug']) return $this->admin_details(); |
|
| 57 | + if ($cfg['debug']) { |
|
| 58 | + return $this->admin_details(); |
|
| 59 | + } |
|
| 56 | 60 | |
| 57 | 61 | $oidc = $this->construct_oidc(); |
| 58 | 62 | if (!$oidc->getIdToken()) { |
@@ -60,7 +64,9 @@ discard block |
||
| 60 | 64 | } |
| 61 | 65 | |
| 62 | 66 | $details = $oidc->requestUserInfo(); |
| 63 | - if (isset($details->error)) $oidc->refreshTokens(); |
|
| 67 | + if (isset($details->error)) { |
|
| 68 | + $oidc->refreshTokens(); |
|
| 69 | + } |
|
| 64 | 70 | return $oidc->requestUserInfo(); |
| 65 | 71 | } |
| 66 | 72 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | <?php foreach ($sponsors as $sponsor): ?> |
| 302 | 302 | <div class="col3 container"> |
| 303 | 303 | <p><?= $sponsor['name'] ?></p> |
| 304 | - <img src="<?= base_url() .'static/images/sponsors/'. $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 304 | + <img src="<?= base_url() . 'static/images/sponsors/' . $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 305 | 305 | </div> |
| 306 | 306 | <?php endforeach; ?> |
| 307 | 307 | </div> |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | <div class="row some-top-margin"> |
| 332 | 332 | <?php foreach ($sponsors as $sponsor): ?> |
| 333 | 333 | <div class="col3 container"> |
| 334 | - <img src="<?= base_url() .'static/images/sponsors/'. $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 334 | + <img src="<?= base_url() . 'static/images/sponsors/' . $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 335 | 335 | <p><?= $sponsor['name'] ?></p> |
| 336 | 336 | </div> |
| 337 | 337 | <?php endforeach; ?> |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | <div class="row"> |
| 343 | 343 | <?php foreach ($sponsors as $sponsor): ?> |
| 344 | 344 | <div class="col3 container"> |
| 345 | - <img src="<?= base_url() .'static/images/sponsors/'. $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 345 | + <img src="<?= base_url() . 'static/images/sponsors/' . $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 346 | 346 | <p><?= $sponsor['name'] ?></p> |
| 347 | 347 | </div> |
| 348 | 348 | <?php endforeach; ?> |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | <?php foreach ($sponsors as $sponsor): ?> |
| 510 | 510 | <div class="col3 container"> |
| 511 | 511 | <p><?= $sponsor['name'] ?></p> |
| 512 | - <img src="<?= base_url() .'static/images/sponsors/'. $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 512 | + <img src="<?= base_url() . 'static/images/sponsors/' . $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 513 | 513 | </div> |
| 514 | 514 | <?php endforeach; ?> |
| 515 | 515 | </div> |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | <div class="row some-top-margin"> |
| 540 | 540 | <?php foreach ($sponsors as $sponsor): ?> |
| 541 | 541 | <div class="col3 container"> |
| 542 | - <img src="<?= base_url() .'static/images/sponsors/'. $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 542 | + <img src="<?= base_url() . 'static/images/sponsors/' . $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 543 | 543 | <p><?= $sponsor['name'] ?></p> |
| 544 | 544 | </div> |
| 545 | 545 | <?php endforeach; ?> |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | <div class="row"> |
| 551 | 551 | <?php foreach ($sponsors as $sponsor): ?> |
| 552 | 552 | <div class="col3 container"> |
| 553 | - <img src="<?= base_url() .'static/images/sponsors/'. $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 553 | + <img src="<?= base_url() . 'static/images/sponsors/' . $sponsor['image'] ?>" alt="<?= $sponsor['name'] ?> Logo" /> |
|
| 554 | 554 | <p><?= $sponsor['name'] ?></p> |
| 555 | 555 | </div> |
| 556 | 556 | <?php endforeach; ?> |