@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - $this->load_fragment('auth/form_header', ['heading' => __('Email Verification Required') ]); |
|
2 | + $this->load_fragment('auth/form_header', ['heading' => __('Email Verification Required')]); |
|
3 | 3 | ?> |
4 | 4 | <div class="row"> |
5 | 5 | <div class="col6 offset3 text-center"> |
@@ -10,7 +10,8 @@ discard block |
||
10 | 10 | <div class="success"><?= __('Password successfully set!') ?></div> |
11 | 11 | <a href="<?= locale_base_url() . "auth/login/" ?>" class="some-top-margin pure-button pure-button-primary"><?= __('Continue to a magical journey') ?></a> |
12 | 12 | <?php |
13 | - else: |
|
13 | + else { |
|
14 | + : |
|
14 | 15 | ?> |
15 | 16 | <form action="<?= locale_base_url() . "auth/register/password_reset/" ?>" method="post" class="pure-form pure-form-stacked"> |
16 | 17 | <fieldset> |
@@ -29,5 +30,6 @@ discard block |
||
29 | 30 | </form> |
30 | 31 | <?php |
31 | 32 | endif; |
32 | -?> |
|
33 | + } |
|
34 | + ?> |
|
33 | 35 | <?php $this->load_fragment('auth/form_footer'); ?> |
@@ -8,7 +8,7 @@ |
||
8 | 8 | $button_action = __('Confirm'); |
9 | 9 | $message = __("If you change your email, we will send an email to the new address to verify it."); |
10 | 10 | } |
11 | - $this->load_fragment('auth/form_header', ['heading' => __('Welcome!') ]); |
|
11 | + $this->load_fragment('auth/form_header', ['heading' => __('Welcome!')]); |
|
12 | 12 | ?> |
13 | 13 | <div> |
14 | 14 | <p><?= $heading ?></p> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - $this->load_fragment('auth/form_header', ['heading' => __('Update your profile') ]); |
|
2 | + $this->load_fragment('auth/form_header', ['heading' => __('Update your profile')]); |
|
3 | 3 | ?> |
4 | 4 | <?php |
5 | 5 | //"nick", "name", "mail", "gender", "country", "city", "dob", "organization" |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | <?php |
36 | 36 | load_helper('country_list'); |
37 | 37 | $countries = get_country_list(); |
38 | - foreach($countries as $code => $name): |
|
38 | + foreach ($countries as $code => $name): |
|
39 | 39 | if ($user_data['country'] == $code) { |
40 | 40 | $selected = 'selected'; |
41 | 41 | } else { |
@@ -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> |
@@ -56,12 +56,18 @@ |
||
56 | 56 | <?php if ($is_authenticated): ?> |
57 | 57 | <?php if (!empty($user_nick)): ?> |
58 | 58 | <div class="nick"><?= sprintf(__('Hello, %s'), $user_nick) ?> <a href="<?= locale_base_url() . "auth/logout/" ?>"><?= __('Logout') ?></a></div> |
59 | - <?php else: ?> |
|
59 | + <?php else { |
|
60 | + : ?> |
|
60 | 61 | <div><a href="<?= locale_base_url() . "auth/logout/" ?>" class="pure-button btn"><?= __('Logout') ?></a></div> |
61 | - <?php endif; ?> |
|
62 | - <?php else: ?> |
|
62 | + <?php endif; |
|
63 | +} |
|
64 | +?> |
|
65 | + <?php else { |
|
66 | + : ?> |
|
63 | 67 | <div><a href="<?= locale_base_url() . "auth/login/" ?>" class="pure-button btn"><?= __('Login / Register') ?></a></div> |
64 | - <?php endif; ?> |
|
68 | + <?php endif; |
|
69 | +} |
|
70 | +?> |
|
65 | 71 | </div> |
66 | 72 | <?php endif; ?> |
67 | 73 |
@@ -7,19 +7,19 @@ |
||
7 | 7 | } |
8 | 8 | |
9 | 9 | public function login() { |
10 | - $this->http_lib->redirect( locale_base_url() . 'auth/login/' ); |
|
10 | + $this->http_lib->redirect(locale_base_url() . 'auth/login/'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | public function logout() { |
14 | - $this->http_lib->redirect( locale_base_url() . 'auth/logout/' ); |
|
14 | + $this->http_lib->redirect(locale_base_url() . 'auth/logout/'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function register() { |
18 | - $this->http_lib->redirect( locale_base_url() . 'auth/login/' ); |
|
18 | + $this->http_lib->redirect(locale_base_url() . 'auth/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() { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | $this->load_model('sap_model'); |
85 | 85 | $user = $this->sap_model->verify_hash($hash); |
86 | - if (! $user) { |
|
86 | + if (!$user) { |
|
87 | 87 | $this->http_lib->response_code(404); |
88 | 88 | } |
89 | 89 | $this->load_library('csrf_lib'); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $this->http_lib->response_code(400); |
102 | 102 | } |
103 | 103 | foreach (['hash', 'password', 'csrf_token'] as $name) { |
104 | - if (! isset($_POST[$name])) { |
|
104 | + if (!isset($_POST[$name])) { |
|
105 | 105 | $this->http_lib->response_code(400); |
106 | 106 | } |
107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $this->csrf_lib->reset_csrf_token(); |
111 | 111 | $this->load_model('sap_model'); |
112 | 112 | $user = $this->sap_model->verify_hash($_POST['hash']); |
113 | - if (! $user) { |
|
113 | + if (!$user) { |
|
114 | 114 | $this->http_lib->response_code(400); |
115 | 115 | } |
116 | 116 | $success = $this->sap_model->create_user_password($user, $_POST['password']); |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | $url = $payment_cfg['artuino']['api_url']; |
22 | 22 | $api_headers = $payment_cfg['artuino']['api_headers']; |
23 | 23 | $purpose = $payment_cfg['artuino']['purpose']; |
24 | - $amount = $payment_cfg['artuino']['amount']; |
|
25 | - $redirect_url = $payment_cfg['artuino']['redirect_url']; |
|
24 | + $amount = $payment_cfg['artuino']['amount']; |
|
25 | + $redirect_url = $payment_cfg['artuino']['redirect_url']; |
|
26 | 26 | $webhook = $payment_cfg['artuino']['webhook']; |
27 | 27 | |
28 | 28 | $ch = curl_init(); |
@@ -65,30 +65,30 @@ discard block |
||
65 | 65 | 'contact_number', |
66 | 66 | ], $errors); |
67 | 67 | |
68 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
68 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
69 | 69 | $errors['contact_number'] = 'Please enter a valid phone number'; |
70 | 70 | } |
71 | 71 | |
72 | - if (!empty($_POST['team_name']) && $this->contest_model->check_artuino_team_exists($_POST['team_name']) ) { |
|
72 | + if (!empty($_POST['team_name']) && $this->contest_model->check_artuino_team_exists($_POST['team_name'])) { |
|
73 | 73 | $errors['team_name'] = 'This team name already exists'; |
74 | 74 | } |
75 | 75 | |
76 | 76 | $team = [$user_nick]; |
77 | 77 | $this->load_model('auth_model'); |
78 | - for ($i=2; $i <= 4; $i++) { |
|
79 | - if ( ! empty($_POST['nick'.$i]) ) { |
|
80 | - $teammate = $this->auth_model->get_user_by_nick($_POST['nick'.$i]); |
|
78 | + for ($i = 2; $i <= 4; $i++) { |
|
79 | + if (!empty($_POST['nick' . $i])) { |
|
80 | + $teammate = $this->auth_model->get_user_by_nick($_POST['nick' . $i]); |
|
81 | 81 | if (!empty($teammate) |
82 | 82 | && isset($teammate["resitration_status"]) && $teammate["resitration_status"] == "complete" |
83 | - && isset($teammate["email_verified"]) && $teammate["email_verified"] |
|
83 | + && isset($teammate["email_verified"]) && $teammate["email_verified"] |
|
84 | 84 | ) { |
85 | - if ($this->contest_model->check_artuino_participant_exists($_POST['nick'.$i])) { |
|
86 | - $errors['nick'.$i] = 'This member is already registered'; |
|
85 | + if ($this->contest_model->check_artuino_participant_exists($_POST['nick' . $i])) { |
|
86 | + $errors['nick' . $i] = 'This member is already registered'; |
|
87 | 87 | } else { |
88 | - $team[] = $_POST['nick'.$i]; |
|
88 | + $team[] = $_POST['nick' . $i]; |
|
89 | 89 | } |
90 | 90 | } else { |
91 | - $errors['nick'.$i] = 'This member is not registered'; |
|
91 | + $errors['nick' . $i] = 'This member is not registered'; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if ($success) { |
110 | 110 | $redirect_url = $this->get_artuino_payment_url($_POST['team_name'], $_POST['contact_number']); |
111 | 111 | $this->load_library('http_lib', 'http'); |
112 | - $this->http->redirect( $redirect_url ); |
|
112 | + $this->http->redirect($redirect_url); |
|
113 | 113 | } else { |
114 | 114 | $errors['common'] = 'Some unexpected error occured'; |
115 | 115 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | $this->load_view('skeleton_template/header', [ |
120 | - 'title' => __('Register').' · '.__('artuino'), |
|
120 | + 'title' => __('Register') . ' · ' . __('artuino'), |
|
121 | 121 | 'is_authenticated' => true, |
122 | 122 | 'user_nick' => $user_nick, |
123 | 123 | ]); |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | $this->load_model('contest_model'); |
155 | 155 | |
156 | 156 | if (!isset($_GET['payment_id'])) { |
157 | - $this->http->response_code( 400 ); |
|
157 | + $this->http->response_code(400); |
|
158 | 158 | exit(); |
159 | 159 | } |
160 | 160 | global $payment_cfg; |
161 | 161 | $proxy = 'http://proxy.iiit.ac.in:8080'; |
162 | 162 | |
163 | - $nick = $this->auth->get_user(); |
|
163 | + $nick = $this->auth->get_user(); |
|
164 | 164 | |
165 | 165 | $id = urlencode($_GET['payment_request_id']); |
166 | 166 | $payment_id = urlencode($_GET['payment_id']); |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | $payment_data = $response; |
189 | 189 | $this->model->artuino_payment_success($payment_id, $team_id, $status == 'Credit' ? 'success' : 'failed', $payment_data); |
190 | 190 | } else { |
191 | - if ( is_array( $response_array ) ) { |
|
192 | - $this->model->artuino_dump_data('unknown', 'callback', json_encode( [ '$_GET' => $_GET, 'response' => $response_array ] )); |
|
191 | + if (is_array($response_array)) { |
|
192 | + $this->model->artuino_dump_data('unknown', 'callback', json_encode(['$_GET' => $_GET, 'response' => $response_array])); |
|
193 | 193 | } else { |
194 | 194 | $this->model->artuino_dump_data('unknown', 'callback', json_encode($_GET)); |
195 | 195 | } |