Completed
Pull Request — master (#3)
by
unknown
05:51
created
system/modules/Users/Users.php 3 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -92,6 +92,9 @@  discard block
 block discarded – undo
92 92
         }
93 93
     }
94 94
 
95
+    /**
96
+     * @param string $user_mail
97
+     */
95 98
     public function passre($user_mail)
96 99
     {
97 100
         $user = $this->get($user_mail, 'mail');
@@ -322,6 +325,9 @@  discard block
 block discarded – undo
322 325
         return $user->id;
323 326
     }
324 327
 
328
+    /**
329
+     * @param string $pass
330
+     */
325 331
     public function hashpass($pass)
326 332
     {
327 333
         return password_hash($pass, PASSWORD_DEFAULT);
@@ -359,6 +365,9 @@  discard block
 block discarded – undo
359 365
         return $return;
360 366
     }
361 367
 
368
+    /**
369
+     * @param integer $cat_id
370
+     */
362 371
     public function addUserActivity($user_id, $cat_id , $text = '')
363 372
     {
364 373
         $ua = new Users\Activity([
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         ]);
298 298
         $info->save();
299 299
         if (isset($inviter))
300
-            $this->AddUserActivity($inviter, 2, "По вашей ссылке зарегистрировался новый партнер, {$info->first_name} {$info->last_name} (id: {$user->id})" );
300
+            $this->AddUserActivity($inviter, 2, "По вашей ссылке зарегистрировался новый партнер, {$info->first_name} {$info->last_name} (id: {$user->id})");
301 301
         if ($autorization) {
302 302
             $this->autorization($user_mail, $pass, 'mail');
303 303
         }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             $to = $user_mail;
307 307
             $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
308 308
             $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass;
309
-            $text .='<br />';
309
+            $text .= '<br />';
310 310
             $text .= '<br />';
311 311
             $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://' . INJI_DOMAIN_NAME . '/users/activation/' . $user->id . '/' . $user->activation . '">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/activation/' . $user->id . '/' . $user->activation . '</a>';
312 312
             Tools::sendMail($from, $to, $subject, $text);
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         return $return;
360 360
     }
361 361
 
362
-    public function addUserActivity($user_id, $cat_id , $text = '')
362
+    public function addUserActivity($user_id, $cat_id, $text = '')
363 363
     {
364 364
         $ua = new Users\Activity([
365 365
             'user_id' => $user_id,
Please login to merge, or discard this patch.
Braces   +16 added lines, -12 removed lines patch added patch discarded remove patch
@@ -196,17 +196,20 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function get($idn, $ltype = 'id')
198 198
     {
199
-        if (!$idn)
200
-            return false;
199
+        if (!$idn) {
200
+                    return false;
201
+        }
201 202
 
202
-        if (is_numeric($idn) && $ltype != 'login')
203
-            $user = Users\User::get($idn, 'id');
204
-        elseif ($ltype == 'login')
205
-            $user = Users\User::get($idn, 'login');
206
-        else
207
-            $user = Users\User::get($idn, 'mail');
208
-        if (!$user)
209
-            return [];
203
+        if (is_numeric($idn) && $ltype != 'login') {
204
+                    $user = Users\User::get($idn, 'id');
205
+        } elseif ($ltype == 'login') {
206
+                    $user = Users\User::get($idn, 'login');
207
+        } else {
208
+                    $user = Users\User::get($idn, 'mail');
209
+        }
210
+        if (!$user) {
211
+                    return [];
212
+        }
210 213
 
211 214
         return $user;
212 215
     }
@@ -296,8 +299,9 @@  discard block
 block discarded – undo
296 299
             'phone' => htmlspecialchars($user_phone),
297 300
         ]);
298 301
         $info->save();
299
-        if (isset($inviter))
300
-            $this->AddUserActivity($inviter, 2, "По вашей ссылке зарегистрировался новый партнер, {$info->first_name} {$info->last_name} (id: {$user->id})" );
302
+        if (isset($inviter)) {
303
+                    $this->AddUserActivity($inviter, 2, "По вашей ссылке зарегистрировался новый партнер, {$info->first_name} {$info->last_name} (id: {$user->id})" );
304
+        }
301 305
         if ($autorization) {
302 306
             $this->autorization($user_mail, $pass, 'mail');
303 307
         }
Please login to merge, or discard this patch.
system/modules/Money/Money.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if (empty($blocks[$block->wallet->currency_id])) {
103 103
                 $blocks[$block->wallet->currency_id] = $block->amount;
104 104
             } else {
105
-                $blocks[$block->wallet->currency_id]+= $block->amount;
105
+                $blocks[$block->wallet->currency_id] += $block->amount;
106 106
             }
107 107
         }
108 108
         return $blocks;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $rootUser = $rootUser ? $rootUser : \Users\User::$cur;
167 167
         $reward = \Money\Reward::get($reward_id);
168 168
         $reward->checkBlocked();
169
-        $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id ]]);
169
+        $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]);
170 170
         if ($reward_count >= $reward->quantity && $reward->quantity)
171 171
             return false;
172 172
         $types = $this->getSnippets('rewardType');
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]);
188 188
                 $amount = 0;
189 189
                 foreach ($recives as $recive) {
190
-                    $amount+=$recive->amount;
190
+                    $amount += $recive->amount;
191 191
                 }
192 192
                 if ($amount >= $reward->peruser) {
193 193
                     continue;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,8 +167,9 @@
 block discarded – undo
167 167
         $reward = \Money\Reward::get($reward_id);
168 168
         $reward->checkBlocked();
169 169
         $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id ]]);
170
-        if ($reward_count >= $reward->quantity && $reward->quantity)
171
-            return false;
170
+        if ($reward_count >= $reward->quantity && $reward->quantity) {
171
+                    return false;
172
+        }
172 173
         $types = $this->getSnippets('rewardType');
173 174
         foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
174 175
             $user = $rootUser;
Please login to merge, or discard this patch.