@@ -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 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | /* $type can be 'approved' to show only already approved submissions */ |
| 187 | 187 | public function review_mission($mission_id, $type = null) { |
| 188 | - if (! $this->sap_auth->is_current_user_admin()) { |
|
| 188 | + if (!$this->sap_auth->is_current_user_admin()) { |
|
| 189 | 189 | $this->http_lib->response_code(403); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | public function review_submission($submission_id) { |
| 213 | - if (! $this->sap_auth->is_current_user_admin()) { |
|
| 213 | + if (!$this->sap_auth->is_current_user_admin()) { |
|
| 214 | 214 | $this->http_lib->response_code(403); |
| 215 | 215 | } |
| 216 | 216 | $action = $_POST['action']; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | public function confirm_users() { |
| 289 | - if (! $this->sap_auth->is_current_user_admin()) { |
|
| 289 | + if (!$this->sap_auth->is_current_user_admin()) { |
|
| 290 | 290 | $this->http_lib->response_code(403); |
| 291 | 291 | } |
| 292 | 292 | $users = $this->sap_model->get_users_list(); |
@@ -297,21 +297,21 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | public function approve_user($id = "") { |
| 300 | - if (! $this->sap_auth->is_current_user_admin()) { |
|
| 300 | + if (!$this->sap_auth->is_current_user_admin()) { |
|
| 301 | 301 | $this->http_lib->response_code(403); |
| 302 | 302 | } |
| 303 | - if (! ctype_digit($id)) { |
|
| 303 | + if (!ctype_digit($id)) { |
|
| 304 | 304 | $this->http_lib->response_code(400); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | $user = $this->sap_model->get_user($id, false); |
| 308 | - if (! $user) { |
|
| 308 | + if (!$user) { |
|
| 309 | 309 | $this->http_lib->response_code(400); |
| 310 | 310 | } |
| 311 | 311 | do { |
| 312 | 312 | $password_hash = bin2hex(openssl_random_pseudo_bytes(21)); |
| 313 | 313 | } |
| 314 | - while (! $this->sap_model->approve_user($id, $password_hash)); |
|
| 314 | + while (!$this->sap_model->approve_user($id, $password_hash)); |
|
| 315 | 315 | |
| 316 | 316 | $link = base_url() . 'sap/verify/' . $password_hash . '/'; |
| 317 | 317 | |
@@ -341,12 +341,12 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | public function resend_password_email() { |
| 344 | - if (! $this->sap_auth->is_current_user_admin()) { |
|
| 344 | + if (!$this->sap_auth->is_current_user_admin()) { |
|
| 345 | 345 | $this->http_lib->response_code(403); |
| 346 | 346 | } |
| 347 | 347 | $id = isset($_POST['user-id']) ? $_POST['user-id'] : null; |
| 348 | 348 | $user = $this->sap_model->get_user($id, false); |
| 349 | - if (! $user) { |
|
| 349 | + if (!$user) { |
|
| 350 | 350 | $this->http_lib->response_code(400); |
| 351 | 351 | } |
| 352 | 352 | |
@@ -378,19 +378,19 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | public function remove_user($id = "") { |
| 381 | - if (! $this->sap_auth->is_current_user_admin()) { |
|
| 381 | + if (!$this->sap_auth->is_current_user_admin()) { |
|
| 382 | 382 | $this->http_lib->response_code(403); |
| 383 | 383 | } |
| 384 | - if (! ctype_digit($id)) { |
|
| 384 | + if (!ctype_digit($id)) { |
|
| 385 | 385 | $this->http_lib->response_code(400); |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | $user = $this->sap_model->get_user($id, false); |
| 389 | - if (! $user) { |
|
| 389 | + if (!$user) { |
|
| 390 | 390 | $this->http_lib->response_code(400); |
| 391 | 391 | } |
| 392 | 392 | $success = $this->sap_model->remove_user($id); |
| 393 | - if (! $success) { |
|
| 393 | + if (!$success) { |
|
| 394 | 394 | $this->session_lib->flash_set('error', 'Could not remove user. :/'); |
| 395 | 395 | } |
| 396 | 396 | $this->http_lib->redirect(base_url() . 'sap/portal/users/'); |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | 'data_name' => $name, |
| 28 | 28 | 'data_email' => $email, |
| 29 | 29 | 'data_phone' => $phone, |
| 30 | - 'data_'.$nick_field => $nick, |
|
| 31 | - 'data_hidden' => 'data_'.$nick_field, |
|
| 30 | + 'data_' . $nick_field => $nick, |
|
| 31 | + 'data_hidden' => 'data_' . $nick_field, |
|
| 32 | 32 | ]; |
| 33 | 33 | $readonly_str = 'data_readonly=data_name&data_readonly=data_email&data_readonly=data_phone'; |
| 34 | 34 | $query_str = http_build_query($data); |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | $user_nick = $this->auth->get_user(); |
| 42 | 42 | $errors = []; |
| 43 | 43 | $user_details = $this->model->is_registered_for_ttt($user_nick); |
| 44 | - if (!$user_details && $_SERVER['REQUEST_METHOD'] === 'POST'){ |
|
| 44 | + if (!$user_details && $_SERVER['REQUEST_METHOD'] === 'POST') { |
|
| 45 | 45 | required_post_params([ |
| 46 | 46 | 'contact_number', |
| 47 | 47 | ], $errors); |
| 48 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
| 48 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
| 49 | 49 | $errors['contact_number'] = 'Please enter a valid phone number'; |
| 50 | 50 | } |
| 51 | 51 | if (!$errors) { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($success) { |
| 57 | 57 | $redirect_url = $this->get_ttt_payment_url($user_nick, $_POST['contact_number']); |
| 58 | 58 | $this->load_library('http_lib', 'http'); |
| 59 | - $this->http->redirect( $redirect_url ); |
|
| 59 | + $this->http->redirect($redirect_url); |
|
| 60 | 60 | } |
| 61 | 61 | else { |
| 62 | 62 | $errors['common'] = 'Some unexpected error occured'; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | $payment_url = $this->get_ttt_payment_url($user_nick, $user_details['contact_number']); |
| 67 | 67 | $this->load_view('skeleton_template/header', [ |
| 68 | - 'title' => __('Register').' · '.__('Terribly Tiny Tales Workshop'), |
|
| 68 | + 'title' => __('Register') . ' · ' . __('Terribly Tiny Tales Workshop'), |
|
| 69 | 69 | 'is_authenticated' => true, |
| 70 | 70 | 'user_nick' => $user_nick, |
| 71 | 71 | ]); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | public function success() { |
| 84 | 84 | $this->load_library('http_lib', 'http'); |
| 85 | 85 | if (!isset($_GET['payment_id'])) { |
| 86 | - $this->http->response_code( 400 ); |
|
| 86 | + $this->http->response_code(400); |
|
| 87 | 87 | exit(); |
| 88 | 88 | } |
| 89 | 89 | global $payment_cfg; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $nick_field = $payment_cfg['ttt']['nick_field']; |
| 94 | 94 | $api_headers = $payment_cfg['ttt']['api_headers']; |
| 95 | 95 | |
| 96 | - $ch = curl_init(); |
|
| 96 | + $ch = curl_init(); |
|
| 97 | 97 | //curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); |
| 98 | 98 | curl_setopt($ch, CURLOPT_URL, $url); |
| 99 | 99 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | $payment_data |
| 115 | 115 | ); |
| 116 | 116 | } else { |
| 117 | - if ( is_array( $response_array ) ) { |
|
| 118 | - $this->model->ttt_dump_data('unknown', 'callback', json_encode( [ '$_GET' => $_GET, 'response' => $response_array ] )); |
|
| 117 | + if (is_array($response_array)) { |
|
| 118 | + $this->model->ttt_dump_data('unknown', 'callback', json_encode(['$_GET' => $_GET, 'response' => $response_array])); |
|
| 119 | 119 | } else { |
| 120 | 120 | $this->model->ttt_dump_data('unknown', 'callback', json_encode($_GET)); |
| 121 | 121 | } |
@@ -23,30 +23,30 @@ discard block |
||
| 23 | 23 | 'nick4', |
| 24 | 24 | ], $errors); |
| 25 | 25 | |
| 26 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
| 26 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
| 27 | 27 | $errors['contact_number'] = 'Please enter a valid phone number'; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if (!empty($_POST['team_name']) && $this->contest_model->check_futsal_team_exists($_POST['team_name']) ) { |
|
| 30 | + if (!empty($_POST['team_name']) && $this->contest_model->check_futsal_team_exists($_POST['team_name'])) { |
|
| 31 | 31 | $errors['team_name'] = 'This team name already exists'; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $team = [$user_nick]; |
| 35 | 35 | $this->load_model('auth_model'); |
| 36 | - for ($i=2; $i <= 6; $i++) { |
|
| 37 | - if ( ! empty($_POST['nick'.$i]) ) { |
|
| 38 | - $teammate = $this->auth_model->get_user_by_nick($_POST['nick'.$i]); |
|
| 36 | + for ($i = 2; $i <= 6; $i++) { |
|
| 37 | + if (!empty($_POST['nick' . $i])) { |
|
| 38 | + $teammate = $this->auth_model->get_user_by_nick($_POST['nick' . $i]); |
|
| 39 | 39 | if (!empty($teammate) |
| 40 | 40 | && isset($teammate["resitration_status"]) && $teammate["resitration_status"] == "complete" |
| 41 | - && isset($teammate["email_verified"]) && $teammate["email_verified"] |
|
| 41 | + && isset($teammate["email_verified"]) && $teammate["email_verified"] |
|
| 42 | 42 | ) { |
| 43 | - if ($this->contest_model->check_futsal_participant_exists($_POST['nick'.$i])) { |
|
| 44 | - $errors['nick'.$i] = 'This member is already registered'; |
|
| 43 | + if ($this->contest_model->check_futsal_participant_exists($_POST['nick' . $i])) { |
|
| 44 | + $errors['nick' . $i] = 'This member is already registered'; |
|
| 45 | 45 | } else { |
| 46 | - $team[] = $_POST['nick'.$i]; |
|
| 46 | + $team[] = $_POST['nick' . $i]; |
|
| 47 | 47 | } |
| 48 | 48 | } else { |
| 49 | - $errors['nick'.$i] = 'This member is not registered'; |
|
| 49 | + $errors['nick' . $i] = 'This member is not registered'; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $this->load_view('skeleton_template/header', [ |
| 75 | - 'title' => __('Register').' · '.__('Futsal'), |
|
| 75 | + 'title' => __('Register') . ' · ' . __('Futsal'), |
|
| 76 | 76 | 'is_authenticated' => true, |
| 77 | 77 | 'user_nick' => $user_nick, |
| 78 | 78 | ]); |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | $errors = []; |
| 93 | 93 | if (!$user_details && $_SERVER['REQUEST_METHOD'] === 'POST') { |
| 94 | 94 | required_post_params(['contact_number', 'paper_link'], $errors); |
| 95 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
| 95 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
| 96 | 96 | $errors['contact_number'] = 'Please enter a valid phone number'; |
| 97 | 97 | } |
| 98 | - if (!empty($_POST['paper_link']) && !is_valid_url($_POST['paper_link']) ) { |
|
| 98 | + if (!empty($_POST['paper_link']) && !is_valid_url($_POST['paper_link'])) { |
|
| 99 | 99 | $errors['paper_link'] = 'Please enter a valid link'; |
| 100 | 100 | } |
| 101 | 101 | if (!$errors) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | $this->load_view('skeleton_template/header', [ |
| 114 | - 'title' => __('Register').' · '.__('Paper Presentation'), |
|
| 114 | + 'title' => __('Register') . ' · ' . __('Paper Presentation'), |
|
| 115 | 115 | 'is_authenticated' => true, |
| 116 | 116 | 'user_nick' => $user_nick, |
| 117 | 117 | ]); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $errors = []; |
| 131 | 131 | if (!$user_details && $_SERVER['REQUEST_METHOD'] === 'POST') { |
| 132 | 132 | required_post_params(['paper_link'], $errors); |
| 133 | - if (!empty($_POST['paper_link']) && !is_valid_url($_POST['paper_link']) ) { |
|
| 133 | + if (!empty($_POST['paper_link']) && !is_valid_url($_POST['paper_link'])) { |
|
| 134 | 134 | $errors['paper_link'] = 'Please enter a valid link'; |
| 135 | 135 | } |
| 136 | 136 | if (!$errors) { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | $this->load_view('skeleton_template/header', [ |
| 148 | - 'title' => __('Register').' · '.__('Paper Presentation'), |
|
| 148 | + 'title' => __('Register') . ' · ' . __('Paper Presentation'), |
|
| 149 | 149 | 'is_authenticated' => true, |
| 150 | 150 | 'user_nick' => $user_nick, |
| 151 | 151 | ]); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $teammate = $this->auth_model->get_user_by_nick($_POST['teammate_nick']); |
| 176 | 176 | if (!empty($teammate) |
| 177 | 177 | && isset($teammate["resitration_status"]) && $teammate["resitration_status"] == "complete" |
| 178 | - && isset($teammate["email_verified"]) && $teammate["email_verified"] |
|
| 178 | + && isset($teammate["email_verified"]) && $teammate["email_verified"] |
|
| 179 | 179 | ) { |
| 180 | 180 | $other_team = $this->breakin_model->get_team_info($teammate['nick']); |
| 181 | 181 | if ($other_team) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $this->load_view('skeleton_template/header', [ |
| 226 | - 'title' => __('Register').' · '.__('Breakin'), |
|
| 226 | + 'title' => __('Register') . ' · ' . __('Breakin'), |
|
| 227 | 227 | 'is_authenticated' => true, |
| 228 | 228 | 'user_nick' => $user_nick, |
| 229 | 229 | ]); |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | $url = $payment_cfg['webdev']['api_url']; |
| 22 | 22 | $api_headers = $payment_cfg['webdev']['api_headers']; |
| 23 | 23 | $purpose = $payment_cfg['webdev']['purpose']; |
| 24 | - $amount = $payment_cfg['webdev']['amount']; |
|
| 25 | - $redirect_url = $payment_cfg['webdev']['redirect_url']; |
|
| 24 | + $amount = $payment_cfg['webdev']['amount']; |
|
| 25 | + $redirect_url = $payment_cfg['webdev']['redirect_url']; |
|
| 26 | 26 | $webhook = $payment_cfg['webdev']['webhook']; |
| 27 | 27 | |
| 28 | 28 | $ch = curl_init(); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $errors = []; |
| 61 | 61 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
| 62 | 62 | required_post_params(['contact_number', 'stream', 'year', 'experience', 'why_join'], $errors); |
| 63 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
| 63 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
| 64 | 64 | $errors['contact_number'] = 'Please enter a valid phone number'; |
| 65 | 65 | } |
| 66 | 66 | if (!$errors) { |
@@ -75,14 +75,14 @@ discard block |
||
| 75 | 75 | if ($this->model->register_for_webdev($user_details)) { |
| 76 | 76 | $redirect_url = $this->get_webdev_payment_url($user_nick, $_POST['contact_number']); |
| 77 | 77 | $this->load_library('http_lib', 'http'); |
| 78 | - $this->http->redirect( $redirect_url ); |
|
| 78 | + $this->http->redirect($redirect_url); |
|
| 79 | 79 | } else { |
| 80 | 80 | $errors['common'] = __('Some unexpected error occurred'); |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | $this->load_view('skeleton_template/header', [ |
| 85 | - 'title' => __('Register').' · '.__('Web development Workshop'), |
|
| 85 | + 'title' => __('Register') . ' · ' . __('Web development Workshop'), |
|
| 86 | 86 | 'is_authenticated' => true, |
| 87 | 87 | 'user_nick' => $user_nick, |
| 88 | 88 | ]); |
@@ -113,13 +113,13 @@ discard block |
||
| 113 | 113 | public function success() { |
| 114 | 114 | $this->load_library('http_lib', 'http'); |
| 115 | 115 | if (!isset($_GET['payment_id'])) { |
| 116 | - $this->http->response_code( 400 ); |
|
| 116 | + $this->http->response_code(400); |
|
| 117 | 117 | exit(); |
| 118 | 118 | } |
| 119 | 119 | global $payment_cfg; |
| 120 | 120 | $proxy = 'http://proxy.iiit.ac.in:8080'; |
| 121 | 121 | |
| 122 | - $nick = $this->auth->get_user(); |
|
| 122 | + $nick = $this->auth->get_user(); |
|
| 123 | 123 | $id = urlencode($_GET['payment_request_id']); |
| 124 | 124 | $payment_id = urlencode($_GET['payment_id']); |
| 125 | 125 | $url = $payment_cfg['webdev']['api_url'] . $id . '/' . $payment_id . '/'; |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | $payment_data = $response; |
| 144 | 144 | $this->model->webdev_payment_success($payment_id, $nick, $status == 'Credit' ? 'success' : 'failed', $payment_data); |
| 145 | 145 | } else { |
| 146 | - if ( is_array( $response_array ) ) { |
|
| 147 | - $this->model->webdev_dump_data('unknown', 'callback', json_encode( [ '$_GET' => $_GET, 'response' => $response_array ] )); |
|
| 146 | + if (is_array($response_array)) { |
|
| 147 | + $this->model->webdev_dump_data('unknown', 'callback', json_encode(['$_GET' => $_GET, 'response' => $response_array])); |
|
| 148 | 148 | } else { |
| 149 | 149 | $this->model->webdev_dump_data('unknown', 'callback', json_encode($_GET)); |
| 150 | 150 | } |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | $url = $payment_cfg['arvr']['api_url']; |
| 22 | 22 | $api_headers = $payment_cfg['arvr']['api_headers']; |
| 23 | 23 | $purpose = $payment_cfg['arvr']['purpose']; |
| 24 | - $amount = $payment_cfg['arvr']['amount']; |
|
| 25 | - $redirect_url = $payment_cfg['arvr']['redirect_url']; |
|
| 24 | + $amount = $payment_cfg['arvr']['amount']; |
|
| 25 | + $redirect_url = $payment_cfg['arvr']['redirect_url']; |
|
| 26 | 26 | $webhook = $payment_cfg['arvr']['webhook']; |
| 27 | 27 | |
| 28 | 28 | $ch = curl_init(); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $errors = []; |
| 61 | 61 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
| 62 | 62 | required_post_params(['contact_number'], $errors); |
| 63 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
| 63 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
| 64 | 64 | $errors['contact_number'] = 'Please enter a valid phone number'; |
| 65 | 65 | } |
| 66 | 66 | if (!$errors) { |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | if ($this->model->register_for_arvr($user_details)) { |
| 72 | 72 | $redirect_url = $this->get_arvr_payment_url($user_nick, $_POST['contact_number']); |
| 73 | 73 | $this->load_library('http_lib', 'http'); |
| 74 | - $this->http->redirect( $redirect_url ); |
|
| 74 | + $this->http->redirect($redirect_url); |
|
| 75 | 75 | } else { |
| 76 | 76 | $errors['common'] = __('Some unexpected error occurred'); |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | $this->load_view('skeleton_template/header', [ |
| 81 | - 'title' => __('Register').' · '.__('Web development Workshop'), |
|
| 81 | + 'title' => __('Register') . ' · ' . __('Web development Workshop'), |
|
| 82 | 82 | 'is_authenticated' => true, |
| 83 | 83 | 'user_nick' => $user_nick, |
| 84 | 84 | ]); |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | public function success() { |
| 110 | 110 | $this->load_library('http_lib', 'http'); |
| 111 | 111 | if (!isset($_GET['payment_id'])) { |
| 112 | - $this->http->response_code( 400 ); |
|
| 112 | + $this->http->response_code(400); |
|
| 113 | 113 | exit(); |
| 114 | 114 | } |
| 115 | 115 | global $payment_cfg; |
| 116 | 116 | $proxy = 'http://proxy.iiit.ac.in:8080'; |
| 117 | 117 | |
| 118 | - $nick = $this->auth->get_user(); |
|
| 118 | + $nick = $this->auth->get_user(); |
|
| 119 | 119 | $id = urlencode($_GET['payment_request_id']); |
| 120 | 120 | $payment_id = urlencode($_GET['payment_id']); |
| 121 | 121 | $url = $payment_cfg['arvr']['api_url'] . $id . '/' . $payment_id . '/'; |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | $payment_data = $response; |
| 140 | 140 | $this->model->arvr_payment_success($payment_id, $nick, $status == 'Credit' ? 'success' : 'failed', $payment_data); |
| 141 | 141 | } else { |
| 142 | - if ( is_array( $response_array ) ) { |
|
| 143 | - $this->model->arvr_dump_data('unknown', 'callback', json_encode( [ '$_GET' => $_GET, 'response' => $response_array ] )); |
|
| 142 | + if (is_array($response_array)) { |
|
| 143 | + $this->model->arvr_dump_data('unknown', 'callback', json_encode(['$_GET' => $_GET, 'response' => $response_array])); |
|
| 144 | 144 | } else { |
| 145 | 145 | $this->model->arvr_dump_data('unknown', 'callback', json_encode($_GET)); |
| 146 | 146 | } |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | $url = $payment_cfg['riderofstorms']['api_url']; |
| 22 | 22 | $api_headers = $payment_cfg['riderofstorms']['api_headers']; |
| 23 | 23 | $purpose = $payment_cfg['riderofstorms']['purpose']; |
| 24 | - $amount = $payment_cfg['riderofstorms']['amount']; |
|
| 25 | - $redirect_url = $payment_cfg['riderofstorms']['redirect_url']; |
|
| 24 | + $amount = $payment_cfg['riderofstorms']['amount']; |
|
| 25 | + $redirect_url = $payment_cfg['riderofstorms']['redirect_url']; |
|
| 26 | 26 | $webhook = $payment_cfg['riderofstorms']['webhook']; |
| 27 | 27 | |
| 28 | 28 | $ch = curl_init(); |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | $errors = []; |
| 61 | 61 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
| 62 | 62 | required_post_params(['name', 'leader', 'contact_number', 'members', 'link'], $errors); |
| 63 | - if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) { |
|
| 63 | + if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) { |
|
| 64 | 64 | $errors['contact_number'] = 'Please enter a valid phone number'; |
| 65 | 65 | } |
| 66 | - if (!empty($_POST['link']) && !is_valid_url($_POST['link']) ) { |
|
| 66 | + if (!empty($_POST['link']) && !is_valid_url($_POST['link'])) { |
|
| 67 | 67 | $errors['link'] = 'Please enter a valid link'; |
| 68 | 68 | } |
| 69 | 69 | if (!$errors) { |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | if ($this->model->register_for_riderofstorms($user_details)) { |
| 80 | 80 | $redirect_url = $this->get_riderofstorms_payment_url($_POST['name'], $_POST['contact_number']); |
| 81 | 81 | $this->load_library('http_lib', 'http'); |
| 82 | - $this->http->redirect( $redirect_url ); |
|
| 82 | + $this->http->redirect($redirect_url); |
|
| 83 | 83 | } else { |
| 84 | 84 | $errors['common'] = __('Some unexpected error occurred'); |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | $this->load_view('skeleton_template/header', [ |
| 89 | - 'title' => __('Register').' · '.__('Riders on the Storms'), |
|
| 89 | + 'title' => __('Register') . ' · ' . __('Riders on the Storms'), |
|
| 90 | 90 | 'is_authenticated' => true, |
| 91 | 91 | 'user_nick' => $user_nick, |
| 92 | 92 | ]); |
@@ -117,13 +117,13 @@ discard block |
||
| 117 | 117 | public function success() { |
| 118 | 118 | $this->load_library('http_lib', 'http'); |
| 119 | 119 | if (!isset($_GET['payment_id'])) { |
| 120 | - $this->http->response_code( 400 ); |
|
| 120 | + $this->http->response_code(400); |
|
| 121 | 121 | exit(); |
| 122 | 122 | } |
| 123 | 123 | global $payment_cfg; |
| 124 | 124 | $proxy = 'http://proxy.iiit.ac.in:8080'; |
| 125 | 125 | |
| 126 | - $nick = $this->auth->get_user(); |
|
| 126 | + $nick = $this->auth->get_user(); |
|
| 127 | 127 | $id = urlencode($_GET['payment_request_id']); |
| 128 | 128 | $payment_id = urlencode($_GET['payment_id']); |
| 129 | 129 | $url = $payment_cfg['riderofstorms']['api_url'] . $id . '/' . $payment_id . '/'; |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | $payment_data = $response; |
| 148 | 148 | $this->model->riderofstorms_payment_success($payment_id, $nick, $status == 'Credit' ? 'success' : 'failed', $payment_data); |
| 149 | 149 | } else { |
| 150 | - if ( is_array( $response_array ) ) { |
|
| 151 | - $this->model->riderofstorms_dump_data('unknown', 'callback', json_encode( [ '$_GET' => $_GET, 'response' => $response_array ] )); |
|
| 150 | + if (is_array($response_array)) { |
|
| 151 | + $this->model->riderofstorms_dump_data('unknown', 'callback', json_encode(['$_GET' => $_GET, 'response' => $response_array])); |
|
| 152 | 152 | } else { |
| 153 | 153 | $this->model->riderofstorms_dump_data('unknown', 'callback', json_encode($_GET)); |
| 154 | 154 | } |