Skip to content

Commit

Permalink
Merge pull request #105 from UpendoVentures/dev
Browse files Browse the repository at this point in the history
Syncing branches for 1.4.1 release
  • Loading branch information
WillStrohl authored Dec 10, 2024
2 parents f74bcb2 + a98820f commit 67854b8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 16 deletions.
16 changes: 13 additions & 3 deletions Modules/UserManager/Controllers/UserManageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public ActionResult Index(double? take, int? pageIndex, string filter, int? goTo
public ActionResult Create()
{
DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(CommonJs.DnnPlugins);
ViewBag.IsCurrentUserSuperUser = _currentUser.IsSuperUser;
return View();
}

Expand All @@ -166,6 +167,10 @@ public ActionResult Create(UserViewModel item)
{
return View(item);
}
if (!_currentUser.IsSuperUser)
{
item.IsSuperUser = false;
}
var userCreateStatus = UserRepository.CreateUser(item, portalId);
if (userCreateStatus == UserCreateStatus.Success)
{
Expand Down Expand Up @@ -201,10 +206,11 @@ public ActionResult Create(UserViewModel item)
}
string errorMessage = UserController.GetUserCreateStatus(userCreateStatus);
ModelState.AddModelError(string.Empty, errorMessage);
ViewBag.IsCurrentUserSuperUser = _currentUser.IsSuperUser;
return View(item);
}
}

public ActionResult Edit(int itemId)
{
var portalId = ModuleContext.PortalId;
Expand All @@ -221,6 +227,10 @@ public ActionResult Edit(UserViewModel item)
var portalId = ModuleContext.PortalId;
if (_currentUser.UserID != item.UserId)
{
if (!_currentUser.IsSuperUser)
{
item.IsSuperUser = false;
}
UserRepository.EditUser(portalId, item);
}
return RedirectToDefaultRoute();
Expand Down Expand Up @@ -265,8 +275,8 @@ public ActionResult BulkDelete(BulkDeleteViewModel bulkDeleteViewModel)
var userAlreadyBeenDeletedPreviously = 0;
var userMarkedDeleted = 0;
var userNotFound = 0;
var userInvalid = 0;
var userInvalid = 0;

var resultLogPermanentlyDeleted = new StringBuilder();
var resultLogAlreadyBeenDeletedPreviously = new StringBuilder();
var resultLogMarkedDeleted = new StringBuilder();
Expand Down
2 changes: 1 addition & 1 deletion Modules/UserManager/Module.css
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
margin-top: 20px;
}

.admin-manager #checkbox {
.admin-manager #checkbox, #chkCIsSuperuser {
margin-top: 20px;
margin-bottom: 20px;
height: 20px;
Expand Down
4 changes: 2 additions & 2 deletions Modules/UserManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("01.04.00")]
[assembly: AssemblyFileVersion("01.04.00")]
[assembly: AssemblyVersion("01.04.01")]
[assembly: AssemblyFileVersion("01.04.01")]
8 changes: 4 additions & 4 deletions Modules/UserManager/Upendo.UserManager.dnn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<dotnetnuke type="Package" version="6.0">
<packages>
<package name="Upendo.Modules.UserManager" type="Module" version="01.04.00">
<package name="Upendo.Modules.UserManager" type="Module" version="01.04.01">
<friendlyName>Upendo DNN User Manager</friendlyName>
<description><![CDATA[<p>The Upendo DNN User Manager empowers authorized end-users in your DNN website to be able to manage user accounts and their assigned security roles.</p>]]></description>
<iconFile>DesktopModules/MVC/Upendo.Modules.UserManager/Images/logo.png</iconFile>
Expand Down Expand Up @@ -60,7 +60,7 @@
<attributes>
<businessControllerClass>Upendo.Modules.UserManager.Components.UserManagerController, Upendo.Modules.UserManager</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<upgradeVersionsList>01.00.00,01.01.00,01.01.01,01.02.00,01.03.00,01.04.00</upgradeVersionsList>
<upgradeVersionsList>01.00.00,01.01.00,01.01.01,01.02.00,01.03.00,01.04.00,01.04.01</upgradeVersionsList>
</attributes>
</eventMessage>
</component>
Expand All @@ -69,7 +69,7 @@
<assembly>
<name>Upendo.Modules.UserManager.dll</name>
<path>bin</path>
<version>01.04.00</version>
<version>01.04.01</version>
</assembly>
</assemblies>
</component>
Expand All @@ -92,7 +92,7 @@
<script type="UnInstall">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>Uninstall.SqlDataProvider</name>
<version>01.04.00</version>
<version>01.04.01</version>
</script>
</scripts>
</component>
Expand Down
4 changes: 2 additions & 2 deletions Modules/UserManager/Upendo.UserManager_Symbols.dnn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<dotnetnuke type="Package" version="6.0">
<packages>
<package name="Upendo.Modules.UserManager_Symbols" type="Library" version="01.04.00">
<package name="Upendo.Modules.UserManager_Symbols" type="Library" version="01.04.01">
<friendlyName>Upendo DNN User Manager Symbols</friendlyName>
<description><![CDATA[Upendo DNN User Manager Extension for DNN]]></description>
<owner>
Expand All @@ -14,7 +14,7 @@
<releaseNotes src="ReleaseNotes.txt" />
<azureCompatible>True</azureCompatible>
<dependencies>
<dependency type="managedPackage" version="1.4.0">Upendo.Modules.UserManager</dependency>
<dependency type="managedPackage" version="1.4.1">Upendo.Modules.UserManager</dependency>
</dependencies>
<components>
<component type="ResourceFile">
Expand Down
12 changes: 10 additions & 2 deletions Modules/UserManager/Views/UserManage/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
</div>
<div class="col-md-12">
<div class="AMFormItem col-md-3">
@Html.CheckBoxFor(m => m.IsSuperUser, new { @id = "checkbox" })
<label>@Localization.GetString("IsSuperUser", @ResourceFile)</label>
@Html.CheckBoxFor(m => m.IsSuperUser, new { @id = "chkCIsSuperuser" })
<label for="chkCIsSuperuser">@Localization.GetString("IsSuperUser", @ResourceFile)</label>
</div>
<div class="AMFormItem col-md-3">
@Html.CheckBoxFor(m => m.Approved, new { @id = "checkbox" })
Expand All @@ -104,6 +104,14 @@
</div>
</div>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
var isCurrentUserSuperUser = @Json.Encode(ViewBag.IsCurrentUserSuperUser);
var superuserCheckbox = document.getElementById("chkCIsSuperuser");
if (superuserCheckbox) {
superuserCheckbox.disabled = !isCurrentUserSuperUser;
}
});
var weak = '@Localization.GetString("Weak.Text", @ResourceFile)';
var fair = '@Localization.GetString("Fair.Text", @ResourceFile)';
var strong = '@Localization.GetString("Strong.Text", @ResourceFile)';
Expand Down
24 changes: 22 additions & 2 deletions Modules/UserManager/releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
<p>Sponsorship is <em>Powered by GitHub Sponsors</em> and ensures that this project lives and thrives. <a href="https://github.com/sponsors/UpendoVentures" target="_blank">Please consider contributing</a> any amount.</p>
<p>THANK YOU to the following rockstars!</p>
<ul>
<li>Dan Rice, <a href="https://www.puresystems.co.uk/" target="_blank">Pure Systems</a></li>
<li>Adam Bernstein, <a href="https://practicewise.com/" target="_blank">PracticeWise</a></li>
<li>Jeremy Farrance, <a href="https://accuraty.com/" target="_blank">Accuraty</a></li>
<li><a href="https://github.com/JohnRamminger" target="_blank">John Ramminger</a></li>
<li>(<em>and two anonymous sponsors</em>)</li>
<li>(<i>two private sponsors</i>)</li>
</ul>

<h3>Contributors</h3>
Expand All @@ -34,6 +33,27 @@
<li><strong>SI:</strong> Support Inquiry - This issue was reported by a <a href="https://upendoventures.com/Support" target="_blank">support customer</a> and, as such, was prioritized above all other tasks.</li>
</ul>

<h2>Release Notes: 01.04.01</h2>

<h3><strong>Enhancements</strong></h3>
<ul>
<li>None at this time.</li>
<!--
<li><strong></strong> - . (<a href="https://github.com/UpendoVentures/Upendo-Dnn-UserManager/issues/" target="_blank">Issue </a>), Thanks <a href="https://github.com/" target="_blank">@</a></li>
<li>None at this time.</li>
-->
</ul>

<h3><strong>Maintenance Updates</strong></h3>
<ul>
<li>Prevent Non-Superusers from Creating Superuser Accounts. (No Issue) Thanks, <a href="https://github.com/alejoroman0605" target="_blank">@alejoroman0605</a>!</li>
<!--
<li><a href="https://github.com/UpendoVentures/Upendo-Dnn-UserManager/issues/" target="_blank">Issue </a> - . Thanks <a href="https://github.com/" target="_blank">@</a></li>
<li>(no issue) - .</li>
-->
</ul>
<hr />

<h2>Release Notes: 01.04.00</h2>

<h3><strong>Enhancements</strong></h3>
Expand Down

0 comments on commit 67854b8

Please sign in to comment.