Completed
Branch master (ebb499)
by Alexey
04:15
created
system/modules/Users/objects/SocialHelper/Vk.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
         $auth_key = md5($config['appId'] . '_' . $viewer_id . '_' . $config['secret']);
146 146
 
147 147
         if ($auth_key !== $get_auth_key) {
148
-            return FALSE;
148
+            return false;
149 149
         }
150 150
         $userQuery = [
151 151
             'user_id' => $viewer_id,
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
18 18
     public function getArray($keyCol = '') {
19 19
         if (!$keyCol) {
20 20
             return $this->pdoResult->fetchAll(\PDO::FETCH_ASSOC);
21
-        } else {
21
+        }
22
+        else {
22 23
             $array = [];
23 24
             while ($row = $this->pdoResult->fetch(\PDO::FETCH_ASSOC)) {
24 25
                 $array[$row[$keyCol]] = $row;
@@ -33,7 +34,8 @@  discard block
 block discarded – undo
33 34
         while ($object = $this->pdoResult->fetchObject($class)) {
34 35
             if ($keyCol) {
35 36
                 $array[$object->$keyCol] = $object;
36
-            } else {
37
+            }
38
+            else {
37 39
                 $array[] = $object;
38 40
             }
39 41
         }
@@ -44,7 +46,8 @@  discard block
 block discarded – undo
44 46
     public function fetch($className = '') {
45 47
         if ($className) {
46 48
             return $this->pdoResult->fetchObject($className);
47
-        } else {
49
+        }
50
+        else {
48 51
             return $this->pdoResult->fetch(\PDO::FETCH_ASSOC);
49 52
         }
50 53
     }
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
@@ -43,7 +43,8 @@
 block discarded – undo
43 43
                         }
44 44
 
45 45
                         $inputOptions['values'] = $item->{$relationName}(['forSelect' => true]);
46
-                    } else {
46
+                    }
47
+                    else {
47 48
                         $inputOptions['values'] = $this->activeForm->model->{$type['relation']}(['forSelect' => true]);
48 49
                     }
49 50
                 }
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/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.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 ?>
36 36
 <div>
37 37
     <h3>Комментарии (<?=
38
-      \Dashboard\Comment::getCount(['where' => [
39
-              ['item_id', $item->id],
40
-              ['model', $modelName],
41
-      ]]);
42
-      ?>)</h3>
38
+        \Dashboard\Comment::getCount(['where' => [
39
+                ['item_id', $item->id],
40
+                ['model', $modelName],
41
+        ]]);
42
+        ?>)</h3>
43 43
     <?php
44 44
     foreach (\Dashboard\Comment::getList([ 'where' => [
45 45
             ['item_id', $item->id],
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 </div>
62 62
 <div>
63 63
   <?php
64
-  $form = new \Ui\Form();
65
-  $form->begin('Оставить комментарий');
66
-  $form->input('textarea', 'comment', 'Комментарий');
67
-  $form->end();
68
-  ?>
64
+    $form = new \Ui\Form();
65
+    $form->begin('Оставить комментарий');
66
+    $form->input('textarea', 'comment', 'Комментарий');
67
+    $form->end();
68
+    ?>
69 69
 </div>
70 70
 <div>
71 71
     <h1>Хронология</h1>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
       ]]);
42 42
       ?>)</h3>
43 43
     <?php
44
-    foreach (\Dashboard\Comment::getList([ 'where' => [
44
+    foreach (\Dashboard\Comment::getList(['where' => [
45 45
             ['item_id', $item->id],
46 46
             ['model', $modelName],
47 47
         ], 'order' => ['date_create', 'desc']]) as $comment) {
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm/Input/DynamicList.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
                             foreach ($relModels as $model) {
47 47
                                 if (empty($rels[$model->{$relation['model']::index()}])) {
48 48
                                     $model->delete();
49
-                                } else {
49
+                                }
50
+                                else {
50 51
                                     unset($rels[$model->{$relation['model']::index()}]);
51 52
                                 }
52 53
                             }
@@ -78,7 +79,8 @@  discard block
 block discarded – undo
78 79
                             foreach ($relModels as $model) {
79 80
                                 if (empty($rels[$model->pk()])) {
80 81
                                     $model->delete();
81
-                                } else {
82
+                                }
83
+                                else {
82 84
                                     $model->setParams($rels[$model->pk()]);
83 85
                                     $model->save();
84 86
                                 }
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm/Input/ChangePassword.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@
 block discarded – undo
17 17
         if (!empty($request[$this->colName]['pass']) && !empty($request[$this->colName]['pass'])) {
18 18
             if (empty($request[$this->colName]['pass'])) {
19 19
                 \Msg::add('Вы не ввели пароль в первое поле', 'danger');
20
-                return FALSE;
20
+                return false;
21 21
             }
22 22
             if (empty($request[$this->colName]['repeat'])) {
23 23
                 \Msg::add('Вы не ввели пароль во второе поле', 'danger');
24
-                return FALSE;
24
+                return false;
25 25
             }
26 26
             if ($request[$this->colName]['pass'] != $request[$this->colName]['repeat']) {
27 27
                 \Msg::add('Введенные пароли не совпадают', 'danger');
28
-                return FALSE;
28
+                return false;
29 29
             }
30 30
             $this->activeForm->model->{$this->colName} = \App::$cur->users->hashpass($request[$this->colName]['pass']);
31 31
         }
Please login to merge, or discard this patch.