().Where(u => u.NormalizedUserName == lowerName || u.Email == lowerName).List().FirstOrDefault();
if (user != null) {
diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml
index c2152cb8d..f3bd89337 100644
--- a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml
+++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml
@@ -69,7 +69,7 @@
@Html.ActionLink(T("Edit").ToString(), "Edit", new { entry.User.Id }) |
- @Html.ActionLink(T("Delete").ToString(), "Delete", new { entry.User.Id }) |
+ @Html.ActionLink(T("Delete").ToString(), "Delete", new { entry.User.Id}, new { itemprop = "RemoveUrl UnsafeUrl" }) |
@if (entry.User.RegistrationStatus == UserStatus.Pending) {
@Html.ActionLink(T("Approve").ToString(), "Approve", new { entry.User.Id })
} else {
diff --git a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs
index 79a2eb717..980c1fefa 100644
--- a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs
+++ b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs
@@ -135,8 +135,18 @@ namespace Orchard.FileSystems.Media {
/// The relative path to the folder to be created.
/// True if success; False otherwise.
public bool TryCreateFolder(string path) {
- try { CreateFolder(path); }
- catch { return false; }
+ try {
+ // prevent unnecessary exception
+ DirectoryInfo directoryInfo = new DirectoryInfo(MapStorage(path));
+ if (directoryInfo.Exists) {
+ return false;
+ }
+
+ CreateFolder(path);
+ }
+ catch {
+ return false;
+ }
return true;
}
@@ -250,8 +260,12 @@ namespace Orchard.FileSystems.Media {
/// The stream to be saved.
/// True if success; False otherwise.
public bool TrySaveStream(string path, Stream inputStream) {
- try { SaveStream(path, inputStream); }
- catch { return false; }
+ try {
+ SaveStream(path, inputStream);
+ }
+ catch {
+ return false;
+ }
return true;
}
@@ -334,6 +348,10 @@ namespace Orchard.FileSystems.Media {
return new FileStream(_fileInfo.FullName, FileMode.Open, FileAccess.ReadWrite);
}
+ public Stream CreateFile() {
+ return new FileStream(_fileInfo.FullName, FileMode.Truncate, FileAccess.ReadWrite);
+ }
+
#endregion
}
diff --git a/src/Orchard/FileSystems/Media/IStorageFile.cs b/src/Orchard/FileSystems/Media/IStorageFile.cs
index 1f33ed907..a92359f11 100644
--- a/src/Orchard/FileSystems/Media/IStorageFile.cs
+++ b/src/Orchard/FileSystems/Media/IStorageFile.cs
@@ -18,5 +18,11 @@ namespace Orchard.FileSystems.Media {
/// Creates a stream for writing to the file.
///
Stream OpenWrite();
+
+ ///
+ /// Creates a stream for writing to the file, and truncates the existing content.
+ ///
+ Stream CreateFile();
+
}
}
\ No newline at end of file
|