From: vincent@cubedesigners.com Date: Tue, 23 Apr 2013 09:31:45 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8c333d0c258572579518d6e1a5e6866ed1982794;p=cubeextranet.git --- diff --git a/inc/commons/DAO/class.common.dao.fichier.php b/inc/commons/DAO/class.common.dao.fichier.php index e3a39d134..4c389f038 100644 --- a/inc/commons/DAO/class.common.dao.fichier.php +++ b/inc/commons/DAO/class.common.dao.fichier.php @@ -1,8 +1,10 @@ con); $contacts = $dao->getContacts($this->entreprise_id); $daoEquipiers = new commonDAOEquipier($this->con); $eq = $daoEquipiers->selectAll(); $equipiers = array(); - foreach($eq as $e) { + foreach ($eq as $e) { $equipiers[$e->utilisateur_id] = $e; } $paths = array(); $c = array(); - foreach($contacts as $contact) { + foreach ($contacts as $contact) { $c[$contact->utilisateur_id] = $contact; $paths[$contact->utilisateur_id] = array(); cubeFiles::scanRecursiveDir(FTPROOT . $contact->utilisateur_id, $paths[$contact->utilisateur_id]); } $liste = array(); - foreach($paths as $utilisateur_id => $files) { - foreach($files as $file) { + foreach ($paths as $utilisateur_id => $files) { + foreach ($files as $file) { if (stristr($file, '/.in/')) { $p = explode('/', str_replace(FTPROOT . $utilisateur_id . '/.in/', '', $file)); $equipier_id = array_shift($p); @@ -67,12 +68,11 @@ class commonDAOFichier extends commonDAO { return $fichiers; } - public function count() - { + public function count() { $dao = new commonDAOEntreprise($this->con); $contacts = $dao->getContacts($this->entreprise_id); $res = 0; - foreach($contacts as $contact) { + foreach ($contacts as $contact) { $t = array(); cubeFiles::scanRecursiveDir(FTPROOT . $contact->utilisateur_id, $t); $res += count($t); @@ -80,12 +80,11 @@ class commonDAOFichier extends commonDAO { return $res; } - public function sort($a, $b) - { - $a1 = $a-> { - $this->orderby} ; - $b1 = $b-> { - $this->orderby} ; + public function sort($a, $b) { + $a1 = $a->{ + $this->orderby}; + $b1 = $b->{ + $this->orderby}; if (is_numeric($a1) && is_numeric($b1)) { if ($a1 == $b1) { @@ -105,28 +104,26 @@ class commonDAOFichier extends commonDAO { } } - protected function search($fichiers) - { + protected function search($fichiers) { $res = array(); - foreach($fichiers as $k => $f) { - if (stristr((string)$f, $this->q)) { + foreach ($fichiers as $k => $f) { + if (stristr((string) $f, $this->q)) { $res[$k] = $f; } } return $res; } - public function supprime($path) - { + public function supprime($path) { if (file_exists(FTPROOT . $path)) { unlink(FTPROOT . $path); } } - public function deleteOldFiles() - { - cubeFiles::deleteFilesOlderThan(FTPROOT, 60); + public function deleteOldFiles() { + cubeFiles::deleteFilesOlderThan(FTPROOT, 60, array('*.ipa', '*.apk')); } + } ?> \ No newline at end of file