Luxbum.net - Script de galerie photo

Changeset 209

Show
Ignore:
Timestamp:
05/26/07 20:03:46 (1 year ago)
Author:
nicolas
Message:

vérification des dossiers/fichiers en entrée.
vérification correcte de l'execution des commandes pour le backend
imagemagick

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/api/inc/imagetoolkit.imagemagick.php

    r208 r209  
    2424                           escapeshellarg($this->image),  
    2525                           escapeshellarg($img_dest)); 
    26             if (!system($cmd)) { 
     26                            
     27            $res = array(); 
     28            exec($cmd, $res, $returnCode); 
     29            if ($returnCode != 0) { 
    2730               throw new Pluf_HTTP_ImageException(); 
    2831            } 
     
    3437                           escapeshellarg($img_dest), 
    3538                           escapeshellarg($img_dest)); 
    36             //exec($cmd); 
    37             if (!system($cmd)) { 
     39             
     40            $res = array(); 
     41            exec($cmd, $res, $returnCode); 
     42            if ($returnCode != 0) { 
    3843               throw new Pluf_HTTP_ImageException(); 
    3944            } 
     
    4752                           escapeshellarg($this->image),  
    4853                           escapeshellarg($img_dest)); 
    49             //exec($cmd); 
    50             if (!system($cmd)) { 
     54            $res = array(); 
     55            exec($cmd, $res, $returnCode); 
     56            if ($returnCode != 0) { 
    5157               throw new Pluf_HTTP_ImageException(); 
    5258            } 
  • trunk/api/ui/CommonView.php

    r207 r209  
    2525      } 
    2626   } 
     27    
     28   /** 
     29    * Enter description here... 
     30    * 
     31    * @param string $dir 
     32    */ 
     33   public function checkDir($dir) { 
     34      $dir = files::addTailSlash($dir); 
     35      if (!is_dir(luxBum::getFsPath($dir))) { 
     36         throw new Pluf_HTTP_FileSystemException(sprintf(__('The gallery %s doesn\'t exists.'), $dir)); 
     37      } 
     38   } 
     39    
     40   /** 
     41    * Enter description here... 
     42    * 
     43    * @param string $file 
     44    */ 
     45   public function checkFile($dir, $file) { 
     46      $dir = files::addTailSlash($dir); 
     47      $this->checkDir($dir); 
     48      if (!file_exists(luxBum::getFilePath($dir, $file))) { 
     49         throw new Pluf_HTTP_FileSystemException(sprintf(__('The file %s doesn\'t exists.'), $dir . $file)); 
     50      } 
     51   } 
    2752} 
    2853 
  • trunk/api/ui/public/Commentaire.php

    r207 r209  
    2626      // Check if the gallery is private 
    2727      $this->checkPrivate($dir); 
    28  
    29       verif::photo($dir, $photo); 
    30       $img = new luxBumImage ($dir, $photo); 
     28          $this->checkFile($dir); 
     29           
     30         $img = new luxBumImage ($dir, $photo); 
    3131      $img->metaInit (); 
    3232 
  • trunk/api/ui/public/Display.php

    r207 r209  
    1717 
    1818      // Check if the gallery is private 
     19          $this->checkFile($dir, $file); 
    1920      $this->checkPrivate($dir); 
    2021 
    21       verif::photo($dir, $file); 
    22  
     22       
    2323      $gallery = new luxBumGallery($dir); 
    2424      $imgIndex = $gallery->getImageIndex($file); 
  • trunk/api/ui/public/FileDownload.php

    r208 r209  
    2727 
    2828      // Check if the gallery is private 
     29          $this->checkFile($dir, $photo); 
    2930      $this->checkPrivate($dir); 
    3031       
    31        
    32       verif::isImage($dir, $photo); 
    3332 
    3433      $luxAff = new luxBumImage($dir, $photo); 
     
    8584 
    8685      // Check if the gallery is private 
     86          $this->checkFile($dir, $file); 
    8787      $this->checkPrivate($dir); 
    8888       
  • trunk/api/ui/public/Gallery.php

    r207 r209  
    2929      } 
    3030       
     31       
    3132      // Check if the gallery is private 
     33          $this->checkFile($dir, $defaultImage); 
    3234      $this->checkPrivate($dir); 
    3335 
     
    7577   public function selection($request, $match) { 
    7678      if (count($match) == 3) { 
    77          $dir = $match[1]; 
     79         //$dir = $match[1]; 
    7880         $defaultImage = $match[2]; 
    7981      } 
  • trunk/api/ui/public/Index.php

    r207 r209  
    2929      } 
    3030 
     31 
    3132      // Check if the gallery is private 
    32       if (PrivateManager::isLockedStatic($dir)) { 
    33          return PrivateView::action($match); 
    34       } 
     33          $this->checkDir($dir); 
     34      $this->checkPrivate($dir); 
    3535 
    3636      $galleries = new luxBumIndex ($dir); 
  • trunk/api/ui/public/InfosMeta.php

    r207 r209  
    2626 
    2727      // Check if the gallery is private 
     28          $this->checkFile($dir, $photo); 
    2829      $this->checkPrivate($dir); 
    2930 
  • trunk/api/ui/public/Private.php

    r207 r209  
    2323 
    2424      $dir = files::removeTailSlash($match[1]); 
     25       
     26          $this->checkDir($dir); 
    2527 
    2628 
  • trunk/api/ui/public/Selection.php

    r207 r209  
    2525       
    2626      // Check if the gallery is private 
     27          $this->checkFile($dir, $file); 
    2728      $this->checkPrivate($dir); 
    2829 
     
    4546       
    4647      // Check if the gallery is private 
     48          $this->checkFile($dir, $file); 
    4749      $this->checkPrivate($dir); 
    4850 
  • trunk/api/ui/public/SlideShow.php

    r207 r209  
    2424       
    2525      // Check if the gallery is private 
     26          $this->checkDir($dir); 
    2627      $this->checkPrivate($dir); 
    2728