Пример #1
0
# edit file (for editor page)
if (!empty($_GET['file']) & !empty($_GET['p']) && $_GET['p'] == 'editor' && is_allowed('markdown editor')) {
    $file = id2file($_GET['file']);
    if (!empty($file) && is_file($file)) {
        $editor_content = file_get_contents($file);
    } else {
        $editor_content = '';
        $file = '';
        if (!is_writable($file)) {
            $msg = '<div class="error">' . $file . ' ' . e('is not writable', false) . '</div>';
        }
    }
}
# regen ids base
if (isset($_GET['regen'])) {
    $ids = updateIDs($ids, $_GET['regen']);
    header('location:index.php?p=admin&token=' . TOKEN);
    exit;
}
# unzip: convert zip file to folder
if (!empty($_GET['unzip']) && trim($_GET['unzip']) !== false && $_SESSION['zip']) {
    $id = $_GET['unzip'];
    $zipfile = id2file($id);
    $folder = str_ireplace('.zip', '', _basename($zipfile));
    $id = new_folder($folder);
    $destination = id2file($id);
    unzip($zipfile, $destination);
    $sdi = array_flip($ids);
    $unzipped_content = recursive_glob($destination);
    foreach ($unzipped_content as $item) {
        if (empty($sdi[$item])) {
Пример #2
0
if (empty($RIGHTS)) {
    #default profiles if not configured
    $PROFILES = array('admin', 'user', 'guest');
    $RIGHTS['admin'] = array('add user' => 1, 'delete user' => 1, 'change folder size' => 1, 'markdown editor' => 1, 'regen ID base' => 1, 'access logfile' => 1, 'upload' => 1);
    $RIGHTS['user'] = array('markdown editor' => 1, 'upload' => 1);
    $RIGHTS['guest'] = array('upload' => 1);
    save($_SESSION['profiles_rights_file'], $RIGHTS);
} else {
    $PROFILES = array_filter(array_keys($RIGHTS));
}
include 'core/templates.php';
#################################################
# Load IDS
#################################################
if (is_user_connected() && $check_ID_base_on_page_load) {
    $ids = updateIDs();
} else {
    $ids = unstore();
}
#################################################
#################################################
# Load current path tree
#################################################
if (is_user_connected()) {
    $tree = tree($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $_SESSION['current_path'], false, false, $allow_folder_size_stat);
}
#################################################
#################################################
# Functions
#################################################
# Data save/load & files