Username not found in our record.';
}
$user_enc = user('encryption', $user);
$user_pass = user('password', $user);
$user_role = user('role', $user);
if ($user_enc == "password_hash") {
if (password_verify($pass, $user_pass)) {
if (password_needs_rehash($user_pass, PASSWORD_DEFAULT)) {
update_user($user, $pass, $user_role);
}
$_SESSION[config("site.url")]['user'] = $user;
header('location: admin');
} else {
return $str = '
';
echo '| ' . i18n('Title') . ' | ' . i18n('Published') . ' | ';
if (config("views.counter") == "true")
echo 'Views | ';
echo '' . i18n('Tag') . ' | ' . i18n('Operations') . ' |
';
$i = 0;
$len = count($posts);
foreach ($posts as $p) {
if ($i == 0) {
$class = 'item first';
} elseif ($i == $len - 1) {
$class = 'item last';
} else {
$class = 'item';
}
$i++;
echo '';
echo '| ' . $p->title . ' | ';
echo '' . format_date($p->date) . ' | ';
if (config("views.counter") == "true")
echo '' . $p->views . ' | ';
echo '' . $p->tag . ' | ';
echo '' . i18n('Edit') . ' ' . i18n('Delete') . ' | ';
echo '
';
}
echo '
';
}
}
}
// Get all static pages
function get_user_pages()
{
if (isset($_SESSION[config("site.url")]['user'])) {
$posts = get_static_post(null);
if (!empty($posts)) {
krsort($posts);
echo '';
echo '| ' . i18n('Title') . ' | ';
if (config("views.counter") == "true")
echo 'Views | ';
echo '' . i18n('Operations') . ' |
';
$i = 0;
$len = count($posts);
foreach ($posts as $p) {
if ($i == 0) {
$class = 'item first';
} elseif ($i == $len - 1) {
$class = 'item last';
} else {
$class = 'item';
}
$i++;
echo '';
echo '| ' . $p->title . ' | ';
if (config("views.counter") == "true")
echo '' . $p->views . ' | ';
echo '' . i18n('Add_sub') . ' ' . i18n('Edit') . ' ' . i18n('Delete') . ' | ';
echo '
';
$shortUrl = substr($p->url, strrpos($p->url, "/") + 1);
$subPages = get_static_sub_post($shortUrl, null);
foreach ($subPages as $sp) {
echo '';
echo '| »' . $sp->title . ' | ';
if (config("views.counter") == "true")
echo '' . $sp->views . ' | ';
echo '' . i18n('Edit') . ' ' . i18n('Delete') . ' | ';
echo '
';
}
}
echo '
';
}
}
}
// Get all available zip files
function get_backup_files()
{
if (isset($_SESSION[config("site.url")]['user'])) {
$files = get_zip_files();
if (!empty($files)) {
krsort($files);
echo '