- make sure the drop box folder is used, even if the user has a login

name like '../user'
This commit is contained in:
steinm 2013-02-08 15:03:53 +00:00
parent 315fe7ac55
commit 39b4638134

View File

@ -50,17 +50,22 @@ var targetName = document.<?php echo $form?>.dropfolderfile<?php print $form ?>;
$this->contentContainerStart();
$dir = $dropfolderdir.'/'.$user->getLogin();
if(is_dir($dir)) {
$d = dir($dir);
echo "<table>\n";
while (false !== ($entry = $d->read())) {
if($entry != '..' && $entry != '.') {
if(!is_dir($entry)) {
echo "<tr><td><span style=\"cursor: pointer;\" onClick=\"targetName.value = '".$entry."'; window.close();\">".$entry."</span></td><td align=\"right\">".LetoDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td></tr>\n";
/* Check if we are still looking in the configured directory and
* not somewhere else, e.g. if the login was '../test'
*/
if(dirname($dir) == $dropfolderdir) {
if(is_dir($dir)) {
$d = dir($dir);
echo "<table>\n";
while (false !== ($entry = $d->read())) {
if($entry != '..' && $entry != '.') {
if(!is_dir($entry)) {
echo "<tr><td><span style=\"cursor: pointer;\" onClick=\"targetName.value = '".$entry."'; window.close();\">".$entry."</span></td><td align=\"right\">".LetoDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td></tr>\n";
}
}
}
echo "</table>\n";
}
echo "</table>\n";
}
$this->contentContainerEnd();