@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
| 303 | - * @param $key |
|
| 303 | + * @param string $key |
|
| 304 | 304 | * @param $value |
| 305 | 305 | * @return $this |
| 306 | 306 | */ |
@@ -396,8 +396,8 @@ discard block |
||
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
| 399 | - * @param $data |
|
| 400 | - * @return bool|string |
|
| 399 | + * @param integer $data |
|
| 400 | + * @return string|false |
|
| 401 | 401 | */ |
| 402 | 402 | protected function findUserBy($data) |
| 403 | 403 | { |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | |
| 652 | 652 | /** |
| 653 | 653 | * @param $ids |
| 654 | - * @param int|bool $depth |
|
| 654 | + * @param integer $depth |
|
| 655 | 655 | * @return array |
| 656 | 656 | */ |
| 657 | 657 | public function childrens($ids, $depth = 0) |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | /** |
| 707 | - * @return array |
|
| 707 | + * @return integer[] |
|
| 708 | 708 | */ |
| 709 | 709 | private function systemID() |
| 710 | 710 | { |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | /** |
| 824 | - * @param $tpl |
|
| 824 | + * @param string $tpl |
|
| 825 | 825 | * @return int |
| 826 | 826 | * @throws Exception |
| 827 | 827 | */ |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | */ |
| 236 | 236 | $refer = htmlspecialchars_decode($_SERVER['HTTP_REFERER'], ENT_QUOTES); |
| 237 | 237 | } else { |
| 238 | - $refer = $this->getBackUrl($request); |
|
| 238 | + $refer = $this->getBackUrl($request); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php namespace DLUsers; |
| 2 | 2 | |
| 3 | -include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
|
| 4 | -include_once(MODX_BASE_PATH . 'assets/lib/Helpers/FS.php'); |
|
| 5 | -include_once(MODX_BASE_PATH . 'assets/lib/MODxAPI/modUsers.php'); |
|
| 6 | -include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLTemplate.class.php'); |
|
| 7 | -include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLCollection.class.php'); |
|
| 3 | +include_once(MODX_BASE_PATH.'assets/lib/APIHelpers.class.php'); |
|
| 4 | +include_once(MODX_BASE_PATH.'assets/lib/Helpers/FS.php'); |
|
| 5 | +include_once(MODX_BASE_PATH.'assets/lib/MODxAPI/modUsers.php'); |
|
| 6 | +include_once(MODX_BASE_PATH.'assets/snippets/DocLister/lib/DLTemplate.class.php'); |
|
| 7 | +include_once(MODX_BASE_PATH.'assets/snippets/DocLister/lib/DLCollection.class.php'); |
|
| 8 | 8 | |
| 9 | 9 | use APIHelpers, DocumentParser, DLCollection, DLTemplate; |
| 10 | 10 | use Helpers\FS; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $go = APIHelpers::getkey($params, 'url', ''); |
| 118 | 118 | if (empty($go)) { |
| 119 | 119 | $go = str_replace( |
| 120 | - array("?" . $LogoutName, "&" . $LogoutName), |
|
| 120 | + array("?".$LogoutName, "&".$LogoutName), |
|
| 121 | 121 | array("", ""), |
| 122 | 122 | $_SERVER['REQUEST_URI'] |
| 123 | 123 | ); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if ($start == $go) { |
| 128 | 128 | $go = $this->config['site_url']; |
| 129 | 129 | } else { |
| 130 | - $go = $this->config['site_url'] . ltrim($go, '/'); |
|
| 130 | + $go = $this->config['site_url'].ltrim($go, '/'); |
|
| 131 | 131 | } |
| 132 | 132 | $this->moveTo(array('url' => $go)); |
| 133 | 133 | } else { |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | //Во избежании XSS мы не сохраняем весь REQUEST_URI, а берем только path |
| 152 | 152 | /*$query = (!empty($request['query'])) ? $request['query'].'&' : '';*/ |
| 153 | - $query = '?' . $LogoutName; |
|
| 153 | + $query = '?'.$LogoutName; |
|
| 154 | 154 | |
| 155 | - return $request['path'] . $query; |
|
| 155 | + return $request['path'].$query; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $authId = APIHelpers::getkey($params, 'authId'); |
| 201 | 201 | if (!empty($authId)) { |
| 202 | 202 | $dataTPL['authPage'] = $this->makeUrl($authId); |
| 203 | - $dataTPL['method'] = strtolower(__CLASS__ . '::' . 'authpage'); |
|
| 203 | + $dataTPL['method'] = strtolower(__CLASS__.'::'.'authpage'); |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | if (!empty($POST['backUrl'])) { |
| 258 | 258 | $idURL = $this->moveTo(array( |
| 259 | - 'url' => '/' . ltrim($POST['backUrl'], '/'), |
|
| 259 | + 'url' => '/'.ltrim($POST['backUrl'], '/'), |
|
| 260 | 260 | 'validate' => true |
| 261 | 261 | )); |
| 262 | 262 | } else { |
@@ -286,11 +286,11 @@ discard block |
||
| 286 | 286 | * @param array $request |
| 287 | 287 | * @return string |
| 288 | 288 | */ |
| 289 | - protected function getBackUrl(array $request = array()){ |
|
| 289 | + protected function getBackUrl(array $request = array()) { |
|
| 290 | 290 | $selfHost = rtrim(str_replace("http://", "", $this->config['site_url']), '/'); |
| 291 | 291 | if (empty($request['host']) || $request['host'] == $selfHost) { |
| 292 | - $query = !empty($request['query']) ? '?' . $request['query'] : ''; |
|
| 293 | - $out = !empty($request['path']) ? $request['path'] . $query : ''; |
|
| 292 | + $query = !empty($request['query']) ? '?'.$request['query'] : ''; |
|
| 293 | + $out = !empty($request['path']) ? $request['path'].$query : ''; |
|
| 294 | 294 | } else { |
| 295 | 295 | $out = ''; |
| 296 | 296 | } |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $code = (int)APIHelpers::getkey($params, 'code', 0); |
| 470 | 470 | $addUrl = APIHelpers::getkey($params, 'addUrl', ''); |
| 471 | 471 | if (is_scalar($addUrl) && $addUrl != '') { |
| 472 | - $uri .= "?" . $addUrl; |
|
| 472 | + $uri .= "?".$addUrl; |
|
| 473 | 473 | } |
| 474 | 474 | if (APIHelpers::getkey($params, 'validate', false)) { |
| 475 | 475 | if (isset($this->modx->snippetCache['getPageID'])) { |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | } |
| 483 | 483 | } else { |
| 484 | 484 | //$modx->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.1 307 Temporary Redirect'); |
| 485 | - header("Location: " . $uri, true, ($code > 0 ? $code : 307)); |
|
| 485 | + header("Location: ".$uri, true, ($code > 0 ? $code : 307)); |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | return $uri; |
@@ -517,9 +517,9 @@ discard block |
||
| 517 | 517 | protected function getTemplate($name) |
| 518 | 518 | { |
| 519 | 519 | $out = ''; |
| 520 | - $file = dirname(dirname(__FILE__)) . '/tpl/' . $name . '.html'; |
|
| 520 | + $file = dirname(dirname(__FILE__)).'/tpl/'.$name.'.html'; |
|
| 521 | 521 | if (FS::getInstance()->checkFile($file)) { |
| 522 | - $out = '@CODE: ' . file_get_contents($file); |
|
| 522 | + $out = '@CODE: '.file_get_contents($file); |
|
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | return $out; |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | */ |
| 532 | 532 | protected static function loadLang($lang) |
| 533 | 533 | { |
| 534 | - $file = dirname(dirname(__FILE__)) . '/lang/' . $lang . '.php'; |
|
| 534 | + $file = dirname(dirname(__FILE__)).'/lang/'.$lang.'.php'; |
|
| 535 | 535 | if (!FS::getInstance()->checkFile($file)) { |
| 536 | 536 | $file = false; |
| 537 | 537 | } |
@@ -557,11 +557,11 @@ discard block |
||
| 557 | 557 | $out = $default; |
| 558 | 558 | $lng = static::$lang; |
| 559 | 559 | $dic = static::$langDic; |
| 560 | - if (isset($dic[$lng], $dic[$lng][$lng . '.' . $key])) { |
|
| 561 | - $out = $dic[$lng][$lng . '.' . $key]; |
|
| 560 | + if (isset($dic[$lng], $dic[$lng][$lng.'.'.$key])) { |
|
| 561 | + $out = $dic[$lng][$lng.'.'.$key]; |
|
| 562 | 562 | } |
| 563 | 563 | if (class_exists('evoBabel', false) && isset(self::$instance->modx->snippetCache['lang'])) { |
| 564 | - $msg = self::$instance->modx->runSnippet('lang', array('a' => 'DLUsers.' . $key)); |
|
| 564 | + $msg = self::$instance->modx->runSnippet('lang', array('a' => 'DLUsers.'.$key)); |
|
| 565 | 565 | if (!empty($msg)) { |
| 566 | 566 | $out = $msg; |
| 567 | 567 | } |