+ Подробные коменты в не [[]]
This commit is contained in:
@ -18,7 +18,7 @@ class BolmerCMS{
|
||||
if ( ! self::$authenticated) {
|
||||
define('BOLMER_API_MODE', true);
|
||||
define('IN_MANAGER_MODE', true);
|
||||
$init = realpath(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))."/index.php");
|
||||
$init = realpath(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))."/login.php");
|
||||
include_once($init);
|
||||
$type = getService('user', true)->getLoginUserType();
|
||||
if($type=='manager'){
|
||||
|
||||
@ -314,6 +314,43 @@ function deleteTempFiles($dir)
|
||||
}
|
||||
}
|
||||
|
||||
function getFilesTree($dir,$cut="",$result = null){
|
||||
if($result==null)
|
||||
$result = new stdClass();
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$result->list = array();
|
||||
|
||||
$dh = opendir($dir);
|
||||
if ($dh)
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if($file == '..' || $file == '.') continue;
|
||||
|
||||
if(is_dir($dir.DIRECTORY_SEPARATOR.$file)){
|
||||
$sub = new stdClass();
|
||||
$sub->name=$file;
|
||||
$sub->path=$dir.DIRECTORY_SEPARATOR.$file;
|
||||
if($cut) $sub->path = str_replace($cut, "",$sub->path);
|
||||
array_push($result->list, $sub);
|
||||
getFilesTree($dir.DIRECTORY_SEPARATOR.$file, $cut, $sub);
|
||||
}else{
|
||||
$sub = new stdClass();
|
||||
$sub->name=$file;
|
||||
$sub->path=$dir.DIRECTORY_SEPARATOR.$file;
|
||||
if($cut) $sub->path = str_replace($cut, "",$sub->path);
|
||||
array_push($result->list, $sub);
|
||||
}
|
||||
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
//Генерация пароля
|
||||
function getPassword($max)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user