Skip to content

Commit

Permalink
Merge pull request #69 from periface/AbpCinotamDev
Browse files Browse the repository at this point in the history
Abp cinotam dev
  • Loading branch information
periface authored Nov 17, 2016
2 parents 5232a58 + e263d88 commit c2483d7
Show file tree
Hide file tree
Showing 37 changed files with 763 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<text name="PleaseEnterLoginInformation" value="Please enter login information" />
<text name="InvalidUserNameOrPassword" value="Invalid user name or password" />
<text name="UserDeleted" value="User deleted" />
<text name="UserCreated" value="User created" />
<text name="UserCreated" value="User created/edited" />
<text name="UserDeletedByUser" value="The user {userName} has deleted the user {userNameDeleted}!"/>
<text name="ProfilePicture" value="Profile picture" />
<text name="MyInfo" value="My info"/>
Expand Down Expand Up @@ -329,20 +329,55 @@
<text name="Features" value="Features"/>
<text name="Price" value="Price"/>
<text name="DeleteEdition" value="The edition will be deleted?"/>
<text name="EditionCreated" value="Edition: {editionName} created"/>
<text name="EditionDeleted" value="Edition: {editionName} deleted"/>
<text name="EditionCreatedNotification" value="Edition: {editionName} created by user {userName}"/>
<text name="EditionDeletedNotification" value="Edition: {editionName} deleted by user {userName}"/>
<text name="EditionDeletedForTenant" value="Your current edition: {editionName} was deleted please contact support"/>
<text name="EditionDeleted" value="Edition deleted"/>
<!--Tenants-->
<text name="TenantManagement" value="Tenant management"/>
<text name="SetEdition" value="Set edition"/>
<text name="EnableFeatures" value="Enable features"/>
<text name="SetTenantEdition" value="Set edition"/>
<text name="TenantCreated" value="A new tenant was created {0}, by user {1}"/>
<text name="TenantDelete" value="A tenant was deleted {0}, by user {1}"/>
<text name="TenantCreated" value="A new tenant was created: {tenancyName}, by user {userName}"/>
<text name="TenantDeleted" value="A tenant was deleted: {tenancyName}, by user {userName}"/>
<text name="TenantFeaturesChanged" value="Features for tenant {0} changed by user {1}"/>
<text name="TenantEditionChanged" value="Edition for tenant {tenantName} was changed to {editionName} by user {userName}"/>
<text name="EditionChanged" value="Edition {editionName} was modified by user {userName}"/>

<text name="YourEditionWasChanged" value="Your edition was changed"/>
<text name ="TenantWillBeDeleted" value="The tenant will be deleted"/>
<text name="RestoreTenant" value="Restore tenant"/>
<text name="SetTenantFeatures" value="Set tenant features" />
<text name="DeleteTenant" value="Delete tenant"/>
<text name="PasswordChanged" value="Password changed"/>
<text name="ShouldChangePassword" value="If this is your first login, click here to change your password"/>
<text name="ShouldChangePasswordOnLogin" value="Should change password on login"/>
<text name="NewPassword" value="New password"/>
<text name="TenantRestored" value="Tenant: {tenancyName} restored by user {userName}"/>
<text name="SubscribeToNotificationsTenantDeleted" value="Tenant deleted notification"/>
<text name="SubscribeToNotificationsTenantEditionChanged" value="Tenant edition changed notification"/>
<text name="SubscribeToNotificationsTenantEditionDeleted" value="Tenant edition deleted notification"/>
<text name="SubscribeToNotificationsTenantCreated" value="Tenant created notification"/>
<text name="SubscribeToNotificationsTenantRestored" value="Tenant restored notification"/>
<text name="SubscribeToNotificationsTenantEditionCreated" value="Edition created notification"/>
<text name="SubscribeToNotificationsTenantEditionEdited" value="Edition modified notification"/>
<text name="SubscribeToNotificationsTenantEditionAssigned" value="Edition assigned notification"/>
<text name="YourEmailIsNotConfirmed" value="Your email is not confirmed, please check your inbox or your junk folder"/>
<text name="Resend" value="Re-send email"/>
<text name="ClickHereToConfirm" value="Click here to confirm your email address"/>
<text name="EmailConfirmationUrl" value="Welcome to the very best website of the UNIVERSE!!! [Awesome CGI Explosion]: "/>
<text name="EmailVerificationCode" value="Cinotam email confirmation"/>
<text name="EmailConfirmed" value="Awesome! your email has been confirmed"/>
<text name="EmailIsConfirmed" value="Email confirmed"/>
<text name="ForgottenPasswordRecovery" value="Forgotten password form"/>
<text name="ForgottenPassword" value="I forgot my password >:( "/>
<text name="SessionExpired" value="Session expired"/>
<text name="ConfirmLogin" value="Confirm login"/>
<text name="Confirm" value="Confirm"/>
<text name="SetNewPassword" value="Set new password"/>
<text name="RecoverPasswordMessage" value="Please provide us the email associated with your account"/>
<text name="RecoveryMessageSent" value="A recovery message was sent to the provided email account, please read it for further instructions"/>
<text name="PasswordReset" value="Cinotam password recovery"/>
<text name="PasswordResetUrl" value="Your password recovery link"/>
<text name="ClickHereToResetPassword" value="Click here to reset password"/>
</texts>
</localizationDictionary>
1 change: 1 addition & 0 deletions Cinotam.AbpModuleZero.Core/Users/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class User : AbpUser<User>
public bool IsPictureOnCdn { get; set; }
public string CountryPhoneCode { get; set; }
public string CountryCode { get; set; }
public bool ShouldChangePasswordOnLogin { get; set; }
public static string CreateRandomPassword()
{
return Guid.NewGuid().ToString("N").Truncate(16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@
<Compile Include="Migrations\201611041955460_SimpleChat.Designer.cs">
<DependentUpon>201611041955460_SimpleChat.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201611171642024_UserShouldChangePassword.cs" />
<Compile Include="Migrations\201611171642024_UserShouldChangePassword.Designer.cs">
<DependentUpon>201611171642024_UserShouldChangePassword.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\AbpZeroDbMigrator.cs" />
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="AbpModuleZeroDataModule.cs" />
Expand Down Expand Up @@ -346,6 +350,9 @@
<EmbeddedResource Include="Migrations\201611041955460_SimpleChat.resx">
<DependentUpon>201611041955460_SimpleChat.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201611171642024_UserShouldChangePassword.resx">
<DependentUpon>201611171642024_UserShouldChangePassword.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Cinotam.AbpModuleZero.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class UserShouldChangePassword : DbMigration
{
public override void Up()
{
AddColumn("dbo.AbpUsers", "ShouldChangePasswordOnLogin", c => c.Boolean(nullable: false));
}

public override void Down()
{
DropColumn("dbo.AbpUsers", "ShouldChangePasswordOnLogin");
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<Compile Include="DatatablesJsModels\ReflectionHelpers\InputBuilder.cs" />
<Compile Include="DatatablesJsModels\ReflectionHelpers\QueryableHelper.cs" />
<Compile Include="Extensions\HtmlCleaner.cs" />
<Compile Include="Extensions\ServerHelpers.cs" />
<Compile Include="Extensions\Slugger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
16 changes: 16 additions & 0 deletions Cinotam.AbpModuleZero.Tools/Extensions/ServerHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Web;

namespace Cinotam.AbpModuleZero.Tools.Extensions
{
public static class ServerHelpers
{
public static string GetServerUrl(HttpRequestBase request)
{
if (request.Url == null) return string.Empty;
var strPathAndQuery = request.Url.PathAndQuery;
var strUrl = request.Url.AbsoluteUri.Replace(strPathAndQuery, "/");
strUrl = strUrl.Remove(strUrl.Length - 1);
return strUrl;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Abp.Application.Navigation;
using Abp.Configuration.Startup;
using Abp.Localization;
using Abp.Runtime.Session;
using Abp.Threading;
using Abp.Web.Mvc.Authorization;
using Cinotam.AbpModuleZero.Users;
using Cinotam.AbpModuleZero.Web.Controllers;
using Cinotam.AbpModuleZero.Web.Models.Layout;
using Cinotam.ModuleZero.AppModule.Sessions;
using Microsoft.AspNet.SignalR.Hubs;
using System.Collections.Generic;
using System.Web.Mvc;

Expand All @@ -16,21 +17,17 @@ public class LayoutController : AbpModuleZeroControllerBase
{
// GET: SysAdmin/Layout
private readonly IUserNavigationManager _userNavigationManager;
private readonly ILocalizationManager _localizationManager;
private readonly ISessionAppService _sessionAppService;
private readonly IMultiTenancyConfig _multiTenancyConfig;
private readonly ILanguageManager _languageManager;
private readonly UserManager _userManager;
public LayoutController(
IUserNavigationManager userNavigationManager,
ILocalizationManager localizationManager,
ISessionAppService sessionAppService,
IMultiTenancyConfig multiTenancyConfig, ILanguageManager languageManager)
ISessionAppService sessionAppService, ILanguageManager languageManager, UserManager userManager)
{
_userNavigationManager = userNavigationManager;
_localizationManager = localizationManager;
_sessionAppService = sessionAppService;
_multiTenancyConfig = multiTenancyConfig;
_languageManager = languageManager;
_userManager = userManager;
}
[ChildActionOnly]
public PartialViewResult LanguageSelection()
Expand Down Expand Up @@ -77,6 +74,14 @@ public ActionResult ChatMenu()


}

public ViewResult ShouldChangePasswordMessage()
{
if (!AbpSession.UserId.HasValue) throw new NotAuthorizedException();
var user = AsyncHelper.RunSync(() => _userManager.GetUserByIdAsync(AbpSession.UserId.Value));
return View(user.ShouldChangePasswordOnLogin);
}

public ActionResult GetMenu(string menuName)
{
var model = new TopMenuViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@model bool
@{
Layout = null;
}


@if (Model)
{
<div class="alert alert-info">
<a data-modal href="@Url.Action("ChangePassword","Users")">@L("ShouldChangePassword")</a>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
@{ Html.RenderPartialIf("_Aside", Request.IsAuthenticated); }
<div id="main" role="main">
@{ Html.RenderPartialIf("_Ribbon", Request.IsAuthenticated); }

@{ Html.RenderAction("ShouldChangePasswordMessage", "Layout"); }


@RenderBody()

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</section>
<section>
<div class="row">
<label class="label col col-2">@L("Password")</label>
<label class="label col col-2">@L("NewPassword")</label>
<div class="col col-10">
<label class="input">
<i class="icon-append fa fa-lock"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@L("RegisterUserForm")
</header>
@Html.HiddenFor(a => a.Id)
@Html.HiddenFor(a=>a.Password)
<fieldset>
<section>
<div class="row">
Expand Down Expand Up @@ -100,7 +101,18 @@
</label>
</section>
}

<section>
<label class="checkbox">
@Html.CheckBoxFor(a => a.ShouldChangePasswordOnLogin)
<i></i>@L("ShouldChangePasswordOnLogin")
</label>
</section>
<section>
<label class="checkbox">
@Html.CheckBoxFor(a => a.IsEmailConfirmed)
<i></i>@L("EmailIsConfirmed")
</label>
</section>
</fieldset>
<footer>
<button type="submit" class="btn btn-primary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
var sendNotificationMail = $("#SendNotificationMail");
var isTwoFactorEnabled = $("#IsTwoFactorEnabled");
var isActive = $("#IsActive");
var shouldChangePasswordOnLogin = $("#ShouldChangePasswordOnLogin");
var isEmailConfirmed = $("#IsEmailConfirmed");
var self = this;
e.preventDefault();
var url = $(self).attr("action");
var data = $(self).serializeFormToObject();
data.IsActive = isActive.is(":checked");
data.ShouldChangePasswordOnLogin = shouldChangePasswordOnLogin.is(":checked");
data.SendNotificationMail = sendNotificationMail.is(":checked");
data.IsTwoFactorEnabled = isTwoFactorEnabled.is(":checked");
data.IsEmailConfirmed = isEmailConfirmed.is(":checked");
abp.ui.setBusy($form, abp.ajax({
url: url,
data: JSON.stringify(data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@
@L("SubscribeToNotificationRoleEdited")
</label>
</div>
<div class="col col-6">
<div class="col col-6">

<label>
<input data-subscription data-subscription-name="@NotificationNames.RoleDeleted" type="checkbox" />
<i></i>
@L("SubscribeToNotificationRoleDeleted")
</label>
</div>
<label>
<input data-subscription data-subscription-name="@NotificationNames.RoleDeleted" type="checkbox" />
<i></i>
@L("SubscribeToNotificationRoleDeleted")
</label>
</div>
<div class="col col-6">

<label>
Expand Down Expand Up @@ -179,7 +179,7 @@
</label>
</div>
}

@if (IsGranted(PermissionNames.PagesSysAdminConfiguration))
{
<div class="col col-6">
Expand Down Expand Up @@ -225,6 +225,49 @@
@L("SubscribeToNotificationsTenantEditionChanged")
</label>
</div>






<div class="col col-6">

<label>
<input data-subscription data-subscription-name="@NotificationNames.EditionCreated" type="checkbox" />
<i></i>
@L("SubscribeToNotificationsTenantEditionCreated")
</label>
</div>
<div class="col col-6">

<label>
<input data-subscription data-subscription-name="@NotificationNames.EditionEdited" type="checkbox" />
<i></i>
@L("SubscribeToNotificationsTenantEditionEdited")
</label>
</div>



<div class="col col-6">

<label>
<input data-subscription data-subscription-name="@NotificationNames.EditionDeleted" type="checkbox" />
<i></i>
@L("SubscribeToNotificationsTenantEditionDeleted")
</label>
</div>


<div class="col col-6">

<label>
<input data-subscription data-subscription-name="@NotificationNames.EditionAssigned" type="checkbox" />
<i></i>
@L("SubscribeToNotificationsTenantEditionAssigned")
</label>
</div>
}
</div>
</section>
Expand Down
Loading

0 comments on commit c2483d7

Please sign in to comment.