diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-10-22 18:11:03 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-10-22 18:11:03 +0200 |
commit | 45e6d9670266884806431f35a4cedb80c0ceb229 (patch) | |
tree | f1826a6b1dc97cf2ee92b99f2569f1ea59112ae5 /apps/files/lib | |
parent | cadd71ec8a02fc5619a9347109f9e588e13b3e3b (diff) | |
download | nextcloud-server-45e6d9670266884806431f35a4cedb80c0ceb229.tar.gz nextcloud-server-45e6d9670266884806431f35a4cedb80c0ceb229.zip |
prevent user from creating or renaming sth. to an existing filename
- show tooltip when violating naming constraints while typing
- when target filename exists on server fallback to dialog to interrupt the users flow because something unexpected went wrong
- fixes #5062
- also fixes some whitespace and codestyle issues in files js
- uses css selector over filterAttr in touched js files
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/app.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php index 579e8676cfc..ccf629ae3cb 100644 --- a/apps/files/lib/app.php +++ b/apps/files/lib/app.php @@ -52,7 +52,15 @@ class App { $result['data'] = array( 'message' => $this->l10n->t("Invalid folder name. Usage of 'Shared' is reserved by ownCloud") ); - } elseif( + // rename to existing file is denied + } else if ($this->view->file_exists($dir . '/' . $newname)) { + + $result['data'] = array( + 'message' => $this->l10n->t( + "The name %s is already used in the folder %s. Please choose a different name.", + array($newname, $dir)) + ); + } else if ( // rename to "." is denied $newname !== '.' and // rename of "/Shared" is denied |