Esempio n. 1
0
 static function createuser($id, $data)
 {
     $folder = SIMPLE_STORE . "/home/" . $data["username"] . "/";
     if (!is_dir($folder)) {
         sys_mkdir($folder);
         sys_notification(sprintf("{t}Folder created.{/t} (%s)", $folder));
     }
     self::createedituser($id, $data);
     return "";
 }
Esempio n. 2
0
 private static function _dirs_clean_dir($path, $olderthan)
 {
     if (is_dir($path . "/")) {
         dirs_delete_all($path, $olderthan, false);
     }
     sys_mkdir($path);
     dirs_create_index_htm($path . "/");
 }
Esempio n. 3
0
 static function dirs_create_dir($dirname)
 {
     if (!is_dir($dirname)) {
         sys_mkdir($dirname);
     }
     dirs_create_index_htm($dirname . "/");
 }
Esempio n. 4
0
 function output()
 {
     if ($this->pagename == "rss") {
         $this->_output_rss();
     }
     if ($this->pagename == "sitemap") {
         $this->_output_sitemap();
     }
     $this->template->cms = $this;
     $this->template->page = $this->page;
     $template = sys_custom("templates/cms/" . basename($this->page["template"]));
     if (!file_exists($template)) {
         $template = sys_custom("templates/cms/pmwiki.php");
     }
     $output = $this->template->render($template);
     echo $output;
     if (self::$cache_file != "" and $output != "" and $this->page["staticcache"] == "1" and sys_is_guest($_SESSION["username"]) and strpos($this->page["rread_users"], "|anonymous|") !== false) {
         sys_mkdir(dirname(self::$cache_file));
         file_put_contents(self::$cache_file, $output, LOCK_EX);
         if ($this->page["attachment"] == "") {
             return;
         }
         $files = explode("|", trim($this->page["attachment"], "|"));
         foreach ($files as $file) {
             copy($file, dirname(self::$cache_file) . "/" . modify::basename($file));
         }
     }
 }
Esempio n. 5
0
function sys_cache_set($cid, $data, $time)
{
    sys::$cache[$cid] = $data;
    if (APC) {
        apc_store($cid . $_SESSION["username"], $data, $time);
    } else {
        $cache_file = SIMPLE_CACHE . "/schema_data/" . substr($cid, 0, strpos($cid, "_")) . "/" . sys_get_pathnum($cid) . "/" . $cid . "_" . $_SESSION["username"] . ".ser";
        sys_mkdir(dirname($cache_file));
        file_put_contents($cache_file, serialize($data), LOCK_EX);
        touch($cache_file, $time + time());
    }
}
Esempio n. 6
0
 static function create_folder($title, $parent, $mfolder)
 {
     $newpath = $parent . $title . "/";
     if (sys_allowedpath($parent) != "" or is_dir($newpath) or file_exists($newpath)) {
         return "";
     }
     if (!sys_mkdir($newpath)) {
         exit("{t}Access denied.{/t}");
     }
     if (is_dir($newpath)) {
         return "ok";
     } else {
         return "";
     }
 }
Esempio n. 7
0
}
if (empty($_REQUEST["release"]) and empty($_REQUEST["cfile"]) or !sys_validate_token()) {
    updater::show_list($mirror_id);
} else {
    if (!empty($_REQUEST["cfile"])) {
        $source = $_REQUEST["cfile"];
        if (!file_exists($source) or filesize($source) < 3 * 1048576) {
            sys_die(t("{t}Error{/t}") . ": file-check [0] " . $source);
        }
    } else {
        $release = $_REQUEST["release"];
        if ($release == "latest" or !is_numeric($release)) {
            $data = @file_get_contents($mirror["url"]);
            $match = array();
            preg_match($mirror["pattern"], $data, $match);
            if (empty($match[1])) {
                sys_die(t("{t}Error{/t}") . ": file-check " . $mirror["url"]);
            }
            $release = $match[1];
        }
        $source = sprintf($mirror["source"], $release, $release);
    }
}
$temp_folder = SIMPLE_CACHE . "/updater/";
sys_mkdir($temp_folder);
$target = $temp_folder . substr(basename($source), 0, -3);
updater::download($source, $target);
$source_folder = updater::extract($target, $temp_folder);
updater::move_files($move_folders, $source_folder);
updater::extensions();
updater::footer();
Esempio n. 8
0
 static function update_modules_list()
 {
     setup::out(sprintf("<br>{t}Processing %s ...{/t}", SIMPLE_EXT . "*/modules.txt"));
     $data = "";
     foreach (scandir(SIMPLE_EXT) as $file) {
         if ($file[0] == "." or !is_dir(SIMPLE_EXT . $file)) {
             continue;
         }
         if (!file_exists(SIMPLE_EXT . $file . "/modules.txt")) {
             continue;
         }
         $data .= trim(file_get_contents(SIMPLE_EXT . $file . "/modules.txt")) . "\n";
     }
     $target = SIMPLE_EXT . "modules/schema/modules_ext.txt";
     @unlink($target);
     if ($data != "") {
         sys_mkdir(dirname($target));
         file_put_contents($target, $data, LOCK_EX);
     }
     setup::out(sprintf("{t}Processing %s ...{/t}", SIMPLE_EXT . "*/sys_modules.txt"));
     $data = "";
     foreach (scandir(SIMPLE_EXT) as $file) {
         if ($file[0] == "." or !is_dir(SIMPLE_EXT . $file)) {
             continue;
         }
         if (!file_exists(SIMPLE_EXT . $file . "/sys_modules.txt")) {
             continue;
         }
         $data .= trim(file_get_contents(SIMPLE_EXT . $file . "/sys_modules.txt")) . "\n";
     }
     $target = SIMPLE_EXT . "modules/schema_sys/modules_ext.txt";
     @unlink($target);
     if ($data != "") {
         sys_mkdir(dirname($target));
         file_put_contents($target, $data, LOCK_EX);
     }
 }