@@ -97,13 +97,13 @@ |
||
| 97 | 97 | if ($this->first_name . $this->last_name . $this->middle_name) { |
| 98 | 98 | $name = ''; |
| 99 | 99 | if ($this->first_name) { |
| 100 | - $name.=$this->first_name; |
|
| 100 | + $name .= $this->first_name; |
|
| 101 | 101 | } |
| 102 | 102 | if ($this->middle_name) { |
| 103 | - $name.=($name ? ' ' : '') . $this->middle_name; |
|
| 103 | + $name .= ($name ? ' ' : '') . $this->middle_name; |
|
| 104 | 104 | } |
| 105 | 105 | if ($this->last_name) { |
| 106 | - $name.=($name ? ' ' : '') . $this->last_name; |
|
| 106 | + $name .= ($name ? ' ' : '') . $this->last_name; |
|
| 107 | 107 | } |
| 108 | 108 | return $name; |
| 109 | 109 | } else { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * Get all posible directorys for module files |
| 82 | 82 | * |
| 83 | 83 | * @param string $moduleName |
| 84 | - * @return array |
|
| 84 | + * @return string |
|
| 85 | 85 | */ |
| 86 | 86 | public static function getModulePaths($moduleName) |
| 87 | 87 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * Get installed modules for app |
| 132 | 132 | * |
| 133 | 133 | * @param \App $app |
| 134 | - * @param boolean|\App $primary |
|
| 134 | + * @param App $primary |
|
| 135 | 135 | * @return array |
| 136 | 136 | */ |
| 137 | 137 | public static function getInstalled($app, $primary = false) |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $buttons = []; |
| 12 | 12 | foreach ($actions as $action => $actionParams) { |
| 13 | 13 | if (class_exists($actionParams['className']) && $actionParams['className']::$rowAction) { |
| 14 | - $buttons[]= $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams); |
|
| 14 | + $buttons[] = $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams); |
|
| 15 | 15 | } |
| 16 | 16 | } |
| 17 | 17 | echo implode(' ', $buttons); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | public static $dataManagers = [ |
| 21 | 21 | 'manager' => [ |
| 22 | 22 | 'cols' => [ |
| 23 | - 'name','date_create' |
|
| 23 | + 'name', 'date_create' |
|
| 24 | 24 | ] |
| 25 | 25 | ] |
| 26 | 26 | ]; |
@@ -92,6 +92,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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([ |
@@ -297,7 +297,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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, |
@@ -196,17 +196,20 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -167,8 +167,9 @@ |
||
| 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; |