Completed
Push — master ( 6abae4...8c7895 )
by Megh
02:56
created
src/app/models/breakin_model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             "INSERT INTO `breakin_teams`
49 49
             (`nick1`, `nick2`, `team_name`) VALUES  (?, ?, ?)",
50 50
             "sss",
51
-            [ $info['nick1'], $info['nick2'], $info['team_name'] ?: $info['nick1'] ],
51
+            [$info['nick1'], $info['nick2'], $info['team_name'] ?: $info['nick1']],
52 52
             false
53 53
         );
54 54
     }
Please login to merge, or discard this patch.
src/app/models/sap_model.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             [$email]
33 33
         );
34 34
         $row = $stmt->get_result()->fetch_row();
35
-        if (! $row) {
35
+        if (!$row) {
36 36
             return false;
37 37
         }
38 38
         if (password_verify($password, $row[1])) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             [$email]
50 50
         );
51 51
         $row = $stmt->get_result()->fetch_row();
52
-        if (! $row) {
52
+        if (!$row) {
53 53
             return false;
54 54
         }
55 55
         return boolval($row[0]);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             'ssss',
164 164
             [$title, $level, $points, $description]
165 165
         );
166
-        if (! $stmt) {
166
+        if (!$stmt) {
167 167
             return false;
168 168
         }
169 169
         return $stmt->insert_id;
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 WHERE `tasks`.`mission_id`=?
285 285
 SQL;
286 286
         if (!$approved) {
287
-            $query .=  " AND `task_submissions`.`done` = 0";
287
+            $query .= " AND `task_submissions`.`done` = 0";
288 288
         } else {
289
-            $query .=  " AND `task_submissions`.`done` = 1";
289
+            $query .= " AND `task_submissions`.`done` = 1";
290 290
         }
291 291
 
292 292
         $stmt = $this->db_lib->prepared_execute(
@@ -407,11 +407,11 @@  discard block
 block discarded – undo
407 407
                 [null, $user['id']],
408 408
                 false
409 409
             );
410
-        if (! $stmt) {
410
+        if (!$stmt) {
411 411
             $db_error = true;
412 412
         }
413 413
 
414
-        if (! $db_error) {
414
+        if (!$db_error) {
415 415
             $stmt = $this->db_lib->prepared_execute(
416 416
                 $this->DB->sap,
417 417
                 'INSERT INTO `sap_users` (`email`, `registration_id`, `password_hash`) VALUES (?, ?, ?)',
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
                 [$user['email'], $user['id'], password_hash($password, PASSWORD_DEFAULT)],
420 420
                 false
421 421
             );
422
-            if (! $stmt) {
422
+            if (!$stmt) {
423 423
                 $db_error = true;
424 424
             }
425 425
         }
Please login to merge, or discard this patch.
src/app/models/auth_model.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $this->load_library("ldap_lib", "ldap");
84 84
         $ds = $this->ldap->get_link();
85 85
         $dn = "dc=felicity,dc=iiit,dc=ac,dc=in";
86
-        $filter = '(&(mail='.$email.'))';
86
+        $filter = '(&(mail=' . $email . '))';
87 87
         $sr = ldap_search($ds, $dn, $filter, array_keys($attributes));
88 88
         $entry = ldap_first_entry($ds, $sr);
89 89
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $user_data = [];
96 96
 
97 97
         foreach ($attributes as $key => $value) {
98
-            if (isset($entry_data[$key]) &&  isset($entry_data[$key][0])) {
98
+            if (isset($entry_data[$key]) && isset($entry_data[$key][0])) {
99 99
                 $user_data[$value] = $entry_data[$key][0];
100 100
             }
101 101
         }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         return false;
264 264
     }
265 265
 
266
-    function verify_mail($hash, $remove=true) {
266
+    function verify_mail($hash, $remove = true) {
267 267
         $stmt = $this->db_lib->prepared_execute(
268 268
             $this->DB->users,
269 269
             "SELECT `email`, `hash`, `action` FROM `mail_verify` WHERE `hash`=?",
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     function create_ldap_user($email, $password) {
293 293
         $this->load_library("ldap_lib", "ldap");
294 294
         $ds = $this->ldap->get_link();
295
-        return ldap_add($ds, "uid=".addcslashes($email, '+').",ou=users,dc=felicity,dc=iiit,dc=ac,dc=in", [
295
+        return ldap_add($ds, "uid=" . addcslashes($email, '+') . ",ou=users,dc=felicity,dc=iiit,dc=ac,dc=in", [
296 296
             "userPassword"  => "{SHA}" . base64_encode(pack("H*", sha1($password))),
297 297
             "objectClass"   => [
298 298
                 "account",
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
     function reset_ldap_password($email, $password) {
307 307
         $this->load_library("ldap_lib", "ldap");
308 308
         $ds = $this->ldap->get_link();
309
-        return ldap_mod_replace($ds, "uid=".addcslashes($email, '+').",ou=users,dc=felicity,dc=iiit,dc=ac,dc=in", [
309
+        return ldap_mod_replace($ds, "uid=" . addcslashes($email, '+') . ",ou=users,dc=felicity,dc=iiit,dc=ac,dc=in", [
310 310
             "userPassword" => "{SHA}" . base64_encode(pack("H*", sha1($password)))
311 311
         ]);
312 312
     }
Please login to merge, or discard this patch.
src/app/models/contest_model.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -317,13 +317,13 @@
 block discarded – undo
317 317
             VALUES  (?, ?, ?, ?, ?, ?, ?)",
318 318
             "sssssss",
319 319
             [
320
-              $info['nick'],
321
-              $info['name'],
322
-              $info['contact_number'],
323
-              $info['leader'],
324
-              $info['link'],
325
-              $info['members'],
326
-              $info['tell']
320
+                $info['nick'],
321
+                $info['name'],
322
+                $info['contact_number'],
323
+                $info['leader'],
324
+                $info['link'],
325
+                $info['members'],
326
+                $info['tell']
327 327
             ],
328 328
             false
329 329
         );
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -45,8 +45,7 @@  discard block
 block discarded – undo
45 45
         );
46 46
         if (!$stmt) {
47 47
             return false;
48
-        }
49
-        else {
48
+        } else {
50 49
             return true;
51 50
         }
52 51
     }
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
         $this->ttt_dump_data($nick, 'callback', $payment_data);
64 63
         if (!$stmt) {
65 64
             return false;
66
-        }
67
-        else {
65
+        } else {
68 66
             return true;
69 67
         }
70 68
     }
@@ -272,8 +270,7 @@  discard block
 block discarded – undo
272 270
         $this->webdev_dump_data($nick, 'callback', $payment_data);
273 271
         if (!$stmt) {
274 272
             return false;
275
-        }
276
-        else {
273
+        } else {
277 274
             return true;
278 275
         }
279 276
     }
@@ -341,8 +338,7 @@  discard block
 block discarded – undo
341 338
         $this->riderofstorms_dump_data($nick, 'callback', $payment_data);
342 339
         if (!$stmt) {
343 340
             return false;
344
-        }
345
-        else {
341
+        } else {
346 342
             return true;
347 343
         }
348 344
     }
@@ -396,8 +392,7 @@  discard block
 block discarded – undo
396 392
         $this->arvr_dump_data($nick, 'callback', $payment_data);
397 393
         if (!$stmt) {
398 394
             return false;
399
-        }
400
-        else {
395
+        } else {
401 396
             return true;
402 397
         }
403 398
     }
@@ -525,8 +520,7 @@  discard block
 block discarded – undo
525 520
         $this->artuino_dump_data($team_id, 'callback', $payment_data);
526 521
         if (!$stmt) {
527 522
             return false;
528
-        }
529
-        else {
523
+        } else {
530 524
             return true;
531 525
         }
532 526
     }
@@ -582,8 +576,7 @@  discard block
 block discarded – undo
582 576
         $this->mun_dump_data($nick, 'callback', $payment_data);
583 577
         if (!$stmt) {
584 578
             return false;
585
-        }
586
-        else {
579
+        } else {
587 580
             return true;
588 581
         }
589 582
     }
Please login to merge, or discard this patch.
src/app/views/http_error.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,10 @@
 block discarded – undo
4 4
     <meta charset="utf-8">
5 5
     <meta name="robots" content="noindex">
6 6
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
-    <title><?= $error_code ?><?php if (isset($message)) echo " - ", $message; ?></title>
7
+    <title><?= $error_code ?><?php if (isset($message)) {
8
+    echo " - ", $message;
9
+}
10
+?></title>
8 11
     <link rel="stylesheet" href="<?= base_url() ?>static/styles/error.css">
9 12
 </head>
10 13
 <body>
Please login to merge, or discard this patch.
src/app/views/contest/ttt_workshop.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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] : '' ?>"
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,14 +3,17 @@  discard block
 block discarded – undo
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>
@@ -33,11 +36,14 @@  discard block
 block discarded – undo
33 36
         <?php if ($user_details): ?>
34 37
             <?php if ($user_details['payment_status'] == 'success'): ?>
35 38
                 <p class="success">You have successfully paid </p>
36
-            <?php else: ?>
39
+            <?php else {
40
+    : ?>
37 41
                 <div class="text-center">
38 42
                     <?php if ($user_details['payment_status'] == 'failed'): ?>
39 43
                         <p class="error">Payment was unsuccessfull </p>
40
-                    <?php endif; ?>
44
+                    <?php endif;
45
+}
46
+?>
41 47
 
42 48
                     <a href="<?= $payment_url ?>" class="pure-button pure-button-primary some-top-margin">
43 49
                         <?= __('Proceed to payment ₹100') ?>
Please login to merge, or discard this patch.
src/app/views/contest/futsal.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-$text_input = function ($name, $required=true) use ($errors) {
2
+$text_input = function($name, $required = true) use ($errors) {
3 3
 ?>
4 4
     <input
5 5
         name="<?= $name ?>"
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
             <p class="text-center">
35 35
                 If you think this is a mistake, please email us at <a href="mailto:[email protected]" class="underlined">[email protected]</a>
36 36
             </p>
37
-        <?php else: ?>
37
+        <?php else {
38
+    : ?>
38 39
             <p class="text-center lead">
39 40
                 Note: Make sure that all of the team members are registered with us.
40 41
             </p>
@@ -45,7 +46,9 @@  discard block
 block discarded – undo
45 46
                 <fieldset class="offset3 col6">
46 47
                     <?php if (isset($errors['common'])): ?>
47 48
                         <div class="error pure-input-1-1"><?= $errors['common'] ?></div>
48
-                    <?php endif; ?>
49
+                    <?php endif;
50
+}
51
+?>
49 52
 
50 53
                     <label><?= __('Team name') ?> (*)</label>
51 54
                     <?php $text_input('team_name'); ?>
Please login to merge, or discard this patch.
src/app/views/contest/artuino.php 2 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
                     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>
37 37
                 </p>
38 38
                 <a class="btn" href="<?= locale_base_url() ?>pulsation/artuino/pay_again/"> Click here to pay again.</a>
39
-            <?php else: ?>
39
+            <?php else {
40
+    : ?>
40 41
                 <p class="text-center lead success">
41 42
                     Payment Successful. You're registered for the event as a part of team <?= $team_info['team_name'] ?>
42 43
                 </p>
@@ -44,8 +45,11 @@  discard block
 block discarded – undo
44 45
                     Kindly carry your payment receipt which is mailed to you while atteding workshop.<br/>
45 46
                     If you think this is a mistake, please email us at <a href="mailto:[email protected]" class="underlined">[email protected]</a>
46 47
                 </p>
47
-            <?php endif; ?>
48
-        <?php else: ?>
48
+            <?php endif;
49
+}
50
+?>
51
+        <?php else {
52
+    : ?>
49 53
             <p class="text-center lead">
50 54
                 Note: Make sure that all of the team members are registered with us.
51 55
             </p>
@@ -56,7 +60,9 @@  discard block
 block discarded – undo
56 60
                 <fieldset class="offset3 col6">
57 61
                     <?php if (isset($errors['common'])): ?>
58 62
                         <div class="error pure-input-1-1"><?= $errors['common'] ?></div>
59
-                    <?php endif; ?>
63
+                    <?php endif;
64
+}
65
+?>
60 66
 
61 67
                     <label><?= __('Team name') ?> (*)</label>
62 68
                     <?php $text_input('team_name'); ?>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-$text_input = function ($name, $required=true) use ($errors) {
2
+$text_input = function($name, $required = true) use ($errors) {
3 3
 ?>
4 4
     <input
5 5
         name="<?= $name ?>"
Please login to merge, or discard this patch.
src/app/views/contest/webdev_workshop.php 2 patches
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,14 +3,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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/web-development/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
 block discarded – undo
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'); ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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] : '' ?>"
Please login to merge, or discard this patch.