From 45e6d9670266884806431f35a4cedb80c0ceb229 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Tue, 22 Oct 2013 18:11:03 +0200 Subject: 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 --- apps/files/lib/app.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apps/files/lib') 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 -- cgit v1.2.3