Пример #1
0
 function delete_backup()
 {
     global $globals;
     if ($globals['Amazon_S3_media_bucket']) {
         return Media::rm($this->type . '/' . $this->filename());
     }
 }
Пример #2
0
 function delete_thumb($base = '')
 {
     global $globals;
     if (!empty($base)) {
         // Don't delete if not the original (smaller) thumbnail
         return;
     }
     $this->thumb = '';
     $this->thumb_status = 'deleted';
     $this->thumb_x = 0;
     $this->thumb_y = 0;
     $this->store_thumb();
     if ($globals['Amazon_S3_media_bucket'] && $globals['Amazon_S3_media_url']) {
         Media::rm("thumbs/{$this->id}*");
     }
     $dir = Upload::get_cache_dir($this->id);
     $files = glob("{$dir}/thumb*-{$this->id}.jpg");
     foreach ($files as $file) {
         if (is_file($file)) {
             @unlink($file);
         }
     }
 }
Пример #3
0
	function delete_thumb() {
		global $globals;
		$this->thumb = '';
		$this->thumb_status = 'deleted';
		$this->thumb_x = 0;
		$this->thumb_y = 0;
		$this->store_thumb();
		if ($globals['Amazon_S3_media_bucket'] && $globals['Amazon_S3_media_url']) {
			Media::rm("thumbs/$this->id*");
		}
	}
Пример #4
0
function avatars_remove_user_files($user)
{
    global $globals;
    if ($globals['Amazon_S3_media_bucket']) {
        Media::rm("avatars/{$user}-*");
    }
    if ($globals['Amazon_S3_local_cache'] || !$globals['Amazon_S3_media_bucket']) {
        $subdir = @get_avatars_dir() . '/' . get_cache_dir_chain($user);
        if ($subdir && ($handle = @opendir($subdir))) {
            while (false !== ($file = readdir($handle))) {
                if (preg_match("/^{$user}-/", $file)) {
                    @unlink($subdir . '/' . $file);
                }
            }
            closedir($handle);
        }
    }
}