Beispiel #1
0
if ($action == 'modify') {
    if ($met_pseudo && $met_webhtm > 0) {
        metsave('-1', $lang_rewritefinfo3);
        die;
    }
    $query = "update {$met_lang} SET met_webhtm = '{$met_webhtm}' where lang='{$lang}'";
    $db->query($query);
    $query = "update {$met_lang} SET met_htmtype = '{$met_htmtype}' where lang='{$lang}'";
    $db->query($query);
    require_once $depth . '../include/config.php';
    if ($met_webhtm == 0 && $dehtm == 'deleteall' || $dehtm == 'bianhtm') {
        $query = "SELECT * FROM {$met_column} where (bigclass=0 or releclass!=0) and if_in=0 and lang='{$lang}'";
        $result = $db->query($query);
        while ($list = $db->fetch_array($result)) {
            $dir = '../../' . $list['foldername'];
            $file = met_scandir($dir);
            foreach ($file as $value) {
                if ($lang == $met_index_type) {
                    if ($value != "." && $value != "..") {
                        $langmarkarray = explode("_", $value);
                        $k = count($langmarkarray) - 1;
                        $langmark = $k ? $langmarkarray[$k] : "";
                        if (substr($value, -4, 4) == "html" || substr($value, -3, 3) == "htm" and !strstr($htmlang, "_" . $langmark) || $langmark == "") {
                            unlink($dir . "/" . $value);
                        }
                    }
                } else {
                    if ($value != "." && $value != "..") {
                        if (strstr($value, ".htm")) {
                            unlink($dir . "/" . $value);
                        }
Beispiel #2
0
 /**
  * Unlink file/folder
  *
  * @static
  * @access public
  * @param string $path
  * @return boolean
  */
 public static function unlink($path)
 {
     /*    make sure the path exists    */
     if (!file_exists($path)) {
         return false;
     }
     /*    If it is a file or link, just delete it    */
     if (is_file($path) || is_link($path)) {
         return @unlink($path);
     }
     /*    Scan the dir and recursively unlink    */
     $files = met_scandir($path);
     if ($files) {
         foreach ($files as $filename) {
             if ($filename == '.' || $filename == '..') {
                 continue;
             }
             $file = str_replace('//', '/', $path . '/' . $filename);
             CKFinder_Connector_Utils_FileSystem::unlink($file);
         }
     }
     /*    Remove the parent dir    */
     if (!@rmdir($path)) {
         return false;
     }
     return true;
 }