Skip to content

Commit

Permalink
Fix ISSUE #79
Browse files Browse the repository at this point in the history
  • Loading branch information
sawest committed May 10, 2021
1 parent 82b439c commit 206db75
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
6 changes: 3 additions & 3 deletions ActiveDirectory.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="DNN_ActiveDirectoryAuthentication" type="Auth_System" version="07.00.00">
<package name="DNN_ActiveDirectoryAuthentication" type="Auth_System" version="07.02.00">
<friendlyName>DNN_ActiveDirectoryAuthentication</friendlyName>
<description>The DotNetNuke Active Directory Authentication Project is an Authentication provider for DotNetNuke that uses the Windows
Active Directory authentication protocol to authenticate users.
Expand All @@ -16,7 +16,7 @@

<dependencies>
<dependency type="Permission">AspNetHostingPermission</dependency>
<dependency type="CoreVersion">08.00.04</dependency>
<dependency type="CoreVersion">09.04.01</dependency>
</dependencies>

<components>
Expand All @@ -33,7 +33,7 @@
<assembly>
<path>bin\Providers</path>
<name>DotNetNuke.Authentication.ActiveDirectory.dll</name>
<version>07.00.00</version>
<version>07.02.00</version>
</assembly>
<assembly>
<path>bin</path>
Expand Down
8 changes: 4 additions & 4 deletions AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("2019 DotNetNuke Corporation")>
<Assembly: AssemblyCopyright("2021 DotNetNuke Corporation")>
<Assembly: AssemblyTrademark("")>

<Assembly: ComVisible(False)>
Expand All @@ -29,7 +29,7 @@ Imports System.Runtime.InteropServices
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("07.00.00.13")>
' <Assembly: AssemblyVersion("07.02.00.16")>

<Assembly: AssemblyVersion("07.00.00.13")>
<Assembly: AssemblyFileVersion("07.00.00.13")>
<Assembly: AssemblyVersion("07.02.00.16")>
<Assembly: AssemblyFileVersion("07.02.00.16")>
35 changes: 20 additions & 15 deletions Components/AuthenticationController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -237,25 +237,30 @@ Namespace DotNetNuke.Authentication.ActiveDirectory
''' -------------------------------------------------------------------
Public Function AuthenticateUser(ByVal objUser As UserInfo, ByVal objAuthUser As ADUserInfo,
ByRef loginStatus As UserLoginStatus, ByVal ipAddress As String) As UserInfo
Dim _config As Configuration = Configuration.GetConfig()
'Dim _config As Configuration = Configuration.GetConfig()
Dim objReturnUser As UserInfo = Nothing

If Not (objUser Is Nothing) Then
Dim aspNetUser As MembershipUser = Web.Security.Membership.GetUser(objUser.Username)
Dim strPassword As String

If Web.Security.Membership.Provider.EnablePasswordRetrieval And Web.Security.Membership.Provider.PasswordFormat <> MembershipPasswordFormat.Hashed Then
strPassword = RandomizePassword(aspNetUser, objUser, aspNetUser.GetPassword())
Else
strPassword = RandomizePassword(aspNetUser, objUser, "")
End If
'Stop resetting password and stop validating user against DNN. ISSUE #79 - Steven A West 4/27/2021
'Dim aspNetUser As MembershipUser = Web.Security.Membership.GetUser(objUser.Username)
'Dim strPassword As String
'If Web.Security.Membership.Provider.EnablePasswordRetrieval And Web.Security.Membership.Provider.PasswordFormat <> MembershipPasswordFormat.Hashed Then
' strPassword = RandomizePassword(aspNetUser, objUser, aspNetUser.GetPassword())
' Else
' strPassword = RandomizePassword(aspNetUser, objUser, "")
'End If

If (objUser.IsDeleted = False) Then

objReturnUser =
DNNUserController.ValidateUser(_portalSettings.PortalId, objUser.Username, strPassword,
"Active Directory", _portalSettings.PortalName, ipAddress,
loginStatus)
'ISSUE #79 - Steven A West 4/27/2021
' objReturnUser =
' DNNUserController.ValidateUser(_portalSettings.PortalId, objUser.Username, strPassword,
' "Active Directory", _portalSettings.PortalName, ipAddress,
' loginStatus)

loginStatus = UserLoginStatus.LOGIN_SUCCESS
objReturnUser = DNNUserController.GetUserByName(_portalSettings.PortalId, objAuthUser.Username)

' Synchronize role membership if it's required in settings
If _config.SynchronizeRole Then
SynchronizeRoles(objReturnUser)
Expand All @@ -267,7 +272,7 @@ Namespace DotNetNuke.Authentication.ActiveDirectory
If Not _config.AutoCreateUsers = True Then
objUser.IsDeleted = False
objUser.Membership.IsDeleted = False
objUser.Membership.Password = strPassword
objUser.Membership.Password = Utilities.GetRandomPassword()
DNNUserController.UpdateUser(_portalSettings.PortalId, objUser)
CreateUser(objUser, loginStatus)
If loginStatus = UserLoginStatus.LOGIN_SUCCESS Then
Expand All @@ -284,7 +289,7 @@ Namespace DotNetNuke.Authentication.ActiveDirectory
'ACD-4259
If Not _config.AutoCreateUsers = True Then
'User doesn't exist in this portal. Make sure user doesn't exist on any other portal
objUser = DNNUserController.GetUserByName(Null.NullInteger, objAuthUser.Username)
objUser = DNNUserController.GetUserByName(objAuthUser.Username)
If objUser Is Nothing Then 'User doesn't exist in any portal
'Item 6365
objAuthUser.Membership.Password = Utilities.GetRandomPassword()
Expand Down
6 changes: 3 additions & 3 deletions DotNetNuke.Authentication.ActiveDirectory.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<OptionInfer>On</OptionInfer>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<UseIISExpress>false</UseIISExpress>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -58,9 +58,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetNuke, Version=7.2.0.607, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="DotNetNuke, Version=9.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Sites\dnndev80\bin\DotNetNuke.dll</HintPath>
<HintPath>..\..\..\..\adTest\bin\DotNetNuke.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Binary file modified Resources.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0.13
7.2.0.16

0 comments on commit 206db75

Please sign in to comment.