Answer the question
In order to leave comments, you need to log in
Why does the pattern not work in the program?
There is a pattern:
/(\/\/ \[\'administrator_start\'\])(.|\n)*(\/\/ \[\'administrator_end\'\])/
file_get_contents("./home.php")
and read into a string:// ['administrator_start']
if ($_SESSION["user_group_short"] == "administrator" && $_SESSION['active'] == 1) {
//
//
//Группа administrator
//
//
?>
<div>
Администратор
</div>
<div id="databoard">
<?php
function showTree($folder) {
/* Получаем полный список файлов и каталогов внутри $folder */
$files = scandir($folder);
foreach ($files as $file) {
/* Отбрасываем текущий и родительский каталог */
if (($file == '.') || ($file == '..')) {
continue;
}
$f0 = $folder . '/' . $file; //Получаем полный путь к файлу
/* Если это директория */
if (is_dir($f0)) {
/* Выводим, делая заданный отступ, название директории */
echo "<p>" . translate(iconv(mb_detect_encoding($file, mb_detect_order(), true), "UTF-8", $file)) . "</p>";
/* С помощью рекурсии выводим содержимое полученной директории */
showTree($f0);
} else {
/* Если это файл, то просто выводим название файла */
$name_page = explode(".", iconv(mb_detect_encoding($file, mb_detect_order(), true), "UTF-8", $file));
echo "<a style='text-decoration: none;' href='" . iconv(mb_detect_encoding($f0, mb_detect_order(), true), "UTF-8", $f0) . "'>" . translate($name_page[0]) . "</a> ";
}
}
}
showTree("../pages/" . $_SESSION['user_group_short']);
?>
</div>
<?php
}
// ['administrator_end']
// ['insert_body']
// ['insert_body']
. Answer the question
In order to leave comments, you need to log in
In my opinion, it's easier to do this through Vuex. During authorization, we get the user data, save it in vuex, and then, if necessary, we get it again and save it there.
PS: this option is suitable if you use laravel as Api.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question