@@ -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(); |
@@ -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 | } |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | $redirect_url = $this->get_ttt_payment_url($user_nick, $_POST['contact_number']); |
| 58 | 58 | $this->load_library('http_lib', 'http'); |
| 59 | 59 | $this->http->redirect( $redirect_url ); |
| 60 | - } |
|
| 61 | - else { |
|
| 60 | + } else { |
|
| 62 | 61 | $errors['common'] = 'Some unexpected error occured'; |
| 63 | 62 | } |
| 64 | 63 | } |
@@ -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 | } |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class ldap_lib extends Library { |
| 7 | 7 | |
| 8 | - public function get_link($value='') { |
|
| 8 | + public function get_link($value = '') { |
|
| 9 | 9 | global $ldap_cfg; |
| 10 | 10 | |
| 11 | 11 | $ds = ldap_connect($ldap_cfg["host"]); |
@@ -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 |