Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Enhancement for User's password #49

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Lastly you need to modify the `my.config` file which contains your login informa

FunnelWeb is licensed under the New BSD license.

# Merged with original master @May 28, 2013

==============================================================================

Copyright (c) 2009, FunnelWeb Contributors
Expand Down
8 changes: 5 additions & 3 deletions src/FunnelWeb.Web/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ public static void RegisterBundles(BundleCollection bundles)
bundles.Add(new ScriptBundle("~/bundles/jsdate").Include("~/Scripts/jsdate.js"));
bundles.Add(new ScriptBundle("~/bundles/showdown").Include("~/Scripts/showdown.js"));
bundles.Add(new ScriptBundle("~/bundles/taggy").Include("~/Scripts/taggy.js"));
bundles.Add(new ScriptBundle("~/bundles/prettify").Include("~/Scripts/Prettify/prettify.js", "~/Scripts/Prettify/lang-*"));
bundles.Add( new Bundle( "~/bundles/prettify" ).Include( "~/Scripts/Prettify/prettify.js", "~/Scripts/Prettify/lang-*" ) );

bundles.Add(new ScriptBundle("~/bundles/site").Include("~/Scripts/site.js"));
bundles.Add(new ScriptBundle("~/bundles/wmd").Include("~/Scripts/wmd.js"));

bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/themes/base/Base.css"));
bundles.Add(new StyleBundle("~/Content/adminCss").Include("~/Content/themes/base/Base.css", "~/Content/themes/base/Admin.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/baseCss").Include("~/Content/themes/base/Base.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/adminCss").Include("~/Content/themes/base/Base.css", "~/Content/themes/base/Admin.css"));


bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
Expand Down
8 changes: 4 additions & 4 deletions src/FunnelWeb.Web/Application/Extensions/MarkupExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,16 @@ public static IHtmlString Date(this HtmlHelper html, object value)
{
var date = (DateTime)value;
return MvcHtmlString.Create(string.Format("<span class=\"date\" title=\"{0}\">{1}</span>",
date.ToString("dd MMM, yyyy HH:mm"),
date.ToString("dd MMM, yyyy hh:mm tt")));
date.ToString( "yyyy-MM-dd HH:mm" ),
date.ToString( "yyyy-MM-dd HH:mm" ) ) );
}

public static IHtmlString DateWithoutTime(this HtmlHelper html, object value)
{
var date = (DateTime)value;
return MvcHtmlString.Create(string.Format("<span class=\"date\" title=\"{0}\">{1}</span>",
date.ToString("dd MMM, yyyy"),
date.ToString("dd MMM, yyyy")));
date.ToString( "yyyy-MM-dd" ),
date.ToString( "yyyy-MM-dd" ) ) );
}

public static MvcHtmlString RenderTrusted(this HtmlHelper html, object content, string format)
Expand Down
7 changes: 4 additions & 3 deletions src/FunnelWeb.Web/Application/Mvc/ViewBundleRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ public static void RegisterViewBundles(BundleCollection bundles)
{
string path = HttpContext.Current.Server.MapPath("Scripts/Views");

foreach (string jsFile in Directory.EnumerateFiles(path, "*.js", SearchOption.AllDirectories))
{
bundles.Add(CreateScriptBundle(jsFile, path));
if ( Directory.Exists( path ) ) {
foreach ( string jsFile in Directory.EnumerateFiles( path, "*.js", SearchOption.AllDirectories ) ) {
bundles.Add( CreateScriptBundle( jsFile, path ) );
}
}
}

Expand Down
21 changes: 14 additions & 7 deletions src/FunnelWeb.Web/Areas/Admin/Controllers/WikiAdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,21 @@ public virtual ActionResult Edit(EntryRevision model)
return View(model);
}

// Does an entry with that name already exist?
var existing = Repository.FindFirstOrDefault(new EntryByNameQuery(model.Name));
if (existing != null && existing.Id != model.Id)
var author = Authenticator.GetName();
var entry = Repository.Get<Entry>( model.Id );
if ( entry == null && CurrentEntryExistsWithName( model.Name ) )
{
model.SelectedTags = GetEditTags(model);
ModelState.AddModelError("PageExists", string.Format("A page with SLUG '{0}' already exists. You should edit that page instead.", model.Title));
ModelState.AddModelError( "PageExists", string.Format( "A page with SLUG '{0}' already exists. You should edit that page instead", model.Name ) );
return View(model);
}
if ( entry == null && CurrentEntryExistsWithName( model.Title ) && model.Name == "" ) {
model.SelectedTags = GetEditTags( model );
ModelState.AddModelError("PageExists", string.Format("A page with SLUG '{0}' already exists. Please add a unique SLUG here.", model.Title));
return View(model);
}

var author = Authenticator.GetName();

var entry = Repository.Get<Entry>(model.Id) ?? new Entry { Author = author };
entry = entry ?? new Entry { Author = author };
entry.Name = string.IsNullOrWhiteSpace(model.Name) ? model.Title.Slugify() : model.Name.ToString();
entry.PageTemplate = string.IsNullOrEmpty(model.PageTemplate) ? null : model.PageTemplate;
entry.Title = model.Title ?? string.Empty;
Expand Down Expand Up @@ -130,6 +133,10 @@ public virtual ActionResult Edit(EntryRevision model)
return RedirectToAction("Page", "Wiki", new { Area = "", page = entry.Name});
}

private bool CurrentEntryExistsWithName( string name ) {
return Repository.FindFirstOrDefault( new EntryByNameQuery( name ) ) != null;
}

private List<Tag> GetEditTags(EntryRevision model)
{
var tagList = new List<Tag>();
Expand Down
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Areas/Admin/Views/Admin/Comments.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model CommentsModel
@model FunnelWeb.Web.Areas.Admin.Views.Admin.CommentsModel
@{
ViewBag.Title = "FunnelWeb Administration - Comments";
Layout = "~/Areas/Admin/Views/Shared/_Private.cshtml";
Expand Down
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Areas/Admin/Views/Admin/PageList.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model PageListModel
@model FunnelWeb.Web.Areas.Admin.Views.Admin.PageListModel
@{
ViewBag.Title = "FunnelWeb Administration - Page List";
Layout = "~/Areas/Admin/Views/Shared/_Private.cshtml";
Expand Down
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Areas/Admin/Views/Admin/Pingbacks.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model PingbacksModel
@model FunnelWeb.Web.Areas.Admin.Views.Admin.PingbacksModel
@{
ViewBag.Title = "FunnelWeb Administration - Pingbacks";
Layout = "~/Areas/Admin/Views/Shared/_Private.cshtml";
Expand Down
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Areas/Admin/Views/Admin/Task.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model TaskModel
@model FunnelWeb.Web.Areas.Admin.Views.Admin.TaskModel
@{
ViewBag.Title = "FunnelWeb Administration - Task Details";
Layout = "~/Areas/Admin/Views/Shared/_Private.cshtml";
Expand Down
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Areas/Admin/Views/Admin/Tasks.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model TasksModel
@model FunnelWeb.Web.Areas.Admin.Views.Admin.TasksModel
@{
ViewBag.Title = "FunnelWeb Administration - Task List";
Layout = "~/Areas/Admin/Views/Shared/_Private.cshtml";
Expand Down
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Areas/Admin/Views/Shared/_Private.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>@(ViewBag.Title == null ? "" : (ViewBag.Title + " - "))@Html.Settings().SiteTitle
</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@Styles.Render("~/Content/adminCss")
@Styles.Render("~/Content/themes/base/adminCss")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/jquery")

Expand Down
8 changes: 4 additions & 4 deletions src/FunnelWeb.Web/My.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<funnelweb xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<setting key="funnelweb.configuration.database.connection" value="database=FunnelWeb;server=.\SQLEXPRESS;trusted_connection=true;" />
<setting key="funnelweb.configuration.database.schema" value="dbo" />
<setting key="funnelweb.configuration.authentication.username" value="test" />
<setting key="funnelweb.configuration.authentication.password" value="test" />
<setting key="funnelweb.configuration.database.connection" value="database=funnelweb;server=.\SQLEXPRESS;trusted_connection=true;" />
<setting key="funnelweb.configuration.database.schema" value="funnel" />
<setting key="funnelweb.configuration.authentication.username" value="user_install" />
<setting key="funnelweb.configuration.authentication.password" value="pw_install_1234567" />
<setting key="funnelweb.configuration.database.provider" value="sql" />
</funnelweb>
2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Scripts/Prettify/lang-apollo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/FunnelWeb.Web/Scripts/Prettify/lang-basic.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Scripts/Prettify/lang-clj.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
limitations under the License.
*/
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
["typ",/^:[\dA-Za-z-]+/]]),["clj"]);
4 changes: 2 additions & 2 deletions src/FunnelWeb.Web/Scripts/Prettify/lang-css.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/FunnelWeb.Web/Scripts/Prettify/lang-dart.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/FunnelWeb.Web/Scripts/Prettify/lang-erlang.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Scripts/Prettify/lang-go.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Scripts/Prettify/lang-hs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/FunnelWeb.Web/Scripts/Prettify/lang-lisp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/FunnelWeb.Web/Scripts/Prettify/lang-llvm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/FunnelWeb.Web/Scripts/Prettify/lang-lua.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading