echo "</table></form>\n";
    echo "<hr />\n";
}
/* [ML] Changer les permissions : */
if ($formu == 2 && !empty($actperms) && count($d)) {
    echo "<form action=\"bro_main.php\" method=\"post\">\n";
    echo "<input type=\"hidden\" name=\"R\" value=\"{$R}\" />\n";
    echo "<input type=\"hidden\" name=\"formu\" value=\"7\" />\n";
    echo "<p>" . _("Permissions") . "</p>";
    $tmp_absdir = $bro->convertabsolute($R, 0);
    echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"0\">";
    echo "<tr>";
    echo "<th>" . _("File") . "</th><th>" . _("Permissions") . "</th>";
    echo "</tr>";
    for ($i = 0; $i < count($d); $i++) {
        $d[$i] = ssla($d[$i]);
        $stats = stat($tmp_absdir . '/' . $d[$i]);
        $modes = $stats[2];
        echo "<tr>";
        echo "<td>" . $d[$i] . "</td>";
        // Owner
        echo "<td>";
        echo "<input type=\"hidden\" name=\"d[{$i}]\" value=\"" . $d[$i] . "\" />";
        echo "<label for=\"permw{$i}\">" . _("write") . "</label> <input type=\"checkbox\" id=\"permw{$i}\" name=\"perm[{$i}][w]\" value=\"1\" " . ($modes & 0200 ? 'checked="checked"' : '') . " />";
        echo "</td>";
        echo "</tr>";
    }
    echo "</table>";
    echo "<p><input type=\"submit\" class=\"inb\" name=\"submit\" value=\"" . _("Change permissions") . "\" /></p>";
    echo "</form>\n";
    echo "<hr />\n";
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 To read the license please visit http://www.gnu.org/copyleft/gpl.html
 ----------------------------------------------------------------------
 Original Author of file: Benjamin Sonntag
 Purpose of file: Editor of the browser
 ----------------------------------------------------------------------
*/
require_once "../class/config.php";
$fields = array("editfile" => array("request", "string", ""), "texte" => array("post", "string", ""), "save" => array("post", "string", ""), "saveret" => array("post", "string", ""), "cancel" => array("post", "string", ""), "R" => array("request", "string", ""));
getFields($fields);
$editfile = ssla($editfile);
$texte = ssla($texte);
$R = $bro->convertabsolute($R, 1);
$p = $bro->GetPrefs();
if (isset($cancel) && $cancel) {
    include "bro_main.php";
    exit;
}
if (isset($saveret) && $saveret) {
    if ($bro->save($editfile, $R, $texte)) {
        $error = sprintf(_("Your file %s has been saved"), $editfile) . " (" . format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s")) . ")";
    } else {
        $error = $err->errstr();
    }
    include "bro_main.php";
    exit;
}
Exemple #3
0
 /**
  * Copy many files from point A to point B
  * 
  * @global m_err $err
  * @param array $d List of files to move
  * @param string $old 
  * @param string $new 
  * @return boolean
  */
 function CopyFile($d, $old, $new)
 {
     global $err;
     $old = $this->convertabsolute($old, false);
     if (!$old) {
         $err->raise("bro", _("File or folder name is incorrect"));
         return false;
     }
     $new = $this->convertabsolute($new, false);
     if (!$new) {
         $err->raise("bro", _("File or folder name is incorrect"));
         return false;
     }
     if ($old == $new) {
         $err->raise("bro", _("You cannot move or copy a file to the same folder"));
         return false;
     }
     for ($i = 0; $i < count($d); $i++) {
         $d[$i] = ssla($d[$i]);
         // strip slashes if needed
         if (!strpos($d[$i], "/") && file_exists($old . "/" . $d[$i]) && !file_exists($new . "/" . $d[$i])) {
             $this->CopyOneFile($old . "/" . $d[$i], $new);
         }
     }
     return true;
 }