From c8f477c3ece413e45324964828bd49a2886b8280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Thu, 10 Apr 2008 18:40:08 +0000 Subject: [PATCH] crude implementation of permission change in the file browser Contributed by: Mathieu Lutfy Sponsored by: Koumbit --- bureau/admin/bro_main.php | 46 +++++++++++++++++++++++++++++++++++++++ bureau/class/m_bro.php | 36 ++++++++++++++++++++++++++++++ debian/changelog | 1 + 3 files changed, 83 insertions(+) diff --git a/bureau/admin/bro_main.php b/bureau/admin/bro_main.php index 5dd30e72..e937c8b4 100644 --- a/bureau/admin/bro_main.php +++ b/bureau/admin/bro_main.php @@ -107,6 +107,11 @@ if ($formu) { print $err->errstr(); } break; + case 7: // Changement de permissions [ML] + if (!$bro->ChangePermissions($R, $d, $perm)) { + print $err->errstr(); + } + break; } } @@ -173,6 +178,46 @@ if ($formu==2 && $actrename && count($d)) { echo "
\n"; } +/* [ML] Changer les permissions : */ +if ($formu==2 && $_REQUEST['actperms'] && count($d)) { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "

"._("Permissions")."

"; + + $tmp_absdir = $bro->convertabsolute($R,0); + + echo ""; // FIXME, marco, ajouter classe css? + echo ""; + // echo ""; // FIXME , i18n + echo ""; // FIXME, i18n + echo ""; + + for ($i=0;$i"; + echo ""; + + // Owner + echo ""; + + echo ""; + } + + echo "
" . 'File' . " OwnerGroupOther" . 'File' . "Permissions
".$d[$i].""; + echo ""; + // echo "
"; + + echo "

"; + echo "
\n"; + echo "
\n"; +} + /* We draw the file list and button bar only if there is files here ! */ if (count($c)) { @@ -189,6 +234,7 @@ document.write("\" class= " /> " /> +" />     " /> diff --git a/bureau/class/m_bro.php b/bureau/class/m_bro.php index ffe09f39..0caebc6d 100644 --- a/bureau/class/m_bro.php +++ b/bureau/class/m_bro.php @@ -385,6 +385,42 @@ class m_bro { return true; } + /* ----------------------------------------------------------------- */ + /** Change les droits d'acces aux fichier de $d du dossier $R en $p + * @param string $R dossier dans lequel se trouve les fichiers à renommer. + * @param array of string $old Ancien nom des fichiers + * @param array of string $new Nouveau nom des fichiers + * @return boolean TRUE si les fichiers ont été renommés, FALSE si une erreur s'est produite. + */ + function ChangePermissions($R,$d,$perm) { + global $err; + $absolute=$this->convertabsolute($R,0); + if (!$absolute) { + $err->raise("bro",1); + return false; + } + for ($i=0;$i Thu, 10 Apr 2008 13:56:22 -0400