From 44e83fc1760fd5e442af0771d504c7b1d5db777c Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 17 Jan 2011 14:48:15 +0000 Subject: [PATCH] --- inc/commons/class.common.ajax.php | 42 +++ inc/commons/class.common.url.php | 251 +++++++++++++++++- inc/config.inc.php | 12 + .../Controlleur/class.extranet.ajax.php | 41 --- .../Controlleur/class.extranet.url.php | 248 ----------------- inc/ws/Controlleur/class.ws.droits.php | 9 +- inc/ws/Controlleur/class.ws.url.php | 1 - 7 files changed, 312 insertions(+), 292 deletions(-) diff --git a/inc/commons/class.common.ajax.php b/inc/commons/class.common.ajax.php index 61aa6f153..3ee49b03e 100644 --- a/inc/commons/class.common.ajax.php +++ b/inc/commons/class.common.ajax.php @@ -161,6 +161,48 @@ class commonAjax { $x->addRedirection(SITE_PATH); } + + public static function sortFichiers($args, &$x) + { + commonAjax::sort('fichiers', $args[1]); + $x->addContent('listeFichiers', extranetUrl::listeFichiers()); + } + + public static function pageFichiers($args, &$x) + { + commonAjax::page('fichiers', $args[1]); + $x->addContent('listeFichiers', extranetUrl::listeFichiers()); + } + + public static function parPageFichiers($args, &$x) + { + commonAjax::parPage('fichiers', $_POST['par_page']); + $x->addContent('listeFichiers', extranetUrl::listeFichiers()); + } + + public static function searchFichiers($args, &$x) + { + $x->addContent('listeFichiers', extranetUrl::listeFichiers()); + } + + public static function refreshFichiers($args, &$x) + { + $x->addContent('listeFichiers', extranetUrl::listeFichiers()); + } + + public static function supprimeFichier($args, &$x) + { + global $core; + + array_shift($args); + $path = implode('/', $args); + $entreprise = array_shift($args); + extranetDroits::telecharger($entreprise); + + $dao = new extranetDAOFichier($core->con); + $dao->supprime($path); + $x->addContent('listeFichiers', extranetUrl::listeFichiers()); + } } ?> \ No newline at end of file diff --git a/inc/commons/class.common.url.php b/inc/commons/class.common.url.php index ebcb90454..acd1be616 100644 --- a/inc/commons/class.common.url.php +++ b/inc/commons/class.common.url.php @@ -250,7 +250,7 @@ class commonUrl { $res .= extranetUrl::listeFactures($r->dashboard_id, self::getDashboardSettings($r->settings)); } elseif ($r->rubrique == 'devis') { $res .= extranetUrl::listeDevis($r->dashboard_id, self::getDashboardSettings($r->settings)); - } elseif ($r->rubrique == 'clients' && MODE=='extranet') { + } elseif ($r->rubrique == 'clients' && MODE == 'extranet') { $res .= extranetUrl::listeClients($r->dashboard_id, self::getDashboardSettings($r->settings)); } elseif ($r->rubrique == 'timereport') { $res .= extranetUrl::listeTimereport($r->dashboard_id, self::getDashboardSettings($r->settings)); @@ -285,6 +285,255 @@ class commonUrl { return $res; } + + public static function fichiers($args) + { + global $core; + extranetDroits::min(0); + + $settings = $core->user->getSettings('fichiers'); + + if ($core->user->grade > 0 && isset($args[1])) { + $dao = new commonDAOClient($core->con); + $client = $dao->selectById($args[1]); + $_SESSION['entreprise_fichiers'] = $client->entreprise; + } + + $shortcuts = array(); + // $shortcuts[] = '' . $core->typo->Ajouter('Créer un projet') . ''; + $filtres = array(); + $res = ''; + if ($core->user->grade != 0) { + $res .= commonPage::barre(null, null, null, array('' . $core->typo->BoutonOK(__('Accès direct FTP')) . '')); + } else { + $res .= commonPage::barre(); + } + $res .= commonPage::tMain(); + if ($core->user->grade == 0) { + $res .= self::formFichier(); + } else { + $res .= self::formFichier($args[1]); + } + $res .= commonPage::bh(); + $res .= '
'; + $res .= self::listeFichiers($settings); + $res .= '
'; + $res .= commonPage::bf(); + $res .= commonPage::bMain(); + return $res; + } + + public static function formFichier($for = 'client') + { + global $core; + + if ($for == 'client') { + $titre = __('Envoyez-nous un fichier'); + $texte = __('Cliquez sur le bouton Parcourir, et sélectionnez le ou les fichiers que vous souhaitez nous faire parvenir'); + } else { + $dao = new commonDAOClient($core->con); + $client = $dao->selectById($for); + $titre = __('Envoyer un fichier à') . ' ' . $client->prenom . ' ' . $client->nom; + $texte = ''; + } + + $res = '
'; + $res .= '
' . $core->typo->OngletBlancNoDash($titre) . '
'; + $res .= commonPage::bh(); + $res .= '
'; + $res .= '

' . $texte . '

'; + + if ($for == 'client') { + $fv = array('url' => SITE_PATH . 'upload'); + } else { + $fv = array('url' => SITE_PATH . 'upload/' . $for); + } + $fv['browseText'] = __('Parcourir') . ' ...'; + $fv['finishedText'] = __('Transfert terminé'); + $fv['totalText'] = __('Total'); + $fv['loadingFileText'] = __('Chargement du fichier'); + // $fv['debug']='true'; + $fv['PHPSESSID'] = session_id(); + + $res .= cubeMedia::flash(WEBROOT . '/swf/uploader.swf', '970', '50', $fv, 'uploaderContainer', '', '9', '#ffffff', '', 'true', 'noscale', 'transparent'); + $res .= '
'; + $res .= commonPage::bf(); + $res .= '
'; + return $res; + } + + public static function listeFichiers($settings = null) + { + global $core; + extranetDroits::min(0); + if ($core->user->grade <= 0) { + $entreprise = $core->user->entreprise; + } else { + $entreprise = $_SESSION['entreprise_fichiers']; + } + + $settings = is_null($settings)?$core->user->getSettings('fichiers'):$settings; + $dao = new extranetDAOFichier($core->con); + $change = 'Fichiers'; + $dao->entreprise_id = $entreprise; + if (isset($settings['search']) && !is_null($settings['search'])) { + $dao->setSearch($settings['search']); + } + $liste = $dao->getListe($settings['orderby'], $settings['sens'], $settings['limit']); + + $res = ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + $i = 0; + foreach($liste as $fichier) { + $odd = cubeMath::isOdd($i)?' class="odd"':''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + $res .= ''; + if ($fichier->destinataire) { + $res .= ''; + } else { + $res .= ''; + } + $res .= ''; + $res .= ''; + $res .= ''; + $i++; + } + if (!isset($settings['search']) || is_null($settings['search'])) { + $odd = cubeMath::isOdd($i)?' class="odd"':''; + $res .= ''; + } + $res .= '
' . commonUrl::orderby(__('Nom de fichier'), 'nom', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Type'), 'type', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Taille'), 'taille', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Date'), 'date', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Envoyé par'), 'contact', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Destiné à'), 'destinataire', $settings, 'sort' . $change) . '
' . $fichier->nom . '' . $fichier->type . '' . files::size($fichier->taille) . '' . date(__('d/m/Y'), $fichier->date) . '' . $fichier->contact->prenom . ' ' . $fichier->contact->nom . '' . $fichier->destinataire->prenom . ' ' . $fichier->destinataire->nom . '' . $core->typo->Telecharger('Télécharger') . '' . cubeMedia::image(IMG . '/delete.png') . '
' ; + $res .= commonPage::pager($settings['page'], $dao->count() , $settings['par_page'], 'page' . $change . '/%d'); + $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('fichiers')); + $res .= '
'; + return $res; + } + + public static function telecharger($args) + { + array_shift($args); + $path = implode('/', $args); + $utilisateur_id = array_shift($args); + extranetDroits::telecharger($utilisateur_id); + $dir = md5($path . (rand(1, 235548684) * 50.5)); + $nom = array_pop($args); + @mkdir(ROOT . '/cache/download/' . $dir, 0755, true); + copy(FTPROOT . $path, ROOT . '/cache/download/' . $dir . '/' . $nom); + + http::redirect(WEBROOT . '/cache/download/' . $dir . '/' . $nom); + } + + public static function upload($args) + { + global $core; + if (isset($args[1]) && $args[1] != '') { + $for = $args[1]; + } else { + $for = false; + } + + if (!$for) { + $destrel = $core->user->utilisateur_id; + } else { + $destrel = $for . '/.in/' . $core->user->utilisateur_id; + } + $dest = FTPROOT . $destrel; + if (!file_exists($dest)) { + mkdir($dest, 0755, true); + } + + if (!isset($_SESSION['files_uploaded'])) { + $_SESSION['files_uploaded'] = array(); + } + foreach($_FILES as $f) { + if ($f['error']) { + continue; + } + $fname = cubeFiles::tidyName($f['name']); + while (file_exists($dest . '/' . $fname)) { + $name = cubeFiles::getName($fname); + $ext = files::getExtension($fname); + + $name .= '.' . rand(1, 9); + $fname = $name . '.' . $ext; + } + + move_uploaded_file($f['tmp_name'], $dest . '/' . $fname); + $_SESSION['files_uploaded'][] = $destrel . '/' . $fname; + + if (isset($_POST['last']) && $_POST['last'] == '1') { + $mail = new cubeMail(); + $mail->charset = 'UTF-8'; + $mail->from = FROM_NAME . '<' . FROM_EMAIL . '>'; + if (!$for) { + $mail->to = TEAM_EMAIL; + $mail->subject = '[' . EMAIL_SUBJECT . '] Nouveaux fichiers uploadés par ' . $core->user->prenom . ' ' . $core->user->nom; + $body = 'Tous les fichiers de ' . $core->user->prenom . ' ' . $core->user->nom . ' : http://extranet.cubedesigners.com/fichiers/' . $core->user->utilisateur_id . "\n\n"; + $body .= 'Fichiers chargés : ' . "\n"; + foreach($_SESSION['files_uploaded'] as $f) { + $body .= ' - http://' . $_SERVER['HTTP_HOST'] . '/telecharger/' . $f . "\n"; + } + } else { + $dao = new commonDAOClient($core->con); + $client = $dao->selectById($for); + + $mail->to = $core->user->email; + $mail->subject = '[' . EMAIL_SUBJECT . '] Nouveaux fichiers uploadés pour ' . $client->prenom . ' ' . $client->nom; + + $body = 'Tous les fichiers de ' . $client->prenom . ' ' . $client->nom . ' : http://extranet.cubedesigners.com/fichiers/' . $client->utilisateur_id . "\n\n"; + $body .= 'Fichiers chargés : ' . "\n"; + foreach($_SESSION['files_uploaded'] as $f) { + $body .= ' - http://' . $_SERVER['HTTP_HOST'] . '/telecharger/' . $f . "\n"; + } + $body .= "\n" . RAPPEL . " : \n"; + $body .= ' - Adresse : http://' . $_SERVER['HTTP_HOST'] . '/' . "\n"; + $body .= ' - Login : ' . $client->email . "\n"; + $body .= ' - Mot de passe : ' . $client->password . "\n"; + } + $mail->body = $body; + $ok = $mail->send(); + + $_SESSION['files_uploaded'] = array(); + } + } + ob_clean(); + exit; + } + + public static function cleanDownload($args) + { + $root = ROOT . '/cache/download/'; + cubeFiles::scanRecursiveDir($root, $files); + $limit = TIME-7200; + foreach($files as $f) { + if (filemtime($f) < $limit) { + unlink($f); + } + } + $files = cubeFiles::scandir($root, true); + foreach($files as $f) { + if (cubeFiles::isEmpty($f)) { + @rmdir($f); + } + } + } + + public static function deleteOldFilesFromFTP($args) + { + global $core; + $dao = new extranetDAOFichier($core->con); + $dao->deleteOldFiles(); + } } ?> \ No newline at end of file diff --git a/inc/config.inc.php b/inc/config.inc.php index cafecc068..fab91a91a 100644 --- a/inc/config.inc.php +++ b/inc/config.inc.php @@ -46,10 +46,22 @@ if ($ws) { define('MODE', 'ws'); define('GA', 'UA-4339912-5'); define('TITLE', 'Fuidbook Workshop'); + + define('FROM_EMAIL', 'workshop@fluidbook.com'); + define('FROM_NAME', 'Fluidbook Workshop'); + define('EMAIL_SUBJECT', 'Fluidbook Workshop'); + define('TEAM_EMAIL', 'team@fluidbook.com'); + define('RAPPEL','Rappel des identifiants de connexion au Fluidbook Workshop'); } elseif ($extranet) { define('MODE', 'extranet'); define('GA', 'UA-4339912-4'); define('TITLE', 'Extranet Cubedesigners'); + + define('FROM_EMAIL', 'extranet@cubedesigners.com'); + define('FROM_NAME', 'Extranet Cubedesigners'); + define('EMAIL_SUBJECT', 'Extranet Cubedesigners'); + define('TEAM_EMAIL', 'team@cubedesigners.com'); + define('RAPPEL','Rappel des identifiants de connexion à l\'extranet Cubedesigners'); } if (DEV) { diff --git a/inc/extranet/Controlleur/class.extranet.ajax.php b/inc/extranet/Controlleur/class.extranet.ajax.php index db89466f3..35c5c564d 100644 --- a/inc/extranet/Controlleur/class.extranet.ajax.php +++ b/inc/extranet/Controlleur/class.extranet.ajax.php @@ -733,47 +733,6 @@ class extranetAjax { commonAjax::form('', sprintf(__("Détails des charges de l'année %s"), date('Y')), extranetPageChiffres::chargesDetails($args), '', 3, 'liste'); } - public static function sortFichiers($args, &$x) - { - commonAjax::sort('fichiers', $args[1]); - $x->addContent('listeFichiers', extranetUrl::listeFichiers()); - } - - public static function pageFichiers($args, &$x) - { - commonAjax::page('fichiers', $args[1]); - $x->addContent('listeFichiers', extranetUrl::listeFichiers()); - } - - public static function parPageFichiers($args, &$x) - { - commonAjax::parPage('fichiers', $_POST['par_page']); - $x->addContent('listeFichiers', extranetUrl::listeFichiers()); - } - - public static function searchFichiers($args, &$x) - { - $x->addContent('listeFichiers', extranetUrl::listeFichiers()); - } - - public static function refreshFichiers($args, &$x) - { - $x->addContent('listeFichiers', extranetUrl::listeFichiers()); - } - - public static function supprimeFichier($args, &$x) - { - global $core; - - array_shift($args); - $path = implode('/', $args); - $entreprise = array_shift($args); - extranetDroits::telecharger($entreprise); - - $dao = new extranetDAOFichier($core->con); - $dao->supprime($path); - $x->addContent('listeFichiers', extranetUrl::listeFichiers()); - } } ?> \ No newline at end of file diff --git a/inc/extranet/Controlleur/class.extranet.url.php b/inc/extranet/Controlleur/class.extranet.url.php index e80079052..1d93a8c85 100644 --- a/inc/extranet/Controlleur/class.extranet.url.php +++ b/inc/extranet/Controlleur/class.extranet.url.php @@ -1661,254 +1661,6 @@ class extranetUrl { $res .= ''; return $res; } - public static function fichiers($args) - { - global $core; - extranetDroits::min(0); - - $settings = $core->user->getSettings('fichiers'); - - if ($core->user->grade > 0 && isset($args[1])) { - $dao = new commonDAOClient($core->con); - $client = $dao->selectById($args[1]); - $_SESSION['entreprise_fichiers'] = $client->entreprise; - } - - $shortcuts = array(); - // $shortcuts[] = '' . $core->typo->Ajouter('Créer un projet') . ''; - $filtres = array(); - $res = ''; - if ($core->user->grade != 0) { - $res .= commonPage::barre(null, null, null, array('' . $core->typo->BoutonOK(__('Accès direct FTP')) . '')); - } else { - $res .= commonPage::barre(); - } - $res .= commonPage::tMain(); - if ($core->user->grade == 0) { - $res .= self::formFichier(); - } else { - $res .= self::formFichier($args[1]); - } - $res .= commonPage::bh(); - $res .= '
'; - $res .= self::listeFichiers($settings); - $res .= '
'; - $res .= commonPage::bf(); - $res .= commonPage::bMain(); - return $res; - } - - public static function formFichier($for = 'client') - { - global $core; - - if ($for == 'client') { - $titre = __('Envoyez-nous un fichier'); - $texte = __('Cliquez sur le bouton Parcourir, et sélectionnez le ou les fichiers que vous souhaitez nous faire parvenir'); - } else { - $dao = new commonDAOClient($core->con); - $client = $dao->selectById($for); - $titre = __('Envoyer un fichier à') . ' ' . $client->prenom . ' ' . $client->nom; - $texte = ''; - } - - $res = '
'; - $res .= '
' . $core->typo->OngletBlancNoDash($titre) . '
'; - $res .= commonPage::bh(); - $res .= '
'; - $res .= '

' . $texte . '

'; - - if ($for == 'client') { - $fv = array('url' => SITE_PATH . 'upload'); - } else { - $fv = array('url' => SITE_PATH . 'upload/' . $for); - } - $fv['browseText'] = __('Parcourir') . ' ...'; - $fv['finishedText'] = __('Transfert terminé'); - $fv['totalText'] = __('Total'); - $fv['loadingFileText'] = __('Chargement du fichier'); - // $fv['debug']='true'; - $fv['PHPSESSID'] = session_id(); - - $res .= cubeMedia::flash(WEBROOT . '/swf/uploader.swf', '970', '50', $fv, 'uploaderContainer', '', '9', '#ffffff', '', 'true', 'noscale', 'transparent'); - $res .= '
'; - $res .= commonPage::bf(); - $res .= '
'; - return $res; - } - - public static function listeFichiers($settings = null) - { - global $core; - extranetDroits::min(0); - if ($core->user->grade <= 0) { - $entreprise = $core->user->entreprise; - } else { - $entreprise = $_SESSION['entreprise_fichiers']; - } - - $settings = is_null($settings)?$core->user->getSettings('fichiers'):$settings; - $dao = new extranetDAOFichier($core->con); - $change = 'Fichiers'; - $dao->entreprise_id = $entreprise; - if (isset($settings['search']) && !is_null($settings['search'])) { - $dao->setSearch($settings['search']); - } - $liste = $dao->getListe($settings['orderby'], $settings['sens'], $settings['limit']); - - $res = ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $i = 0; - foreach($liste as $fichier) { - $odd = cubeMath::isOdd($i)?' class="odd"':''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - if ($fichier->destinataire) { - $res .= ''; - } else { - $res .= ''; - } - $res .= ''; - $res .= ''; - $res .= ''; - $i++; - } - if (!isset($settings['search']) || is_null($settings['search'])) { - $odd = cubeMath::isOdd($i)?' class="odd"':''; - $res .= ''; - } - $res .= '
' . commonUrl::orderby(__('Nom de fichier'), 'nom', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Type'), 'type', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Taille'), 'taille', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Date'), 'date', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Envoyé par'), 'contact', $settings, 'sort' . $change) . '' . commonUrl::orderby(__('Destiné à'), 'destinataire', $settings, 'sort' . $change) . '
' . $fichier->nom . '' . $fichier->type . '' . files::size($fichier->taille) . '' . date(__('d/m/Y'), $fichier->date) . '' . $fichier->contact->prenom . ' ' . $fichier->contact->nom . '' . $fichier->destinataire->prenom . ' ' . $fichier->destinataire->nom . '' . $core->typo->Telecharger('Télécharger') . '' . cubeMedia::image(IMG . '/delete.png') . '
' ; - $res .= commonPage::pager($settings['page'], $dao->count() , $settings['par_page'], 'page' . $change . '/%d'); - $res .= commonUrl::formParPage('parPage' . $change, $settings['par_page'], __('fichiers')); - $res .= '
'; - return $res; - } - - public static function telecharger($args) - { - array_shift($args); - $path = implode('/', $args); - $utilisateur_id = array_shift($args); - extranetDroits::telecharger($utilisateur_id); - $dir = md5($path . (rand(1, 235548684) * 50.5)); - $nom = array_pop($args); - @mkdir(ROOT . '/cache/download/' . $dir, 0755, true); - copy(FTPROOT . $path, ROOT . '/cache/download/' . $dir . '/' . $nom); - - http::redirect(WEBROOT . '/cache/download/' . $dir . '/' . $nom); - } - - public static function upload($args) - { - global $core; - if (isset($args[1]) && $args[1] != '') { - $for = $args[1]; - } else { - $for = false; - } - - if (!$for) { - $destrel = $core->user->utilisateur_id; - } else { - $destrel = $for . '/.in/' . $core->user->utilisateur_id; - } - $dest = FTPROOT . $destrel; - if (!file_exists($dest)) { - mkdir($dest, 0755, true); - } - - if (!isset($_SESSION['files_uploaded'])) { - $_SESSION['files_uploaded'] = array(); - } - foreach($_FILES as $f) { - if ($f['error']) { - continue; - } - $fname = cubeFiles::tidyName($f['name']); - while (file_exists($dest . '/' . $fname)) { - $name = cubeFiles::getName($fname); - $ext = files::getExtension($fname); - - $name .= '.' . rand(1, 9); - $fname = $name . '.' . $ext; - } - - move_uploaded_file($f['tmp_name'], $dest . '/' . $fname); - $_SESSION['files_uploaded'][] = $destrel . '/' . $fname; - - if (isset($_POST['last']) && $_POST['last'] == '1') { - $mail = new cubeMail(); - $mail->charset = 'UTF-8'; - $mail->from = 'Extranet Cubedesigners'; - if (!$for) { - $mail->to = 'team@cubedesigners.com'; - $mail->subject = '[Extranet] Nouveaux fichiers uploadés par ' . $core->user->prenom . ' ' . $core->user->nom; - $body = 'Tous les fichiers de ' . $core->user->prenom . ' ' . $core->user->nom . ' : http://extranet.cubedesigners.com/fichiers/' . $core->user->utilisateur_id . "\n\n"; - $body .= 'Fichiers chargés : ' . "\n"; - foreach($_SESSION['files_uploaded'] as $f) { - $body .= ' - http://' . $_SERVER['HTTP_HOST'] . '/telecharger/' . $f . "\n"; - } - } else { - $dao = new commonDAOClient($core->con); - $client = $dao->selectById($for); - - $mail->to = $core->user->email; - $mail->subject = '[Extranet] Nouveaux fichiers uploadés pour ' . $client->prenom . ' ' . $client->nom; - - $body = 'Tous les fichiers de ' . $client->prenom . ' ' . $client->nom . ' : http://extranet.cubedesigners.com/fichiers/' . $client->utilisateur_id . "\n\n"; - $body .= 'Fichiers chargés : ' . "\n"; - foreach($_SESSION['files_uploaded'] as $f) { - $body .= ' - http://extranet.cubedesigners.com/telecharger/' . $f . "\n"; - } - $body .= "\n" . 'Rappel des identifiants de connexion à l\'extranet Cubedesigners : ' . "\n"; - $body .= ' - Adresse : http://' . $_SERVER['HTTP_HOST'] . '/' . "\n"; - $body .= ' - Login : ' . $client->email . "\n"; - $body .= ' - Mot de passe : ' . $client->password . "\n"; - } - $mail->body = $body; - $ok = $mail->send(); - - $_SESSION['files_uploaded'] = array(); - } - } - ob_clean(); - exit; - } - - public static function cleanDownload($args) - { - $root = ROOT . '/cache/download/'; - cubeFiles::scanRecursiveDir($root, $files); - $limit = TIME-7200; - foreach($files as $f) { - if (filemtime($f) < $limit) { - unlink($f); - } - } - $files = cubeFiles::scandir($root, true); - foreach($files as $f) { - if (cubeFiles::isEmpty($f)) { - @rmdir($f); - } - } - } - - public static function deleteOldFilesFromFTP($args) - { - global $core; - $dao = new extranetDAOFichier($core->con); - $dao->deleteOldFiles(); - } } ?> \ No newline at end of file diff --git a/inc/ws/Controlleur/class.ws.droits.php b/inc/ws/Controlleur/class.ws.droits.php index d076a054f..9f260b027 100644 --- a/inc/ws/Controlleur/class.ws.droits.php +++ b/inc/ws/Controlleur/class.ws.droits.php @@ -5,7 +5,11 @@ class wsDroits { global $core; $nav = array(); - $nav[__('Dashboard')] = 'dashboard'; + + if ($core->user->ws_grade >= 5) { + $nav[__('Dashboard')] = 'dashboard'; + } + $nav[__('Publications')] = 'publications'; if ($core->user->ws_grade >= 3) { $nav[__('Clients')] = 'clients'; @@ -13,6 +17,9 @@ class wsDroits { if ($core->user->ws_grade >= 5) { $nav[__('Traductions')] = 'traductions'; } + if ($core->user->ws_grade < 5) { + $nav[__('Fichiers')] = 'fichiers'; + } return $nav; } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index fac416cf4..d957549cb 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -431,7 +431,6 @@ html{height:100%}' . "\n"; $res .= ''; $res .= ''; $res .= '' . cubeMedia::image(IMG . '/edit.png') . ''; - $res .= '' . cubeMedia::image(IMG . '/edit.png') . ''; $res .= ''; $i++; } -- 2.39.5