+
}
\ No newline at end of file
diff --git a/src/Orchard.Web/Modules/Orchard.Setup/SetupMode.cs b/src/Orchard.Web/Modules/Orchard.Setup/SetupMode.cs
index bd77e21af..f7f185abb 100644
--- a/src/Orchard.Web/Modules/Orchard.Setup/SetupMode.cs
+++ b/src/Orchard.Web/Modules/Orchard.Setup/SetupMode.cs
@@ -45,6 +45,8 @@ namespace Orchard.Setup {
// standard services needed in setup mode
builder.RegisterModule(new MvcModule());
builder.RegisterModule(new CommandModule());
+ builder.RegisterModule(new WorkContextModule());
+
builder.RegisterType
().As().InstancePerLifetimeScope();
builder.RegisterType().As().InstancePerLifetimeScope();
builder.RegisterType().As().As().InstancePerLifetimeScope();
@@ -58,7 +60,7 @@ namespace Orchard.Setup {
builder.RegisterType().As().InstancePerLifetimeScope();
builder.RegisterType().As().InstancePerLifetimeScope();
builder.RegisterType().As().InstancePerLifetimeScope();
- builder.RegisterType().As().InstancePerMatchingLifetimeScope("shell");
+ builder.RegisterType().As().InstancePerMatchingLifetimeScope("shell");
builder.RegisterType().As().InstancePerLifetimeScope();
builder.RegisterType().As().InstancePerLifetimeScope();
builder.RegisterType().As().InstancePerLifetimeScope();
diff --git a/src/Orchard.Web/Modules/Orchard.Users/Services/UserService.cs b/src/Orchard.Web/Modules/Orchard.Users/Services/UserService.cs
index ae4951d35..a1ed2f3fc 100644
--- a/src/Orchard.Web/Modules/Orchard.Users/Services/UserService.cs
+++ b/src/Orchard.Web/Modules/Orchard.Users/Services/UserService.cs
@@ -38,32 +38,30 @@ namespace Orchard.Users.Services {
public ILogger Logger { get; set; }
public string VerifyUserUnicity(string userName, string email) {
- IEnumerable allUsers = _contentManager.Query().List();
+ string normalizedUserName = userName.ToLower();
- foreach (var user in allUsers) {
- if (String.Equals(userName.ToLower(), user.NormalizedUserName, StringComparison.OrdinalIgnoreCase)) {
- return "A user with that name already exists";
- }
- if (String.Equals(email, user.Email, StringComparison.OrdinalIgnoreCase)) {
- return "A user with that email already exists";
- }
+ if (_contentManager.Query()
+ .Where(user =>
+ user.NormalizedUserName == normalizedUserName ||
+ user.Email == email)
+ .List().Any()) {
+ return "User with that username and/or email already exists.";
}
return null;
}
public string VerifyUserUnicity(int id, string userName, string email) {
- IEnumerable allUsers = _contentManager.Query().List();
- foreach (var user in allUsers) {
- if (user.Id == id)
- continue;
- if (String.Equals(userName.ToLower(), user.NormalizedUserName, StringComparison.OrdinalIgnoreCase)) {
- return "A user with that name already exists";
- }
- if (String.Equals(email, user.Email, StringComparison.OrdinalIgnoreCase)) {
- return "A user with that email already exists";
- }
+ string normalizedUserName = userName.ToLower();
+
+ if (_contentManager.Query()
+ .Where(user =>
+ user.NormalizedUserName == normalizedUserName ||
+ user.Email == email)
+ .List().Any(user => user.Id != id)) {
+ return "User with that username and/or email already exists.";
}
+
return null;
}
diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css
index 100725b95..2fa19a380 100644
--- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css
+++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Site.css
@@ -321,26 +321,25 @@ nav ul
/* Main
***************************************************************/
-/* Blogs */
-.blog-description { font-size: 1.231em; }
-.blog-post .tags { margin-top: 12px; }
-.blog-post .tags a { background-color: #dbdbdb; padding: 3px; color: #434343; }
-.blog-post .tags a:hover { background-color: #434343; padding: 3px; color: #fff; }
-.blog-posts { padding: 0; margin: 0; list-style: none; }
-.blog-posts li { padding: 0; margin: 0; }
-.blog-posts .blog-post { border-top: 1px solid #dbdbdb; padding: 6px 0 6px 0; }
-.blog-posts .blog-post header {}
-.blog-posts .blog-post header h1 { font-size: 1.308em; }
-.blog-posts .blog-post header h1 a { color: #434343; }
-.blog-posts .blog-post header h1 a:hover {}
-.blog-posts .blog-post .tags { margin-top: 12px; }
-.blog-posts .blog-post .tags a { background-color: #dbdbdb; padding: 3px; color: #434343; }
-.blog-posts .blog-post .tags a:hover { background-color: #434343; padding: 3px; color: #fff; text-decoration: none; }
-.blog-posts .blog-post .metadata { margin: 0 0 12px 0; color: #999; font-size: 0.846em; }
-.blog-posts .blog-post .metadata .published { display: inline; margin: 0 6px 0 0; }
-.blog-posts .blog-post .metadata .commentcount { display: inline; }
-.blog-post {}
-.blog-post-title {}
+/* Content lists and details */
+.content-description { font-size: 1.154em; }
+.content-items { padding: 0; margin: 0; list-style: none; }
+.content-items li { padding: 0; margin: 0; }
+.content-items .content-item { border-top: 1px solid #dbdbdb; padding: 6px 0 6px 0; }
+.content-items .content-item header {}
+.content-items .content-item header h1 { font-size: 1.308em; color:#ff0000; }
+.content-items .content-item header h1 a { color: #434343; }
+.content-items .content-item header h1 a:hover {}
+
+/* Tags */
+.tags { margin-top: 12px; }
+.tags a { background-color: #dbdbdb; padding: 3px 6px; color: #434343; }
+.tags a:hover { background-color: #434343; padding: 3px; color: #fff; }
+
+/* Metadata */
+.metadata { margin: 0 0 12px 0; color: #999; font-size: 0.846em; }
+.metadata .published { display: inline; margin: 0 6px 0 0; }
+.metadata .commentcount { display: inline; }
.meta {}
/* Comments */
@@ -359,38 +358,6 @@ nav ul
.comment-disabled {}
.comment-count { font-size: 1.231em; }
-/* Tag Search */
-.tagged-posts {}
-.tagged-posts { padding: 0; margin: 0; list-style: none; }
-.tagged-posts li { padding: 0; margin: 0; }
-.tagged-posts .blog-post { border-top: 1px solid #dbdbdb; padding: 6px 0 6px 0; }
-.tagged-posts .blog-post header {}
-.tagged-posts .blog-post header h1 { font-size: 1.308em; }
-.tagged-posts .blog-post header h1 a { color: #434343; }
-.tagged-posts .blog-post header h1 a:hover {}
-.tagged-posts .blog-post .tags { margin-top: 12px; }
-.tagged-posts .blog-post .tags a { background-color: #dbdbdb; padding: 3px; color: #434343; }
-.tagged-posts .blog-post .tags a:hover { background-color: #434343; padding: 3px; color: #fff; text-decoration: none; }
-.tagged-posts .blog-post .metadata { margin: 0 0 12px 0; color: #999; font-size: 1.1em; }
-.tagged-posts .blog-post .metadata .published { display: inline; margin: 0 6px 0 0; }
-.tagged-posts .blog-post .metadata .commentcount { display: inline; }
-
-/* Search Results */
-.search-results {}
-.search-results { padding: 0; margin: 0; list-style: none; }
-.search-results li { padding: 0; margin: 0; }
-.search-results .blog-post { border-top: 1px solid #dbdbdb; padding: 6px 0 6px 0; }
-.search-results .blog-post header {}
-.search-results .blog-post header h1 { font-size: 1.308em; }
-.search-results .blog-post header h1 a { color: #434343; }
-.search-results .blog-post header h1 a:hover {}
-.search-results .blog-post .tags { margin-top: 12px; }
-.search-results .blog-post .tags a { background-color: #dbdbdb; padding: 3px; color: #434343; }
-.search-results .blog-post .tags a:hover { background-color: #434343; padding: 3px; color: #fff; text-decoration: none; }
-.search-results .blog-post .metadata { margin: 0 0 12px 0; color: #999; font-size: 0.846em; }
-.search-results .blog-post .metadata .published { display: inline; margin: 0 6px 0 0; }
-.search-results .blog-post .metadata .commentcount { display: inline; }
-
/* Confirmations */
.message, .validation-summary-errors { margin:10px 0 4px 0; padding:4px; }
.messages a { font-weight:bold; }
@@ -455,18 +422,11 @@ nav ul
/* Widgets
***************************************************************/
.widgets {}
+.widget h1 { font-size: 1.077em; }
/* Search */
/* Search widget shuld go into the sidebar for proper styling */
/* TODO: (mibach) Generic any zone compatible search widget */
-.widget-search-form
-{
- position: absolute;
- top: 30px;
- right: 12px;
-}
-.widget-search-form h1 { font-size: 1.077em; }
-
.search-form {}
.search-form input[type="text"] { float: left; }
.search-form button[type="submit"] { float: left; margin: 0; margin-left: 6px; }
@@ -477,12 +437,6 @@ nav ul
.widget-control .manage-actions { position:absolute; top: 0px; right: 0px; }
.widget-control .manage-actions a { display: block; background-color: #dbdbdb; color: #434343; padding: 3px 6px; }
.widget-control .manage-actions a:hover { background-color: #434343; color: #fff; text-decoration: none; }
-.widget-control .widget-search-form /* TODO: (mibach) Remove special case for Search Widget */
-{
- position: absolute;
- top: 0px;
- right: 12px;
-}
/* Content Mode */
.content-control { position: relative; border: 1px dotted #5f97af; }
diff --git a/src/Orchard/Environment/DefaultWorkContextAccessor.cs b/src/Orchard/Environment/WorkContextAccessor.cs
similarity index 60%
rename from src/Orchard/Environment/DefaultWorkContextAccessor.cs
rename to src/Orchard/Environment/WorkContextAccessor.cs
index 9a2c6816f..307ed2dd2 100644
--- a/src/Orchard/Environment/DefaultWorkContextAccessor.cs
+++ b/src/Orchard/Environment/WorkContextAccessor.cs
@@ -1,13 +1,11 @@
using System;
using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Linq;
using System.Web;
using Autofac;
using Orchard.Mvc;
namespace Orchard.Environment {
- public class DefaultWorkContextAccessor : IWorkContextAccessor {
+ public class WorkContextAccessor : IWorkContextAccessor {
readonly ILifetimeScope _lifetimeScope;
readonly IHttpContextAccessor _httpContextAccessor;
@@ -18,7 +16,7 @@ namespace Orchard.Environment {
[ThreadStatic]
static ConcurrentDictionary