Skip to content

Commit

Permalink
0.55.0
Browse files Browse the repository at this point in the history
This closes #61 and closes #62
  • Loading branch information
coni2k committed Jun 8, 2016
1 parent 07a2b9e commit 8f2530e
Show file tree
Hide file tree
Showing 53 changed files with 924 additions and 437 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
### Changelog

**0.55.0**

* Auto register with guest account
https://github.com/forCrowd/WealthEconomy/issues/61
* login.html & register.html was updated accordingly
* registerLogin.html was removed
* Allow login with email address
https://github.com/forCrowd/WealthEconomy/issues/62
* Both Profile (/[username]) and New CMRP (/[username]/new) routes now correctly check 'username' for both against local (currentUser) & remote
* README.md updates
* favicon.ico update
* New css definitions

**0.54.0**

* Ignore 'anonymous users' in 'Reset Password' case
Expand Down
3 changes: 1 addition & 2 deletions Facade/RoleManager.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace forCrowd.WealthEconomy.Facade
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.DataObjects;
using BusinessObjects;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;

Expand Down
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,44 @@

An experimental, open source crowd investment platform

---
## Setup

#### Setup
### Build and run

To build and run the project:
* If you don't already have it installed, download and install [node.js](https://nodejs.org/)
* Open the solution with Visual Studio, it will restore node & bower packages
* Build the solution and restore nuget packages
* Optional: Update the files under "WebApi\Configs" and "ngClient\js\appSettings" folders with your own settings
* Optional: Update the files under "WebApi\Configs" and "ngClient\\_system\js\appSettings" folders with your own settings
* Run both "WebApi" and "ngClient" projects
* Navigate to [http://localhost:15002/](http://localhost:15002/) with your browser

### Deployment

Configuration files are excluded from deploy (Build Action: 'None').
When deploying the project, update following configuration files with your own settings and manually copy them:
* WebApi\googleanalytics.js
* WebApi\Web.config
* WebApi\Configs\\*.config
* ngClient\Web.config
* ngClient\\_system\js\appSettings\appSettings.js

### Jasmine tests

To be able add "Jasmine" tests under "ngClient.Tests" folder into "Test Explorer" window, install the following extension:
* [Chutzpah Test Adapter for the Test Explorer](https://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe)

### T4 files

To be able run Entity Framework related T4 files (.tt files that include "EF6.Utility.ttinclude" file):
* After restoring nuget packages, find and copy "EntityFramework.dll" and "EntityFramework.SqlServer.dll" files under "[Solution Folder]\packages" folder
* Go to "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE" folder
* Optional: Take a backup of the existing files
* Paste these two files into this folder

To be able add "Jasmine" tests under "ngClient.Tests" folder into "Test Explorer" window, install the following extension:
* [Chutzpah Test Adapter for the Test Explorer](https://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe)
## Changelog

See [Changelog.md](/CHANGELOG.md) for a detailed list.

---
## License

#### [Changelog](/CHANGELOG.md)
Wealth Economy is licensed under [MIT license](/LICENSE).
5 changes: 2 additions & 3 deletions SolutionItems/Documents/Todo.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
*** HOT ***

* try auto register again
* anonymous -> guest
* deployment details?
* field - rating edit in manage.html?
* warmup script for live?!
* cmrp list? -> search page
* content for editor? new content or new resourcepool - content in a content? or page as a new entity?
* route update (_system/)
* application manager - allows admin to update appSettings & restarts the app?

* expand('User' - brings all user info ?!?!?
http://stackoverflow.com/questions/10781309/asp-net-mvc-4-webapi-manually-handle-odata-queries
Expand Down Expand Up @@ -165,6 +163,7 @@ Or in some cases, it should do it automatically (like in resourcePoolEditor samp
* New Features

* Misc
* isAnonymous -> add as a guest role
* permissions - instead of enableresourcepooladdition field to control whether user can enter userresourcepoolrate, handle it with permissions - if the user has a right to enter or not? same goes for FieldIndex ratings
* Database performance: Suggests to create a separate username field with index http://blogs.msdn.com/b/webdev/archive/2015/02/11/improve-performance-by-optimizing-queries-for-asp-net-identity-and-other-membership-providers.aspx
* __migrationhistory createdon field error - it seems there is not much to do, it also might be about glimpse?
Expand Down
2 changes: 1 addition & 1 deletion SolutionItems/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// AssemblyFileVersion is not in use for the moment
//
[assembly: AssemblyVersion("0.54.0")]
[assembly: AssemblyVersion("0.55.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/ElementCellController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/ElementController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/ElementFieldController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/ElementItemController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/ODataController.tt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
<#= codeStringGenerator.WriteHeader() #>
namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/ResourcePoolController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/RolesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/UserClaimsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/UserLoginsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/UserRolesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
4 changes: 2 additions & 2 deletions WebApi/Controllers/OData/Generated/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace forCrowd.WealthEconomy.WebApi.Controllers.OData
{
using forCrowd.WealthEconomy.BusinessObjects;
using forCrowd.WealthEconomy.Facade;
using BusinessObjects;
using Facade;
using Results;
using System;
using System.Data.Entity;
Expand Down
24 changes: 20 additions & 4 deletions WebApi/Providers/ApplicationOAuthProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,28 @@ public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwner
}
else
{
user = await userManager.FindAsync(context.UserName, context.Password);
user = await userManager.FindAsync(userName, password);

if (user == null)
{
context.SetError("invalid_grant", "The username or password is incorrect.");
return;
// User can also login with email address
user = await userManager.FindByEmailAsync(userName);

if (user == null)
{
context.SetError("invalid_grant", "The username or password is incorrect.");
return;
}
else
{
var result = await userManager.CheckPasswordAsync(user, password);

if (!result)
{
context.SetError("invalid_grant", "The username or password is incorrect.");
return;
}
}
}
}

Expand All @@ -72,7 +88,7 @@ public override async Task TokenEndpoint(OAuthTokenEndpointContext context)
{
context.Properties.ExpiresUtc = DateTime.UtcNow.AddYears(1);
}

foreach (var property in context.Properties.Dictionary)
{
context.AdditionalResponseParameters.Add(property.Key, property.Value);
Expand Down
4 changes: 3 additions & 1 deletion WebApi/default.aspx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Wealth Economy API</title>
<meta charset="utf-8" />
<!-- Favicon -->
<link rel="shortcut icon" href="favicon.ico?v=0.55.0" />
<script src="googleanalytics.js"></script>
</head>
<body>
Expand Down
Binary file modified WebApi/favicon.ico
Binary file not shown.
Loading

0 comments on commit 8f2530e

Please sign in to comment.