protected function moveFile($oldname, $newname, $rights = 0404)
 {
     $filename = basename($newname);
     $dir = dirname($newname) . DS;
     $t = explode('.', $filename);
     if (sizeof($t) > 0 && PregFucntions::prohibited_extension(end($t))) {
         return false;
     }
     if (!PregFucntions::check_file_name($filename)) {
         return false;
     }
     if (!PregFucntions::check_file_length($newname)) {
         return false;
     }
     $uniqnewname = $this->uniqFileName($dir, $filename);
     if ($uniqnewname !== false) {
         if (is_uploaded_file($oldname)) {
             if (move_uploaded_file($oldname, $dir . $uniqnewname)) {
                 if (chmod($dir . $uniqnewname, $rights)) {
                     return true;
                 }
             }
         }
     }
     return false;
 }