Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/Users/objects/SocialHelper/Google.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@  discard block
 block discarded – undo
69 69
             if (!empty(\App::$cur->users->config['loginUrl'][\App::$cur->type])) {
70 70
                 \Tools::redirect(\App::$cur->users->config['loginUrl'][\App::$cur->type]);
71 71
             }
72
-        } else {
72
+        }
73
+        else {
73 74
             if ($userSocial && !$userSocial->user) {
74 75
                 $userSocial->delete();
75 76
             }
@@ -111,7 +112,8 @@  discard block
 block discarded – undo
111 112
                     $userInfo->user_id = $user->id;
112 113
                     $userInfo->save();
113 114
                 }
114
-            } else {
115
+            }
116
+            else {
115 117
                 $user = \Users\User::$cur;
116 118
             }
117 119
             if (!$user->info->photo_file_id && !empty($userDetail['picture'])) {
Please login to merge, or discard this patch.
system/modules/Users/objects/SocialHelper/Twitter.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,7 +137,8 @@  discard block
 block discarded – undo
137 137
             if (!empty(\App::$cur->users->config['loginUrl'][\App::$cur->type])) {
138 138
                 \Tools::redirect(\App::$cur->users->config['loginUrl'][\App::$cur->type]);
139 139
             }
140
-        } else {
140
+        }
141
+        else {
141 142
             if ($userSocial && !$userSocial->user) {
142 143
                 $userSocial->delete();
143 144
             }
@@ -170,7 +171,8 @@  discard block
 block discarded – undo
170 171
                 $userInfo = new \Users\User\Info();
171 172
                 $userInfo->user_id = $user->id;
172 173
                 $userInfo->save();
173
-            } else {
174
+            }
175
+            else {
174 176
                 $user = \Users\User::$cur;
175 177
             }
176 178
             $name = explode(' ', $userDetail['name']);
@@ -186,7 +188,8 @@  discard block
 block discarded – undo
186 188
             \App::$cur->users->newSession($user);
187 189
             if (!empty(\App::$cur->users->config['loginUrl'][\App::$cur->type])) {
188 190
                 \Tools::redirect(\App::$cur->users->config['loginUrl'][\App::$cur->type], 'Вы успешно зарегистрировались через Twitter', 'success');
189
-            } else {
191
+            }
192
+            else {
190 193
                 \Tools::redirect('/users/cabinet/profile', 'Вы успешно зарегистрировались через Twitter', 'success');
191 194
             }
192 195
         }
Please login to merge, or discard this patch.
system/modules/Users/widgets/cabinet/socials.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,8 @@
 block discarded – undo
11 11
     }
12 12
     if ($connect) {
13 13
         echo "<a href = '/users/social/disconnect/{$social->code}'>Отключить {$social->name}</a><br />";
14
-    } else {
14
+    }
15
+    else {
15 16
         echo "<a href = '/users/social/auth/{$social->code}'>Подключить {$social->name}</a><br />";
16 17
     }
17 18
 }
18 19
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Users/appControllers/UsersController.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -167,14 +167,14 @@
 block discarded – undo
167 167
                 <h5 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h5>
168 168
                 <ul>
169 169
                   <?php
170
-                  foreach ($condition->items as $item) {
171
-                      $itemComplete = $item->checkComplete($userId);
172
-                      switch ($item->type) {
173
-                          case 'event':
170
+                    foreach ($condition->items as $item) {
171
+                        $itemComplete = $item->checkComplete($userId);
172
+                        switch ($item->type) {
173
+                            case 'event':
174 174
                               $name = \Events\Event::get($item->value, 'event')->name();
175
-                              break;
176
-                      }
177
-                      ?>
175
+                                break;
176
+                        }
177
+                        ?>
178 178
                         <li> 
179 179
                             <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount($userId); ?></b>/<?= $item->count; ?> <br />
180 180
                         </li>
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
             $this->view->setTitle($sections[$activeSection]['name'] . ' - Личный кабинет');
23 23
             $bread[] = ['text' => 'Личный кабинет', 'href' => '/users/cabinet'];
24 24
             $bread[] = ['text' => $sections[$activeSection]['name']];
25
-        } else {
25
+        }
26
+        else {
26 27
             $this->view->setTitle('Личный кабинет');
27 28
             $bread[] = ['text' => 'Личный кабинет'];
28 29
         }
@@ -57,7 +58,8 @@  discard block
 block discarded – undo
57 58
                         Msg::add('Вы не прошли проверку на робота', 'danger');
58 59
                         $error = true;
59 60
                     }
60
-                } else {
61
+                }
62
+                else {
61 63
                     Msg::add('Произошла ошибка, попробуйте ещё раз');
62 64
                     $error = true;
63 65
                 }
@@ -93,11 +95,13 @@  discard block
 block discarded – undo
93 95
             $user_mail = trim($_POST['mail']);
94 96
             if (!filter_var($user_mail, FILTER_VALIDATE_EMAIL)) {
95 97
                 Msg::add('Вы ввели не корректный E-mail', 'danger');
96
-            } else {
98
+            }
99
+            else {
97 100
                 $user = Users\User::get($user_mail, 'mail');
98 101
                 if ($user && $user->id != Users\User::$cur->id) {
99 102
                     Msg::add('Данный E-mail уже привязан к другому аккаунту', 'danger');
100
-                } else {
103
+                }
104
+                else {
101 105
                     Users\User::$cur->mail = $user_mail;
102 106
                     if (!empty($this->module->config['needActivation'])) {
103 107
                         Users\User::$cur->activation = Tools::randomString();
@@ -107,7 +111,8 @@  discard block
 block discarded – undo
107 111
                         $text = 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://' . INJI_DOMAIN_NAME . '/users/activation/' . Users\User::$cur->id . '/' . Users\User::$cur->activation . '">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/activation/' . Users\User::$cur->id . '/' . Users\User::$cur->activation . '</a>';
108 112
                         Tools::sendMail($from, $to, $subject, $text);
109 113
                         Msg::add('На указанный почтовый ящик была выслана ваша ссылка для подтверждения E-Mail', 'success');
110
-                    } else {
114
+                    }
115
+                    else {
111 116
                         Msg::add('Вы успешно привязали E-Mail к своему аккаунту', 'success');
112 117
                     }
113 118
                     Users\User::$cur->save();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,13 +138,13 @@
 block discarded – undo
138 138
         $userId = (int) $userId;
139 139
         $result = new \Server\Result();
140 140
         if (!$userId) {
141
-            $result->success = FALSE;
141
+            $result->success = false;
142 142
             $result->content = 'Не указан пользователь';
143 143
             $result->send();
144 144
         }
145 145
         $partners = App::$cur->users->getUserPartners(Users\User::$cur, 8);
146 146
         if (empty($partners['users'][$userId])) {
147
-            $result->success = FALSE;
147
+            $result->success = false;
148 148
             $result->content = 'Этот пользователь не находится в вашей структуре';
149 149
             $result->send();
150 150
         }
Please login to merge, or discard this patch.
system/modules/Users/appControllers/content/cabinet.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
26 26
                 </div>
27 27
                 <div class="col-sm-9">
28 28
                   <?php
29
-                  if (empty($activeSection) || empty($sections[$activeSection]['fullWidget'])) {
30
-                      foreach ($sections as $section) {
31
-                          if (!empty($section['smallWidget'])) {
32
-                              $widgetName = is_array($section['smallWidget']) ? $section['smallWidget']['widget'] : $section['smallWidget'];
33
-                              $widgetSize = !empty($section['smallWidget']['size']) ? $section['smallWidget']['size'] : 1;
34
-                              ?>
29
+                    if (empty($activeSection) || empty($sections[$activeSection]['fullWidget'])) {
30
+                        foreach ($sections as $section) {
31
+                            if (!empty($section['smallWidget'])) {
32
+                                $widgetName = is_array($section['smallWidget']) ? $section['smallWidget']['widget'] : $section['smallWidget'];
33
+                                $widgetSize = !empty($section['smallWidget']['size']) ? $section['smallWidget']['size'] : 1;
34
+                                ?>
35 35
                                 <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $this->widget($widgetName); ?></div>
36 36
                                 <?php
37 37
                             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@
 block discarded – undo
36 36
                                 <?php
37 37
                             }
38 38
                         }
39
-                    } else {
39
+                    }
40
+                    else {
40 41
                         $this->widget($sections[$activeSection]['fullWidget']);
41 42
                     }
42 43
                     ?>
Please login to merge, or discard this patch.
system/modules/Users/appControllers/content/registration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@
 block discarded – undo
41 41
                     <div class ='row'>
42 42
                         <div class="col-sm-6">
43 43
                           <?php
44
-                          if (!empty(App::$cur->users->config['invites'])) {
45
-                              ?>
44
+                            if (!empty(App::$cur->users->config['invites'])) {
45
+                                ?>
46 46
                                 <div class ='form-group'>
47 47
                                     <label><?= !empty(App::$cur->users->config['invitesName']) ? App::$cur->users->config['invitesName'] : 'Код приглашения'; ?></label>
48 48
                                     <input type ='text' name ='invite_code' class ='form-control' value ="<?= (isset($_POST['invite_code']) ? $_POST['invite_code'] : ((!empty($_COOKIE['invite_code']) ? $_COOKIE['invite_code'] : ((!empty($_GET['invite_code']) ? $_GET['invite_code'] : ''))))); ?>" />
Please login to merge, or discard this patch.
system/modules/Users/appControllers/content/login.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -5,15 +5,15 @@
 block discarded – undo
5 5
                 <h3>Вход</h3>
6 6
                 <div class="form-group">
7 7
                   <?php
8
-                  $socials = Users\Social::getList(['where' => ['active', 1]]);
9
-                  if ($socials) {
10
-                      echo 'Войти через: ';
11
-                      foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) {
12
-                          $text = $social->image ? '<img src ="' . Statics::file($social->image->path) . '">' : $social->name();
13
-                          echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> ";
14
-                      }
15
-                  }
16
-                  ?>
8
+                    $socials = Users\Social::getList(['where' => ['active', 1]]);
9
+                    if ($socials) {
10
+                        echo 'Войти через: ';
11
+                        foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) {
12
+                            $text = $social->image ? '<img src ="' . Statics::file($social->image->path) . '">' : $social->name();
13
+                            echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> ";
14
+                        }
15
+                    }
16
+                    ?>
17 17
                 </div>
18 18
                 <form action = '' method = 'POST' >
19 19
                     <div class ='row'>
Please login to merge, or discard this patch.
system/modules/Access/snippets/accessGetter/Controller.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 return [
12 12
     'classes' => ['Controller'],
13 13
     'get' => function($element) {
14
-$access = NULL;
14
+$access = null;
15 15
 $path = [
16 16
     'accessTree',
17 17
     $element->module->app->type,
Please login to merge, or discard this patch.
system/modules/Access/Access.php 2 patches
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
         if (!$app) {
21 21
             $app = $this->app->type;
22 22
         }
23
-        if (!empty($this->config['access']['accessTree'][$app]['deniedUrl']))
24
-            return $this->config['access']['accessTree'][$app]['deniedUrl'];
23
+        if (!empty($this->config['access']['accessTree'][$app]['deniedUrl'])) {
24
+                    return $this->config['access']['accessTree'][$app]['deniedUrl'];
25
+        }
25 26
 
26 27
         return '/';
27 28
     }
@@ -46,8 +47,9 @@  discard block
 block discarded – undo
46 47
             return true;
47 48
         }
48 49
 
49
-        if ((!$user->group_id && !empty($access)) || ($user->group_id && !empty($access) && !in_array($user->group_id, $access)))
50
-            return false;
50
+        if ((!$user->group_id && !empty($access)) || ($user->group_id && !empty($access) && !in_array($user->group_id, $access))) {
51
+                    return false;
52
+        }
51 53
 
52 54
         return true;
53 55
     }
@@ -66,9 +68,11 @@  discard block
 block discarded – undo
66 68
     public function pathWalker($array, $path) {
67 69
         if ($path && isset($array[$path[0]])) {
68 70
             return $this->pathWalker($array[$path[0]], array_slice($path, 1));
69
-        } elseif (!$path) {
71
+        }
72
+        elseif (!$path) {
70 73
             return $array;
71
-        } else {
74
+        }
75
+        else {
72 76
             return NULL;
73 77
         }
74 78
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     }
28 28
 
29 29
     public function checkAccess($element, $user = null) {
30
-        $access = NULL;
30
+        $access = null;
31 31
         foreach ($this->accessCheckers as $getter) {
32 32
             foreach ($getter['classes'] as $className) {
33 33
                 if ($element instanceof $className) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         } elseif (!$path) {
70 70
             return $array;
71 71
         } else {
72
-            return NULL;
72
+            return null;
73 73
         }
74 74
     }
75 75
 
Please login to merge, or discard this patch.