Completed
Branch master (608ddd)
by Patrick
08:32
created
api/v1/aws.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@  discard block
 block discarded – undo
12 12
     $app->post('/test', 'testX');
13 13
 }
14 14
 
15
+/**
16
+ * @param string $function
17
+ */
15 18
 function sendToBackend($function, $payload)
16 19
 {
17 20
     $context = new ZMQContext();
@@ -72,6 +75,9 @@  discard block
 block discarded – undo
72 75
     }
73 76
 }
74 77
 
78
+/**
79
+ * @param string $test
80
+ */
75 81
 function endswith($string, $test)
76 82
 {
77 83
     $strlen = strlen($string);
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,28 +38,28 @@  discard block
 block discarded – undo
38 38
     global $app;
39 39
     $array = $app->getJSONBody(true);
40 40
 
41
-    try{
41
+    try {
42 42
         $message = Message::fromArray($array);
43 43
 
44 44
         // Validate the message
45 45
         $validator = new MessageValidator();
46 46
         $validator->validate($message);
47
-    } catch(\Exception $e) {
47
+    } catch (\Exception $e) {
48 48
         $app->notFound();
49 49
     }
50 50
 
51 51
     $type = $message->get('Type');
52
-    switch($type)
52
+    switch ($type)
53 53
     {
54 54
         case 'SubscriptionConfirmation':
55 55
             (new Client)->get($message->get('SubscribeURL'))->send();
56 56
             break;
57 57
         case 'Notification':
58 58
             $arn = $message->get('TopicArn');
59
-            if($arn !== false)
59
+            if ($arn !== false)
60 60
             {
61 61
                 $pos = strpos($arn, 'Listserv');
62
-                if($pos !== false)
62
+                if ($pos !== false)
63 63
                 {
64 64
                     sendToBackend('processListServMessage', $message->get('Message'));
65 65
                     echo 'true';
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 function getDestinationsForID($id)
84 84
 {
85
-    if(strcasecmp($id,'pboyd') === 0)
85
+    if (strcasecmp($id, 'pboyd') === 0)
86 86
     {
87 87
         return array('[email protected]');
88 88
     }
@@ -96,16 +96,16 @@  discard block
 block discarded – undo
96 96
 {
97 97
     $ret = array();
98 98
     $count = count($originals);
99
-    for($i = 0; $i < $count; $i++)
99
+    for ($i = 0; $i < $count; $i++)
100 100
     {
101 101
         $dest = $originals[$i];
102
-        if(endswith($dest, 'burningflipside.com'))
102
+        if (endswith($dest, 'burningflipside.com'))
103 103
         {
104 104
             $parts = explode('@', $dest);
105
-            if(count($parts) === 2)
105
+            if (count($parts) === 2)
106 106
             {
107 107
                 $dests = getDestinationsForID($parts[0]);
108
-                if($dests === false)
108
+                if ($dests === false)
109 109
                 {
110 110
                     file_put_contents('/var/www/profiles/tmp/log.log', "getActualDestinations: Invalid destination id $parts[0]\n", FILE_APPEND);
111 111
                 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -76,7 +76,9 @@  discard block
 block discarded – undo
76 76
 {
77 77
     $strlen = strlen($string);
78 78
     $testlen = strlen($test);
79
-    if ($testlen > $strlen) return false;
79
+    if ($testlen > $strlen) {
80
+        return false;
81
+    }
80 82
     return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;
81 83
 }
82 84
 
@@ -85,8 +87,7 @@  discard block
 block discarded – undo
85 87
     if(strcasecmp($id,'pboyd') === 0)
86 88
     {
87 89
         return array('[email protected]');
88
-    }
89
-    else
90
+    } else
90 91
     {
91 92
         return false;
92 93
     }
@@ -108,13 +109,11 @@  discard block
 block discarded – undo
108 109
                 if($dests === false)
109 110
                 {
110 111
                     file_put_contents('/var/www/profiles/tmp/log.log', "getActualDestinations: Invalid destination id $parts[0]\n", FILE_APPEND);
111
-                }
112
-                else
112
+                } else
113 113
                 {
114 114
                     $ret = array_merge($ret, $dests);
115 115
                 }
116
-            }
117
-            else
116
+            } else
118 117
             {
119 118
                 file_put_contents('/var/www/profiles/tmp/log.log', "getActualDestinations: Invalid destination format $dest\n", FILE_APPEND);
120 119
             }
Please login to merge, or discard this patch.
register.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@  discard block
 block discarded – undo
2 2
 ini_set('display_errors', 1);
3 3
 error_reporting(E_ALL);
4 4
 //Redirect users to https
5
-if($_SERVER["HTTPS"] != "on")
5
+if ($_SERVER["HTTPS"] != "on")
6 6
 {
7
-    header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
7
+    header("Location: https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
8 8
     exit();
9 9
 }
10 10
 require_once('class.FlipsideCAPTCHA.php');
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $captcha = new FlipsideCAPTCHA();
17 17
 FlipSession::setVar('captcha', $captcha);
18 18
 
19
-if(isset($_GET['return']))
19
+if (isset($_GET['return']))
20 20
 {
21 21
     $return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>';
22 22
 }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     $return = '';
26 26
 }
27 27
 
28
-if(FlipSession::isLoggedIn())
28
+if (FlipSession::isLoggedIn())
29 29
 {
30 30
     $page->add_notification('You are currently logged in to the system. Are you sure you want to register another account?');
31 31
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
 if(isset($_GET['return']))
20 20
 {
21 21
     $return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>';
22
-}
23
-else
22
+} else
24 23
 {
25 24
     $return = '';
26 25
 }
Please login to merge, or discard this patch.
user_exists.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 $provider = $auth->getSuplementalProviderByHost($_GET['src']);
15 15
 if($provider !== false)
16 16
 {
17
-   $user = $provider->getUserFromToken(false);
18
-   $email = $user->getEmail();
17
+    $user = $provider->getUserFromToken(false);
18
+    $email = $user->getEmail();
19 19
 }
20 20
 
21 21
 $page->body .= '
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
 
8 8
 $auth = AuthProvider::getInstance();
9 9
 $email = false;
10
-if(!isset($_GET['src']))
10
+if (!isset($_GET['src']))
11 11
 {
12 12
     die('Error loading page. Authentication source (src) must be specified');
13 13
 }
14 14
 $provider = $auth->getSuplementalProviderByHost($_GET['src']);
15
-if($provider !== false)
15
+if ($provider !== false)
16 16
 {
17 17
    $user = $provider->getUserFromToken(false);
18 18
    $email = $user->getEmail();
Please login to merge, or discard this patch.
index.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
     <p>This system will contain all your private data seperately so as to help prevent unwanted display of your data on www.burningflipside.com.
12 12
        Additionally, completing your profile on this site will enable you to complete ticket requests and sign up for volunteer shifts even faster than before.</p>';
13 13
 
14
-if($page->user !== null)
14
+if ($page->user !== null)
15 15
 {
16
-    if(!$page->user->isProfileComplete())
16
+    if (!$page->user->isProfileComplete())
17 17
     {
18 18
         $page->add_notification('Your profile is not yet complete. Click <a href="/profile.php" class="alert-link">here</a> to complete your profile.', $page::NOTIFICATION_WARNING);
19 19
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
     $page->body .= '<h1>Need to reset your password?</h1>
21 21
     <p>You can reset your password <a href="reset.php">here.</a></p>
22 22
 </div>';
23
-}
24
-else
23
+} else
25 24
 {
26 25
     $page->body .= '
27 26
     <h1>Need to register for the first time?</h1>
Please login to merge, or discard this patch.
change.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@  discard block
 block discarded – undo
2 2
 ini_set('display_errors', 1);
3 3
 error_reporting(E_ALL);
4 4
 //Redirect users to https
5
-if($_SERVER["HTTPS"] != "on")
5
+if ($_SERVER["HTTPS"] != "on")
6 6
 {
7
-    header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
7
+    header("Location: https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
8 8
     exit();
9 9
 }
10 10
 require_once('class.ProfilesPage.php');
@@ -12,19 +12,19 @@  discard block
 block discarded – undo
12 12
 $auth = AuthProvider::getInstance();
13 13
 $require_current_pass = true;
14 14
 $user = $page->user;
15
-if($user === false || $user === null)
15
+if ($user === false || $user === null)
16 16
 {
17 17
     //We might be reseting a user's forgotten password...
18
-    if(isset($_GET['hash']))
18
+    if (isset($_GET['hash']))
19 19
     {
20 20
         $user = $auth->getUserByResetHash($_GET['hash']);
21 21
         $require_current_pass = false;
22 22
     }
23 23
 }
24 24
 
25
-if($user === false || $user === null)
25
+if ($user === false || $user === null)
26 26
 {
27
-    if(isset($_GET['hash']))
27
+    if (isset($_GET['hash']))
28 28
     {
29 29
         $page->add_notification('This reset hash is no longer valid. Please select the neweset reset link in your email', FlipPage::NOTIFICATION_FAILED);
30 30
     }
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 {
38 38
     $page->add_js_from_src('js/zxcvbn-async.js');
39 39
     $page->add_js_from_src('js/change.js');
40
-    $current ='';
41
-    if($require_current_pass)
40
+    $current = '';
41
+    if ($require_current_pass)
42 42
     {
43 43
         $current = '<div class="form-group"><input class="form-control" type="password" id="current" name="current" placeholder="Current Password" required autofocus/></div>';
44 44
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,13 +27,11 @@  discard block
 block discarded – undo
27 27
     if(isset($_GET['hash']))
28 28
     {
29 29
         $page->add_notification('This reset hash is no longer valid. Please select the neweset reset link in your email', FlipPage::NOTIFICATION_FAILED);
30
-    }
31
-    else
30
+    } else
32 31
     {
33 32
         $page->add_notification('Please Log in first!', FlipPage::NOTIFICATION_FAILED);
34 33
     }
35
-}
36
-else
34
+} else
37 35
 {
38 36
     $page->add_js_from_src('js/zxcvbn-async.js');
39 37
     $page->add_js_from_src('js/change.js');
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
     if($require_current_pass)
42 40
     {
43 41
         $current = '<div class="form-group"><input class="form-control" type="password" id="current" name="current" placeholder="Current Password" required autofocus/></div>';
44
-    }
45
-    else
42
+    } else
46 43
     {
47 44
         $current = '<input type="hidden" id="hash" name="hash" value="'.$_GET['hash'].'"/>';
48 45
     }
Please login to merge, or discard this patch.
reset.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 $page->add_js(JS_BOOTBOX);
7 7
 $page->add_js_from_src('js/reset.js');
8 8
 
9
-if($page->user !== false && $page->user !== null)
9
+if ($page->user !== false && $page->user !== null)
10 10
 {
11 11
     //User is logged in. They can reset their password...
12 12
     $page->body = '
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
             <button name="submit" class="btn btn-primary" onclick="change_password();">Change Password</button>
37 37
         </div>
38 38
     ';
39
-}
40
-else
39
+} else
41 40
 {
42 41
     $page->body = '
43 42
         <div id="content">
Please login to merge, or discard this patch.
oauth/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 require_once('class.FlipREST.php');
3 3
 require_once('class.AuthProvider.php');
4 4
 
5
-if($_SERVER['REQUEST_URI'][0] == '/' && $_SERVER['REQUEST_URI'][1] == '/')
5
+if ($_SERVER['REQUEST_URI'][0] == '/' && $_SERVER['REQUEST_URI'][1] == '/')
6 6
 {
7 7
     $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 1);
8 8
 }
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
     global $app;
30 30
     $auth = AuthProvider::getInstance();
31 31
     $provider = $auth->getSuplementalProviderByHost($host);
32
-    if($provider === false)
32
+    if ($provider === false)
33 33
     {
34 34
         $app->notFound();
35 35
         return; 
36 36
     }
37 37
     $res = $provider->authenticate($app->request->get(), $currentUser);
38
-    switch($res)
38
+    switch ($res)
39 39
     {
40 40
         case \Auth\Authenticator::SUCCESS:
41 41
             $app->redirect('/');
Please login to merge, or discard this patch.
oauth2callback.php 3 patches
Switch Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 
25 25
 switch($src)
26 26
 {
27
-    case 'google':
28
-        $google = $auth->getAuthenticator('Auth\GoogleAuthenticator');
29
-        if(!isset($_GET['code']))
30
-        {
31
-            $google->redirect();
32
-            die();
33
-        }
34
-        else
35
-        {
36
-            $res = $google->authenticate($_GET['code'], $current_user);
37
-            switch($res)
27
+        case 'google':
28
+            $google = $auth->getAuthenticator('Auth\GoogleAuthenticator');
29
+            if(!isset($_GET['code']))
30
+            {
31
+                $google->redirect();
32
+                die();
33
+            }
34
+            else
38 35
             {
36
+                $res = $google->authenticate($_GET['code'], $current_user);
37
+                switch($res)
38
+                {
39 39
                 case \Auth\Authenticator::SUCCESS:
40 40
                     header('Location: '.$ref);
41 41
                     die();
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
                 case \Auth\Authenticator::ALREADY_PRESENT:
47 47
                     header('Location: user_exists.php?src=google&uid='.$current_user->getUid());
48 48
                     die();
49
-            }
49
+                }
50 50
         }
51 51
         break;
52
-    case 'twitter':
53
-        $twitter = $auth->getAuthenticator('Auth\TwitterAuthenticator');
54
-        if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
55
-        {
56
-            $twitter->redirect();
57
-            die();
58
-        }
59
-        else
60
-        {
61
-            $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
62
-            switch($res)
52
+        case 'twitter':
53
+            $twitter = $auth->getAuthenticator('Auth\TwitterAuthenticator');
54
+            if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
55
+            {
56
+                $twitter->redirect();
57
+                die();
58
+            }
59
+            else
63 60
             {
61
+                $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
62
+                switch($res)
63
+                {
64 64
                 case \Auth\Authenticator::SUCCESS:
65 65
                     header('Location: '.$ref);
66 66
                     die();
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
                 case \Auth\Authenticator::ALREADY_PRESENT:
72 72
                     header('Location: user_exists.php?src=twitter&uid='.$current_user->getUid());
73 73
                     die();
74
-            }
74
+                }
75 75
         }
76 76
         break;
77
-    case 'gitlab':
78
-        $gitlab = $auth->getAuthenticator('Auth\OAuth2\GitLabAuthenticator');
79
-        if(!isset($_GET['code']))
80
-        {
81
-            $google->redirect();
82
-            die();
83
-        }
84
-        else
85
-        {
86
-            $res = $gitlab->authenticate($_GET['code'], $current_user);
87
-            switch($res)
77
+        case 'gitlab':
78
+            $gitlab = $auth->getAuthenticator('Auth\OAuth2\GitLabAuthenticator');
79
+            if(!isset($_GET['code']))
80
+            {
81
+                $google->redirect();
82
+                die();
83
+            }
84
+            else
88 85
             {
86
+                $res = $gitlab->authenticate($_GET['code'], $current_user);
87
+                switch($res)
88
+                {
89 89
                 case \Auth\Authenticator::SUCCESS:
90 90
                     header('Location: '.$ref);
91 91
                     die();
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
                 case \Auth\Authenticator::ALREADY_PRESENT:
97 97
                     header('Location: user_exists.php?src=gitlab&uid='.$current_user->getUid());
98 98
                     die();
99
-            }
99
+                }
100 100
         }
101 101
     //Generic OAuth...
102
-    default:
103
-        print_r($_SERVER);
104
-        break;
102
+        default:
103
+            print_r($_SERVER);
104
+            break;
105 105
 }
106 106
 ?>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,30 +3,30 @@  discard block
 block discarded – undo
3 3
 
4 4
 $auth = AuthProvider::getInstance();
5 5
 $src  = false;
6
-if(isset($_GET['src']))
6
+if (isset($_GET['src']))
7 7
 {
8 8
     $src = $_GET['src'];
9 9
 }
10
-else if(strstr($_SERVER['HTTP_REFERER'], 'google.com') !== false)
10
+else if (strstr($_SERVER['HTTP_REFERER'], 'google.com') !== false)
11 11
 {
12 12
     $src = 'google';
13 13
 }
14
-else if(strstr($_SERVER['HTTP_REFERER'], 'gitlab.com') !== false)
14
+else if (strstr($_SERVER['HTTP_REFERER'], 'gitlab.com') !== false)
15 15
 {
16 16
     $src = 'gitlab';
17 17
 }
18 18
 
19 19
 $ref = '.';
20
-if(isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], 'google.com') === false)
20
+if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], 'google.com') === false)
21 21
 {
22 22
     $ref = $_SERVER['HTTP_REFERER'];
23 23
 }
24 24
 
25
-switch($src)
25
+switch ($src)
26 26
 {
27 27
     case 'google':
28 28
         $google = $auth->getAuthenticator('Auth\GoogleAuthenticator');
29
-        if(!isset($_GET['code']))
29
+        if (!isset($_GET['code']))
30 30
         {
31 31
             $google->redirect();
32 32
             die();
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         else
35 35
         {
36 36
             $res = $google->authenticate($_GET['code'], $current_user);
37
-            switch($res)
37
+            switch ($res)
38 38
             {
39 39
                 case \Auth\Authenticator::SUCCESS:
40 40
                     header('Location: '.$ref);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         break;
52 52
     case 'twitter':
53 53
         $twitter = $auth->getAuthenticator('Auth\TwitterAuthenticator');
54
-        if(!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
54
+        if (!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier']))
55 55
         {
56 56
             $twitter->redirect();
57 57
             die();
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         else
60 60
         {
61 61
             $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
62
-            switch($res)
62
+            switch ($res)
63 63
             {
64 64
                 case \Auth\Authenticator::SUCCESS:
65 65
                     header('Location: '.$ref);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         break;
77 77
     case 'gitlab':
78 78
         $gitlab = $auth->getAuthenticator('Auth\OAuth2\GitLabAuthenticator');
79
-        if(!isset($_GET['code']))
79
+        if (!isset($_GET['code']))
80 80
         {
81 81
             $google->redirect();
82 82
             die();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         else
85 85
         {
86 86
             $res = $gitlab->authenticate($_GET['code'], $current_user);
87
-            switch($res)
87
+            switch ($res)
88 88
             {
89 89
                 case \Auth\Authenticator::SUCCESS:
90 90
                     header('Location: '.$ref);
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,12 +6,10 @@  discard block
 block discarded – undo
6 6
 if(isset($_GET['src']))
7 7
 {
8 8
     $src = $_GET['src'];
9
-}
10
-else if(strstr($_SERVER['HTTP_REFERER'], 'google.com') !== false)
9
+} else if(strstr($_SERVER['HTTP_REFERER'], 'google.com') !== false)
11 10
 {
12 11
     $src = 'google';
13
-}
14
-else if(strstr($_SERVER['HTTP_REFERER'], 'gitlab.com') !== false)
12
+} else if(strstr($_SERVER['HTTP_REFERER'], 'gitlab.com') !== false)
15 13
 {
16 14
     $src = 'gitlab';
17 15
 }
@@ -30,8 +28,7 @@  discard block
 block discarded – undo
30 28
         {
31 29
             $google->redirect();
32 30
             die();
33
-        }
34
-        else
31
+        } else
35 32
         {
36 33
             $res = $google->authenticate($_GET['code'], $current_user);
37 34
             switch($res)
@@ -55,8 +52,7 @@  discard block
 block discarded – undo
55 52
         {
56 53
             $twitter->redirect();
57 54
             die();
58
-        }
59
-        else
55
+        } else
60 56
         {
61 57
             $twitter->authenticate($_GET['oauth_token'], $_GET['oauth_verifier'], $current_user);
62 58
             switch($res)
@@ -80,8 +76,7 @@  discard block
 block discarded – undo
80 76
         {
81 77
             $google->redirect();
82 78
             die();
83
-        }
84
-        else
79
+        } else
85 80
         {
86 81
             $res = $gitlab->authenticate($_GET['code'], $current_user);
87 82
             switch($res)
Please login to merge, or discard this patch.
login.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@  discard block
 block discarded – undo
2 2
 ini_set('display_errors', 1);
3 3
 error_reporting(E_ALL);
4 4
 //Redirect users to https
5
-if($_SERVER["HTTPS"] != "on")
5
+if ($_SERVER["HTTPS"] != "on")
6 6
 {
7
-    header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
7
+    header("Location: https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
8 8
     exit();
9 9
 }
10 10
 require_once('class.ProfilesPage.php');
11 11
 $page = new ProfilesPage('Burning Flipside Profiles Login');
12
-if($page->user !== false && $page->user !== null)
12
+if ($page->user !== false && $page->user !== null)
13 13
 {
14
-    if(isset($_GET['return']))
14
+    if (isset($_GET['return']))
15 15
     {
16 16
         header('Location: '.$_GET['return']);
17 17
     }
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     }
22 22
 }
23 23
 
24
-if(isset($_GET['return']))
24
+if (isset($_GET['return']))
25 25
 {
26 26
     $return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>';
27 27
 }
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 {
30 30
     $return = '';
31 31
 }
32
-if(isset($_GET['failed']))
32
+if (isset($_GET['failed']))
33 33
 {
34 34
     $page->add_notification('Login Failed! <a href="/reset.php" class="alert-link">Click here to reset your password.</a>', $page::NOTIFICATION_FAILED);
35 35
 }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 $auth_links = $auth->getSupplementaryLinks();
39 39
 $auth_links_str = '';
40 40
 $count = count($auth_links);
41
-for($i = 0; $i < $count; $i++)
41
+for ($i = 0; $i < $count; $i++)
42 42
 {
43 43
     $auth_links_str .= $auth_links[$i];
44 44
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
     if(isset($_GET['return']))
15 15
     {
16 16
         header('Location: '.$_GET['return']);
17
-    }
18
-    else
17
+    } else
19 18
     {
20 19
         header('Location: /index.php');
21 20
     }
@@ -24,8 +23,7 @@  discard block
 block discarded – undo
24 23
 if(isset($_GET['return']))
25 24
 {
26 25
     $return = '<input type="hidden" name="return" value="'.$_GET['return'].'"/>';
27
-}
28
-else
26
+} else
29 27
 {
30 28
     $return = '';
31 29
 }
Please login to merge, or discard this patch.