From 3fc5fe75c94e11b9ef584a7d854986407651f394 Mon Sep 17 00:00:00 2001 From: "West, Steven A." Date: Mon, 20 Aug 2018 10:43:19 -0500 Subject: [PATCH] 6.1.2 commit --- .gitignore | 436 ++--- ActiveDirectory.dnn | 306 ++-- App_LocalResources/Login.ascx.resx | 280 +-- App_LocalResources/Settings.ascx.resx | 556 +++--- AssemblyInfo.vb | 70 +- BuildScripts/MSBuild.Community.Tasks.Targets | 208 +-- BuildScripts/ModulePackage.targets | 328 ++-- Components/AuthenticationController.vb | 1525 +++++++++-------- Components/AuthenticationProvider.vb | 162 +- Components/Common/AuthenticationMode.vb | 76 +- Components/Common/AuthenticationStatus.vb | 76 +- Components/Common/ObjectClass.vb | 100 +- Components/Config/ApplicationPool.vb | 32 +- Components/Config/Configuration.vb | 1269 +++++++------- Components/Groups/GroupController.vb | 130 +- Components/Groups/GroupInfo.vb | 232 +-- Components/IAuthenticationObjectBase.vb | 70 +- Components/Users/UserController.vb | 584 +++---- Components/Users/UserInfo.vb | 350 ++-- Documentation/Documentation.css | 164 +- Documentation/Documentation.html | 134 +- DotNetNuke.Authentication.ActiveDirectory.sln | 44 +- ...Nuke.Authentication.ActiveDirectory.vbproj | 452 ++--- HttpModule/AuthenticationModule.vb | 435 ++--- LICENSE | 44 +- Login.ascx | 62 +- Login.ascx.designer.vb | 196 +-- Login.ascx.vb | 614 +++---- Providers/ADSIProvider/ADSIProvider.vb | 1054 ++++++------ Providers/ADSIProvider/Configuration.vb | 1080 ++++++------ .../ADSIProvider/CrossReferenceCollection.vb | 476 ++--- Providers/ADSIProvider/Domain.vb | 598 +++---- Providers/ADSIProvider/Search.vb | 674 ++++---- Providers/ADSIProvider/Utilities.vb | 1464 ++++++++-------- README.md | 4 +- ReleaseNotes.txt | 86 +- Resources.zip | Bin 100792 -> 101412 bytes Settings.ascx | 182 +- Settings.ascx.designer.vb | 952 +++++----- Settings.ascx.vb | 578 +++---- TestCases.txt | 120 +- WindowsSignin.aspx | 10 +- WindowsSignin.aspx.designer.vb | 86 +- WindowsSignin.aspx.vb | 128 +- install.css | 322 ++-- license.txt | 40 +- trusterror.htm | 32 +- version.txt | 2 +- 48 files changed, 8458 insertions(+), 8365 deletions(-) diff --git a/.gitignore b/.gitignore index d75c90d..f611bf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,218 +1,218 @@ -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates -*.local.sln -*.sln.GhostDoc.xml - -## Ignore VS2015/Roslyn artifacts -*.sln.ide/ -.vs/ - -## Ignore Webstorm artifacts -*.idea/ - -# Build results -[Rr]elease -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.eml -*.vspscc -.builds -*.dotCover -*.ldf - -# git merge artifacts -*.orig -*.gitmodules - -## TODO: If you have NuGet Package Restore enabled, uncomment this -[Pp]ackages/ - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Others - -[Oo]bj -TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML - -############ -## DNN -############ - -# Ignore artifacts from deployed/installed site - -DNN_*.zip - -!DNN [Pp]latform/[Cc]omponents -!DNN [Pp]latform/[Cc]ontrols -DNN [Pp]latform/[Cc]omponents/[Cc]lient[Dd]ependency/[Ss]ource/[Bb]in -DNN [Pp]latform/[Cc]ontrols/[Cc]ountry[Ll]ist[Bb]ox/[Bb]in/* - -DNN [Pp]latform/*/[Bb]in -DNN [Pp]latform/Tests/*/[Bb]in/* -DNN [Pp]latform/Modules/*/[Bb]in/* -DNN [Pp]latform/Admin Modules/*/[Bb]in/* -DNN [Pp]latform/MVC Modules/*/[Bb]in/* -DNN [Pp]latform/[Pp]roviders/*/*/[Bb]in/* -DNN [Pp]latform/[Pp]roviders/*/*/*/[Bb]in/* -DNN [Pp]latform/Syndication/[Bb]in/* - - -[Ww]ebsite/*/[Dd]efault.aspx - -[Ww]ebsite/[Aa]dmin/[Pp]ersonabar - -[Ww]ebsite/[Aa]pp_[Cc]ode - -[Ww]ebsite/[Aa]pp_[Dd]ata - -[Ww]ebsite/[Bb]in - -[Ww]ebsite/[Cc]onfig - -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Ff]ifty[Oo]ne[Cc]lient[Cc]apability[Pp]rovider -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Rr]ad[Ee]ditor[Pp]rovider -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Tt]axonomy -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Uu]rl[Mm]anagement -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Hh]tml[Ee]ditor[Mm]anager -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Rr]ecycle[Bb]in -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Nn]ewsletters - -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Ff]acebook -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Gg]oogle -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Ll]ive -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Tt]witter -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/DNN[Pp]ro_[Aa]ctive[Dd]irectory - -[Ww]ebsite/[Dd]esktop[Mm]odules/[Cc]ore[Mm]essaging -[Ww]ebsite/[Dd]esktop[Mm]odules/DDRMenu -[Ww]ebsite/[Dd]esktop[Mm]odules/[Dd]evice[Pp]review[Mm]anagement -[Ww]ebsite/[Dd]esktop[Mm]odules/[Dd]igital[Aa]ssets -[Ww]ebsite/[Dd]esktop[Mm]odules/DNNCorp -[Ww]ebsite/[Dd]esktop[Mm]odules/[Dd][Nn][Nn] -[Ww]ebsite/[Dd]esktop[Mm]odules/HTML -[Ww]ebsite/[Dd]esktop[Mm]odules/MVC -[Ww]ebsite/[Dd]esktop[Mm]odules/[Jj]ournal -[Ww]ebsite/[Dd]esktop[Mm]odules/[Mm]ember[Dd]irectory -[Ww]ebsite/[Dd]esktop[Mm]odules/[Mm]obile[Mm]anagement -[Ww]ebsite/[Dd]esktop[Mm]odules/[Rr]azor[Mm]odules -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ss]ocial[Gg]roups -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ss]ubscriptions[Mm]gmt -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ii]dentity[Ss]witcher -[Ww]ebsite/[Dd]esktop[Mm]odules/[Bb]log -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ii][Ff]rame -[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]nnouncements -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ee]vents -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ff]eedback -[Ww]ebsite/[Dd]esktop[Mm]odules/[Ff][Aa][Qq]s -[Ww]ebsite/[Dd]esktop[Mm]odules/[Mm]edia -[Ww]ebsite/[Dd]esktop[Mm]odules/[Uu]ser[Dd]efined[Tt]able -[Ww]ebsite/[Dd]esktop[Mm]odules/dnnGlimpse -[Ww]ebsite/[Dd]esktop[Mm]odules/[Tt]est* - -[Ww]ebsite/[Ii]nstall/*/*.zip -[Ww]ebsite/[Ii]nstall/*/*.resources -[Ww]ebsite/[Ii]nstall/[Cc]leanup -[Ww]ebsite/[Ii]nstall/[Cc]onfig -[Ww]ebsite/[Ii]nstall/[Dd]ot[Nn]et[Nn]uke.install.config -[Ww]ebsite/[Ii]nstall/installstat.log.resources.txt -[Ww]ebsite/[Ii]nstall/upgradestat.log.resources.txt - -[Ww]ebsite/[Ll]icenses/*.txt - -[Ww]ebsite/[Mm]odules - -[Ww]ebsite/[Pp]ortals/_default/[Ll]ogs -[Ww]ebsite/[Pp]ortals/_default/[Mm]erged[Tt]emplate -[Ww]ebsite/[Pp]ortals/_default/[Bb]lank [Ww]ebsite*.* -[Ww]ebsite/[Pp]ortals/_default/[Dd]efault [Ww]ebsite*.* -[Ww]ebsite/[Pp]ortals/_default/[Mm]obile [Ww]ebsite*.* -[Ww]ebsite/[Pp]ortals/_default/[Cc]ontainers/*/thumbnail*.jpg -[Ww]ebsite/[Pp]ortals/_default/[Cc]ontainers/[Cc]avalier/*.* -[Ww]ebsite/[Pp]ortals/_default/[Ss]kins/*/thumbnail*.jpg -[Ww]ebsite/[Pp]ortals/_default/[Ss]kins/[Cc]avalier -[Ww]ebsite/[Pp]ortals/_default/[Ss]kins/[Cc]avalier/*/*.* - -[Ww]ebsite/[Pp]ortals/_default/[Uu]ser* -[Ww]ebsite/[Pp]ortals/[0-9]*/ - -[Ww]ebsite/[Pp]roviders/[Dd]ata[Pp]roviders/*/*.resources -[Ww]ebsite/[Pp]roviders/*/*/license.txt -[Ww]ebsite/[Pp]roviders/*/*/release[Nn]otes.txt -[Ww]ebsite/[Pp]roviders/[Ff]older[Pp]roviders - -[Ww]ebsite/[Rr]esources/[Ll]ibraries - -[Ww]ebsite/[Ss]ignatures - -[Ww]ebsite/51[Dd]egrees.mobi.config -[Ww]ebsite/[Dd]ot[Nn]et[Nn]uke.log4net.config -[Ww]ebsite/[Dd]ot[Nn]et[Nn]uke.config -[Ww]ebsite/[Ss]ite[Aa]nalytics.config -[Ww]ebsite/[Ss]ite[Uu]rls.config -[Ww]ebsite/web.config -[Ww]ebsite/app_offline.htm - -# ignore all other language resx files -*.de-DE.resx -*.es-ES.resx -*.fr-FR.resx -*.it-IT.resx -*.nl-NL.resx - -# but do track translations in the Install folder -![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.de-DE.resx -![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.es-ES.resx -![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.fr-FR.resx -![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.it-IT.resx -![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.nl-NL.resx - -*.zip.manifest - -############ -## Windows -############ - -# Windows image file caches -Thumbs.db - -# Folder config file -Desktop.ini -Website/Install/Temp/ +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates +*.local.sln +*.sln.GhostDoc.xml + +## Ignore VS2015/Roslyn artifacts +*.sln.ide/ +.vs/ + +## Ignore Webstorm artifacts +*.idea/ + +# Build results +[Rr]elease +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.eml +*.vspscc +.builds +*.dotCover +*.ldf + +# git merge artifacts +*.orig +*.gitmodules + +## TODO: If you have NuGet Package Restore enabled, uncomment this +[Pp]ackages/ + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Others + +[Oo]bj +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + +############ +## DNN +############ + +# Ignore artifacts from deployed/installed site + +DNN_*.zip + +!DNN [Pp]latform/[Cc]omponents +!DNN [Pp]latform/[Cc]ontrols +DNN [Pp]latform/[Cc]omponents/[Cc]lient[Dd]ependency/[Ss]ource/[Bb]in +DNN [Pp]latform/[Cc]ontrols/[Cc]ountry[Ll]ist[Bb]ox/[Bb]in/* + +DNN [Pp]latform/*/[Bb]in +DNN [Pp]latform/Tests/*/[Bb]in/* +DNN [Pp]latform/Modules/*/[Bb]in/* +DNN [Pp]latform/Admin Modules/*/[Bb]in/* +DNN [Pp]latform/MVC Modules/*/[Bb]in/* +DNN [Pp]latform/[Pp]roviders/*/*/[Bb]in/* +DNN [Pp]latform/[Pp]roviders/*/*/*/[Bb]in/* +DNN [Pp]latform/Syndication/[Bb]in/* + + +[Ww]ebsite/*/[Dd]efault.aspx + +[Ww]ebsite/[Aa]dmin/[Pp]ersonabar + +[Ww]ebsite/[Aa]pp_[Cc]ode + +[Ww]ebsite/[Aa]pp_[Dd]ata + +[Ww]ebsite/[Bb]in + +[Ww]ebsite/[Cc]onfig + +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Ff]ifty[Oo]ne[Cc]lient[Cc]apability[Pp]rovider +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Rr]ad[Ee]ditor[Pp]rovider +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Tt]axonomy +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Uu]rl[Mm]anagement +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Hh]tml[Ee]ditor[Mm]anager +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Rr]ecycle[Bb]in +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]dmin/[Nn]ewsletters + +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Ff]acebook +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Gg]oogle +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Ll]ive +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/[Tt]witter +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]uthentication[Ss]ervices/DNN[Pp]ro_[Aa]ctive[Dd]irectory + +[Ww]ebsite/[Dd]esktop[Mm]odules/[Cc]ore[Mm]essaging +[Ww]ebsite/[Dd]esktop[Mm]odules/DDRMenu +[Ww]ebsite/[Dd]esktop[Mm]odules/[Dd]evice[Pp]review[Mm]anagement +[Ww]ebsite/[Dd]esktop[Mm]odules/[Dd]igital[Aa]ssets +[Ww]ebsite/[Dd]esktop[Mm]odules/DNNCorp +[Ww]ebsite/[Dd]esktop[Mm]odules/[Dd][Nn][Nn] +[Ww]ebsite/[Dd]esktop[Mm]odules/HTML +[Ww]ebsite/[Dd]esktop[Mm]odules/MVC +[Ww]ebsite/[Dd]esktop[Mm]odules/[Jj]ournal +[Ww]ebsite/[Dd]esktop[Mm]odules/[Mm]ember[Dd]irectory +[Ww]ebsite/[Dd]esktop[Mm]odules/[Mm]obile[Mm]anagement +[Ww]ebsite/[Dd]esktop[Mm]odules/[Rr]azor[Mm]odules +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ss]ocial[Gg]roups +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ss]ubscriptions[Mm]gmt +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ii]dentity[Ss]witcher +[Ww]ebsite/[Dd]esktop[Mm]odules/[Bb]log +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ii][Ff]rame +[Ww]ebsite/[Dd]esktop[Mm]odules/[Aa]nnouncements +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ee]vents +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ff]eedback +[Ww]ebsite/[Dd]esktop[Mm]odules/[Ff][Aa][Qq]s +[Ww]ebsite/[Dd]esktop[Mm]odules/[Mm]edia +[Ww]ebsite/[Dd]esktop[Mm]odules/[Uu]ser[Dd]efined[Tt]able +[Ww]ebsite/[Dd]esktop[Mm]odules/dnnGlimpse +[Ww]ebsite/[Dd]esktop[Mm]odules/[Tt]est* + +[Ww]ebsite/[Ii]nstall/*/*.zip +[Ww]ebsite/[Ii]nstall/*/*.resources +[Ww]ebsite/[Ii]nstall/[Cc]leanup +[Ww]ebsite/[Ii]nstall/[Cc]onfig +[Ww]ebsite/[Ii]nstall/[Dd]ot[Nn]et[Nn]uke.install.config +[Ww]ebsite/[Ii]nstall/installstat.log.resources.txt +[Ww]ebsite/[Ii]nstall/upgradestat.log.resources.txt + +[Ww]ebsite/[Ll]icenses/*.txt + +[Ww]ebsite/[Mm]odules + +[Ww]ebsite/[Pp]ortals/_default/[Ll]ogs +[Ww]ebsite/[Pp]ortals/_default/[Mm]erged[Tt]emplate +[Ww]ebsite/[Pp]ortals/_default/[Bb]lank [Ww]ebsite*.* +[Ww]ebsite/[Pp]ortals/_default/[Dd]efault [Ww]ebsite*.* +[Ww]ebsite/[Pp]ortals/_default/[Mm]obile [Ww]ebsite*.* +[Ww]ebsite/[Pp]ortals/_default/[Cc]ontainers/*/thumbnail*.jpg +[Ww]ebsite/[Pp]ortals/_default/[Cc]ontainers/[Cc]avalier/*.* +[Ww]ebsite/[Pp]ortals/_default/[Ss]kins/*/thumbnail*.jpg +[Ww]ebsite/[Pp]ortals/_default/[Ss]kins/[Cc]avalier +[Ww]ebsite/[Pp]ortals/_default/[Ss]kins/[Cc]avalier/*/*.* + +[Ww]ebsite/[Pp]ortals/_default/[Uu]ser* +[Ww]ebsite/[Pp]ortals/[0-9]*/ + +[Ww]ebsite/[Pp]roviders/[Dd]ata[Pp]roviders/*/*.resources +[Ww]ebsite/[Pp]roviders/*/*/license.txt +[Ww]ebsite/[Pp]roviders/*/*/release[Nn]otes.txt +[Ww]ebsite/[Pp]roviders/[Ff]older[Pp]roviders + +[Ww]ebsite/[Rr]esources/[Ll]ibraries + +[Ww]ebsite/[Ss]ignatures + +[Ww]ebsite/51[Dd]egrees.mobi.config +[Ww]ebsite/[Dd]ot[Nn]et[Nn]uke.log4net.config +[Ww]ebsite/[Dd]ot[Nn]et[Nn]uke.config +[Ww]ebsite/[Ss]ite[Aa]nalytics.config +[Ww]ebsite/[Ss]ite[Uu]rls.config +[Ww]ebsite/web.config +[Ww]ebsite/app_offline.htm + +# ignore all other language resx files +*.de-DE.resx +*.es-ES.resx +*.fr-FR.resx +*.it-IT.resx +*.nl-NL.resx + +# but do track translations in the Install folder +![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.de-DE.resx +![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.es-ES.resx +![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.fr-FR.resx +![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.it-IT.resx +![Ww]ebsite/[Ii]nstall/[Aa]pp_[Ll]ocal[Rr]esources/*.nl-NL.resx + +*.zip.manifest + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini +Website/Install/Temp/ diff --git a/ActiveDirectory.dnn b/ActiveDirectory.dnn index de33abd..da783ad 100644 --- a/ActiveDirectory.dnn +++ b/ActiveDirectory.dnn @@ -1,154 +1,154 @@ - - - - DNN_ActiveDirectoryAuthentication - The DotNetNuke Active Directory Authentication Project is an Authentication provider for DotNetNuke that uses the Windows - Active Directory authentication protocol to authenticate users. - - - DotNetNuke Corporation - DotNetNuke Corporation - http://www.dotnetnuke.com - support@dotnetnuke.com - - - - - - AspNetHostingPermission - 07.00.00 - - - - - - ActiveDirectory - DesktopModules/AuthenticationServices/ActiveDirectory/Settings.ascx - DesktopModules/AuthenticationServices/ActiveDirectory/Login.ascx - - - - - - - bin\Providers - DotNetNuke.Authentication.ActiveDirectory.dll - 06.00.08 - - - bin - Mvolo.FormsAuthenticationModule.dll - 01.00.00 - - - - - - - DesktopModules/AuthenticationServices/ActiveDirectory - - Resources.zip - - - - - - - - bin\Providers - Interop.ActiveDs.dll - - - install\package - ActiveDirectory_01.00.04_install.resources - - - install\package - ActiveDirectory_01.00.03_install.resources - - - install\package - ActiveDirectory_01.00.00_install.resources - - - install\AuthSystem - ActiveDirectory_05.00.00_install.resources - - - install\AuthSystem - ActiveDirectory_05.00.01_install.resources - - - install\AuthSystem - ActiveDirectory_05.00.02_install.resources - - - install\AuthSystem - ActiveDirectory_06.00.00_install.resources - - - - - - - web.config - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + DNN_ActiveDirectoryAuthentication + The DotNetNuke Active Directory Authentication Project is an Authentication provider for DotNetNuke that uses the Windows + Active Directory authentication protocol to authenticate users. + + + DotNetNuke Corporation + DotNetNuke Corporation + http://www.dotnetnuke.com + support@dotnetnuke.com + + + + + + AspNetHostingPermission + 07.00.00 + + + + + + ActiveDirectory + DesktopModules/AuthenticationServices/ActiveDirectory/Settings.ascx + DesktopModules/AuthenticationServices/ActiveDirectory/Login.ascx + + + + + + + bin\Providers + DotNetNuke.Authentication.ActiveDirectory.dll + 06.01.02 + + + bin + Mvolo.FormsAuthenticationModule.dll + 01.00.00 + + + + + + + DesktopModules/AuthenticationServices/ActiveDirectory + + Resources.zip + + + + + + + + bin\Providers + Interop.ActiveDs.dll + + + install\package + ActiveDirectory_01.00.04_install.resources + + + install\package + ActiveDirectory_01.00.03_install.resources + + + install\package + ActiveDirectory_01.00.00_install.resources + + + install\AuthSystem + ActiveDirectory_05.00.00_install.resources + + + install\AuthSystem + ActiveDirectory_05.00.01_install.resources + + + install\AuthSystem + ActiveDirectory_05.00.02_install.resources + + + install\AuthSystem + ActiveDirectory_06.00.00_install.resources + + + + + + + web.config + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_LocalResources/Login.ascx.resx b/App_LocalResources/Login.ascx.resx index 48ebbcb..3bfbcef 100644 --- a/App_LocalResources/Login.ascx.resx +++ b/App_LocalResources/Login.ascx.resx @@ -1,141 +1,141 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Contact your website administrator to have an account created for you. - - - Login - - - Enter your Password below - - - Password: - - - Enter your User Name below in the following format (domain\username) - - - User Name: - - - Windows Login - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Contact your website administrator to have an account created for you. + + + Login + + + Enter your Password below + + + Password: + + + Enter your User Name below in the following format (domain\username) + + + User Name: + + + Windows Login + \ No newline at end of file diff --git a/App_LocalResources/Settings.ascx.resx b/App_LocalResources/Settings.ascx.resx index 0986ba6..6218688 100644 --- a/App_LocalResources/Settings.ascx.resx +++ b/App_LocalResources/Settings.ascx.resx @@ -1,276 +1,282 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Active Directory Authentication - - - Enabled? - - - Check to enable Active Directory Authentication for this portal - - - - - - Synchronize Role? - - - If select, user's role will be synchronized with Windows Active Directory security group each time user logon - - - - - - Synchronize Password? - - - If select, user's password will be updated with Windows password (if 2 password not match) when user logon - - - - - - Provider - - - Select Authentication provider for this portal - - - Authentication Type - - - Select Authentication type for this portal (Delegation is recommenced) - - - Root Domain: - - - Root Domain in format yourdomain.com or DC=yourdomain,DC=com or LDAP://mydomain.com. Leave this value blank if you want to obtain Active Directory objects from root forest. While using LDAP, please specify the four-letter LDAP prefix in upper-case. - - - User Name: - - - User Name, who has permission to access Active Directory - - - Password: - - - Password of this User - - - Confirm Password: - - - Confirm Password - - - Email Domain: - - - Email Domain to be used for user email when your network doesn't have Windows Active Directory (Blank is recommended) - - - Update - - - Accessing Global Catalog: - - - Checking Root Domain: - - - Accessing LDAP: - - - Find all domains in network: - - - Could not access LDAP to obtain domains info - - - OK - - - FAIL - - - The default authentication provider specified in web.config is not configured properly. Authentication settings are disabled. - - - The domain name of the authenticated user ({0}) is the same as the server name ({1}). This usually indicates the server is not a member of a domain. Authentication settings are disabled. - - - Active Directory Settings - - - ASP.Net Full Trust is required to use the Active Directory Authentication Provider. Modify the web.config file so that the TRUST tag in SYSTEM.WEB has a level of "Full". - - - Enter the IP string, address, or range separated by semicolons that you want to automatically log in (eg: 192.168.0.1-192 - 192.168.0.100 for any IP in that range, 192.168.0.50 for only that IP.). An example string could look like 192.168.0.100;192.168.0.1-192.168.0.100 - - - Auto-login IP Address (Optional): - - - Optional:Users will be entered into the DNN database as Username instead of Domain\Username. Not a good idea for Intranet/Internet sites where a user may already exist. - - - Strip Domain Name (Optional) - - - Hides the Windows Login button on the Login screen. - - - Hide Login Controls? - - - Warning: Automatic user logins only works in IIS7 when using the Classic .NET AppPool. This site has been detected as using an application pool using the Integrate Pipeline Mode - - - is not a valid IP address - - - If you enter the default domain users can login with just their username instead of DOMAIN\Username. - - - Default Domain - - - If checked Active Directory users not able to log into the DNN portal until an account is created. - - - Do Not Automatically Create Users? - - - Enter the name of the search crawler that you wish to allow to crawl the site separated by a comma (eg: gsa-crawler, MS Search 5.0 Robot). - - - Allowed Search Bots - - - If a user has a thumbnail image in Active Directory, this option will copy that image to DNN and use it for the profile picture. - - - Synchronize Photo? - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Active Directory Authentication + + + Enabled? + + + Check to enable Active Directory Authentication for this portal + + + + + + Synchronize Role? + + + If select, user's role will be synchronized with Windows Active Directory security group each time user logon + + + + + + Synchronize Password? + + + If select, user's password will be updated with Windows password (if 2 password not match) when user logon + + + + + + Provider + + + Select Authentication provider for this portal + + + Authentication Type + + + Select Authentication type for this portal (Delegation is recommenced) + + + Root Domain: + + + Root Domain in format yourdomain.com or DC=yourdomain,DC=com or LDAP://mydomain.com. Leave this value blank if you want to obtain Active Directory objects from root forest. While using LDAP, please specify the four-letter LDAP prefix in upper-case. + + + User Name: + + + User Name, who has permission to access Active Directory + + + Password: + + + Password of this User + + + Confirm Password: + + + Confirm Password + + + Email Domain: + + + Email Domain to be used for user email when your network doesn't have Windows Active Directory (Blank is recommended) + + + Update + + + Accessing Global Catalog: + + + Checking Root Domain: + + + Accessing LDAP: + + + Find all domains in network: + + + Could not access LDAP to obtain domains info + + + OK + + + FAIL + + + The default authentication provider specified in web.config is not configured properly. Authentication settings are disabled. + + + The domain name of the authenticated user ({0}) is the same as the server name ({1}). This usually indicates the server is not a member of a domain. Authentication settings are disabled. + + + Active Directory Settings + + + ASP.Net Full Trust is required to use the Active Directory Authentication Provider. Modify the web.config file so that the TRUST tag in SYSTEM.WEB has a level of "Full". + + + Enter the IP string, address, or range separated by semicolons that you want to automatically log in (eg: 192.168.0.1-192 - 192.168.0.100 for any IP in that range, 192.168.0.50 for only that IP.). An example string could look like 192.168.0.100;192.168.0.1-192.168.0.100 + + + Auto-login IP Address (Optional): + + + Optional:Users will be entered into the DNN database as Username instead of Domain\Username. Not a good idea for Intranet/Internet sites where a user may already exist. + + + Strip Domain Name (Optional) + + + Hides the Windows Login button on the Login screen. + + + Hide Login Controls? + + + Warning: Automatic user logins only works in IIS7 when using the Classic .NET AppPool. This site has been detected as using an application pool using the Integrate Pipeline Mode + + + is not a valid IP address + + + If you enter the default domain users can login with just their username instead of DOMAIN\Username. + + + Default Domain + + + If checked Active Directory users not able to log into the DNN portal until an account is created. + + + Do Not Automatically Create Users? + + + Enter the name of the search crawler that you wish to allow to crawl the site separated by a comma (eg: gsa-crawler, MS Search 5.0 Robot). + + + Allowed Search Bots + + + If a user has a thumbnail image in Active Directory, this option will copy that image to DNN and use it for the profile picture. + + + Synchronize Photo? + + + Enabling this will auto-login users when they access the portal. You can restrict which users get this feature by IP below. + + + Enable Auto Login? + \ No newline at end of file diff --git a/AssemblyInfo.vb b/AssemblyInfo.vb index 363599f..7bfa0fe 100644 --- a/AssemblyInfo.vb +++ b/AssemblyInfo.vb @@ -1,35 +1,35 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/BuildScripts/MSBuild.Community.Tasks.Targets b/BuildScripts/MSBuild.Community.Tasks.Targets index 85a901f..b8419fa 100644 --- a/BuildScripts/MSBuild.Community.Tasks.Targets +++ b/BuildScripts/MSBuild.Community.Tasks.Targets @@ -1,105 +1,105 @@ - - - - - - $(MSBuildProjectDirectory)\BuildScripts - $(MSBuildProjectDirectory)\..\..\..\bin\Providers - $(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + $(MSBuildProjectDirectory)\BuildScripts + $(MSBuildProjectDirectory)\..\..\..\bin\Providers + $(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BuildScripts/ModulePackage.targets b/BuildScripts/ModulePackage.targets index 73987a8..78c89ae 100644 --- a/BuildScripts/ModulePackage.targets +++ b/BuildScripts/ModulePackage.targets @@ -1,165 +1,165 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Components/AuthenticationController.vb b/Components/AuthenticationController.vb index df5fa3c..ee4d21a 100644 --- a/Components/AuthenticationController.vb +++ b/Components/AuthenticationController.vb @@ -1,750 +1,775 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Authentication.ActiveDirectory.ADSI -Imports DotNetNuke.Common -Imports DotNetNuke.Entities.Modules -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Security.Membership -Imports DotNetNuke.Entities.Users -Imports DotNetNuke.Common.Utilities -Imports DotNetNuke.Services.Log.EventLog -Imports System.Xml.XPath -Imports System.Xml - -Imports DNNUserController = DotNetNuke.Entities.Users.UserController - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public Class AuthenticationController - Inherits UserUserControlBase - - Private ReadOnly _mProviderTypeName As String = "" - Private ReadOnly _portalSettings As PortalSettings - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - Dim config As Configuration = Configuration.GetConfig() - _portalSettings = PortalController.Instance.GetCurrentPortalSettings - _mProviderTypeName = config.ProviderTypeName - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 12/07/2008 ACD-7488 - ''' - ''' ------------------------------------------------------------------- - Public Sub AuthenticationLogon() - Dim objAuthUserController As New UserController - Dim objReturnUser As UserInfo - Dim loggedOnUserName As String = HttpContext.Current.Request.ServerVariables(Configuration.LOGON_USER_VARIABLE) - Dim loginStatus As UserLoginStatus = UserLoginStatus.LOGIN_FAILURE - - ' Get ipAddress for eventLog - Dim ipAddress As String = "" - If Not HttpContext.Current.Request.UserHostAddress Is Nothing Then - ipAddress = HttpContext.Current.Request.UserHostAddress - End If - - If (loggedOnUserName.Length > 0) Then - Dim objUser As UserInfo - Dim objAuthUser As ADUserInfo - objAuthUser = objAuthUserController.GetUser(loggedOnUserName) - objUser = DNNUserController.GetUserByName(_portalSettings.PortalId, loggedOnUserName) - - objReturnUser = AuthenticateUser(objUser, objAuthUser, loginStatus, ipAddress) - - - If Not (objReturnUser Is Nothing) Then - - objAuthUser.LastIPAddress = ipAddress - UpdateDNNUser(objReturnUser, objAuthUser) - - FormsAuthentication.SetAuthCookie(Convert.ToString(loggedOnUserName), True) - - SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinLogon) - - 'check if user has supplied custom value for expiration - Dim persistentCookieTimeout As Integer - If Not Config.GetSetting("PersistentCookieTimeout") Is Nothing Then - persistentCookieTimeout = Integer.Parse(Config.GetSetting("PersistentCookieTimeout")) - 'only use if non-zero, otherwise leave as asp.net value - If persistentCookieTimeout <> 0 Then - 'locate and update cookie - Dim authCookie As String = FormsAuthentication.FormsCookieName - For Each cookie As String In HttpContext.Current.Response.Cookies - If cookie.Equals(authCookie) Then - HttpContext.Current.Response.Cookies(cookie).Expires = - DateTime.Now.AddMinutes(persistentCookieTimeout) - End If - Next - End If - End If - - Dim objEventLog As New EventLogController - Dim objEventLogInfo As New LogInfo - objEventLogInfo.AddProperty("IP", ipAddress) - objEventLogInfo.LogPortalID = _portalSettings.PortalId - objEventLogInfo.LogPortalName = _portalSettings.PortalName - objEventLogInfo.LogUserID = objReturnUser.UserID - objEventLogInfo.LogUserName = loggedOnUserName - objEventLogInfo.AddProperty("WindowsAuthentication", "True") - objEventLogInfo.LogTypeKey = "LOGIN_SUCCESS" - - objEventLog.AddLog(objEventLogInfo) - - End If - Else - ' Not Windows Authentication - End If - - 'Updated to redirect to querrystring passed in prior to authentication - Dim querystringparams As String = "logon=" & DateTime.Now.Ticks.ToString() - Dim strUrl As String = NavigateURL(_portalSettings.ActiveTab.TabID, String.Empty, querystringparams) - - If Not HttpContext.Current.Request.Cookies("DNNReturnTo") Is Nothing _ - Then - querystringparams = - HttpContext.Current.Request.Cookies("DNNReturnTo").Value - 'ACD-8445 - If querystringparams <> String.Empty Then querystringparams = querystringparams.ToLower - If querystringparams <> String.Empty And querystringparams.IndexOf("windowssignin.aspx") < 0 Then _ - strUrl = querystringparams - End If - HttpContext.Current.Response.Redirect(strUrl, True) - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 05/23/2009 Created - ''' [mhorton] 03/22/2011 Fixed Item 6365 - ''' - ''' ------------------------------------------------------------------- - Public Function ManualLogon(ByVal userName As String, ByVal strPassword As String, - ByRef loginStatus As UserLoginStatus, ByVal ipAddress As String) As UserInfo - Dim objAuthUser As ADUserInfo = ProcessFormAuthentication(userName, strPassword) - Dim _config As Configuration = Configuration.GetConfig() - Dim objUser As UserInfo = Nothing - Dim objReturnUser As UserInfo = Nothing - - If (userName.Length > 0) And (objAuthUser IsNot Nothing) Then - If _config.StripDomainName Then - userName = Utilities.TrimUserDomainName(userName) - End If - objAuthUser.Username = userName - objUser = DNNUserController.GetUserByName(_portalSettings.PortalId, userName) - - objReturnUser = AuthenticateUser(objUser, objAuthUser, loginStatus, ipAddress) - If Not (objReturnUser Is Nothing) Then - objAuthUser.LastIPAddress = ipAddress - UpdateDNNUser(objReturnUser, objAuthUser) - End If - End If - - Return objReturnUser - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Process the authentication of the user whether they've logged in - ''' manually or automatically - ''' - ''' - ''' - ''' - ''' [mhorton] 02/19/2012 Created - ''' [sawest] 12/16/2016 Added enable password retrieval check before getting aspnetuser password - ''' - ''' ------------------------------------------------------------------- - 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 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 - - If (objUser.IsDeleted = False) Then - - objReturnUser = - DNNUserController.ValidateUser(_portalSettings.PortalId, objUser.Username, strPassword, - "Active Directory", _portalSettings.PortalName, ipAddress, - loginStatus) - ' Synchronize role membership if it's required in settings - If _config.SynchronizeRole Then - SynchronizeRoles(objReturnUser) - End If - Else - 'Only create user if Allowed to - 'ACD-4259 - 'Item 7703 - If Not _config.AutoCreateUsers = True Then - objUser.IsDeleted = False - objUser.Membership.IsDeleted = False - objUser.Membership.Password = strPassword - DNNUserController.UpdateUser(_portalSettings.PortalId, objUser) - CreateUser(objUser, loginStatus) - If loginStatus = UserLoginStatus.LOGIN_SUCCESS Then - objReturnUser = - DNNUserController.GetUserByName(_portalSettings.PortalId, objAuthUser.Username) - If _config.SynchronizeRole Then - SynchronizeRoles(objReturnUser) - End If - End If - End If - End If - Else - 'Only create user if Allowed to - '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) - 'objAuthUser.Membership.Password = Utilities.GetRandomPassword() - If objUser Is Nothing Then 'User doesn't exist in any portal - 'Item 6365 - objAuthUser.Membership.Password = Utilities.GetRandomPassword() - Dim objDnnUserInfo As New UserInfo - objDnnUserInfo.AffiliateID = objAuthUser.AffiliateID - objDnnUserInfo.DisplayName = objAuthUser.DisplayName - objDnnUserInfo.Email = objAuthUser.Email - objDnnUserInfo.FirstName = objAuthUser.FirstName - objDnnUserInfo.IsDeleted = objAuthUser.IsDeleted - objDnnUserInfo.IsSuperUser = objAuthUser.IsSuperUser - objDnnUserInfo.LastIPAddress = ipAddress - objDnnUserInfo.LastName = objAuthUser.LastName - objDnnUserInfo.Membership = objAuthUser.Membership - objDnnUserInfo.PortalID = objAuthUser.PortalID - objDnnUserInfo.Profile = objAuthUser.Profile - 'Deprecated in DNN 6.2 - 'objDnnUserInfo.RefreshRoles = objAuthUser.RefreshRoles - objDnnUserInfo.Roles = objAuthUser.Roles - objDnnUserInfo.Username = objAuthUser.Username - CreateUser(objDnnUserInfo, loginStatus) - Else 'user exists in another portal - 'No need to use randomizepassword here useing getrandompassword instead - 'password set above - Steven A West 1/11/2018 regarding #23 - objAuthUser.Membership.Password = RandomizePassword(objUser, "") - objAuthUser.UserID = objUser.UserID - CreateUser(CType(objAuthUser, UserInfo), loginStatus) - End If - If loginStatus = UserLoginStatus.LOGIN_SUCCESS Then - objReturnUser = - DNNUserController.GetUserByName(_portalSettings.PortalId, objAuthUser.Username) - 'intUserId = objReturnUser.UserID - If _config.SynchronizeRole Then - SynchronizeRoles(objReturnUser) - End If - End If - End If - End If - Return objReturnUser - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Updates the DNN profile with information pulled from the Active Directory - ''' - ''' - ''' - ''' - ''' [mhorton] 02/19/2012 Created - ''' [mhorton] 02/19/2012 Fixed Item 7739 Only updates the profile if information is pulled from the Active Directory. - ''' [sawest] 12/16/2016 Added photo item - ''' - ''' ------------------------------------------------------------------- - Private Sub UpdateDNNUser(ByVal objReturnUser As UserInfo, ByVal objAuthUser As ADUserInfo) - - With objReturnUser - If Not (objAuthUser.DisplayName = "") Then - .DisplayName = objAuthUser.DisplayName - End If - If Not (objAuthUser.Email = "") Then - .Email = objAuthUser.Email - End If - If Not (objAuthUser.FirstName = "") Then - .FirstName = objAuthUser.FirstName - End If - If Not (objAuthUser.LastIPAddress = "") Then - .LastIPAddress = objAuthUser.LastIPAddress - End If - If Not (objAuthUser.LastName = "") Then - .LastName = objAuthUser.LastName - End If - If Not (objAuthUser.Profile.FirstName = "") Then - .Profile.FirstName = objAuthUser.Profile.FirstName - End If - If Not (objAuthUser.Profile.LastName Is Nothing) Then - .Profile.LastName = objAuthUser.Profile.LastName - End If - If Not (objAuthUser.Profile.Street = "") Then - .Profile.Street = objAuthUser.Profile.Street - End If - If Not (objAuthUser.Profile.City = "") Then - .Profile.City = objAuthUser.Profile.City - End If - If Not (objAuthUser.Profile.Region = "") Then - .Profile.Region = objAuthUser.Profile.Region - End If - If Not (objAuthUser.Profile.PostalCode = "") Then - .Profile.PostalCode = objAuthUser.Profile.PostalCode - End If - If Not (objAuthUser.Profile.Country = "") Then - .Profile.Country = objAuthUser.Profile.Country - End If - If Not (objAuthUser.Profile.Telephone = "") Then - .Profile.Telephone = objAuthUser.Profile.Telephone - End If - If Not (objAuthUser.Profile.Fax = "") Then - .Profile.Fax = objAuthUser.Profile.Fax - End If - If Not (objAuthUser.Profile.Cell = "") Then - .Profile.Cell = objAuthUser.Profile.Cell - End If - If Not (objAuthUser.Profile.Fax = "") Then - .Profile.Fax = objAuthUser.Profile.Fax - End If - If Not (objAuthUser.Profile.Website = "") Then - .Profile.Website = objAuthUser.Profile.Website - End If - If Not (objAuthUser.Profile.Photo = "") Then - .Profile.Photo = objAuthUser.Profile.Photo - End If - End With - Dim objAuthUserController As New UserController - objAuthUserController.UpdateDnnUser(objReturnUser) - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 22/05/2008 Created - ''' - ''' ------------------------------------------------------------------- - Private Sub CreateUser(ByVal objUser As UserInfo, ByRef loginStatus As UserLoginStatus) - UpdateDisplayName(objUser) - objUser.Membership.Approved = True - - Dim createStatus As UserCreateStatus = DNNUserController.CreateUser(objUser) - - Dim args As UserCreatedEventArgs - If createStatus = UserCreateStatus.Success Then - args = New UserCreatedEventArgs(objUser) - Else ' registration error - args = New UserCreatedEventArgs(Nothing) - End If - args.CreateStatus = createStatus - OnUserCreated(args) - OnUserCreateCompleted(args) - - 'Item 7703 - If createStatus = UserCreateStatus.Success Or createStatus = UserCreateStatus.UserAlreadyRegistered Then - loginStatus = UserLoginStatus.LOGIN_SUCCESS - Else - loginStatus = UserLoginStatus.LOGIN_FAILURE - End If - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' RandomizePassword = Creates a random password to be stored in the database - ''' - ''' DNN User Object - ''' - ''' [mhorton] 12/10/2008 - ACD-4158 - ''' [sawest] 12/16/2016 Added check for enable password retrieval - ''' [sawest] 12/16/2016 Switched changepassword to changepasswordbytoken to support encrypted passwords - ''' - ''' ----------------------------------------------------------------------------- - Private Function RandomizePassword(ByVal objUser As UserInfo, ByRef strPassword As String) As String - 'ACD-4158 - Make sure password in the DNN database does not match that of the password in the AD. - - Dim aspNetUser As MembershipUser = Web.Security.Membership.GetUser(objUser.Username) - Dim strStoredPassword As String = "" - If Web.Security.Membership.Provider.EnablePasswordRetrieval And Web.Security.Membership.Provider.PasswordFormat <> MembershipPasswordFormat.Hashed Then - strStoredPassword = aspNetUser.GetPassword() - End If - - If strStoredPassword = strPassword Or String.IsNullOrEmpty(strStoredPassword) Then - Dim strRandomPassword As String = Utilities.GetRandomPassword() - DNNUserController.ResetPasswordToken(objUser, 2) - DNNUserController.ChangePasswordByToken(PortalSettings.PortalId, objUser.Username, strRandomPassword, objUser.PasswordResetToken.ToString) - Return strRandomPassword - Else - Return strStoredPassword - End If - End Function - ''' - ''' RandomizePassword = Creates a random password to be stored in the database - ''' First function calls the GetUser function again. Need an overloaded function that can accept a MembershipUser so GetUser is not called twice. - ''' - ''' MembershipUser object - ''' DNN User Object - ''' Password - ''' - ''' - ''' [sawest] 12/16/2016 Created function - ''' - Private Function RandomizePassword(ByVal aspNetUser As MembershipUser, ByVal objUser As UserInfo, ByRef strPassword As String) As String - - Dim strStoredPassword As String = "" - If Web.Security.Membership.Provider.EnablePasswordRetrieval And Web.Security.Membership.Provider.PasswordFormat <> MembershipPasswordFormat.Hashed Then - strStoredPassword = aspNetUser.GetPassword() - End If - - If strStoredPassword = strPassword Or String.IsNullOrEmpty(strStoredPassword) Then - Dim strRandomPassword As String = Utilities.GetRandomPassword() - DNNUserController.ResetPasswordToken(objUser, 2) - DNNUserController.ChangePasswordByToken(PortalSettings.PortalId, objUser.Username, strRandomPassword, objUser.PasswordResetToken.ToString) - Return strRandomPassword - Else - Return strStoredPassword - End If - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Sub AuthenticationLogoff() - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - - ' Log User Off from Cookie Authentication System - FormsAuthentication.SignOut() - If GetStatus(_portalSettings.PortalId) = AuthenticationStatus.WinLogon Then - SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinLogoff) - End If - - ' expire cookies - HttpContext.Current.Response.Cookies("portalaliasid").Value = Nothing - HttpContext.Current.Response.Cookies("portalaliasid").Path = "/" - HttpContext.Current.Response.Cookies("portalaliasid").Expires = DateTime.Now.AddYears(-30) - - HttpContext.Current.Response.Cookies("portalroles").Value = Nothing - HttpContext.Current.Response.Cookies("portalroles").Path = "/" - HttpContext.Current.Response.Cookies("portalroles").Expires = DateTime.Now.AddYears(-30) - - ' Redirect browser back to portal - If _portalSettings.HomeTabId <> -1 Then - HttpContext.Current.Response.Redirect(NavigateURL(_portalSettings.HomeTabId), True) - Else - 'If (_portalSettings.ActiveTab.IsAdminTab) Then - ' HttpContext.Current.Response.Redirect("~/" & glbDefaultPage, True) - 'Else - HttpContext.Current.Response.Redirect(NavigateURL(), True) - 'End If - End If - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function ProcessFormAuthentication(ByVal loggedOnUserName As String, ByVal loggedOnPassword As String) _ - As ADUserInfo - Dim config As Configuration = Configuration.GetConfig() - Dim objAuthUserController As New UserController - - If config.WindowsAuthentication Then - Dim userName As String = loggedOnUserName - - If config.StripDomainName Then - userName = Utilities.TrimUserDomainName(userName) - End If - - Dim objAuthUser As ADUserInfo = objAuthUserController.GetUser(userName, loggedOnPassword) - Return objAuthUser - End If - Return Nothing - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function GetDnnUser(ByVal portalId As Integer, ByVal loggedOnUserName As String) As UserInfo - Dim config As Configuration = Configuration.GetConfig() - Dim objUser As UserInfo - - Dim userName As String = loggedOnUserName - - If config.StripDomainName Then - userName = Utilities.TrimUserDomainName(userName) - End If - - 'TODO: Check the new concept of 3.0 for user in multi portal - ' check if this user exists in database for any portal - objUser = DNNUserController.GetUserByName(Null.NullInteger, userName) - If Not objUser Is Nothing Then - ' Check if user exists in this portal - If DNNUserController.GetUserByName(portalId, userName) Is Nothing Then - ' The user does not exist in this portal - add them - objUser.PortalID = portalId - DNNUserController.CreateUser(objUser) - End If - Return objUser - Else - ' the user does not exist - Return Nothing - End If - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function AuthenticationTypes() As Array - Return AuthenticationProvider.Instance(_mProviderTypeName).GetAuthenticationTypes - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function NetworkStatus() As String - Return AuthenticationProvider.Instance(_mProviderTypeName).GetNetworkStatus() - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetStatus(ByVal portalId As Integer) As AuthenticationStatus - 'Dim _portalSettings As PortalSettings = PortalController.GetCurrentPortalSettings - Dim authCookies As String = Configuration.AUTHENTICATION_STATUS_KEY & "." & portalId.ToString - Try - If Not HttpContext.Current.Request.Cookies(authCookies) Is Nothing Then - ' get Authentication from cookie - Dim _ - authenticationTicket As FormsAuthenticationTicket = - FormsAuthentication.Decrypt(HttpContext.Current.Request.Cookies(authCookies).Value) - Return _ - CType([Enum].Parse(GetType(AuthenticationStatus), authenticationTicket.UserData), - AuthenticationStatus) - Else - Return AuthenticationStatus.Undefined - End If - Catch ex As Exception - End Try - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 02/10/2012 Get the forms cookie timeout from the web.config - WorkItem:7620 - ''' - ''' ------------------------------------------------------------------- - Public Shared Sub SetStatus(ByVal portalId As Integer, ByVal status As AuthenticationStatus) - Dim authCookies As String = Configuration.AUTHENTICATION_STATUS_KEY & "." & portalId.ToString - Dim request As HttpRequest = HttpContext.Current.Request - Dim response As HttpResponse = HttpContext.Current.Response - Dim nTimeOut As Integer = GetAuthCookieTimeout() - - If nTimeOut = 0 Then - nTimeOut = 60 - End If - Dim _ - authenticationTicket As _ - New FormsAuthenticationTicket(1, authCookies, DateTime.Now, DateTime.Now.AddMinutes(nTimeOut), False, - status.ToString) - ' encrypt the ticket - Dim strAuthentication As String = FormsAuthentication.Encrypt(authenticationTicket) - - If Not request.Cookies(authCookies) Is Nothing Then - ' expire - request.Cookies(authCookies).Value = Nothing - request.Cookies(authCookies).Path = "/" - request.Cookies(authCookies).Expires = DateTime.Now.AddYears(-1) - End If - - response.Cookies(authCookies).Value = strAuthentication - response.Cookies(authCookies).Path = "/" - response.Cookies(authCookies).Expires = DateTime.Now.AddMinutes(nTimeOut) - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' [mhorton] Created to prevent duplicate code on role synchronization. - ''' - ''' - ''' [mhorton] 12/18/2006 Created - ''' [mhorton] 10/05/2009 Changed to use IsNotSimplyUser instead of GUID - WorkItem:2943 - ''' [mhorton] 29/05/2011 Fixed code for Item 6735 - ''' - ''' ------------------------------------------------------------------- - - Public Sub SynchronizeRoles(ByVal loggedOnUserName As String, ByVal intUserId As Integer) - Dim objAuthUserController As New UserController - Dim objAuthUser As ADUserInfo - - objAuthUser = objAuthUserController.GetUser(loggedOnUserName) - - ' user object might be in simple version in none active directory network - If objAuthUser.IsNotSimplyUser Then - objAuthUser.UserID = intUserId - UserController.AddUserRoles(_portalSettings.PortalId, objAuthUser) - 'User exists updating user profile - objAuthUserController.UpdateDnnUser(objAuthUser) - End If - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' [mhorton] Created to prevent duplicate code on role synchronization. - ''' - ''' - ''' [mhorton] 12/18/2006 Created - ''' [mhorton] 10/05/2009 Changed to use IsNotSimplyUser instead of GUID - WorkItem:2943 - ''' [mhorton] 02/09/2012 AD User losing host permissions when logging in - WorkItem:7424 - ''' [mhorton] 02/17/2012 User's profile was getting blanked when getting updated - Item 7739 - ''' - ''' ------------------------------------------------------------------- - Public Sub SynchronizeRoles(ByVal objUser As UserInfo) - Dim objAuthUserController As New UserController - Dim objAuthUser As ADUserInfo - - objAuthUser = objAuthUserController.GetUser(objUser.Username) - objAuthUser.IsSuperUser = objUser.IsSuperUser - ' user object might be in simple version in none active directory network - If objAuthUser.IsNotSimplyUser Then - objAuthUser.UserID = objUser.UserID - UserController.AddUserRoles(_portalSettings.PortalId, objAuthUser) - ''User exists updating user profile - 'objAuthUserController.UpdateDNNUser(objUser) - End If - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' This functions updates the display name so that it conforms to - ''' Portal rules - ''' - ''' - ''' - ''' - ''' [mhorton] 02/05/2008 Created - ''' - ''' ------------------------------------------------------------------- - Private Sub UpdateDisplayName(ByVal objDnnUser As UserInfo) - 'Update DisplayName to conform to Format - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim setting As Object = GetSetting(_portalSettings.PortalId, "Security_DisplayNameFormat") - If (Not setting Is Nothing) AndAlso (Not String.IsNullOrEmpty(Convert.ToString(setting))) Then - objDnnUser.UpdateDisplayName(Convert.ToString(setting)) - End If - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' This function pulls the cookie timeout from the web.config. - ''' - ''' - ''' [mhorton] Use only until core version 6.1.0 is the minimum supported version - ''' and then call GetAuthCookieTimeout from the core code. - ''' - ''' - ''' [mhorton] 02/10/2012 Created in response to WorkItem:7620 - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetAuthCookieTimeout() As Integer - - 'First check that the script module is installed - Dim configDoc As XmlDocument = Config.Load() - Dim formsNav As XPathNavigator = configDoc.CreateNavigator.SelectSingleNode("configuration/system.web/authentication/forms") - - If formsNav Is Nothing Then - ' Check the new XPath for a wrapped system.web - formsNav = configDoc.CreateNavigator.SelectSingleNode("configuration/location/system.web/authentication/forms") - End If - Return If((formsNav IsNot Nothing), XmlUtils.GetAttributeValueAsInteger(formsNav, "timeout", 30), 0) - - End Function - - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports DotNetNuke.Authentication.ActiveDirectory.ADSI +Imports DotNetNuke.Common +Imports DotNetNuke.Entities.Modules +Imports DotNetNuke.Entities.Portals +Imports DotNetNuke.Security.Membership +Imports DotNetNuke.Entities.Users +Imports DotNetNuke.Common.Utilities +Imports DotNetNuke.Services.Log.EventLog +Imports System.Xml.XPath +Imports System.Xml + +Imports DNNUserController = DotNetNuke.Entities.Users.UserController + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public Class AuthenticationController + Inherits UserUserControlBase + + Private ReadOnly _mProviderTypeName As String = "" + Private ReadOnly _portalSettings As PortalSettings + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + Dim config As Configuration = Configuration.GetConfig() + _portalSettings = PortalController.Instance.GetCurrentPortalSettings + _mProviderTypeName = config.ProviderTypeName + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 12/07/2008 ACD-7488 + ''' + ''' ------------------------------------------------------------------- + Public Sub AuthenticationLogon() + Dim objAuthUserController As New UserController + Dim objReturnUser As UserInfo + Dim loggedOnUserName As String = HttpContext.Current.Request.ServerVariables(Configuration.LOGON_USER_VARIABLE) + Dim loginStatus As UserLoginStatus = UserLoginStatus.LOGIN_FAILURE + + ' Get ipAddress for eventLog + Dim ipAddress As String = "" + If Not HttpContext.Current.Request.UserHostAddress Is Nothing Then + ipAddress = HttpContext.Current.Request.UserHostAddress + End If + + If (loggedOnUserName.Length > 0) Then + Dim objUser As UserInfo + Dim objAuthUser As ADUserInfo + objAuthUser = objAuthUserController.GetUser(loggedOnUserName) + objUser = DNNUserController.GetUserByName(_portalSettings.PortalId, loggedOnUserName) + + objReturnUser = AuthenticateUser(objUser, objAuthUser, loginStatus, ipAddress) + + + If Not (objReturnUser Is Nothing) Then + + objAuthUser.LastIPAddress = ipAddress + UpdateDNNUser(objReturnUser, objAuthUser) + + FormsAuthentication.SetAuthCookie(Convert.ToString(loggedOnUserName), True) + + SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinLogon) + + 'check if user has supplied custom value for expiration + Dim persistentCookieTimeout As Integer + If Not Config.GetSetting("PersistentCookieTimeout") Is Nothing Then + persistentCookieTimeout = Integer.Parse(Config.GetSetting("PersistentCookieTimeout")) + 'only use if non-zero, otherwise leave as asp.net value + If persistentCookieTimeout <> 0 Then + 'locate and update cookie + Dim authCookie As String = FormsAuthentication.FormsCookieName + For Each cookie As String In HttpContext.Current.Response.Cookies + If cookie.Equals(authCookie) Then + HttpContext.Current.Response.Cookies(cookie).Expires = + DateTime.Now.AddMinutes(persistentCookieTimeout) + End If + Next + End If + End If + + Dim objEventLog As New EventLogController + Dim objEventLogInfo As New LogInfo + objEventLogInfo.AddProperty("IP", ipAddress) + objEventLogInfo.LogPortalID = _portalSettings.PortalId + objEventLogInfo.LogPortalName = _portalSettings.PortalName + objEventLogInfo.LogUserID = objReturnUser.UserID + objEventLogInfo.LogUserName = loggedOnUserName + objEventLogInfo.AddProperty("WindowsAuthentication", "True") + objEventLogInfo.LogTypeKey = "LOGIN_SUCCESS" + + objEventLog.AddLog(objEventLogInfo) + + + 'Updated to redirect to querrystring passed in prior to authentication + Dim querystringparams As String = "logon=" & DateTime.Now.Ticks.ToString() + Dim strUrl As String = NavigateURL(_portalSettings.ActiveTab.TabID, String.Empty, querystringparams) + + If Not HttpContext.Current.Request.Cookies("DNNReturnTo") Is Nothing Then + querystringparams = HttpContext.Current.Request.Cookies("DNNReturnTo").Value + 'ACD-8445 + If querystringparams <> String.Empty Then + querystringparams = querystringparams.ToLower + If querystringparams.IndexOf("windowssignin.aspx") < 0 Then + strUrl = querystringparams + End If + End If + End If + HttpContext.Current.Response.Redirect(strUrl, True) + End If + Else + ' Not Windows Authentication + End If + + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 05/23/2009 Created + ''' [mhorton] 03/22/2011 Fixed Item 6365 + ''' + ''' ------------------------------------------------------------------- + Public Function ManualLogon(ByVal userName As String, ByVal strPassword As String, + ByRef loginStatus As UserLoginStatus, ByVal ipAddress As String) As UserInfo + Dim objAuthUser As ADUserInfo = ProcessFormAuthentication(userName, strPassword) + Dim _config As Configuration = Configuration.GetConfig() + Dim objUser As UserInfo = Nothing + Dim objReturnUser As UserInfo = Nothing + + If (userName.Length > 0) And (objAuthUser IsNot Nothing) Then + If _config.StripDomainName Then + userName = Utilities.TrimUserDomainName(userName) + End If + objAuthUser.Username = userName + objUser = DNNUserController.GetUserByName(_portalSettings.PortalId, userName) + + objReturnUser = AuthenticateUser(objUser, objAuthUser, loginStatus, ipAddress) + If Not (objReturnUser Is Nothing) Then + objAuthUser.LastIPAddress = ipAddress + UpdateDNNUser(objReturnUser, objAuthUser) + End If + End If + + Return objReturnUser + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Process the authentication of the user whether they've logged in + ''' manually or automatically + ''' + ''' + ''' + ''' + ''' [mhorton] 02/19/2012 Created + ''' [sawest] 12/16/2016 Added enable password retrieval check before getting aspnetuser password + ''' + ''' ------------------------------------------------------------------- + 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 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 + + If (objUser.IsDeleted = False) Then + + objReturnUser = + DNNUserController.ValidateUser(_portalSettings.PortalId, objUser.Username, strPassword, + "Active Directory", _portalSettings.PortalName, ipAddress, + loginStatus) + ' Synchronize role membership if it's required in settings + If _config.SynchronizeRole Then + SynchronizeRoles(objReturnUser) + End If + Else + 'Only create user if Allowed to + 'ACD-4259 + 'Item 7703 + If Not _config.AutoCreateUsers = True Then + objUser.IsDeleted = False + objUser.Membership.IsDeleted = False + objUser.Membership.Password = strPassword + DNNUserController.UpdateUser(_portalSettings.PortalId, objUser) + CreateUser(objUser, loginStatus) + If loginStatus = UserLoginStatus.LOGIN_SUCCESS Then + objReturnUser = + DNNUserController.GetUserByName(_portalSettings.PortalId, objAuthUser.Username) + If _config.SynchronizeRole Then + SynchronizeRoles(objReturnUser) + End If + End If + End If + End If + Else + 'Only create user if Allowed to + '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) + If objUser Is Nothing Then 'User doesn't exist in any portal + 'Item 6365 + objAuthUser.Membership.Password = Utilities.GetRandomPassword() + Dim objDnnUserInfo As New UserInfo + objDnnUserInfo.AffiliateID = objAuthUser.AffiliateID + objDnnUserInfo.DisplayName = objAuthUser.DisplayName + objDnnUserInfo.Email = objAuthUser.Email + objDnnUserInfo.FirstName = objAuthUser.FirstName + objDnnUserInfo.IsDeleted = objAuthUser.IsDeleted + objDnnUserInfo.IsSuperUser = objAuthUser.IsSuperUser + objDnnUserInfo.LastIPAddress = ipAddress + objDnnUserInfo.LastName = objAuthUser.LastName + objDnnUserInfo.Membership = objAuthUser.Membership + objDnnUserInfo.PortalID = objAuthUser.PortalID + objDnnUserInfo.Profile = objAuthUser.Profile + 'Deprecated in DNN 6.2 + 'objDnnUserInfo.RefreshRoles = objAuthUser.RefreshRoles + objDnnUserInfo.Roles = objAuthUser.Roles + objDnnUserInfo.Username = objAuthUser.Username + CreateUser(objDnnUserInfo, loginStatus) + Else 'user exists in another portal + 'Issue: 36 8/16/18 Steven A West + 'If user exists in other portal, password must match to create in different portal + 'This will reset all instances of this user's password to the same random password across all portals + objAuthUser.Membership.Password = RandomizeAndNormalizePassword(objUser, objAuthUser) + objAuthUser.UserID = objUser.UserID + CreateUser(CType(objAuthUser, UserInfo), loginStatus) + End If + If loginStatus = UserLoginStatus.LOGIN_SUCCESS Then + objReturnUser = + DNNUserController.GetUserByName(_portalSettings.PortalId, objAuthUser.Username) + 'intUserId = objReturnUser.UserID + If _config.SynchronizeRole Then + SynchronizeRoles(objReturnUser) + End If + End If + End If + End If + Return objReturnUser + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Updates the DNN profile with information pulled from the Active Directory + ''' + ''' + ''' + ''' + ''' [mhorton] 02/19/2012 Created + ''' [mhorton] 02/19/2012 Fixed Item 7739 Only updates the profile if information is pulled from the Active Directory. + ''' [sawest] 12/16/2016 Added photo item + ''' + ''' ------------------------------------------------------------------- + Private Sub UpdateDNNUser(ByVal objReturnUser As UserInfo, ByVal objAuthUser As ADUserInfo) + + With objReturnUser + If Not (objAuthUser.DisplayName = "") Then + .DisplayName = objAuthUser.DisplayName + End If + If Not (objAuthUser.Email = "") Then + .Email = objAuthUser.Email + End If + If Not (objAuthUser.FirstName = "") Then + .FirstName = objAuthUser.FirstName + End If + If Not (objAuthUser.LastIPAddress = "") Then + .LastIPAddress = objAuthUser.LastIPAddress + End If + If Not (objAuthUser.LastName = "") Then + .LastName = objAuthUser.LastName + End If + If Not (objAuthUser.Profile.FirstName = "") Then + .Profile.FirstName = objAuthUser.Profile.FirstName + End If + If Not (objAuthUser.Profile.LastName Is Nothing) Then + .Profile.LastName = objAuthUser.Profile.LastName + End If + If Not (objAuthUser.Profile.Street = "") Then + .Profile.Street = objAuthUser.Profile.Street + End If + If Not (objAuthUser.Profile.City = "") Then + .Profile.City = objAuthUser.Profile.City + End If + If Not (objAuthUser.Profile.Region = "") Then + .Profile.Region = objAuthUser.Profile.Region + End If + If Not (objAuthUser.Profile.PostalCode = "") Then + .Profile.PostalCode = objAuthUser.Profile.PostalCode + End If + If Not (objAuthUser.Profile.Country = "") Then + .Profile.Country = objAuthUser.Profile.Country + End If + If Not (objAuthUser.Profile.Telephone = "") Then + .Profile.Telephone = objAuthUser.Profile.Telephone + End If + If Not (objAuthUser.Profile.Fax = "") Then + .Profile.Fax = objAuthUser.Profile.Fax + End If + If Not (objAuthUser.Profile.Cell = "") Then + .Profile.Cell = objAuthUser.Profile.Cell + End If + If Not (objAuthUser.Profile.Fax = "") Then + .Profile.Fax = objAuthUser.Profile.Fax + End If + If Not (objAuthUser.Profile.Website = "") Then + .Profile.Website = objAuthUser.Profile.Website + End If + If Not (objAuthUser.Profile.Photo = "") Then + .Profile.Photo = objAuthUser.Profile.Photo + End If + End With + Dim objAuthUserController As New UserController + objAuthUserController.UpdateDnnUser(objReturnUser) + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 22/05/2008 Created + ''' + ''' ------------------------------------------------------------------- + Private Sub CreateUser(ByVal objUser As UserInfo, ByRef loginStatus As UserLoginStatus) + UpdateDisplayName(objUser) + objUser.Membership.Approved = True + + Dim createStatus As UserCreateStatus = DNNUserController.CreateUser(objUser) + + Dim args As UserCreatedEventArgs + If createStatus = UserCreateStatus.Success Then + args = New UserCreatedEventArgs(objUser) + Else ' registration error + args = New UserCreatedEventArgs(Nothing) + End If + args.CreateStatus = createStatus + OnUserCreated(args) + OnUserCreateCompleted(args) + + 'Item 7703 + If createStatus = UserCreateStatus.Success Or createStatus = UserCreateStatus.UserAlreadyRegistered Then + loginStatus = UserLoginStatus.LOGIN_SUCCESS + Else + loginStatus = UserLoginStatus.LOGIN_FAILURE + End If + End Sub + + ''' ----------------------------------------------------------------------------- + ''' + ''' RandomizePassword = Creates a random password to be stored in the database + ''' + ''' DNN User Object + ''' + ''' [mhorton] 12/10/2008 - ACD-4158 + ''' [sawest] 12/16/2016 Added check for enable password retrieval + ''' [sawest] 12/16/2016 Switched changepassword to changepasswordbytoken to support encrypted passwords + ''' + ''' ----------------------------------------------------------------------------- + Private Function RandomizePassword(ByVal objUser As UserInfo, ByRef strPassword As String) As String + 'ACD-4158 - Make sure password in the DNN database does not match that of the password in the AD. + + Dim aspNetUser As MembershipUser = Web.Security.Membership.GetUser(objUser.Username) + Dim strStoredPassword As String = "" + If Web.Security.Membership.Provider.EnablePasswordRetrieval And Web.Security.Membership.Provider.PasswordFormat <> MembershipPasswordFormat.Hashed Then + strStoredPassword = aspNetUser.GetPassword() + End If + + If strStoredPassword = strPassword Or String.IsNullOrEmpty(strStoredPassword) Then + Dim strRandomPassword As String = Utilities.GetRandomPassword() + DNNUserController.ChangePassword(objUser, DNNUserController.ResetPassword(objUser, "").ToString(), strRandomPassword) + 'DNNUserController.ResetPasswordToken(objUser, 2) + ' DNNUserController.ChangePasswordByToken(PortalSettings.PortalId, objUser.Username, strRandomPassword, objUser.PasswordResetToken.ToString) + Return strRandomPassword + Else + Return strStoredPassword + End If + End Function + ''' ----------------------------------------------------------------------------- + ''' + ''' RandomizeAndNormalizePassword = Creates a random password and sets all existing userobj in all portals to that password. + ''' + ''' DNN User Object + ''' + ''' [sawest] 8/14/2018 - Created + ''' + ''' ----------------------------------------------------------------------------- + Private Function RandomizeAndNormalizePassword(ByVal objUser As UserInfo, ByVal objAuthUser As ADUserInfo) As String + Dim myPortalController As New DotNetNuke.Entities.Portals.PortalController + Dim myPortals As ArrayList = myPortalController.GetPortals + Dim strRandomPassword As String = Utilities.GetRandomPassword() + For Each prtl As PortalInfo In myPortals + objUser = DNNUserController.GetUserByName(prtl.PortalID, objAuthUser.Username) + If Not objUser Is Nothing Then + DNNUserController.ChangePassword(objUser, DNNUserController.ResetPassword(objUser, "").ToString(), strRandomPassword) + End If + Next + Return strRandomPassword + End Function + ''' + ''' RandomizePassword = Creates a random password to be stored in the database + ''' First function calls the GetUser function again. Need an overloaded function that can accept a MembershipUser so GetUser is not called twice. + ''' + ''' MembershipUser object + ''' DNN User Object + ''' Password + ''' + ''' + ''' [sawest] 12/16/2016 Created function + ''' + Private Function RandomizePassword(ByVal aspNetUser As MembershipUser, ByVal objUser As UserInfo, ByRef strPassword As String) As String + + Dim strStoredPassword As String = "" + If Web.Security.Membership.Provider.EnablePasswordRetrieval And Web.Security.Membership.Provider.PasswordFormat <> MembershipPasswordFormat.Hashed Then + strStoredPassword = aspNetUser.GetPassword() + End If + + If strStoredPassword = strPassword Or String.IsNullOrEmpty(strStoredPassword) Then + Dim strRandomPassword As String = Utilities.GetRandomPassword() + DNNUserController.ResetPasswordToken(objUser, 2) + DNNUserController.ChangePasswordByToken(PortalSettings.PortalId, objUser.Username, strRandomPassword, objUser.PasswordResetToken.ToString) + Return strRandomPassword + Else + Return strStoredPassword + End If + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Sub AuthenticationLogoff() + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + + ' Log User Off from Cookie Authentication System + FormsAuthentication.SignOut() + If GetStatus(_portalSettings.PortalId) = AuthenticationStatus.WinLogon Then + SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinLogoff) + End If + + ' expire cookies + HttpContext.Current.Response.Cookies("portalaliasid").Value = Nothing + HttpContext.Current.Response.Cookies("portalaliasid").Path = "/" + HttpContext.Current.Response.Cookies("portalaliasid").Expires = DateTime.Now.AddYears(-30) + + HttpContext.Current.Response.Cookies("portalroles").Value = Nothing + HttpContext.Current.Response.Cookies("portalroles").Path = "/" + HttpContext.Current.Response.Cookies("portalroles").Expires = DateTime.Now.AddYears(-30) + + ' Redirect browser back to portal + If _portalSettings.HomeTabId <> -1 Then + HttpContext.Current.Response.Redirect(NavigateURL(_portalSettings.HomeTabId), True) + Else + 'If (_portalSettings.ActiveTab.IsAdminTab) Then + ' HttpContext.Current.Response.Redirect("~/" & glbDefaultPage, True) + 'Else + HttpContext.Current.Response.Redirect(NavigateURL(), True) + 'End If + End If + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function ProcessFormAuthentication(ByVal loggedOnUserName As String, ByVal loggedOnPassword As String) _ + As ADUserInfo + Dim config As Configuration = Configuration.GetConfig() + Dim objAuthUserController As New UserController + + If config.WindowsAuthentication Then + Dim userName As String = loggedOnUserName + + If config.StripDomainName Then + userName = Utilities.TrimUserDomainName(userName) + End If + + Dim objAuthUser As ADUserInfo = objAuthUserController.GetUser(userName, loggedOnPassword) + Return objAuthUser + End If + Return Nothing + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function GetDnnUser(ByVal portalId As Integer, ByVal loggedOnUserName As String) As UserInfo + Dim config As Configuration = Configuration.GetConfig() + Dim objUser As UserInfo + + Dim userName As String = loggedOnUserName + + If config.StripDomainName Then + userName = Utilities.TrimUserDomainName(userName) + End If + + 'TODO: Check the new concept of 3.0 for user in multi portal + ' check if this user exists in database for any portal + objUser = DNNUserController.GetUserByName(Null.NullInteger, userName) + If Not objUser Is Nothing Then + ' Check if user exists in this portal + If DNNUserController.GetUserByName(portalId, userName) Is Nothing Then + ' The user does not exist in this portal - add them + objUser.PortalID = portalId + DNNUserController.CreateUser(objUser) + End If + Return objUser + Else + ' the user does not exist + Return Nothing + End If + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function AuthenticationTypes() As Array + Return AuthenticationProvider.Instance(_mProviderTypeName).GetAuthenticationTypes + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function NetworkStatus() As String + Return AuthenticationProvider.Instance(_mProviderTypeName).GetNetworkStatus() + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetStatus(ByVal portalId As Integer) As AuthenticationStatus + 'Dim _portalSettings As PortalSettings = PortalController.GetCurrentPortalSettings + Dim authCookies As String = Configuration.AUTHENTICATION_STATUS_KEY & "." & portalId.ToString + Try + If Not HttpContext.Current.Request.Cookies(authCookies) Is Nothing Then + ' get Authentication from cookie + Dim _ + authenticationTicket As FormsAuthenticationTicket = + FormsAuthentication.Decrypt(HttpContext.Current.Request.Cookies(authCookies).Value) + Return _ + CType([Enum].Parse(GetType(AuthenticationStatus), authenticationTicket.UserData), + AuthenticationStatus) + Else + Return AuthenticationStatus.Undefined + End If + Catch ex As Exception + End Try + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 02/10/2012 Get the forms cookie timeout from the web.config - WorkItem:7620 + ''' + ''' ------------------------------------------------------------------- + Public Shared Sub SetStatus(ByVal portalId As Integer, ByVal status As AuthenticationStatus) + Dim authCookies As String = Configuration.AUTHENTICATION_STATUS_KEY & "." & portalId.ToString + Dim request As HttpRequest = HttpContext.Current.Request + Dim response As HttpResponse = HttpContext.Current.Response + Dim nTimeOut As Integer = GetAuthCookieTimeout() + + If nTimeOut = 0 Then + nTimeOut = 60 + End If + Dim _ + authenticationTicket As _ + New FormsAuthenticationTicket(1, authCookies, DateTime.Now, DateTime.Now.AddMinutes(nTimeOut), False, + status.ToString) + ' encrypt the ticket + Dim strAuthentication As String = FormsAuthentication.Encrypt(authenticationTicket) + + If Not request.Cookies(authCookies) Is Nothing Then + ' expire + request.Cookies(authCookies).Value = Nothing + request.Cookies(authCookies).Path = "/" + request.Cookies(authCookies).Expires = DateTime.Now.AddYears(-1) + End If + + response.Cookies(authCookies).Value = strAuthentication + response.Cookies(authCookies).Path = "/" + response.Cookies(authCookies).Expires = DateTime.Now.AddMinutes(nTimeOut) + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' [mhorton] Created to prevent duplicate code on role synchronization. + ''' + ''' + ''' [mhorton] 12/18/2006 Created + ''' [mhorton] 10/05/2009 Changed to use IsNotSimplyUser instead of GUID - WorkItem:2943 + ''' [mhorton] 29/05/2011 Fixed code for Item 6735 + ''' + ''' ------------------------------------------------------------------- + + Public Sub SynchronizeRoles(ByVal loggedOnUserName As String, ByVal intUserId As Integer) + Dim objAuthUserController As New UserController + Dim objAuthUser As ADUserInfo + + objAuthUser = objAuthUserController.GetUser(loggedOnUserName) + + ' user object might be in simple version in none active directory network + If objAuthUser.IsNotSimplyUser Then + objAuthUser.UserID = intUserId + UserController.AddUserRoles(_portalSettings.PortalId, objAuthUser) + 'User exists updating user profile + objAuthUserController.UpdateDnnUser(objAuthUser) + End If + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' [mhorton] Created to prevent duplicate code on role synchronization. + ''' + ''' + ''' [mhorton] 12/18/2006 Created + ''' [mhorton] 10/05/2009 Changed to use IsNotSimplyUser instead of GUID - WorkItem:2943 + ''' [mhorton] 02/09/2012 AD User losing host permissions when logging in - WorkItem:7424 + ''' [mhorton] 02/17/2012 User's profile was getting blanked when getting updated - Item 7739 + ''' + ''' ------------------------------------------------------------------- + Public Sub SynchronizeRoles(ByVal objUser As UserInfo) + Dim objAuthUserController As New UserController + Dim objAuthUser As ADUserInfo + + objAuthUser = objAuthUserController.GetUser(objUser.Username) + objAuthUser.IsSuperUser = objUser.IsSuperUser + ' user object might be in simple version in none active directory network + If objAuthUser.IsNotSimplyUser Then + objAuthUser.UserID = objUser.UserID + UserController.AddUserRoles(_portalSettings.PortalId, objAuthUser) + ''User exists updating user profile + 'objAuthUserController.UpdateDNNUser(objUser) + End If + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' This functions updates the display name so that it conforms to + ''' Portal rules + ''' + ''' + ''' + ''' + ''' [mhorton] 02/05/2008 Created + ''' + ''' ------------------------------------------------------------------- + Private Sub UpdateDisplayName(ByVal objDnnUser As UserInfo) + 'Update DisplayName to conform to Format + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim setting As Object = GetSetting(_portalSettings.PortalId, "Security_DisplayNameFormat") + If (Not setting Is Nothing) AndAlso (Not String.IsNullOrEmpty(Convert.ToString(setting))) Then + objDnnUser.UpdateDisplayName(Convert.ToString(setting)) + End If + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' This function pulls the cookie timeout from the web.config. + ''' + ''' + ''' [mhorton] Use only until core version 6.1.0 is the minimum supported version + ''' and then call GetAuthCookieTimeout from the core code. + ''' + ''' + ''' [mhorton] 02/10/2012 Created in response to WorkItem:7620 + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetAuthCookieTimeout() As Integer + + 'First check that the script module is installed + Dim configDoc As XmlDocument = Config.Load() + Dim formsNav As XPathNavigator = configDoc.CreateNavigator.SelectSingleNode("configuration/system.web/authentication/forms") + + If formsNav Is Nothing Then + ' Check the new XPath for a wrapped system.web + formsNav = configDoc.CreateNavigator.SelectSingleNode("configuration/location/system.web/authentication/forms") + End If + Return If((formsNav IsNot Nothing), XmlUtils.GetAttributeValueAsInteger(formsNav, "timeout", 30), 0) + + End Function + + End Class +End Namespace diff --git a/Components/AuthenticationProvider.vb b/Components/AuthenticationProvider.vb index 2101446..792e149 100644 --- a/Components/AuthenticationProvider.vb +++ b/Components/AuthenticationProvider.vb @@ -1,82 +1,82 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Framework - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public MustInherit Class AuthenticationProvider - -#Region "Shared/Static Methods" - - ' singleton reference to the instantiated object - Private Shared objProvider As AuthenticationProvider = Nothing - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Shared Sub New() - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim _config As Configuration = Configuration.GetConfig() - Dim strKey As String = "AuthenticationProvider" & _portalSettings.PortalId.ToString - - objProvider = CType (Reflection.CreateObject (_config.ProviderTypeName, strKey), AuthenticationProvider) - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Shadows Function Instance (ByVal AuthenticationTypeName As String) As AuthenticationProvider - 'CreateProvider() - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim strKey As String = "AuthenticationProvider" & _portalSettings.PortalId.ToString - objProvider = CType (Reflection.CreateObject (AuthenticationTypeName, strKey), AuthenticationProvider) - Return objProvider - End Function - -#End Region - -#Region "Abstract Methods" - - Public MustOverride Overloads Function GetUser (ByVal LoggedOnUserName As String, _ - ByVal LoggedOnPassword As String) As ADUserInfo - - Public MustOverride Overloads Function GetUser (ByVal LoggedOnUserName As String) As ADUserInfo - Public MustOverride Function GetGroups() As ArrayList - Public MustOverride Function GetGroups(ByVal arrUserPortalRoles As ArrayList) As ArrayList - Public MustOverride Function GetAuthenticationTypes() As Array - Public MustOverride Function GetNetworkStatus() As String - -#End Region - End Class +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + +Imports DotNetNuke.Entities.Portals +Imports DotNetNuke.Framework + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public MustInherit Class AuthenticationProvider + +#Region "Shared/Static Methods" + + ' singleton reference to the instantiated object + Private Shared objProvider As AuthenticationProvider = Nothing + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Shared Sub New() + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim _config As Configuration = Configuration.GetConfig() + Dim strKey As String = "AuthenticationProvider" & _portalSettings.PortalId.ToString + + objProvider = CType (Reflection.CreateObject (_config.ProviderTypeName, strKey), AuthenticationProvider) + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Shadows Function Instance (ByVal AuthenticationTypeName As String) As AuthenticationProvider + 'CreateProvider() + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim strKey As String = "AuthenticationProvider" & _portalSettings.PortalId.ToString + objProvider = CType (Reflection.CreateObject (AuthenticationTypeName, strKey), AuthenticationProvider) + Return objProvider + End Function + +#End Region + +#Region "Abstract Methods" + + Public MustOverride Overloads Function GetUser (ByVal LoggedOnUserName As String, _ + ByVal LoggedOnPassword As String) As ADUserInfo + + Public MustOverride Overloads Function GetUser (ByVal LoggedOnUserName As String) As ADUserInfo + Public MustOverride Function GetGroups() As ArrayList + Public MustOverride Function GetGroups(ByVal arrUserPortalRoles As ArrayList) As ArrayList + Public MustOverride Function GetAuthenticationTypes() As Array + Public MustOverride Function GetNetworkStatus() As String + +#End Region + End Class End Namespace \ No newline at end of file diff --git a/Components/Common/AuthenticationMode.vb b/Components/Common/AuthenticationMode.vb index d6a6d26..5a5be81 100644 --- a/Components/Common/AuthenticationMode.vb +++ b/Components/Common/AuthenticationMode.vb @@ -1,38 +1,38 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - - -Namespace DotNetNuke.Authentication.ActiveDirectory - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum AuthenticationMode As Integer - FormAuthentication - WindowsAuthentication - MixedAuthentication - FormAndAuthentication - End Enum -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + + +Namespace DotNetNuke.Authentication.ActiveDirectory + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum AuthenticationMode As Integer + FormAuthentication + WindowsAuthentication + MixedAuthentication + FormAndAuthentication + End Enum +End Namespace diff --git a/Components/Common/AuthenticationStatus.vb b/Components/Common/AuthenticationStatus.vb index 0f84ca8..c670938 100644 --- a/Components/Common/AuthenticationStatus.vb +++ b/Components/Common/AuthenticationStatus.vb @@ -1,38 +1,38 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - - -Namespace DotNetNuke.Authentication.ActiveDirectory - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum AuthenticationStatus As Integer - Undefined - WinProcess - WinLogon - WinLogoff - End Enum -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + + +Namespace DotNetNuke.Authentication.ActiveDirectory + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum AuthenticationStatus As Integer + Undefined + WinProcess + WinLogon + WinLogoff + End Enum +End Namespace diff --git a/Components/Common/ObjectClass.vb b/Components/Common/ObjectClass.vb index 45d8614..92d26db 100644 --- a/Components/Common/ObjectClass.vb +++ b/Components/Common/ObjectClass.vb @@ -1,50 +1,50 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - - -Namespace DotNetNuke.Authentication.ActiveDirectory - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum ObjectClass As Integer - domainDNS - '= 203 - person - '= 210 - user - '= 211 - group - '= 212 - contact - '= 213 - computer - '= 214 - printer - '= 215 - crossRef - '= 216 - End Enum -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + + +Namespace DotNetNuke.Authentication.ActiveDirectory + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum ObjectClass As Integer + domainDNS + '= 203 + person + '= 210 + user + '= 211 + group + '= 212 + contact + '= 213 + computer + '= 214 + printer + '= 215 + crossRef + '= 216 + End Enum +End Namespace diff --git a/Components/Config/ApplicationPool.vb b/Components/Config/ApplicationPool.vb index 7d94c15..15c833f 100644 --- a/Components/Config/ApplicationPool.vb +++ b/Components/Config/ApplicationPool.vb @@ -1,16 +1,16 @@ -Namespace DotNetNuke.Authentication.ActiveDirectory - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 02/05/2008 Created - ''' - ''' ------------------------------------------------------------------- - Public Class ApplicationPool - ' Fields - Public DotNetVersion As String = "v2.0.50727" - Public Name As String = "" - End Class -End Namespace +Namespace DotNetNuke.Authentication.ActiveDirectory + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 02/05/2008 Created + ''' + ''' ------------------------------------------------------------------- + Public Class ApplicationPool + ' Fields + Public DotNetVersion As String = "v2.0.50727" + Public Name As String = "" + End Class +End Namespace diff --git a/Components/Config/Configuration.vb b/Components/Config/Configuration.vb index c732b85..2712049 100644 --- a/Components/Config/Configuration.vb +++ b/Components/Config/Configuration.vb @@ -1,624 +1,645 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Framework.Providers -Imports DotNetNuke.Security -Imports DotNetNuke.Common.Utilities - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public Class Configuration - - Public Const AUTHENTICATION_PATH As String = "/DesktopModules/AuthenticationServices/ActiveDirectory/" - Public Const AUTHENTICATION_LOGON_PAGE As String = "WindowsSignin.aspx" - Public Const AUTHENTICATION_LOGOFF_PAGE As String = "Logoff.aspx" - Public Const AUTHENTICATION_KEY As String = "authentication" - Public Const AUTHENTICATION_STATUS_KEY As String = "authentication.status" - Public Const LOGON_USER_VARIABLE As String = "LOGON_USER" - Private Const AUTHENTICATION_CONFIG_CACHE_PREFIX As String = "Authentication.Configuration" - - 'Setting Name Constants - Public Const AD_WINDOWSAUTHENTICATION As String = "AD_WindowsAuthentication" - Public Const AD_HIDEWINDOWSLOGIN As String = "AD_HideWindowsLogin" - Public Const AD_SYNCHRONIZEROLE As String = "AD_SynchronizeRole" - Public Const AD_SYNCHRONIZEPASSWORD As String = "AD_SynchronizePassword" - Public Const AD_STRIPDOMAINNAME As String = "AD_StripDomainName" - Public Const AD_ROOTDOMAIN As String = "AD_RootDomain" - Public Const AD_EMAILDOMAIN As String = "AD_EmailDomain" - Public Const AD_USERNAME As String = "AD_UserName" - Public Const AD_PROVIDERTYPENAME As String = "AD_ProviderTypeName" - Public Const AD_AUTHENTICATIONTYPE As String = "AD_AuthenticationType" - Public Const AD_AUTHENTICATIONPASSWORD As String = "AD_AuthenticationPassword" - Public Const AD_SUBNET As String = "AD_SubNet" - Public Const AD_AUTOCREATEUSERS As String = "AD_AutoCreateUsers" - Public Const AD_DEFAULTDOMAIN As String = "AD_DefaultDomain" - Public Const AD_SEARCHBOTS As String = "AD_SearchBots" - Public Const AD_SYNCPHOTO As String = "AD_SyncPhoto" - - - Private mPortalId As Integer - Private mWindowsAuthentication As Boolean = False - Private mHideWindowsLogin As Boolean = False - Private mRootDomain As String = "" - Private mUserName As String = "" - Private mPassword As String = "" - Private mSynchronizeRole As Boolean = False - Private mSynchronizePassword As Boolean = False - ' reserve for future feature - Private mStripDomainName As Boolean = False - Private mProviderTypeName As String = DefaultProviderTypeName - Private mAuthenticationType As String = DefaultAuthenticationType - Private mEmailDomain As String = DefaultEmailDomain - Private mAutoIP As String = "" - 'ACD-4259 - Private mAutoCreateUsers As Boolean = False - 'ACD-5585 - Private mDefaultDomain As String = "" - 'WorkItems 4766 and 4077 - Private mBots As String = "" - Private mPhoto As Boolean = False - - ''' ------------------------------------------------------------------- - ''' - ''' - Obtain Authentication settings from database - ''' - ''' - ''' - Setting records are stored in ModuleSettings table, separately for each portal, - ''' this method allows each portal could have different accessing method to Windows Active Directory - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [cnurse] 07/04/2007 Moved settings to Authentication Module from Site Settings - ''' [mhorton] 01/02/2008 Move mPortalID inside of the Try/Catch in case PortalSettings hasn't been initialized. - ''' [mhorton] 06/15/2008 ACD-7913 - ''' [sawest] 12/16/2016 Added if contain statements. If a key was missing, an error was thrown in the try block and the rest of the settings did not load. - ''' [sawest] 12/16/2016 Switched to using constants for setting names - ''' [sawest] 01/02/2017 Added photo setting and constant - ''' - ''' ------------------------------------------------------------------- - Sub New() - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim _providerConfiguration As ProviderConfiguration = ProviderConfiguration.GetProviderConfiguration(AUTHENTICATION_KEY) - Dim objSecurity As New PortalSecurity - - Try - If _providerConfiguration.DefaultProvider Is Nothing Then - ' No provider specified, so disable authentication feature - Return - Else - mPortalId = _portalSettings.PortalId - Dim CambrianSettings As Dictionary(Of String, String) = PortalController.Instance.GetPortalSettings(PortalId) - If CambrianSettings.ContainsKey(AD_WINDOWSAUTHENTICATION) Then - mWindowsAuthentication = CType(Null.GetNull(CambrianSettings(AD_WINDOWSAUTHENTICATION), mWindowsAuthentication), Boolean) - End If - If CambrianSettings.ContainsKey(AD_HIDEWINDOWSLOGIN) Then - mHideWindowsLogin = CType(Null.GetNull(CambrianSettings(AD_HIDEWINDOWSLOGIN), mHideWindowsLogin), Boolean) - End If - If CambrianSettings.ContainsKey(AD_SYNCHRONIZEROLE) Then - mSynchronizeRole = CType(Null.GetNull(CambrianSettings(AD_SYNCHRONIZEROLE), mSynchronizeRole), Boolean) - End If - If CambrianSettings.ContainsKey(AD_SYNCHRONIZEPASSWORD) Then - mSynchronizePassword = CType(Null.GetNull(CambrianSettings(AD_SYNCHRONIZEPASSWORD), mSynchronizePassword), Boolean) - End If - If CambrianSettings.ContainsKey(AD_STRIPDOMAINNAME) Then - mStripDomainName = CType(Null.GetNull(CambrianSettings(AD_STRIPDOMAINNAME), mStripDomainName), Boolean) - End If - If CambrianSettings.ContainsKey(AD_ROOTDOMAIN) Then - mRootDomain = CType(Null.GetNull(CambrianSettings(AD_ROOTDOMAIN), mRootDomain), String) - End If - If CambrianSettings.ContainsKey(AD_EMAILDOMAIN) Then - mEmailDomain = CType(Null.GetNull(CambrianSettings(AD_EMAILDOMAIN), mEmailDomain), String) - End If - If CambrianSettings.ContainsKey(AD_USERNAME) Then - mUserName = CType(Null.GetNull(CambrianSettings(AD_USERNAME), mUserName), String) - End If - If CambrianSettings.ContainsKey(AD_PROVIDERTYPENAME) Then - mProviderTypeName = CType(Null.GetNull(CambrianSettings(AD_PROVIDERTYPENAME), mProviderTypeName), String) - End If - If CambrianSettings.ContainsKey(AD_AUTHENTICATIONTYPE) Then - mAuthenticationType = CType(Null.GetNull(CambrianSettings(AD_AUTHENTICATIONTYPE), mAuthenticationType), String) - End If - If CambrianSettings.ContainsKey(AD_AUTHENTICATIONPASSWORD) Then - mPassword = objSecurity.Decrypt(AUTHENTICATION_KEY, CType(Null.GetNull(CambrianSettings(AD_AUTHENTICATIONPASSWORD), mPassword.ToString), String)) - End If - If CambrianSettings.ContainsKey(AD_SUBNET) Then - mAutoIP = CType(Null.GetNull(CambrianSettings(AD_SUBNET), mAutoIP), String) - End If - If CambrianSettings.ContainsKey(AD_AUTOCREATEUSERS) Then - 'ACD-4259 - mAutoCreateUsers = CType(Null.GetNull(CambrianSettings(AD_AUTOCREATEUSERS), mAutoCreateUsers), Boolean) - End If - If CambrianSettings.ContainsKey(AD_DEFAULTDOMAIN) Then - 'ACD-5585 - mDefaultDomain = CType(Null.GetNull(CambrianSettings(AD_DEFAULTDOMAIN), mDefaultDomain), String) - End If - If CambrianSettings.ContainsKey(AD_SEARCHBOTS) Then - 'WorkItems 4766 and 4077 - mBots = CType(Null.GetNull(CambrianSettings(AD_SEARCHBOTS), mBots), String) - End If - If CambrianSettings.ContainsKey(AD_SYNCPHOTO) Then - mPhoto = CType(Null.GetNull(CambrianSettings(AD_SYNCPHOTO), mPhoto), Boolean) - End If - End If - Catch ex As Exception - 'Log the exception - ADSI.Utilities.AddEventLog(_portalSettings, "There was a problem loading the settings for the AD Authentication Provider. Error: " & ex.Message) - End Try - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' Obtain Authentication Configuration - ''' - ''' - ''' Accessing Active Directory also costs resource, - ''' so we only do it once then save into cache for later use - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 01/02/2008 Added Try/Catch in case PortalsSettings haven't - ''' been initialized yet. - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetConfig() As Configuration - Dim config As Configuration = Nothing - Try - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim strKey As String = AUTHENTICATION_CONFIG_CACHE_PREFIX & "." & CStr(_portalSettings.PortalId) - - config = CType(DataCache.GetCache(strKey), Configuration) - - If config Is Nothing Then - config = New Configuration - DataCache.SetCache(strKey, config) - End If - - Catch exc As Exception - ' Problems reading AD config, just return nothing - End Try - - Return config - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 15/10/2007 -Fixed ACD-3084 - ''' - ''' ------------------------------------------------------------------- - Public Shared Sub ResetConfig() - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim strKey As String = AUTHENTICATION_CONFIG_CACHE_PREFIX & "." & CStr(_portalSettings.PortalId) - DataCache.RemoveCache(strKey) - strKey = "AuthenticationProvider" & CStr(_portalSettings.PortalId) - DataCache.RemoveCache(strKey) - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 06/15/2008 ACD-7913 - ''' [mhorton] 04/14/2013 Item 8473 Null values not saved in DNN7. Use blank string - ''' [mhorton] 04/18/2013 Item 8512 Null values not saved in DNN7. Use blank string - ''' [sawest] 12/16/2016 Condensed some code. Switched to using constants for setting names - ''' - ''' ------------------------------------------------------------------- - Public Shared Sub UpdateConfig(ByVal PortalID As Integer, - ByVal WindowsAuthentication As Boolean, - ByVal Hidden As Boolean, - ByVal RootDomain As String, - ByVal EmailDomain As String, - ByVal AuthenticationUserName As String, - ByVal AuthenticationPassword As String, - ByVal SynchronizeRole As Boolean, - ByVal SynchronizePassword As Boolean, - ByVal StripDomainName As Boolean, - ByVal ProviderTypeName As String, - ByVal AuthenticationType As String, - ByVal SubNet As String, - ByVal DefaultDomain As String, - ByVal AutoCreateUsers As Boolean, - ByVal Bots As String, - ByVal Photo As Boolean) - - Dim objSecurity As New PortalSecurity - 'Item 8512 - PortalController.UpdatePortalSetting(PortalID, AD_WINDOWSAUTHENTICATION, WindowsAuthentication.ToString) - PortalController.UpdatePortalSetting(PortalID, AD_HIDEWINDOWSLOGIN, Hidden.ToString) - PortalController.UpdatePortalSetting(PortalID, AD_SYNCHRONIZEROLE, SynchronizeRole.ToString) - PortalController.UpdatePortalSetting(PortalID, AD_SYNCHRONIZEPASSWORD, SynchronizePassword.ToString) - PortalController.UpdatePortalSetting(PortalID, AD_STRIPDOMAINNAME, StripDomainName.ToString) - PortalController.UpdatePortalSetting(PortalID, AD_ROOTDOMAIN, If(String.IsNullOrEmpty(RootDomain), "", RootDomain)) - PortalController.UpdatePortalSetting(PortalID, AD_EMAILDOMAIN, If(String.IsNullOrEmpty(EmailDomain), "", EmailDomain)) - PortalController.UpdatePortalSetting(PortalID, AD_USERNAME, If(String.IsNullOrEmpty(AuthenticationUserName), "", AuthenticationUserName)) - PortalController.UpdatePortalSetting(PortalID, AD_PROVIDERTYPENAME, If(String.IsNullOrEmpty(ProviderTypeName), "", ProviderTypeName)) - PortalController.UpdatePortalSetting(PortalID, AD_AUTHENTICATIONTYPE, If(String.IsNullOrEmpty(AuthenticationType), "", AuthenticationType)) - PortalController.UpdatePortalSetting(PortalID, AD_SUBNET, If(String.IsNullOrEmpty(SubNet), "127.0.0.1", SubNet)) - 'ACD-5585 - PortalController.UpdatePortalSetting(PortalID, AD_DEFAULTDOMAIN, If(String.IsNullOrEmpty(DefaultDomain), "", DefaultDomain)) - 'ACD-4259 - PortalController.UpdatePortalSetting(PortalID, AD_AUTOCREATEUSERS, AutoCreateUsers.ToString) - 'WorkItems 4766 and 4077 - PortalController.UpdatePortalSetting(PortalID, AD_SEARCHBOTS, If(String.IsNullOrEmpty(Bots), "", Bots)) - PortalController.UpdatePortalSetting(PortalID, AD_SYNCPHOTO, Photo.ToString) - 'Only update password if it has been changed - If AuthenticationPassword.Length > 0 Then - PortalController.UpdatePortalSetting(PortalID, AD_AUTHENTICATIONPASSWORD, Convert.ToString(objSecurity.Encrypt(AUTHENTICATION_KEY, AuthenticationPassword))) - End If - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared ReadOnly Property DefaultProviderTypeName() As String - Get - Return _ - "DotNetNuke.Authentication.ActiveDirectory.ADSI.ADSIProvider, DotNetNuke.Authentication.ActiveDirectory" - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared ReadOnly Property DefaultAuthenticationType() As String - Get - Return "Delegation" - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared ReadOnly Property DefaultEmailDomain() As String - Get - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim _portalEmail As String = _portalSettings.Email - Dim sRet As String = "" - If Not String.IsNullOrEmpty(_portalEmail) Then - Dim nPos As Integer = _portalEmail.IndexOf("@") - If nPos > 0 Then - sRet = _portalEmail.Substring(nPos) - End If - End If - Return sRet - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property WindowsAuthentication() As Boolean - Get - Return mWindowsAuthentication - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 12/10/2007 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property HideWindowsLogin() As Boolean - Get - Return mHideWindowsLogin - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property RootDomain() As String - Get - Return mRootDomain - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property UserName() As String - Get - Return mUserName - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property Password() As String - Get - Return mPassword - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' Role membership to be synchronized (Authentication/DNN) when user logon - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property SynchronizeRole() As Boolean - Get - Return mSynchronizeRole - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' Process checking DNN password against Windows password - ''' update DNN password if not match - ''' requires modified signin page for functionality - ''' - ''' - ''' This process quite expensive in terms of performance - ''' Reserve for future implementation - ''' - ''' - ''' [tamttt] 08/01/2005 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property SynchronizePassword() As Boolean - Get - Return mSynchronizePassword - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' Determin if Domain Name should be stripped from UserName - ''' - ''' - ''' In an environment with single domain or unique username across domains - ''' - ''' - ''' [jhoskins] 10/10/2007 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property StripDomainName() As Boolean - Get - Return mStripDomainName - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property PortalId() As Integer - Get - Return mPortalId - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ProviderTypeName() As String - Get - Return mProviderTypeName - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' It was configured in web.config, move to site settings is more flexible - ''' When configure first time, only default provider (ADs) available to provide list of type to select - ''' - ''' - ''' [tamttt] 08/01/2005 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property AuthenticationType() As String - Get - Return mAuthenticationType - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property EmailDomain() As String - Get - Return mEmailDomain - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' Used to determine if a valid input is provided, if not, return default value - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [tamttt] 08/20/2005 Replace by core Null.GetNull function - ''' - ''' ------------------------------------------------------------------- - Private Function GetValue(ByVal Input As Object, ByVal DefaultValue As String) As String - If Input Is Nothing Then - Return DefaultValue - Else - Return CStr(Input) - End If - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Returns list of search crawlers/bots that can index the site - WorkItems 4766 and 4077 - ''' - ''' - ''' - ''' - ''' [mhorton] 17/04/2011 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property Bots() As String - Get - Return mBots - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 17/10/2007 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property AutoIP() As String - Get - Return mAutoIP - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 4/05/2009 created based on code supplied by - ''' Nathan Truhan - ACD-4259 - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property AutoCreateUsers() As String - Get - Return mAutoCreateUsers - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 27/04/2009 Created ACD-5585 - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property DefaultDomain() As String - Get - Return mDefaultDomain - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [sawest] 01/02/2017 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property Photo() As String - Get - Return mPhoto - End Get - End Property - - - - - End Class - - -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports DotNetNuke.Entities.Portals +Imports DotNetNuke.Framework.Providers +Imports DotNetNuke.Security +Imports DotNetNuke.Common.Utilities + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public Class Configuration + + Public Const AUTHENTICATION_PATH As String = "/DesktopModules/AuthenticationServices/ActiveDirectory/" + Public Const AUTHENTICATION_LOGON_PAGE As String = "WindowsSignin.aspx" + Public Const AUTHENTICATION_LOGOFF_PAGE As String = "Logoff.aspx" + Public Const AUTHENTICATION_KEY As String = "authentication" + Public Const AUTHENTICATION_STATUS_KEY As String = "authentication.status" + Public Const LOGON_USER_VARIABLE As String = "LOGON_USER" + Private Const AUTHENTICATION_CONFIG_CACHE_PREFIX As String = "Authentication.Configuration" + + 'Setting Name Constants + Public Const AD_WINDOWSAUTHENTICATION As String = "AD_WindowsAuthentication" + Public Const AD_HIDEWINDOWSLOGIN As String = "AD_HideWindowsLogin" + Public Const AD_SYNCHRONIZEROLE As String = "AD_SynchronizeRole" + Public Const AD_SYNCHRONIZEPASSWORD As String = "AD_SynchronizePassword" + Public Const AD_STRIPDOMAINNAME As String = "AD_StripDomainName" + Public Const AD_ROOTDOMAIN As String = "AD_RootDomain" + Public Const AD_EMAILDOMAIN As String = "AD_EmailDomain" + Public Const AD_USERNAME As String = "AD_UserName" + Public Const AD_PROVIDERTYPENAME As String = "AD_ProviderTypeName" + Public Const AD_AUTHENTICATIONTYPE As String = "AD_AuthenticationType" + Public Const AD_AUTHENTICATIONPASSWORD As String = "AD_AuthenticationPassword" + Public Const AD_SUBNET As String = "AD_SubNet" + Public Const AD_AUTOCREATEUSERS As String = "AD_AutoCreateUsers" + Public Const AD_DEFAULTDOMAIN As String = "AD_DefaultDomain" + Public Const AD_SEARCHBOTS As String = "AD_SearchBots" + Public Const AD_SYNCPHOTO As String = "AD_SyncPhoto" + Public Const AD_ENABLEAUTOLOGIN As String = "AD_ENABLEAUTOLOGIN" + + + Private mPortalId As Integer + Private mWindowsAuthentication As Boolean = False + Private mHideWindowsLogin As Boolean = False + Private mRootDomain As String = "" + Private mUserName As String = "" + Private mPassword As String = "" + Private mSynchronizeRole As Boolean = False + Private mSynchronizePassword As Boolean = False + ' reserve for future feature + Private mStripDomainName As Boolean = False + Private mProviderTypeName As String = DefaultProviderTypeName + Private mAuthenticationType As String = DefaultAuthenticationType + Private mEmailDomain As String = DefaultEmailDomain + Private mAutoIP As String = "" + 'ACD-4259 + Private mAutoCreateUsers As Boolean = False + 'ACD-5585 + Private mDefaultDomain As String = "" + 'WorkItems 4766 and 4077 + Private mBots As String = "" + Private mPhoto As Boolean = False + Private mEnableAutoLogin As Boolean = False + + ''' ------------------------------------------------------------------- + ''' + ''' - Obtain Authentication settings from database + ''' + ''' + ''' - Setting records are stored in ModuleSettings table, separately for each portal, + ''' this method allows each portal could have different accessing method to Windows Active Directory + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [cnurse] 07/04/2007 Moved settings to Authentication Module from Site Settings + ''' [mhorton] 01/02/2008 Move mPortalID inside of the Try/Catch in case PortalSettings hasn't been initialized. + ''' [mhorton] 06/15/2008 ACD-7913 + ''' [sawest] 12/16/2016 Added if contain statements. If a key was missing, an error was thrown in the try block and the rest of the settings did not load. + ''' [sawest] 12/16/2016 Switched to using constants for setting names + ''' [sawest] 01/02/2017 Added photo setting and constant + ''' + ''' ------------------------------------------------------------------- + Sub New() + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim _providerConfiguration As ProviderConfiguration = ProviderConfiguration.GetProviderConfiguration(AUTHENTICATION_KEY) + Dim objSecurity As New PortalSecurity + + Try + If _providerConfiguration.DefaultProvider Is Nothing Then + ' No provider specified, so disable authentication feature + Return + Else + mPortalId = _portalSettings.PortalId + Dim CambrianSettings As Dictionary(Of String, String) = PortalController.Instance.GetPortalSettings(PortalId) + If CambrianSettings.ContainsKey(AD_WINDOWSAUTHENTICATION) Then + mWindowsAuthentication = CType(Null.GetNull(CambrianSettings(AD_WINDOWSAUTHENTICATION), mWindowsAuthentication), Boolean) + End If + If CambrianSettings.ContainsKey(AD_HIDEWINDOWSLOGIN) Then + mHideWindowsLogin = CType(Null.GetNull(CambrianSettings(AD_HIDEWINDOWSLOGIN), mHideWindowsLogin), Boolean) + End If + If CambrianSettings.ContainsKey(AD_SYNCHRONIZEROLE) Then + mSynchronizeRole = CType(Null.GetNull(CambrianSettings(AD_SYNCHRONIZEROLE), mSynchronizeRole), Boolean) + End If + If CambrianSettings.ContainsKey(AD_SYNCHRONIZEPASSWORD) Then + mSynchronizePassword = CType(Null.GetNull(CambrianSettings(AD_SYNCHRONIZEPASSWORD), mSynchronizePassword), Boolean) + End If + If CambrianSettings.ContainsKey(AD_STRIPDOMAINNAME) Then + mStripDomainName = CType(Null.GetNull(CambrianSettings(AD_STRIPDOMAINNAME), mStripDomainName), Boolean) + End If + If CambrianSettings.ContainsKey(AD_ROOTDOMAIN) Then + mRootDomain = CType(Null.GetNull(CambrianSettings(AD_ROOTDOMAIN), mRootDomain), String) + End If + If CambrianSettings.ContainsKey(AD_EMAILDOMAIN) Then + mEmailDomain = CType(Null.GetNull(CambrianSettings(AD_EMAILDOMAIN), mEmailDomain), String) + End If + If CambrianSettings.ContainsKey(AD_USERNAME) Then + mUserName = CType(Null.GetNull(CambrianSettings(AD_USERNAME), mUserName), String) + End If + If CambrianSettings.ContainsKey(AD_PROVIDERTYPENAME) Then + mProviderTypeName = CType(Null.GetNull(CambrianSettings(AD_PROVIDERTYPENAME), mProviderTypeName), String) + End If + If CambrianSettings.ContainsKey(AD_AUTHENTICATIONTYPE) Then + mAuthenticationType = CType(Null.GetNull(CambrianSettings(AD_AUTHENTICATIONTYPE), mAuthenticationType), String) + End If + If CambrianSettings.ContainsKey(AD_AUTHENTICATIONPASSWORD) Then + mPassword = objSecurity.Decrypt(AUTHENTICATION_KEY, CType(Null.GetNull(CambrianSettings(AD_AUTHENTICATIONPASSWORD), mPassword.ToString), String)) + End If + If CambrianSettings.ContainsKey(AD_SUBNET) Then + mAutoIP = CType(Null.GetNull(CambrianSettings(AD_SUBNET), mAutoIP), String) + End If + If CambrianSettings.ContainsKey(AD_AUTOCREATEUSERS) Then + 'ACD-4259 + mAutoCreateUsers = CType(Null.GetNull(CambrianSettings(AD_AUTOCREATEUSERS), mAutoCreateUsers), Boolean) + End If + If CambrianSettings.ContainsKey(AD_DEFAULTDOMAIN) Then + 'ACD-5585 + mDefaultDomain = CType(Null.GetNull(CambrianSettings(AD_DEFAULTDOMAIN), mDefaultDomain), String) + End If + If CambrianSettings.ContainsKey(AD_SEARCHBOTS) Then + 'WorkItems 4766 and 4077 + mBots = CType(Null.GetNull(CambrianSettings(AD_SEARCHBOTS), mBots), String) + End If + If CambrianSettings.ContainsKey(AD_SYNCPHOTO) Then + mPhoto = CType(Null.GetNull(CambrianSettings(AD_SYNCPHOTO), mPhoto), Boolean) + End If + If CambrianSettings.ContainsKey(AD_ENABLEAUTOLOGIN) Then + mEnableAutoLogin = CType(Null.GetNull(CambrianSettings(AD_ENABLEAUTOLOGIN), mEnableAutoLogin), Boolean) + End If + End If + Catch ex As Exception + 'Log the exception + ADSI.Utilities.AddEventLog(_portalSettings, "There was a problem loading the settings for the AD Authentication Provider. Error: " & ex.Message) + End Try + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' Obtain Authentication Configuration + ''' + ''' + ''' Accessing Active Directory also costs resource, + ''' so we only do it once then save into cache for later use + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 01/02/2008 Added Try/Catch in case PortalsSettings haven't + ''' been initialized yet. + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetConfig() As Configuration + Dim config As Configuration = Nothing + Try + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim strKey As String = AUTHENTICATION_CONFIG_CACHE_PREFIX & "." & CStr(_portalSettings.PortalId) + + config = CType(DataCache.GetCache(strKey), Configuration) + + If config Is Nothing Then + config = New Configuration + DataCache.SetCache(strKey, config) + End If + + Catch exc As Exception + ' Problems reading AD config, just return nothing + End Try + + Return config + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 15/10/2007 -Fixed ACD-3084 + ''' + ''' ------------------------------------------------------------------- + Public Shared Sub ResetConfig() + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim strKey As String = AUTHENTICATION_CONFIG_CACHE_PREFIX & "." & CStr(_portalSettings.PortalId) + DataCache.RemoveCache(strKey) + strKey = "AuthenticationProvider" & CStr(_portalSettings.PortalId) + DataCache.RemoveCache(strKey) + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 06/15/2008 ACD-7913 + ''' [mhorton] 04/14/2013 Item 8473 Null values not saved in DNN7. Use blank string + ''' [mhorton] 04/18/2013 Item 8512 Null values not saved in DNN7. Use blank string + ''' [sawest] 12/16/2016 Condensed some code. Switched to using constants for setting names + ''' + ''' ------------------------------------------------------------------- + Public Shared Sub UpdateConfig(ByVal PortalID As Integer, + ByVal WindowsAuthentication As Boolean, + ByVal Hidden As Boolean, + ByVal RootDomain As String, + ByVal EmailDomain As String, + ByVal AuthenticationUserName As String, + ByVal AuthenticationPassword As String, + ByVal SynchronizeRole As Boolean, + ByVal SynchronizePassword As Boolean, + ByVal StripDomainName As Boolean, + ByVal ProviderTypeName As String, + ByVal AuthenticationType As String, + ByVal SubNet As String, + ByVal DefaultDomain As String, + ByVal AutoCreateUsers As Boolean, + ByVal Bots As String, + ByVal Photo As Boolean, + ByVal EnableAutoLogin As Boolean) + + Dim objSecurity As New PortalSecurity + 'Item 8512 + PortalController.UpdatePortalSetting(PortalID, AD_WINDOWSAUTHENTICATION, WindowsAuthentication.ToString) + PortalController.UpdatePortalSetting(PortalID, AD_HIDEWINDOWSLOGIN, Hidden.ToString) + PortalController.UpdatePortalSetting(PortalID, AD_SYNCHRONIZEROLE, SynchronizeRole.ToString) + PortalController.UpdatePortalSetting(PortalID, AD_SYNCHRONIZEPASSWORD, SynchronizePassword.ToString) + PortalController.UpdatePortalSetting(PortalID, AD_STRIPDOMAINNAME, StripDomainName.ToString) + PortalController.UpdatePortalSetting(PortalID, AD_ROOTDOMAIN, If(String.IsNullOrEmpty(RootDomain), "", RootDomain)) + PortalController.UpdatePortalSetting(PortalID, AD_EMAILDOMAIN, If(String.IsNullOrEmpty(EmailDomain), "", EmailDomain)) + PortalController.UpdatePortalSetting(PortalID, AD_USERNAME, If(String.IsNullOrEmpty(AuthenticationUserName), "", AuthenticationUserName)) + PortalController.UpdatePortalSetting(PortalID, AD_PROVIDERTYPENAME, If(String.IsNullOrEmpty(ProviderTypeName), "", ProviderTypeName)) + PortalController.UpdatePortalSetting(PortalID, AD_AUTHENTICATIONTYPE, If(String.IsNullOrEmpty(AuthenticationType), "", AuthenticationType)) + PortalController.UpdatePortalSetting(PortalID, AD_SUBNET, If(String.IsNullOrEmpty(SubNet), "127.0.0.1", SubNet)) + 'ACD-5585 + PortalController.UpdatePortalSetting(PortalID, AD_DEFAULTDOMAIN, If(String.IsNullOrEmpty(DefaultDomain), "", DefaultDomain)) + 'ACD-4259 + PortalController.UpdatePortalSetting(PortalID, AD_AUTOCREATEUSERS, AutoCreateUsers.ToString) + 'WorkItems 4766 and 4077 + PortalController.UpdatePortalSetting(PortalID, AD_SEARCHBOTS, If(String.IsNullOrEmpty(Bots), "", Bots)) + PortalController.UpdatePortalSetting(PortalID, AD_SYNCPHOTO, Photo.ToString) + PortalController.UpdatePortalSetting(PortalID, AD_ENABLEAUTOLOGIN, EnableAutoLogin.ToString) + 'Only update password if it has been changed + If AuthenticationPassword.Length > 0 Then + PortalController.UpdatePortalSetting(PortalID, AD_AUTHENTICATIONPASSWORD, Convert.ToString(objSecurity.Encrypt(AUTHENTICATION_KEY, AuthenticationPassword))) + End If + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared ReadOnly Property DefaultProviderTypeName() As String + Get + Return _ + "DotNetNuke.Authentication.ActiveDirectory.ADSI.ADSIProvider, DotNetNuke.Authentication.ActiveDirectory" + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared ReadOnly Property DefaultAuthenticationType() As String + Get + Return "Delegation" + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared ReadOnly Property DefaultEmailDomain() As String + Get + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim _portalEmail As String = _portalSettings.Email + Dim sRet As String = "" + If Not String.IsNullOrEmpty(_portalEmail) Then + Dim nPos As Integer = _portalEmail.IndexOf("@") + If nPos > 0 Then + sRet = _portalEmail.Substring(nPos) + End If + End If + Return sRet + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property WindowsAuthentication() As Boolean + Get + Return mWindowsAuthentication + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 12/10/2007 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property HideWindowsLogin() As Boolean + Get + Return mHideWindowsLogin + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property RootDomain() As String + Get + Return mRootDomain + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property UserName() As String + Get + Return mUserName + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property Password() As String + Get + Return mPassword + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' Role membership to be synchronized (Authentication/DNN) when user logon + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property SynchronizeRole() As Boolean + Get + Return mSynchronizeRole + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' Process checking DNN password against Windows password + ''' update DNN password if not match + ''' requires modified signin page for functionality + ''' + ''' + ''' This process quite expensive in terms of performance + ''' Reserve for future implementation + ''' + ''' + ''' [tamttt] 08/01/2005 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property SynchronizePassword() As Boolean + Get + Return mSynchronizePassword + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' Determin if Domain Name should be stripped from UserName + ''' + ''' + ''' In an environment with single domain or unique username across domains + ''' + ''' + ''' [jhoskins] 10/10/2007 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property StripDomainName() As Boolean + Get + Return mStripDomainName + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property PortalId() As Integer + Get + Return mPortalId + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ProviderTypeName() As String + Get + Return mProviderTypeName + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' It was configured in web.config, move to site settings is more flexible + ''' When configure first time, only default provider (ADs) available to provide list of type to select + ''' + ''' + ''' [tamttt] 08/01/2005 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property AuthenticationType() As String + Get + Return mAuthenticationType + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property EmailDomain() As String + Get + Return mEmailDomain + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' Used to determine if a valid input is provided, if not, return default value + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [tamttt] 08/20/2005 Replace by core Null.GetNull function + ''' + ''' ------------------------------------------------------------------- + Private Function GetValue(ByVal Input As Object, ByVal DefaultValue As String) As String + If Input Is Nothing Then + Return DefaultValue + Else + Return CStr(Input) + End If + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Returns list of search crawlers/bots that can index the site - WorkItems 4766 and 4077 + ''' + ''' + ''' + ''' + ''' [mhorton] 17/04/2011 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property Bots() As String + Get + Return mBots + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 17/10/2007 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property AutoIP() As String + Get + Return mAutoIP + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 4/05/2009 created based on code supplied by + ''' Nathan Truhan - ACD-4259 + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property AutoCreateUsers() As String + Get + Return mAutoCreateUsers + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 27/04/2009 Created ACD-5585 + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property DefaultDomain() As String + Get + Return mDefaultDomain + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [sawest] 01/02/2017 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property Photo() As String + Get + Return mPhoto + End Get + End Property + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [sawest] 01/02/2017 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property EnableAutoLogin() As String + Get + Return mEnableAutoLogin + End Get + End Property + + + + + End Class + + +End Namespace diff --git a/Components/Groups/GroupController.vb b/Components/Groups/GroupController.vb index dd2f68f..bbe7c3a 100644 --- a/Components/Groups/GroupController.vb +++ b/Components/Groups/GroupController.vb @@ -1,65 +1,65 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public Class GroupController - Private mProviderTypeName As String = "" - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - Dim _config As Configuration = Configuration.GetConfig() - mProviderTypeName = _config.ProviderTypeName - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function GetGroups() As ArrayList - Return AuthenticationProvider.Instance (mProviderTypeName).GetGroups() - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 29/05/2011 Created - ''' - ''' ------------------------------------------------------------------- - Public Function GetGroups(ByVal arrUserPortalRoles As ArrayList) As ArrayList - Return AuthenticationProvider.Instance(mProviderTypeName).GetGroups(arrUserPortalRoles) - End Function - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public Class GroupController + Private mProviderTypeName As String = "" + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + Dim _config As Configuration = Configuration.GetConfig() + mProviderTypeName = _config.ProviderTypeName + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function GetGroups() As ArrayList + Return AuthenticationProvider.Instance (mProviderTypeName).GetGroups() + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 29/05/2011 Created + ''' + ''' ------------------------------------------------------------------- + Public Function GetGroups(ByVal arrUserPortalRoles As ArrayList) As ArrayList + Return AuthenticationProvider.Instance(mProviderTypeName).GetGroups(arrUserPortalRoles) + End Function + End Class +End Namespace diff --git a/Components/Groups/GroupInfo.vb b/Components/Groups/GroupInfo.vb index 0b8668a..dad6002 100644 --- a/Components/Groups/GroupInfo.vb +++ b/Components/Groups/GroupInfo.vb @@ -1,116 +1,116 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Security.Roles - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public Class GroupInfo - Inherits RoleInfo - Implements IAuthenticationObjectBase - - Private mGUID As String = "" - Private mLocation As String = "" - Private mIsPopulated As Boolean = False - Private mMembers As New ArrayList - ' store members object - Private mAuthenticationMember As New ArrayList - ' store members DistinguishedName string - Private mDNNPopulated As Boolean = False - Private mDNNMember As New ArrayList - ' store members UserId - - Private mProcessLog As String = "" - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - MyBase.New() - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property Name() As String Implements IAuthenticationObjectBase.Name - Get - Return RoleName - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ObjectClass() As ObjectClass Implements IAuthenticationObjectBase.ObjectClass - Get - Return ObjectClass.group - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property AuthenticationMember() As ArrayList - Get - Return mAuthenticationMember - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property IsPopulated() As Boolean - Get - Return mIsPopulated - End Get - Set (ByVal Value As Boolean) - mIsPopulated = Value - End Set - End Property - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports DotNetNuke.Security.Roles + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public Class GroupInfo + Inherits RoleInfo + Implements IAuthenticationObjectBase + + Private mGUID As String = "" + Private mLocation As String = "" + Private mIsPopulated As Boolean = False + Private mMembers As New ArrayList + ' store members object + Private mAuthenticationMember As New ArrayList + ' store members DistinguishedName string + Private mDNNPopulated As Boolean = False + Private mDNNMember As New ArrayList + ' store members UserId + + Private mProcessLog As String = "" + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + MyBase.New() + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property Name() As String Implements IAuthenticationObjectBase.Name + Get + Return RoleName + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ObjectClass() As ObjectClass Implements IAuthenticationObjectBase.ObjectClass + Get + Return ObjectClass.group + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property AuthenticationMember() As ArrayList + Get + Return mAuthenticationMember + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property IsPopulated() As Boolean + Get + Return mIsPopulated + End Get + Set (ByVal Value As Boolean) + mIsPopulated = Value + End Set + End Property + End Class +End Namespace diff --git a/Components/IAuthenticationObjectBase.vb b/Components/IAuthenticationObjectBase.vb index 2311ba1..3e93414 100644 --- a/Components/IAuthenticationObjectBase.vb +++ b/Components/IAuthenticationObjectBase.vb @@ -1,36 +1,36 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Namespace DotNetNuke.Authentication.ActiveDirectory - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 10/05/2009 Obsolete Properties removed. - WorkItem:2943 - ''' - ''' ------------------------------------------------------------------- - Public Interface IAuthenticationObjectBase - ReadOnly Property Name() As String - ReadOnly Property ObjectClass() As ObjectClass - End Interface +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + +Namespace DotNetNuke.Authentication.ActiveDirectory + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 10/05/2009 Obsolete Properties removed. - WorkItem:2943 + ''' + ''' ------------------------------------------------------------------- + Public Interface IAuthenticationObjectBase + ReadOnly Property Name() As String + ReadOnly Property ObjectClass() As ObjectClass + End Interface End Namespace \ No newline at end of file diff --git a/Components/Users/UserController.vb b/Components/Users/UserController.vb index 473c513..b952f46 100644 --- a/Components/Users/UserController.vb +++ b/Components/Users/UserController.vb @@ -1,292 +1,292 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Authentication.ActiveDirectory.ADSI -Imports DotNetNuke.Security.Membership -Imports DotNetNuke.Security.Roles -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Entities.Users - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public Class UserController - -#Region "Private Shared Members" - - Private mProviderTypeName As String = "" - Private Shared dataProvider As DataProvider = dataProvider.Instance() - Private Shared mRoleName As String = "" - -#End Region - - Sub New() - Dim _config As Configuration = Configuration.GetConfig() - mProviderTypeName = _config.ProviderTypeName - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' User object with info obtained from Active Directory - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function GetUser (ByVal LoggedOnUserName As String) As ADUserInfo - Return AuthenticationProvider.Instance (mProviderTypeName).GetUser (LoggedOnUserName) - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' User object with info obtained from Active Directory - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function GetUser (ByVal LoggedOnUserName As String, ByVal LoggedOnPassword As String) As ADUserInfo - Return AuthenticationProvider.Instance (mProviderTypeName).GetUser (LoggedOnUserName, LoggedOnPassword) - End Function - - ''' ----------------------------------------------------------------------------- - ''' - ''' CreateDNNUser persists the DNN User information to the Database - ''' - ''' - ''' - ''' The user to persist to the Data Store. - ''' The UserId of the newly created user. - ''' - ''' [cnurse] 12/13/2005 created - ''' [mhorton] 06/12/2008 ACD-5737 - ''' - ''' ----------------------------------------------------------------------------- - _ - Private Function CreateDNNUser (ByRef user As ADUserInfo) As UserCreateStatus - - Dim objSecurity As New PortalSecurity - Dim _ - userName As String = _ - objSecurity.InputFilter (user.Username, _ - PortalSecurity.FilterFlag.NoScripting Or _ - PortalSecurity.FilterFlag.NoAngleBrackets Or _ - PortalSecurity.FilterFlag.NoMarkup) - Dim _ - email As String = _ - objSecurity.InputFilter (user.Email, _ - PortalSecurity.FilterFlag.NoScripting Or _ - PortalSecurity.FilterFlag.NoAngleBrackets Or _ - PortalSecurity.FilterFlag.NoMarkup) - Dim _ - lastName As String = _ - objSecurity.InputFilter (user.LastName, _ - PortalSecurity.FilterFlag.NoScripting Or _ - PortalSecurity.FilterFlag.NoAngleBrackets Or _ - PortalSecurity.FilterFlag.NoMarkup) - Dim _ - firstName As String = _ - objSecurity.InputFilter (user.FirstName, _ - PortalSecurity.FilterFlag.NoScripting Or _ - PortalSecurity.FilterFlag.NoAngleBrackets Or _ - PortalSecurity.FilterFlag.NoMarkup) - Dim createStatus As UserCreateStatus = UserCreateStatus.Success - Dim _ - displayName As String = _ - objSecurity.InputFilter (user.DisplayName, _ - PortalSecurity.FilterFlag.NoScripting Or _ - PortalSecurity.FilterFlag.NoAngleBrackets Or _ - PortalSecurity.FilterFlag.NoMarkup) - Dim updatePassword As Boolean = user.Membership.UpdatePassword - Dim isApproved As Boolean = user.Membership.Approved - - Try - user.UserID = _ - CType ( _ - dataProvider.AddUser (user.PortalID, userName, firstName, lastName, user.AffiliateID, _ - user.IsSuperUser, email, displayName, updatePassword, isApproved, - 1), _ - Integer) - DataCache.ClearPortalCache (user.PortalID, False) - 'ACD-5737 - If Not user.IsSuperUser Then - - Dim objRoles As New RoleController - Dim objRole As RoleInfo - - ' autoassign user to portal roles - Dim arrRoles As ArrayList = objRoles.GetPortalRoles (user.PortalID) - Dim i As Integer - For i = 0 To arrRoles.Count - 1 - objRole = CType (arrRoles (i), RoleInfo) - If objRole.AutoAssignment = True Then - objRoles.AddUserRole (user.PortalID, user.UserID, objRole.RoleID, Null.NullDate, _ - Null.NullDate) - End If - Next - End If - Catch ex As Exception - 'Clear User (duplicate User information) - user = Nothing - createStatus = UserCreateStatus.ProviderError - End Try - - Return createStatus - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' This routine is more accurated, - ''' Prevent user assign to admin role in case user logon as LOCAL\Administrator - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 20/06/2008 Fixed code for ACD-7422 and ACD-6960 - ''' [mhorton] 24/06/2008 Further fixes for ACD-6960 - ''' [mhorton] 30/11/2008 Fixed code for ACD-8844 - ''' [mhorton] 29/05/2011 Fixed code for Item 6735 - ''' - ''' ------------------------------------------------------------------- - - Public Overloads Shared Sub AddUserRoles(ByVal PortalID As Integer, ByVal AuthenticationUser As ADUserInfo) - Try - Dim objPortals As New PortalController - Dim objPortal As PortalInfo = objPortals.GetPortal(PortalID) - Dim objPortalSettings As New PortalSettings(PortalID) - Dim objRoleInfo As New RoleInfo - 'Get all active directory groups the user belongs to. - Dim arrUserADGroups As ArrayList = Utilities.GetADGroups(AuthenticationUser.Username) - - 'Get all portal roles that the user does belong to. - Dim objRoleController As New RoleController - Dim strUserPortalRoles As List(Of UserRoleInfo) = objRoleController.GetUserRoles(AuthenticationUser, True) - Dim arrUserPortalRoles As New ArrayList - 'We want to remove any Auto Assigned roles from the user's portal roles. - For Each strRole As UserRoleInfo In strUserPortalRoles - objRoleInfo = objRoleController.GetRoleByName(PortalID, strRole.RoleName) - If Not (objRoleInfo.AutoAssignment) Then - arrUserPortalRoles.Add(objRoleInfo) - End If - Next - 'Compare the active directory groups the user belongs to against the portal roles the user belongs to. - 'If both exist then do nothing, if only the group exists put the group into a separate array for later processing, - 'if only the role exists also put it into a separate array for later processing. - Dim arrADGroupOnly As New ArrayList - Dim arrRolesOnly As New ArrayList - Dim bMatch As Boolean - 'Get the AD groups that don't match a portal role that the user belongs to. - For Each strGroup As String In arrUserADGroups - bMatch = False - For Each strRole As UserRoleInfo In strUserPortalRoles - If strRole.RoleName = strGroup Then - bMatch = True - Exit For - End If - Next - If Not (bMatch) Then - arrADGroupOnly.Add(strGroup) - End If - Next - - For Each objRoleInfo In arrUserPortalRoles - bMatch = False - For Each strGroup As String In arrUserADGroups - If strGroup = objRoleInfo.RoleName Then - bMatch = True - Exit For - End If - Next - If Not (bMatch) Then - arrRolesOnly.Add(objRoleInfo) - End If - Next - - 'Check the Active Directory groups the user belongs to only and see if there's a portal role that matches. - Dim arrPortalRoles As List(Of RoleInfo) = objRoleController.GetRoles(PortalID) - For Each objRoleInfo In arrPortalRoles - If Not (objRoleInfo.AutoAssignment) Then - If Not (objRoleInfo.RoleID = objPortal.AdministratorRoleId) Then - If arrADGroupOnly.Contains(objRoleInfo.RoleName) Then - objRoleController.AddUserRole(PortalID, AuthenticationUser.UserID, objRoleInfo.RoleID, Date.Today, _ - Null.NullDate) - End If - End If - End If - Next - - 'Check the portal roles the user belongs to only and see if there's an Active Directory group that matches - Dim objGroupController As New GroupController - Dim arrADGroups As ArrayList = objGroupController.GetGroups(arrRolesOnly) - For Each objRoleInfo In arrADGroups - If Not (objRoleInfo.RoleID = objPortal.AdministratorRoleId) Then - RoleController.DeleteUserRole(AuthenticationUser, objRoleInfo, objPortalSettings, False) - End If - Next - - Catch exc As Exception - LogException(exc) - End Try - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Search predicate returns true if a strings match. - ''' - ''' - ''' [mhorton] 30/11/2008 Created - ''' - ''' ------------------------------------------------------------------- - Private Shared Function RolesExists (ByVal s As String) _ - As Boolean - - ' AndAlso prevents evaluation of the second Boolean - ' expression if the string is so short that an error - ' would occur. - If (s.ToLower = mRoleName.ToLower) Then - Return True - Else - Return False - End If - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' This functions updates the users information from Active Directory - ''' - ''' - ''' - ''' - ''' [Stuart] September 12,2006 Created - ''' [mhorton] 02/17/2012 User's profile was getting blanked when getting updated - Item 7739 - ''' - ''' ------------------------------------------------------------------- - Public Function UpdateDnnUser(ByVal authenticationUser As UserInfo) As Boolean - 'Updating user information - Users.UserController.UpdateUser(authenticationUser.PortalID, authenticationUser) - Return True - - End Function - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports DotNetNuke.Authentication.ActiveDirectory.ADSI +Imports DotNetNuke.Security.Membership +Imports DotNetNuke.Security.Roles +Imports DotNetNuke.Entities.Portals +Imports DotNetNuke.Entities.Users + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public Class UserController + +#Region "Private Shared Members" + + Private mProviderTypeName As String = "" + Private Shared dataProvider As DataProvider = dataProvider.Instance() + Private Shared mRoleName As String = "" + +#End Region + + Sub New() + Dim _config As Configuration = Configuration.GetConfig() + mProviderTypeName = _config.ProviderTypeName + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' User object with info obtained from Active Directory + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function GetUser (ByVal LoggedOnUserName As String) As ADUserInfo + Return AuthenticationProvider.Instance (mProviderTypeName).GetUser (LoggedOnUserName) + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' User object with info obtained from Active Directory + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function GetUser (ByVal LoggedOnUserName As String, ByVal LoggedOnPassword As String) As ADUserInfo + Return AuthenticationProvider.Instance (mProviderTypeName).GetUser (LoggedOnUserName, LoggedOnPassword) + End Function + + ''' ----------------------------------------------------------------------------- + ''' + ''' CreateDNNUser persists the DNN User information to the Database + ''' + ''' + ''' + ''' The user to persist to the Data Store. + ''' The UserId of the newly created user. + ''' + ''' [cnurse] 12/13/2005 created + ''' [mhorton] 06/12/2008 ACD-5737 + ''' + ''' ----------------------------------------------------------------------------- + _ + Private Function CreateDNNUser (ByRef user As ADUserInfo) As UserCreateStatus + + Dim objSecurity As New PortalSecurity + Dim _ + userName As String = _ + objSecurity.InputFilter (user.Username, _ + PortalSecurity.FilterFlag.NoScripting Or _ + PortalSecurity.FilterFlag.NoAngleBrackets Or _ + PortalSecurity.FilterFlag.NoMarkup) + Dim _ + email As String = _ + objSecurity.InputFilter (user.Email, _ + PortalSecurity.FilterFlag.NoScripting Or _ + PortalSecurity.FilterFlag.NoAngleBrackets Or _ + PortalSecurity.FilterFlag.NoMarkup) + Dim _ + lastName As String = _ + objSecurity.InputFilter (user.LastName, _ + PortalSecurity.FilterFlag.NoScripting Or _ + PortalSecurity.FilterFlag.NoAngleBrackets Or _ + PortalSecurity.FilterFlag.NoMarkup) + Dim _ + firstName As String = _ + objSecurity.InputFilter (user.FirstName, _ + PortalSecurity.FilterFlag.NoScripting Or _ + PortalSecurity.FilterFlag.NoAngleBrackets Or _ + PortalSecurity.FilterFlag.NoMarkup) + Dim createStatus As UserCreateStatus = UserCreateStatus.Success + Dim _ + displayName As String = _ + objSecurity.InputFilter (user.DisplayName, _ + PortalSecurity.FilterFlag.NoScripting Or _ + PortalSecurity.FilterFlag.NoAngleBrackets Or _ + PortalSecurity.FilterFlag.NoMarkup) + Dim updatePassword As Boolean = user.Membership.UpdatePassword + Dim isApproved As Boolean = user.Membership.Approved + + Try + user.UserID = _ + CType ( _ + dataProvider.AddUser (user.PortalID, userName, firstName, lastName, user.AffiliateID, _ + user.IsSuperUser, email, displayName, updatePassword, isApproved, - 1), _ + Integer) + DataCache.ClearPortalCache (user.PortalID, False) + 'ACD-5737 + If Not user.IsSuperUser Then + + Dim objRoles As New RoleController + Dim objRole As RoleInfo + + ' autoassign user to portal roles + Dim arrRoles As ArrayList = objRoles.GetPortalRoles (user.PortalID) + Dim i As Integer + For i = 0 To arrRoles.Count - 1 + objRole = CType (arrRoles (i), RoleInfo) + If objRole.AutoAssignment = True Then + objRoles.AddUserRole (user.PortalID, user.UserID, objRole.RoleID, Null.NullDate, _ + Null.NullDate) + End If + Next + End If + Catch ex As Exception + 'Clear User (duplicate User information) + user = Nothing + createStatus = UserCreateStatus.ProviderError + End Try + + Return createStatus + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' This routine is more accurated, + ''' Prevent user assign to admin role in case user logon as LOCAL\Administrator + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 20/06/2008 Fixed code for ACD-7422 and ACD-6960 + ''' [mhorton] 24/06/2008 Further fixes for ACD-6960 + ''' [mhorton] 30/11/2008 Fixed code for ACD-8844 + ''' [mhorton] 29/05/2011 Fixed code for Item 6735 + ''' + ''' ------------------------------------------------------------------- + + Public Overloads Shared Sub AddUserRoles(ByVal PortalID As Integer, ByVal AuthenticationUser As ADUserInfo) + Try + Dim objPortals As New PortalController + Dim objPortal As PortalInfo = objPortals.GetPortal(PortalID) + Dim objPortalSettings As New PortalSettings(PortalID) + Dim objRoleInfo As New RoleInfo + 'Get all active directory groups the user belongs to. + Dim arrUserADGroups As ArrayList = Utilities.GetADGroups(AuthenticationUser.Username) + + 'Get all portal roles that the user does belong to. + Dim objRoleController As New RoleController + Dim strUserPortalRoles As List(Of UserRoleInfo) = objRoleController.GetUserRoles(AuthenticationUser, True) + Dim arrUserPortalRoles As New ArrayList + 'We want to remove any Auto Assigned roles from the user's portal roles. + For Each strRole As UserRoleInfo In strUserPortalRoles + objRoleInfo = objRoleController.GetRoleByName(PortalID, strRole.RoleName) + If Not (objRoleInfo.AutoAssignment) Then + arrUserPortalRoles.Add(objRoleInfo) + End If + Next + 'Compare the active directory groups the user belongs to against the portal roles the user belongs to. + 'If both exist then do nothing, if only the group exists put the group into a separate array for later processing, + 'if only the role exists also put it into a separate array for later processing. + Dim arrADGroupOnly As New ArrayList + Dim arrRolesOnly As New ArrayList + Dim bMatch As Boolean + 'Get the AD groups that don't match a portal role that the user belongs to. + For Each strGroup As String In arrUserADGroups + bMatch = False + For Each strRole As UserRoleInfo In strUserPortalRoles + If strRole.RoleName = strGroup Then + bMatch = True + Exit For + End If + Next + If Not (bMatch) Then + arrADGroupOnly.Add(strGroup) + End If + Next + + For Each objRoleInfo In arrUserPortalRoles + bMatch = False + For Each strGroup As String In arrUserADGroups + If strGroup = objRoleInfo.RoleName Then + bMatch = True + Exit For + End If + Next + If Not (bMatch) Then + arrRolesOnly.Add(objRoleInfo) + End If + Next + + 'Check the Active Directory groups the user belongs to only and see if there's a portal role that matches. + Dim arrPortalRoles As List(Of RoleInfo) = objRoleController.GetRoles(PortalID) + For Each objRoleInfo In arrPortalRoles + If Not (objRoleInfo.AutoAssignment) Then + If Not (objRoleInfo.RoleID = objPortal.AdministratorRoleId) Then + If arrADGroupOnly.Contains(objRoleInfo.RoleName) Then + objRoleController.AddUserRole(PortalID, AuthenticationUser.UserID, objRoleInfo.RoleID, Date.Today, _ + Null.NullDate) + End If + End If + End If + Next + + 'Check the portal roles the user belongs to only and see if there's an Active Directory group that matches + Dim objGroupController As New GroupController + Dim arrADGroups As ArrayList = objGroupController.GetGroups(arrRolesOnly) + For Each objRoleInfo In arrADGroups + If Not (objRoleInfo.RoleID = objPortal.AdministratorRoleId) Then + RoleController.DeleteUserRole(AuthenticationUser, objRoleInfo, objPortalSettings, False) + End If + Next + + Catch exc As Exception + LogException(exc) + End Try + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Search predicate returns true if a strings match. + ''' + ''' + ''' [mhorton] 30/11/2008 Created + ''' + ''' ------------------------------------------------------------------- + Private Shared Function RolesExists (ByVal s As String) _ + As Boolean + + ' AndAlso prevents evaluation of the second Boolean + ' expression if the string is so short that an error + ' would occur. + If (s.ToLower = mRoleName.ToLower) Then + Return True + Else + Return False + End If + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' This functions updates the users information from Active Directory + ''' + ''' + ''' + ''' + ''' [Stuart] September 12,2006 Created + ''' [mhorton] 02/17/2012 User's profile was getting blanked when getting updated - Item 7739 + ''' + ''' ------------------------------------------------------------------- + Public Function UpdateDnnUser(ByVal authenticationUser As UserInfo) As Boolean + 'Updating user information + Users.UserController.UpdateUser(authenticationUser.PortalID, authenticationUser) + Return True + + End Function + End Class +End Namespace diff --git a/Components/Users/UserInfo.vb b/Components/Users/UserInfo.vb index 63f1851..67bd1fb 100644 --- a/Components/Users/UserInfo.vb +++ b/Components/Users/UserInfo.vb @@ -1,175 +1,175 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Entities.Users - -Namespace DotNetNuke.Authentication.ActiveDirectory - Public Class ADUserInfo - Inherits UserInfo - Implements IAuthenticationObjectBase - - Private mGUID As String = "" - Private mLocation As String = "" - Private mCName As String = "" - Private mPrincipalName As String = "" - Private mDistinguishedName As String = "" - Private msAMAccountName As String = "" - Private mIsAuthenticated As Boolean - Private mAuthenticationExists As Boolean = False - ' Additional properties which are not provided by MemberRole - Private mDepartment As String - Private mManager As String - Private mHomePhone As String - Private mAssistant As String - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - MyBase.New() - End Sub - - ''' ------------------------------------------------------------------- - ''' IsNotSimplyUser - ''' - ''' - ''' - ''' - ''' [mhorton] 10/05/2009 Created - WorkItem:2943 - ''' - ''' ------------------------------------------------------------------- - Public Property IsNotSimplyUser() As Boolean - Get - Return mIsAuthenticated - End Get - Set (ByVal value As Boolean) - mIsAuthenticated = value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property Name() As String Implements IAuthenticationObjectBase.Name - Get - Return sAMAccountName - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ObjectClass() As ObjectClass Implements IAuthenticationObjectBase.ObjectClass - Get - Return ObjectClass.person - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property AuthenticationExists() As Boolean - Get - Return mAuthenticationExists - End Get - Set (ByVal Value As Boolean) - mAuthenticationExists = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property CName() As String - Get - Return mCName - End Get - Set (ByVal Value As String) - mCName = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property DistinguishedName() As String - Get - Return mDistinguishedName - End Get - Set (ByVal Value As String) - mDistinguishedName = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property sAMAccountName() As String - Get - Return msAMAccountName - End Get - Set(ByVal Value As String) - msAMAccountName = Value - End Set - End Property - - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports DotNetNuke.Entities.Users + +Namespace DotNetNuke.Authentication.ActiveDirectory + Public Class ADUserInfo + Inherits UserInfo + Implements IAuthenticationObjectBase + + Private mGUID As String = "" + Private mLocation As String = "" + Private mCName As String = "" + Private mPrincipalName As String = "" + Private mDistinguishedName As String = "" + Private msAMAccountName As String = "" + Private mIsAuthenticated As Boolean + Private mAuthenticationExists As Boolean = False + ' Additional properties which are not provided by MemberRole + Private mDepartment As String + Private mManager As String + Private mHomePhone As String + Private mAssistant As String + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + MyBase.New() + End Sub + + ''' ------------------------------------------------------------------- + ''' IsNotSimplyUser + ''' + ''' + ''' + ''' + ''' [mhorton] 10/05/2009 Created - WorkItem:2943 + ''' + ''' ------------------------------------------------------------------- + Public Property IsNotSimplyUser() As Boolean + Get + Return mIsAuthenticated + End Get + Set (ByVal value As Boolean) + mIsAuthenticated = value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property Name() As String Implements IAuthenticationObjectBase.Name + Get + Return sAMAccountName + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ObjectClass() As ObjectClass Implements IAuthenticationObjectBase.ObjectClass + Get + Return ObjectClass.person + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property AuthenticationExists() As Boolean + Get + Return mAuthenticationExists + End Get + Set (ByVal Value As Boolean) + mAuthenticationExists = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property CName() As String + Get + Return mCName + End Get + Set (ByVal Value As String) + mCName = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property DistinguishedName() As String + Get + Return mDistinguishedName + End Get + Set (ByVal Value As String) + mDistinguishedName = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property sAMAccountName() As String + Get + Return msAMAccountName + End Get + Set(ByVal Value As String) + msAMAccountName = Value + End Set + End Property + + End Class +End Namespace diff --git a/Documentation/Documentation.css b/Documentation/Documentation.css index 62d028e..1abef5f 100644 --- a/Documentation/Documentation.css +++ b/Documentation/Documentation.css @@ -1,82 +1,82 @@ - -Body, A -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 10pt; - font-weight: normal; - color: black; -} - -Body -{ - background-color: white; - margin-left:25px; -} - -H1 -{ - font-size: 2.0em; - font-weight: bold; - color: #75808A; - text-decoration: underline; -} - -H2 { - font-size: 1.6em; - font-weight: bold; - color: #75808A; -} - -H3 { - font-size: 1.4em; - font-weight: bold; - color: #75808A; -} - -H4 { - font-size: 1.2em; - font-weight: bold; - color: #75808A; -} - -H5 { - font-size: 1.1em; - font-weight: bold; - color: #75808A; -} - -H6 { - font-size: 1.0em; - font-weight: bold; - color: #75808A; -} - -A:link { - font-size: 1.0em; - text-decoration: underline; - color: #0000cc; -} - -A:visited { - font-size: 1.0em; - text-decoration: underline; - color: #0000cc; -} - -A:active { - font-size: 1.0em; - text-decoration: underline; - color: #0000cc; -} - -A:hover { - font-size: 1.0em; - text-decoration: underline; - color: #cc0000; -} - -HR { - color: dimgrey; - height:1pt; - text-align:left -} + +Body, A +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + font-size: 10pt; + font-weight: normal; + color: black; +} + +Body +{ + background-color: white; + margin-left:25px; +} + +H1 +{ + font-size: 2.0em; + font-weight: bold; + color: #75808A; + text-decoration: underline; +} + +H2 { + font-size: 1.6em; + font-weight: bold; + color: #75808A; +} + +H3 { + font-size: 1.4em; + font-weight: bold; + color: #75808A; +} + +H4 { + font-size: 1.2em; + font-weight: bold; + color: #75808A; +} + +H5 { + font-size: 1.1em; + font-weight: bold; + color: #75808A; +} + +H6 { + font-size: 1.0em; + font-weight: bold; + color: #75808A; +} + +A:link { + font-size: 1.0em; + text-decoration: underline; + color: #0000cc; +} + +A:visited { + font-size: 1.0em; + text-decoration: underline; + color: #0000cc; +} + +A:active { + font-size: 1.0em; + text-decoration: underline; + color: #0000cc; +} + +A:hover { + font-size: 1.0em; + text-decoration: underline; + color: #cc0000; +} + +HR { + color: dimgrey; + height:1pt; + text-align:left +} diff --git a/Documentation/Documentation.html b/Documentation/Documentation.html index d92f685..0307cf6 100644 --- a/Documentation/Documentation.html +++ b/Documentation/Documentation.html @@ -1,67 +1,67 @@ - - - - DotNetNuke Corporation Template - - - -
-

- DotNetNuke Corporation DotNetNuke.Authentication.ActiveDirectory Module

-
-

- * Important *

-

- When creating a project using this template, you should have named your project - simply "ModuleName", not "DotNetNuke CorporationModuleName". If you didn't do this, the - easiest thing to do is close the solution, delete the folder from your DesktopModules - folder, then create a new project.

-

- Due to limitations in the templating capabilities of Visual Studio, you will need - to make some minor changes, and double check a few things, before you package this module.

-
    -
  1. BEFORE checking the - module into your source control environment check the following.
  2. -
  3. Edit the Project properties by double-clicking on the Properties folder in Solution - Explorer
  4. -
  5. On the Application tab: -
      -
    1. Make sure the Assembly name textbox is set to "DotNetNuke.Authentication.ActiveDirectory".
    2. -
    3. Make sure the Default namespace is set to "DotNetNuke.Modules.DotNetNuke.Authentication.ActiveDirectory".
    4. -
    -
  6. -
  7. On the Web tab: -
      -
    1. Under 'Start Action', make sure to set your Start URL to the correct site (ex: http://dnndev/).
    2. -
    3. Under 'Servers', make sure to "Use IIS Web Server" with a project url of http://dnndev/desktopmodules/DotNetNuke.Authentication.ActiveDirectory - and an Override application root URL of http://dnndev/
    4. -
    -
  8. -
-

- Steps after your project is setup.

-
    -
  1. To Build and Package your Module you need to change to Release mode and then - simply choose Build from the Build menu. The MSBuild scripts will do the packaging - process for you. The packaging process creates an INSTALL and a SOURCE package in - the PACKAGES folder within your desktopmodule/modulename folder.
  2. -
  3. Installing your module in your development DotNetNuke instance is easy.Take the - SOURCE ZIP file that is created in the Packages folder, upload that using the Host/Extensions - page, Installation Wizard.
  4. -
  5. After you've done a release for your module (typically deploying to an environment - outside of your development environment) you should change the Version number, you - need to do this in two places, the assemblyinfo file, and the .DNN manifest file. - Next time you build the module in release mode you will get a new package (using - the version number) created.
  6. -
  7. For more information visit our - DotNetNuke Training page.
  8. -
-

- After you are finished with the Documentation you can delete the Documentation directory - from your project. -

-
-
-
- - + + + + DotNetNuke Corporation Template + + + +
+

+ DotNetNuke Corporation DotNetNuke.Authentication.ActiveDirectory Module

+
+

+ * Important *

+

+ When creating a project using this template, you should have named your project + simply "ModuleName", not "DotNetNuke CorporationModuleName". If you didn't do this, the + easiest thing to do is close the solution, delete the folder from your DesktopModules + folder, then create a new project.

+

+ Due to limitations in the templating capabilities of Visual Studio, you will need + to make some minor changes, and double check a few things, before you package this module.

+
    +
  1. BEFORE checking the + module into your source control environment check the following.
  2. +
  3. Edit the Project properties by double-clicking on the Properties folder in Solution + Explorer
  4. +
  5. On the Application tab: +
      +
    1. Make sure the Assembly name textbox is set to "DotNetNuke.Authentication.ActiveDirectory".
    2. +
    3. Make sure the Default namespace is set to "DotNetNuke.Modules.DotNetNuke.Authentication.ActiveDirectory".
    4. +
    +
  6. +
  7. On the Web tab: +
      +
    1. Under 'Start Action', make sure to set your Start URL to the correct site (ex: http://dnndev/).
    2. +
    3. Under 'Servers', make sure to "Use IIS Web Server" with a project url of http://dnndev/desktopmodules/DotNetNuke.Authentication.ActiveDirectory + and an Override application root URL of http://dnndev/
    4. +
    +
  8. +
+

+ Steps after your project is setup.

+
    +
  1. To Build and Package your Module you need to change to Release mode and then + simply choose Build from the Build menu. The MSBuild scripts will do the packaging + process for you. The packaging process creates an INSTALL and a SOURCE package in + the PACKAGES folder within your desktopmodule/modulename folder.
  2. +
  3. Installing your module in your development DotNetNuke instance is easy.Take the + SOURCE ZIP file that is created in the Packages folder, upload that using the Host/Extensions + page, Installation Wizard.
  4. +
  5. After you've done a release for your module (typically deploying to an environment + outside of your development environment) you should change the Version number, you + need to do this in two places, the assemblyinfo file, and the .DNN manifest file. + Next time you build the module in release mode you will get a new package (using + the version number) created.
  6. +
  7. For more information visit our + DotNetNuke Training page.
  8. +
+

+ After you are finished with the Documentation you can delete the Documentation directory + from your project. +

+
+
+
+ + diff --git a/DotNetNuke.Authentication.ActiveDirectory.sln b/DotNetNuke.Authentication.ActiveDirectory.sln index 5b90b1c..7986666 100644 --- a/DotNetNuke.Authentication.ActiveDirectory.sln +++ b/DotNetNuke.Authentication.ActiveDirectory.sln @@ -1,22 +1,22 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DotNetNuke.Authentication.ActiveDirectory", "DotNetNuke.Authentication.ActiveDirectory.vbproj", "{89975073-0072-42AA-902B-31EBE7B21526}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {89975073-0072-42AA-902B-31EBE7B21526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89975073-0072-42AA-902B-31EBE7B21526}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89975073-0072-42AA-902B-31EBE7B21526}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89975073-0072-42AA-902B-31EBE7B21526}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DotNetNuke.Authentication.ActiveDirectory", "DotNetNuke.Authentication.ActiveDirectory.vbproj", "{89975073-0072-42AA-902B-31EBE7B21526}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {89975073-0072-42AA-902B-31EBE7B21526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89975073-0072-42AA-902B-31EBE7B21526}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89975073-0072-42AA-902B-31EBE7B21526}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89975073-0072-42AA-902B-31EBE7B21526}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DotNetNuke.Authentication.ActiveDirectory.vbproj b/DotNetNuke.Authentication.ActiveDirectory.vbproj index 5838de1..6b964ed 100644 --- a/DotNetNuke.Authentication.ActiveDirectory.vbproj +++ b/DotNetNuke.Authentication.ActiveDirectory.vbproj @@ -1,227 +1,227 @@ - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {89975073-0072-42AA-902B-31EBE7B21526} - {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Library - - - DotNetNuke.Authentication.ActiveDirectory - - - 4.0 - On - Binary - Off - On - - - v4.0 - false - - - true - full - true - true - ..\..\..\bin\Providers\ - DotNetNuke.Authentication.ActiveDirectory.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 - AllRules.ruleset - false - - - pdbonly - false - true - true - ..\..\..\bin\Providers\ - DotNetNuke.Authentication.ActiveDirectory.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 - AllRules.ruleset - false - - - - False - ..\..\..\..\Sites\dnndev7\bin\DotNetNuke.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ASPXCodeBehind - - - - - - - - - - - - - - - Login.ascx - - - Login.ascx - ASPXCodeBehind - - - - - - Component - - - Component - - - - Settings.ascx - - - Settings.ascx - ASPXCodeBehind - - - WindowsSignin.aspx - - - WindowsSignin.aspx - ASPXCodeBehind - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - 62597 - / - http://localhost/dnndev/DesktopModules/AuthenticationServices/ActiveDirectory - True - http://localhost/dnndev - False - False - - - False - - - - - - zip - ActiveDirectory - ActiveDirectory - $(MSBuildProjectDirectory)\BuildScripts - - - - - - + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {89975073-0072-42AA-902B-31EBE7B21526} + {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + Library + + + DotNetNuke.Authentication.ActiveDirectory + + + 4.0 + On + Binary + Off + On + + + v4.0 + false + + + true + full + true + true + ..\..\..\bin\Providers\ + DotNetNuke.Authentication.ActiveDirectory.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AllRules.ruleset + false + + + pdbonly + false + true + true + ..\..\..\bin\Providers\ + DotNetNuke.Authentication.ActiveDirectory.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AllRules.ruleset + false + + + + False + ..\..\..\..\Sites\dnndev7\bin\DotNetNuke.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ASPXCodeBehind + + + + + + + + + + + + + + + Login.ascx + + + Login.ascx + ASPXCodeBehind + + + + + + Component + + + Component + + + + Settings.ascx + + + Settings.ascx + ASPXCodeBehind + + + WindowsSignin.aspx + + + WindowsSignin.aspx + ASPXCodeBehind + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + 62597 + / + http://localhost/dnndev/DesktopModules/AuthenticationServices/ActiveDirectory + True + http://localhost/dnndev + False + False + + + False + + + + + + zip + ActiveDirectory + ActiveDirectory + $(MSBuildProjectDirectory)\BuildScripts + + + + + + \ No newline at end of file diff --git a/HttpModule/AuthenticationModule.vb b/HttpModule/AuthenticationModule.vb index 54707e0..534466a 100644 --- a/HttpModule/AuthenticationModule.vb +++ b/HttpModule/AuthenticationModule.vb @@ -1,210 +1,225 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports DotNetNuke.Authentication.ActiveDirectory.ADSI -Imports DotNetNuke.Entities.Portals - -Namespace DotNetNuke.Authentication.ActiveDirectory.HttpModules - Public Class AuthenticationModule - Implements IHttpModule - - Public ReadOnly Property ModuleName() As String - Get - Return "AuthenticationModule" - End Get - End Property - - Public Sub Init(ByVal application As HttpApplication) Implements IHttpModule.Init - AddHandler application.AuthenticateRequest, AddressOf OnAuthenticateRequest - End Sub - - Public Sub OnAuthenticateRequest(ByVal s As Object, ByVal e As EventArgs) - - Dim request As HttpRequest = HttpContext.Current.Request - Dim response As HttpResponse = HttpContext.Current.Response - - ''check if we are upgrading/installing/using a web service/rss feeds (ACD-7748) - 'Abort if NOT Default.aspx - If Not request.Url.LocalPath.ToLower.EndsWith("default.aspx") _ - OrElse request.RawUrl.ToLower.Contains("rssid") Then - Exit Sub - End If - 'Check that Host/Admin user is not already logged into the site. - 'If so then bypass authentication (ACD-2592) - If Not (Users.UserController.Instance.GetCurrentUserInfo().Username = String.Empty) Then - Dim bHost As Boolean = Users.UserController.Instance.GetCurrentUserInfo().IsSuperUser - Dim _ - bAdmin As Boolean = Users.UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators") - If bAdmin Or bHost Then Exit Sub - End If - - 'Moved the following statement from the top to correct ACD-9746 - Dim portalSettings As PortalSettings = GetPortalSettings() - - Dim config As Configuration = Configuration.GetConfig() - - If config Is Nothing Then - Exit Sub - End If - - 'ACD-8846, WorkItems 6416,4766, 4077, 7805 - Dim strRequest As String = UCase(request.ServerVariables("HTTP_USER_AGENT")) - If strRequest Is Nothing Then - Exit Sub - End If - Dim arrBots() As String = config.Bots.Split(";") - For intCount As Integer = 0 To arrBots.Length - 1 - Dim strBot As String = UCase(arrBots(intCount)) - If Not strBot = "" Then - If strRequest.Contains(strBot) Then - Exit Sub - End If - End If - Next - If strRequest.Contains("gsa-crawler") Or strRequest Is Nothing Then - Exit Sub - End If - - Dim permission As AspNetHostingPermissionLevel = Utilities.GetCurrentTrustLevel() - - If (Not (permission = AspNetHostingPermissionLevel.Unrestricted)) Then - response.Redirect("~/DesktopModules/AuthenticationServices/ActiveDirectory/trusterror.htm", True) - End If - - 'ACD-8589 - If (config.WindowsAuthentication Or config.HideWindowsLogin) Then - Dim authStatus As AuthenticationStatus = AuthenticationController.GetStatus(portalSettings.PortalId) - Dim _ - blnWinLogon As Boolean = _ - (request.RawUrl.ToLower.IndexOf((Configuration.AUTHENTICATION_LOGON_PAGE).ToLower) > -1) - Dim blnWinLogoff As Boolean = (authStatus = AuthenticationStatus.WinLogon) _ - AndAlso _ - (request.RawUrl.ToLower.IndexOf( _ - (Configuration.AUTHENTICATION_LOGOFF_PAGE) _ - .ToLower) > -1) - Dim blnWinProcess As Boolean = (authStatus = AuthenticationStatus.WinProcess) AndAlso (Not (blnWinLogon OrElse blnWinLogoff)) - - SetDnnReturnToCookie(request, response, portalSettings) - If (authStatus = AuthenticationStatus.Undefined) OrElse (blnWinProcess) Then - AuthenticationController.SetStatus(portalSettings.PortalId, AuthenticationStatus.WinProcess) - Dim url As String = request.RawUrl - Dim arrAutoIp() = config.AutoIP.Split(";") - 'ACD-7664 - Dim strClientIp As String = Utilities.GetIP4Address(request.UserHostAddress) - For intCount As Integer = 0 To arrAutoIp.Length - 1 - Dim strAutoIp As String = arrAutoIp(intCount) - If (InStr(strAutoIp, "-")) Then - Dim arrIpRange() = strAutoIp.Split("-") - Dim lClientIp As Long = IPAddressToLong(strClientIp) - If _ - lClientIp >= IPAddressToLong(Utilities.GetIP4Address(Trim(arrIpRange(0)))) And _ - lClientIp <= IPAddressToLong(Utilities.GetIP4Address(Trim(arrIpRange(1)))) Then - url = GetRedirectUrl(request) - Exit For - End If - ElseIf _ - (Not InStr(Left(strClientIp.ToString, strAutoIp.Length), strAutoIp) = 0) Or _ - (strAutoIp = "") Then - url = GetRedirectUrl(request) - Exit For - End If - Next - 'WorkItem: 8571 - response.Redirect(url & "?portalid=" & portalSettings.PortalId) - ElseIf (Not authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogoff Then - Dim objAuthentication As New AuthenticationController - objAuthentication.AuthenticationLogoff() - ElseIf (authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogon Then ' has been logoff before - AuthenticationController.SetStatus(portalSettings.PortalId, AuthenticationStatus.Undefined) - response.Redirect(request.RawUrl) - End If - - End If - End Sub - - Public Sub Dispose() Implements IHttpModule.Dispose - ' Should check to see why this routine is never called - End Sub - - Private Shared Function GetRedirectUrl(ByVal request As HttpRequest) _ - As String - - If request.ApplicationPath = "/" Then - Return _ - Configuration.AUTHENTICATION_PATH & Configuration.AUTHENTICATION_LOGON_PAGE - Else - Return _ - request.ApplicationPath & Configuration.AUTHENTICATION_PATH & _ - Configuration.AUTHENTICATION_LOGON_PAGE - End If - End Function - - Private Shared Sub SetDnnReturnToCookie(ByVal request As HttpRequest, ByVal response As HttpResponse, _ - ByVal portalSettings As PortalSettings) - Try - Dim refUrl As String = request.RawUrl - response.Clear() - response.Cookies("DNNReturnTo").Value = refUrl - response.Cookies("DNNReturnTo").Path = "/" - response.Cookies("DNNReturnTo").Expires = _ - DateTime.Now.AddMinutes(5) - Catch - End Try - - End Sub - - Private Shared Function IpAddressToLong(ByVal strPassedIp As String) As UInteger - Dim x As Integer - Dim pos As Integer - Dim prevPos As Integer - Dim num As Integer - Dim lConvertToLong As Long = 0 - - If UBound(Split(strPassedIP, ".")) = 3 Then - - ' On Error Resume Next - - For x = 1 To 4 - - pos = InStr(prevPos + 1, strPassedIP, ".", 1) - - If x = 4 Then pos = Len(strPassedIP) + 1 - - num = Int(Mid(strPassedIP, prevPos + 1, pos - prevPos - 1)) - - If num > 255 Then - - 'lConvertToLong = "0" - - Exit Function - - End If - - prevPos = pos - - lConvertToLong = ((num Mod 256) * (256 ^ (4 - x))) + lConvertToLong - - Next - - End If - Return lConvertToLong - - End Function - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports DotNetNuke.Authentication.ActiveDirectory.ADSI +Imports DotNetNuke.Entities.Portals + +Namespace DotNetNuke.Authentication.ActiveDirectory.HttpModules + Public Class AuthenticationModule + Implements IHttpModule + + Public ReadOnly Property ModuleName() As String + Get + Return "AuthenticationModule" + End Get + End Property + + Public Sub Init(ByVal application As HttpApplication) Implements IHttpModule.Init + AddHandler application.AuthenticateRequest, AddressOf OnAuthenticateRequest + End Sub + + Public Sub OnAuthenticateRequest(ByVal s As Object, ByVal e As EventArgs) + Dim request As HttpRequest = HttpContext.Current.Request + Dim response As HttpResponse = HttpContext.Current.Response + + ''check if we are upgrading/installing/using a web service/rss feeds (ACD-7748) + 'Abort if NOT Default.aspx + If Not request.Url.LocalPath.ToLower.EndsWith("default.aspx") _ + OrElse request.RawUrl.ToLower.Contains("rssid") Then + Exit Sub + End If + 'Check that Host/Admin user is not already logged into the site. + 'If so then bypass authentication (ACD-2592) + If Not (Users.UserController.Instance.GetCurrentUserInfo().Username = String.Empty) Then + Dim bHost As Boolean = Users.UserController.Instance.GetCurrentUserInfo().IsSuperUser + Dim _ + bAdmin As Boolean = Users.UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators") + If bAdmin Or bHost Then Exit Sub + End If + + 'Moved the following statement from the top to correct ACD-9746 + Dim portalSettings As PortalSettings = GetPortalSettings() + + Dim config As Configuration = Configuration.GetConfig() + + If config Is Nothing Then + Exit Sub + End If + + 'ACD-8846, WorkItems 6416,4766, 4077, 7805 + Dim strRequest As String = UCase(request.ServerVariables("HTTP_USER_AGENT")) + If strRequest Is Nothing Then + Exit Sub + End If + Dim arrBots() As String = config.Bots.Split(";") + For intCount As Integer = 0 To arrBots.Length - 1 + Dim strBot As String = UCase(arrBots(intCount)) + If Not strBot = "" Then + If strRequest.Contains(strBot) Then + Exit Sub + End If + End If + Next + If strRequest.Contains("gsa-crawler") Or strRequest Is Nothing Then + Exit Sub + End If + + Dim permission As AspNetHostingPermissionLevel = Utilities.GetCurrentTrustLevel() + + If (Not (permission = AspNetHostingPermissionLevel.Unrestricted)) Then + response.Redirect("~/DesktopModules/AuthenticationServices/ActiveDirectory/trusterror.htm", True) + End If + + 'ACD-8589 + If (config.WindowsAuthentication Or config.HideWindowsLogin) Then + Dim authStatus As AuthenticationStatus = AuthenticationController.GetStatus(portalSettings.PortalId) + Dim _ + blnWinLogon As Boolean = + (request.RawUrl.ToLower.IndexOf((Configuration.AUTHENTICATION_LOGON_PAGE).ToLower) > -1) + Dim blnWinLogoff As Boolean = (authStatus = AuthenticationStatus.WinLogon) _ + AndAlso + (request.RawUrl.ToLower.IndexOf( + (Configuration.AUTHENTICATION_LOGOFF_PAGE) _ + .ToLower) > -1) + Dim blnWinProcess As Boolean = (authStatus = AuthenticationStatus.WinProcess) AndAlso (Not (blnWinLogon OrElse blnWinLogoff)) + + SetDnnReturnToCookie(request, response, portalSettings) + If (authStatus = AuthenticationStatus.Undefined) OrElse (blnWinProcess) Then + AuthenticationController.SetStatus(portalSettings.PortalId, AuthenticationStatus.WinProcess) + Dim url As String = request.RawUrl + Dim arrAutoIp() = config.AutoIP.Split(";") + + 'ACD-7664 + Dim strClientIp As String = Utilities.GetIP4Address(request.UserHostAddress) + + 'Issue: 47 + 'Check new settings feature enable auto login + 'Steven A West 8/14/2018 check for no ip addresses, no ip addresses = all clients get windows authentication + Dim redirect As Boolean = False + If CBool(config.EnableAutoLogin) Then + If arrAutoIp.Length > 0 Then + For intCount As Integer = 0 To arrAutoIp.Length - 1 + Dim strAutoIp As String = arrAutoIp(intCount) + If (InStr(strAutoIp, "-")) Then + Dim arrIpRange() = strAutoIp.Split("-") + Dim lClientIp As Long = IpAddressToLong(strClientIp) + If _ + lClientIp >= IpAddressToLong(Utilities.GetIP4Address(Trim(arrIpRange(0)))) And + lClientIp <= IpAddressToLong(Utilities.GetIP4Address(Trim(arrIpRange(1)))) Then + url = GetRedirectUrl(request) + redirect = True + Exit For + End If + ElseIf _ + (Not InStr(Left(strClientIp.ToString, strAutoIp.Length), strAutoIp) = 0) Or + (strAutoIp = "") Then + url = GetRedirectUrl(request) + redirect = True + Exit For + End If + Next + Else + url = GetRedirectUrl(request) + redirect = True + End If + End If + If redirect Then 'prevents infinite redirects issue: 47 + response.Redirect(url & "?portalid=" & portalSettings.PortalId) + End If + ElseIf (Not authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogoff Then + Dim objAuthentication As New AuthenticationController + objAuthentication.AuthenticationLogoff() + ElseIf (authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogon Then ' has been logoff before + AuthenticationController.SetStatus(portalSettings.PortalId, AuthenticationStatus.Undefined) + response.Redirect(request.RawUrl) + End If + + End If + End Sub + + Public Sub Dispose() Implements IHttpModule.Dispose + ' Should check to see why this routine is never called + End Sub + + Private Shared Function GetRedirectUrl(ByVal request As HttpRequest) _ + As String + + If request.ApplicationPath = "/" Then + Return _ + Configuration.AUTHENTICATION_PATH & Configuration.AUTHENTICATION_LOGON_PAGE + Else + Return _ + request.ApplicationPath & Configuration.AUTHENTICATION_PATH & + Configuration.AUTHENTICATION_LOGON_PAGE + End If + End Function + + Private Shared Sub SetDnnReturnToCookie(ByVal request As HttpRequest, ByVal response As HttpResponse, + ByVal portalSettings As PortalSettings) + Try + Dim refUrl As String = request.RawUrl + response.Clear() + response.Cookies("DNNReturnTo").Value = refUrl + response.Cookies("DNNReturnTo").Path = "/" + response.Cookies("DNNReturnTo").Expires = + DateTime.Now.AddMinutes(5) + Catch + End Try + + End Sub + + Private Shared Function IpAddressToLong(ByVal strPassedIp As String) As UInteger + Dim x As Integer + Dim pos As Integer + Dim prevPos As Integer + Dim num As Integer + Dim lConvertToLong As Long = 0 + + If UBound(Split(strPassedIp, ".")) = 3 Then + + ' On Error Resume Next + + For x = 1 To 4 + + pos = InStr(prevPos + 1, strPassedIp, ".", 1) + + If x = 4 Then pos = Len(strPassedIp) + 1 + + num = Int(Mid(strPassedIp, prevPos + 1, pos - prevPos - 1)) + + If num > 255 Then + + 'lConvertToLong = "0" + + Exit Function + + End If + + prevPos = pos + + lConvertToLong = ((num Mod 256) * (256 ^ (4 - x))) + lConvertToLong + + Next + + End If + Return lConvertToLong + + End Function + End Class +End Namespace diff --git a/LICENSE b/LICENSE index 8674976..87cb5e0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,22 @@ -The MIT License (MIT) - -Copyright (c) 2015 DNN Community - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - +The MIT License (MIT) + +Copyright (c) 2015 DNN Community + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/Login.ascx b/Login.ascx index f978478..bb5a866 100644 --- a/Login.ascx +++ b/Login.ascx @@ -1,32 +1,32 @@ -<%@ Control Language="vb" Inherits="DotNetNuke.Authentication.ActiveDirectory.Login, DotNetNuke.Authentication.ActiveDirectory" AutoEventWireup="false" Explicit="True" CodeBehind="Login.ascx.vb" %> -<%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %> -<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> -
-
- - -
-
- - -
- -
- -
-
- -
-
- - -
-
- - \ No newline at end of file diff --git a/Login.ascx.designer.vb b/Login.ascx.designer.vb index 772bbed..7600c3a 100644 --- a/Login.ascx.designer.vb +++ b/Login.ascx.designer.vb @@ -1,98 +1,98 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Authentication.ActiveDirectory - - Partial Public Class Login - - ''' - '''plUsername control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plUsername As Global.System.Web.UI.WebControls.Label - - ''' - '''txtUsername control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtUsername As Global.System.Web.UI.WebControls.TextBox - - ''' - '''plPassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plPassword As Global.System.Web.UI.WebControls.Label - - ''' - '''txtPassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPassword As Global.System.Web.UI.WebControls.TextBox - - ''' - '''divCaptcha1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divCaptcha1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plCaptcha control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plCaptcha As Global.System.Web.UI.WebControls.Label - - ''' - '''divCaptcha2 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents divCaptcha2 As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''ctlCaptcha control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ctlCaptcha As Global.DotNetNuke.UI.WebControls.CaptchaControl - - ''' - '''cmdLogin control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cmdLogin As Global.System.Web.UI.WebControls.LinkButton - End Class -End Namespace +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Namespace DotNetNuke.Authentication.ActiveDirectory + + Partial Public Class Login + + ''' + '''plUsername control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plUsername As Global.System.Web.UI.WebControls.Label + + ''' + '''txtUsername control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtUsername As Global.System.Web.UI.WebControls.TextBox + + ''' + '''plPassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plPassword As Global.System.Web.UI.WebControls.Label + + ''' + '''txtPassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtPassword As Global.System.Web.UI.WebControls.TextBox + + ''' + '''divCaptcha1 control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents divCaptcha1 As Global.System.Web.UI.HtmlControls.HtmlGenericControl + + ''' + '''plCaptcha control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plCaptcha As Global.System.Web.UI.WebControls.Label + + ''' + '''divCaptcha2 control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents divCaptcha2 As Global.System.Web.UI.HtmlControls.HtmlGenericControl + + ''' + '''ctlCaptcha control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents ctlCaptcha As Global.DotNetNuke.UI.WebControls.CaptchaControl + + ''' + '''cmdLogin control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents cmdLogin As Global.System.Web.UI.WebControls.LinkButton + End Class +End Namespace diff --git a/Login.ascx.vb b/Login.ascx.vb index b13e164..a7b3ed7 100644 --- a/Login.ascx.vb +++ b/Login.ascx.vb @@ -1,307 +1,307 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - - -Imports DotNetNuke.Services.Authentication -Imports DotNetNuke.Security.Membership -Imports DotNetNuke.Services.Log.EventLog -Imports System.Security.Permissions -Imports DNNUserInfo = DotNetNuke.Entities.Users.UserInfo - - -Namespace DotNetNuke.Authentication.ActiveDirectory - Partial Class Login - Inherits AuthenticationLoginBase - - -#Region "Private Members" - - Private memberProvider As MembershipProvider = MembershipProvider.Instance() - -#End Region - - ''' ----------------------------------------------------------------------------- - ''' - ''' AddEventLog runs when on login failure - ''' - ''' - ''' - ''' - ''' [mhorton] 10/12/2009 Added writing to the eventlog on login failure. Codeplex Work Item:3050 - ''' - ''' ----------------------------------------------------------------------------- - - Private Shared Sub AddEventLog (ByVal portalId As Integer, ByVal username As String, ByVal userId As Integer, _ - ByVal portalName As String, ByVal Ip As String, _ - ByVal loginStatus As UserLoginStatus) - - Dim objEventLog As New EventLogController - - ' initialize log record - Dim objEventLogInfo As New LogInfo - Dim objSecurity As New PortalSecurity - objEventLogInfo.AddProperty ("IP", Ip) - objEventLogInfo.LogPortalID = portalId - objEventLogInfo.LogPortalName = portalName - objEventLogInfo.LogUserName = _ - objSecurity.InputFilter (username, _ - PortalSecurity.FilterFlag.NoScripting Or _ - PortalSecurity.FilterFlag.NoAngleBrackets Or PortalSecurity.FilterFlag.NoMarkup) - objEventLogInfo.LogUserID = userId - - ' create log record - objEventLogInfo.LogTypeKey = loginStatus.ToString - objEventLog.AddLog (objEventLogInfo) - - End Sub - -#Region "Protected Properties" - - ''' ----------------------------------------------------------------------------- - ''' - ''' Gets whether the Captcha control is used to validate the login - ''' - ''' - ''' [cnurse] 03/17/2006 Created - ''' [cnurse] 07/03/2007 Moved from Sign.ascx.vb - ''' - ''' ----------------------------------------------------------------------------- - Protected ReadOnly Property UseCaptcha() As Boolean - Get - Dim setting As Object = GetSetting (PortalId, "Security_CaptchaLogin") - Return CType (setting, Boolean) - End Get - End Property - - ''' ----------------------------------------------------------------------------- - ''' - ''' Returns the username entered into a standard format (DOMAIN\User) if the - ''' default domain set. - ''' - ''' - ''' [mhorton] 27/04/2009 - Created - ''' [mhorton] 27/04/2009 - ACD-5585 - ''' [mhorton] 22/03/2011 - item-5950 - ''' - ''' ----------------------------------------------------------------------------- - - Protected Property UserName() As String - Get - Dim config As Configuration = Configuration.GetConfig() - 'Check to see if ADAuth config has a "default domain prefix" - Dim sDefaultDomain As String = config.DefaultDomain - - Dim theUser As String = String.Empty - Dim strDomain As String = String.Empty - Dim userinfo As String() - If Not String.IsNullOrEmpty(txtUsername.Text) Then - - 'If UPN username provided, strip domain, translate to netBiOS - If txtUsername.Text.Contains("@") Then - - '***Changed Steven A West 1-11-2018 Bug fix #12 & #24 - theUser = ADSI.Utilities.UPNToLogonName0(txtUsername.Text.ToLower) - - '***Commented Out Steven A West 1-11-2018 Bug fix #12 & #24************** - ' userinfo = Split(txtUsername.Text, "@") - ' theUser = userinfo(0) - 'theUser = Left(txtUsername.Text, txtUsername.Text.IndexOf("@")) ***Changed Steven A West 2-25-2017 Bug fix #12 - ' strDomain = UCase(userinfo(1)) - - '***Changed Steven A West 2-25-2017 Bug fix #12 - 'strDomain = Right(txtUsername.Text, Len(txtUsername.Text) - (Len(theUser) + 1)).ToUpper - '***Changed Steven A West 8-29-2017 Bug fix #12 - 'If strDomain.Contains(sDefaultDomain) Then - ' theUser = Trim(sDefaultDomain).Replace("\", "") & "\" & theUser - 'Else - ' theUser = strDomain & "\" & theUser - 'End If - 'If Not String.IsNullOrEmpty(sDefaultDomain) Then - ' If strDomain.Contains(sDefaultDomain) Then - ' theUser = Trim(sDefaultDomain).Replace("\", "") & "\" & theUser - ' Else - ' theUser = strDomain & "\" & theUser - ' End If - 'End If - - '**************************************************************************** - Else - 'If username doesn't contain the DOMAIN\ already and config uses Default Domain - 'Then append default domain as prefix - If (Not txtUsername.Text.Contains("\")) And (sDefaultDomain <> "") Then - theUser = Trim(sDefaultDomain).Replace("\", "") & "\" & txtUsername.Text - Else - 'if username contains domain\ then check if domain provided is canonical and translate - If txtUsername.Text.Contains("\") Then - - '***Changed Steven A West 1-11-2018 Bug fix #12 & #24 - strDomain = UCase(Split(txtUsername.Text, "\")(0)) - theUser = UCase(Split(txtUsername.Text, "\")(1)) - If strDomain.Contains(".") Then 'canonical domain provided, translate - strDomain = ADSI.Utilities.CanonicalToNetBIOS(strDomain.ToLower) - End If - If Not String.IsNullOrEmpty(strDomain) Then - theUser = strDomain & "\" & theUser - End If - '******** - Else - 'no domain provided and no default domain set - theUser = txtUsername.Text - End If - End If - End If - End If - - Return theUser - End Get - Set (ByVal value As String) - txtUsername.Text = value - End Set - End Property - -#End Region - -#Region "Public Properties" - - ''' ----------------------------------------------------------------------------- - ''' - ''' Check if the Auth System is Enabled (for the Portal) - ''' - ''' - ''' - ''' [cnurse] 07/04/2007 Created - ''' - ''' ----------------------------------------------------------------------------- - Public Overrides ReadOnly Property Enabled() As Boolean - Get - Try - 'Make sure app is running at full trust - Dim HostingPermissions As New AspNetHostingPermission (PermissionState.Unrestricted) - HostingPermissions.Demand() - - 'Check if Windows Auth is enabled for the portal - Return Configuration.GetConfig().WindowsAuthentication - Catch ex As Exception - Return False - End Try - End Get - End Property - -#End Region - -#Region "Event Handlers" - - ''' ----------------------------------------------------------------------------- - ''' - ''' Page_Load runs when the control is loaded - ''' - ''' - ''' - ''' - ''' [cnurse] 9/8/2004 Updated to reflect design changes for Help, 508 support - ''' and localisation - ''' [mhorton] 07/30/2007 Cleaned out unneeded legacy code - ''' - ''' ----------------------------------------------------------------------------- - Private Sub Page_Load (ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load - If Not Request.IsAuthenticated Then - If Page.IsPostBack = False Then - Try - If Not Request.QueryString ("username") Is Nothing Then - txtUsername.Text = Request.QueryString ("username") - End If - Catch - 'control not there - End Try - End If - - txtPassword.Attributes.Add ("value", txtPassword.Text) - - Try - If String.IsNullOrEmpty (txtUsername.Text) Then - SetFormFocus (txtUsername) - Else - SetFormFocus (txtPassword) - End If - Catch - 'Not sure why this Try/Catch may be necessary, logic was there in old setFormFocus location stating the following - 'control not there or error setting focus - End Try - End If - - divCaptcha1.Visible = UseCaptcha - divCaptcha2.Visible = UseCaptcha - - If UseCaptcha Then - ctlCaptcha.ErrorMessage = Localization.GetString ("InvalidCaptcha", Localization.SharedResourceFile) - ctlCaptcha.Text = Localization.GetString ("CaptchaText", Localization.SharedResourceFile) - End If - - End Sub - - ''' ----------------------------------------------------------------------------- - ''' - ''' cmdLogin_Click runs when the login button is clicked - ''' - ''' - ''' - ''' - ''' [cnurse] 9/24/2004 Updated to reflect design changes for Help, 508 support - ''' and localisation - ''' [cnurse] 12/11/2005 Updated to reflect abstraction of Membership - ''' [cnurse] 07/03/2007 Moved from Sign.ascx.vb - ''' [mhorton] 07/30/2007 Cleaned out unneeded legacy code - ''' [mhorton] 10/12/2009 Added writing to the eventlog on login failure. Codeplex Work Item:3050 - ''' - ''' ----------------------------------------------------------------------------- - Private Sub cmdLogin_Click (ByVal sender As Object, ByVal e As EventArgs) Handles cmdLogin.Click - If (UseCaptcha And ctlCaptcha.IsValid) OrElse (Not UseCaptcha) Then - - Dim loginStatus As UserLoginStatus = UserLoginStatus.LOGIN_FAILURE - Dim objAuthentication As New AuthenticationController - Dim objUser As DNNUserInfo = Nothing - If UserName.Contains("\") Then - objUser = objAuthentication.ManualLogon(UserName, txtPassword.Text, loginStatus, IPAddress) - End If - Dim authenticated As Boolean = Null.NullBoolean - Dim message As String = Null.NullString - authenticated = (loginStatus <> UserLoginStatus.LOGIN_FAILURE) - - 'If objUser is nothing then there must've been a problem logging in. Write to the eventlog. - If objUser Is Nothing Then - AddEventLog(PortalId, UserName, Null.NullInteger, PortalSettings.PortalName, IPAddress, loginStatus) - End If - 'Raise UserAuthenticated Event - 'Dim _ - ' eventArgs As UserAuthenticatedEventArgs = - ' New UserAuthenticatedEventArgs(objUser, Split(UserName, "\")(1), loginStatus, "Active Directory") 'Bug fix #12 Steven A West - Dim _ - eventArgs As UserAuthenticatedEventArgs = - New UserAuthenticatedEventArgs(objUser, UserName, loginStatus, "Active Directory") 'Bug fix #17 Steven A West, possible for user not to have \ in username (unauthenticated) so dont split assuming there is an index of 1 - eventArgs.Authenticated = authenticated - eventArgs.Message = message - OnUserAuthenticated(eventArgs) - End If - - End Sub - -#End Region - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + + +Imports DotNetNuke.Services.Authentication +Imports DotNetNuke.Security.Membership +Imports DotNetNuke.Services.Log.EventLog +Imports System.Security.Permissions +Imports DNNUserInfo = DotNetNuke.Entities.Users.UserInfo + + +Namespace DotNetNuke.Authentication.ActiveDirectory + Partial Class Login + Inherits AuthenticationLoginBase + + +#Region "Private Members" + + Private memberProvider As MembershipProvider = MembershipProvider.Instance() + +#End Region + + ''' ----------------------------------------------------------------------------- + ''' + ''' AddEventLog runs when on login failure + ''' + ''' + ''' + ''' + ''' [mhorton] 10/12/2009 Added writing to the eventlog on login failure. Codeplex Work Item:3050 + ''' + ''' ----------------------------------------------------------------------------- + + Private Shared Sub AddEventLog (ByVal portalId As Integer, ByVal username As String, ByVal userId As Integer, _ + ByVal portalName As String, ByVal Ip As String, _ + ByVal loginStatus As UserLoginStatus) + + Dim objEventLog As New EventLogController + + ' initialize log record + Dim objEventLogInfo As New LogInfo + Dim objSecurity As New PortalSecurity + objEventLogInfo.AddProperty ("IP", Ip) + objEventLogInfo.LogPortalID = portalId + objEventLogInfo.LogPortalName = portalName + objEventLogInfo.LogUserName = _ + objSecurity.InputFilter (username, _ + PortalSecurity.FilterFlag.NoScripting Or _ + PortalSecurity.FilterFlag.NoAngleBrackets Or PortalSecurity.FilterFlag.NoMarkup) + objEventLogInfo.LogUserID = userId + + ' create log record + objEventLogInfo.LogTypeKey = loginStatus.ToString + objEventLog.AddLog (objEventLogInfo) + + End Sub + +#Region "Protected Properties" + + ''' ----------------------------------------------------------------------------- + ''' + ''' Gets whether the Captcha control is used to validate the login + ''' + ''' + ''' [cnurse] 03/17/2006 Created + ''' [cnurse] 07/03/2007 Moved from Sign.ascx.vb + ''' + ''' ----------------------------------------------------------------------------- + Protected ReadOnly Property UseCaptcha() As Boolean + Get + Dim setting As Object = GetSetting (PortalId, "Security_CaptchaLogin") + Return CType (setting, Boolean) + End Get + End Property + + ''' ----------------------------------------------------------------------------- + ''' + ''' Returns the username entered into a standard format (DOMAIN\User) if the + ''' default domain set. + ''' + ''' + ''' [mhorton] 27/04/2009 - Created + ''' [mhorton] 27/04/2009 - ACD-5585 + ''' [mhorton] 22/03/2011 - item-5950 + ''' + ''' ----------------------------------------------------------------------------- + + Protected Property UserName() As String + Get + Dim config As Configuration = Configuration.GetConfig() + 'Check to see if ADAuth config has a "default domain prefix" + Dim sDefaultDomain As String = config.DefaultDomain + + Dim theUser As String = String.Empty + Dim strDomain As String = String.Empty + Dim userinfo As String() + If Not String.IsNullOrEmpty(txtUsername.Text) Then + + 'If UPN username provided, strip domain, translate to netBiOS + If txtUsername.Text.Contains("@") Then + + '***Changed Steven A West 1-11-2018 Bug fix #12 & #24 + theUser = ADSI.Utilities.UPNToLogonName0(txtUsername.Text.ToLower) + + '***Commented Out Steven A West 1-11-2018 Bug fix #12 & #24************** + ' userinfo = Split(txtUsername.Text, "@") + ' theUser = userinfo(0) + 'theUser = Left(txtUsername.Text, txtUsername.Text.IndexOf("@")) ***Changed Steven A West 2-25-2017 Bug fix #12 + ' strDomain = UCase(userinfo(1)) + + '***Changed Steven A West 2-25-2017 Bug fix #12 + 'strDomain = Right(txtUsername.Text, Len(txtUsername.Text) - (Len(theUser) + 1)).ToUpper + '***Changed Steven A West 8-29-2017 Bug fix #12 + 'If strDomain.Contains(sDefaultDomain) Then + ' theUser = Trim(sDefaultDomain).Replace("\", "") & "\" & theUser + 'Else + ' theUser = strDomain & "\" & theUser + 'End If + 'If Not String.IsNullOrEmpty(sDefaultDomain) Then + ' If strDomain.Contains(sDefaultDomain) Then + ' theUser = Trim(sDefaultDomain).Replace("\", "") & "\" & theUser + ' Else + ' theUser = strDomain & "\" & theUser + ' End If + 'End If + + '**************************************************************************** + Else + 'If username doesn't contain the DOMAIN\ already and config uses Default Domain + 'Then append default domain as prefix + If (Not txtUsername.Text.Contains("\")) And (sDefaultDomain <> "") Then + theUser = Trim(sDefaultDomain).Replace("\", "") & "\" & txtUsername.Text + Else + 'if username contains domain\ then check if domain provided is canonical and translate + If txtUsername.Text.Contains("\") Then + + '***Changed Steven A West 1-11-2018 Bug fix #12 & #24 + strDomain = UCase(Split(txtUsername.Text, "\")(0)) + theUser = UCase(Split(txtUsername.Text, "\")(1)) + If strDomain.Contains(".") Then 'canonical domain provided, translate + strDomain = ADSI.Utilities.CanonicalToNetBIOS(strDomain.ToLower) + End If + If Not String.IsNullOrEmpty(strDomain) Then + theUser = strDomain & "\" & theUser + End If + '******** + Else + 'no domain provided and no default domain set + theUser = txtUsername.Text + End If + End If + End If + End If + + Return theUser + End Get + Set (ByVal value As String) + txtUsername.Text = value + End Set + End Property + +#End Region + +#Region "Public Properties" + + ''' ----------------------------------------------------------------------------- + ''' + ''' Check if the Auth System is Enabled (for the Portal) + ''' + ''' + ''' + ''' [cnurse] 07/04/2007 Created + ''' + ''' ----------------------------------------------------------------------------- + Public Overrides ReadOnly Property Enabled() As Boolean + Get + Try + 'Make sure app is running at full trust + Dim HostingPermissions As New AspNetHostingPermission (PermissionState.Unrestricted) + HostingPermissions.Demand() + + 'Check if Windows Auth is enabled for the portal + Return Configuration.GetConfig().WindowsAuthentication + Catch ex As Exception + Return False + End Try + End Get + End Property + +#End Region + +#Region "Event Handlers" + + ''' ----------------------------------------------------------------------------- + ''' + ''' Page_Load runs when the control is loaded + ''' + ''' + ''' + ''' + ''' [cnurse] 9/8/2004 Updated to reflect design changes for Help, 508 support + ''' and localisation + ''' [mhorton] 07/30/2007 Cleaned out unneeded legacy code + ''' + ''' ----------------------------------------------------------------------------- + Private Sub Page_Load (ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + If Not Request.IsAuthenticated Then + If Page.IsPostBack = False Then + Try + If Not Request.QueryString ("username") Is Nothing Then + txtUsername.Text = Request.QueryString ("username") + End If + Catch + 'control not there + End Try + End If + + txtPassword.Attributes.Add ("value", txtPassword.Text) + + Try + If String.IsNullOrEmpty (txtUsername.Text) Then + SetFormFocus (txtUsername) + Else + SetFormFocus (txtPassword) + End If + Catch + 'Not sure why this Try/Catch may be necessary, logic was there in old setFormFocus location stating the following + 'control not there or error setting focus + End Try + End If + + divCaptcha1.Visible = UseCaptcha + divCaptcha2.Visible = UseCaptcha + + If UseCaptcha Then + ctlCaptcha.ErrorMessage = Localization.GetString ("InvalidCaptcha", Localization.SharedResourceFile) + ctlCaptcha.Text = Localization.GetString ("CaptchaText", Localization.SharedResourceFile) + End If + + End Sub + + ''' ----------------------------------------------------------------------------- + ''' + ''' cmdLogin_Click runs when the login button is clicked + ''' + ''' + ''' + ''' + ''' [cnurse] 9/24/2004 Updated to reflect design changes for Help, 508 support + ''' and localisation + ''' [cnurse] 12/11/2005 Updated to reflect abstraction of Membership + ''' [cnurse] 07/03/2007 Moved from Sign.ascx.vb + ''' [mhorton] 07/30/2007 Cleaned out unneeded legacy code + ''' [mhorton] 10/12/2009 Added writing to the eventlog on login failure. Codeplex Work Item:3050 + ''' + ''' ----------------------------------------------------------------------------- + Private Sub cmdLogin_Click (ByVal sender As Object, ByVal e As EventArgs) Handles cmdLogin.Click + If (UseCaptcha And ctlCaptcha.IsValid) OrElse (Not UseCaptcha) Then + + Dim loginStatus As UserLoginStatus = UserLoginStatus.LOGIN_FAILURE + Dim objAuthentication As New AuthenticationController + Dim objUser As DNNUserInfo = Nothing + If UserName.Contains("\") Then + objUser = objAuthentication.ManualLogon(UserName, txtPassword.Text, loginStatus, IPAddress) + End If + Dim authenticated As Boolean = Null.NullBoolean + Dim message As String = Null.NullString + authenticated = (loginStatus <> UserLoginStatus.LOGIN_FAILURE) + + 'If objUser is nothing then there must've been a problem logging in. Write to the eventlog. + If objUser Is Nothing Then + AddEventLog(PortalId, UserName, Null.NullInteger, PortalSettings.PortalName, IPAddress, loginStatus) + End If + 'Raise UserAuthenticated Event + 'Dim _ + ' eventArgs As UserAuthenticatedEventArgs = + ' New UserAuthenticatedEventArgs(objUser, Split(UserName, "\")(1), loginStatus, "Active Directory") 'Bug fix #12 Steven A West + Dim _ + eventArgs As UserAuthenticatedEventArgs = + New UserAuthenticatedEventArgs(objUser, UserName, loginStatus, "Active Directory") 'Bug fix #17 Steven A West, possible for user not to have \ in username (unauthenticated) so dont split assuming there is an index of 1 + eventArgs.Authenticated = authenticated + eventArgs.Message = message + OnUserAuthenticated(eventArgs) + End If + + End Sub + +#End Region + End Class +End Namespace diff --git a/Providers/ADSIProvider/ADSIProvider.vb b/Providers/ADSIProvider/ADSIProvider.vb index 74fa8ca..7d1103d 100644 --- a/Providers/ADSIProvider/ADSIProvider.vb +++ b/Providers/ADSIProvider/ADSIProvider.vb @@ -1,528 +1,528 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.DirectoryServices -Imports DotNetNuke.Entities.Portals -Imports System.Runtime.InteropServices -Imports DotNetNuke.Services.Exceptions -Imports DotNetNuke.Security.Roles - -Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI - Public Class ADSIProvider - Inherits AuthenticationProvider - - Private _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Private _adsiConfig As Configuration = Configuration.GetConfig() - Private _config As ActiveDirectory.Configuration = ActiveDirectory.Configuration.GetConfig() - -#Region "Private Methods" - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 10/05/2009 Changed - WorkItem:2943 - ''' - ''' ------------------------------------------------------------------- - - Private Function GetSimplyUser(ByVal UserName As String) As ADUserInfo - Dim objAuthUser As New ADUserInfo - - With objAuthUser - .PortalID = _portalSettings.PortalId - .IsNotSimplyUser = False - .Username = UserName - .FirstName = Utilities.TrimUserDomainName(UserName) - .LastName = Utilities.GetUserDomainName(UserName) - .IsSuperUser = False - .DistinguishedName = Utilities.ConvertToDistinguished(UserName) - - Dim strEmail As String = _adsiConfig.DefaultEmailDomain - If Not strEmail.Length = 0 Then - If strEmail.IndexOf("@") = -1 Then - strEmail = "@" & strEmail - End If - strEmail = .FirstName & strEmail - Else - strEmail = .FirstName & "@" & .LastName & ".com" - ' confusing? - End If - ' Membership properties - .Username = UserName - .Email = strEmail - .Membership.Approved = True - .Membership.LastLoginDate = Date.Now - .Membership.Password = Utilities.GetRandomPassword() - .AuthenticationExists = False - End With - - Return objAuthUser - - End Function - - Private Function IsAuthenticated(ByVal Path As String, ByVal UserName As String, ByVal Password As String) _ - As Boolean - Try - 'Moved to private global for access from other functions - sawest - 'Dim _config As ActiveDirectory.Configuration = ActiveDirectory.Configuration.GetConfig() - If _config.StripDomainName Then - Dim crossRef As CrossReferenceCollection.CrossReference - For Each crossRef In Configuration.GetConfig.RefCollection - UserName = crossRef.NetBIOSName & "\" & UserName - Next - End If - Dim userEntry As New DirectoryEntry(Path, UserName, Password, AuthenticationTypes.Signing) - ' Bind to the native AdsObject to force authentication. - Dim obj As Object = userEntry.NativeObject - - Catch exc As COMException - Return False - End Try - - Return True - - End Function - - ''' - ''' Fill UserInfo object - ''' - ''' - ''' - ''' - ''' [sawest] 12/16/2016 Added set photo - ''' - Private Sub FillUserInfo(ByVal UserEntry As DirectoryEntry, ByRef UserInfo As ADUserInfo) - - With UserInfo - .IsSuperUser = False - .Username = UserInfo.Username - .Membership.Approved = True - .Membership.LastLoginDate = Date.Now - If Not UserEntry Is Nothing Then - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_EMAIL).Value) = "") Then - .Email = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_EMAIL).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CNAME).Value.ToString) = "") _ - Then - .CName = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CNAME).Value.ToString) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_DISPLAYNAME).Value) = "") _ - Then - .DisplayName = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_DISPLAYNAME).Value) - End If - If _ - Not _ - (Utilities.CheckNullString( - UserEntry.Properties(Configuration.ADSI_DISTINGUISHEDNAME).Value. - ToString) = "") Then - .DistinguishedName = - Utilities.CheckNullString( - UserEntry.Properties(Configuration.ADSI_DISTINGUISHEDNAME).Value. - ToString) - End If - If _ - Not _ - (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_ACCOUNTNAME).Value.ToString) = - "") Then - .sAMAccountName = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_ACCOUNTNAME).Value.ToString) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CNAME).Value) = "") Then - .Profile.FirstName = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_FIRSTNAME).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_LASTNAME).Value) = "") Then - .Profile.LastName = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_LASTNAME).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_STREET).Value) = "") Then - .Profile.Street = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_STREET).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CITY).Value) = "") Then - .Profile.City = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CITY).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_REGION).Value) = "") Then - .Profile.Region = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_REGION).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_POSTALCODE).Value) = "") _ - Then - .Profile.PostalCode = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_POSTALCODE).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_COUNTRY).Value) = "") Then - .Profile.Country = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_COUNTRY).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_TELEPHONE).Value) = "") Then - .Profile.Telephone = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_TELEPHONE).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_FAX).Value) = "") Then - .Profile.Fax = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_FAX).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CELL).Value) = "") Then - .Profile.Cell = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CELL).Value) - End If - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_WEBSITE).Value) = "") Then - .Profile.Website = - Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_WEBSITE).Value) - End If - If _config.Photo Then - 'sync photo from AD if checked in settings - If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_PHOTO).Value) = "") Then - .Profile.Photo = - Utilities.WritePhoto(UserInfo, UserEntry.Properties(Configuration.ADSI_PHOTO).Value) - End If - End If - End If - - If .Email = "" Then - .Email = Utilities.TrimUserDomainName(UserInfo.Username) & _adsiConfig.DefaultEmailDomain - End If - If .DisplayName = "" Then - .DisplayName = .CName - End If - - .AuthenticationExists = True - ' obtain firstname from username if admin has not enter enough user info - If .Profile.FirstName.Length = 0 Then - .Profile.FirstName = Utilities.TrimUserDomainName(UserInfo.Username) - End If - End With - End Sub - -#End Region - - - Public Overloads Overrides Function GetUser(ByVal LoggedOnUserName As String, ByVal LoggedOnPassword As String) _ - As ADUserInfo - Dim objAuthUser As ADUserInfo - - If Not _adsiConfig.ADSINetwork Then - Return Nothing - End If - - Try - Dim entry As DirectoryEntry = Utilities.GetUserEntryByName(LoggedOnUserName) -#If DEBUG Then - Dim key As String - For Each key In entry.Properties.PropertyNames - Dim sPropertyValues As String = "" - For Each value As Object In entry.Properties(key) - sPropertyValues += Convert.ToString(value) + ";" - Next - sPropertyValues = sPropertyValues.Substring(0, sPropertyValues.Length - 1) - Debug.Print(key + "=" + sPropertyValues) - Next -#End If - 'Check authenticated - Dim path As String - If Not entry Is Nothing Then - path = entry.Path - Else - path = _adsiConfig.RootDomainPath - End If - If Not IsAuthenticated(path, LoggedOnUserName, LoggedOnPassword) Then - Return Nothing - End If - - ' Return authenticated if no error - objAuthUser = New ADUserInfo - 'ACD-6760 - InitializeUser(objAuthUser) - Dim location As String = Utilities.GetEntryLocation(entry) - If location.Length = 0 Then - location = _adsiConfig.ConfigDomainPath - End If - - With objAuthUser - .PortalID = _portalSettings.PortalId - .IsNotSimplyUser = True - .Username = LoggedOnUserName - .Membership.Password = LoggedOnPassword - End With - - FillUserInfo(entry, objAuthUser) - - Return objAuthUser - - Catch exc As Exception - LogException(exc) - Return Nothing - End Try - End Function - - Public Overloads Overrides Function GetUser(ByVal LoggedOnUserName As String) As ADUserInfo - Dim objAuthUser As ADUserInfo - Try - If _adsiConfig.ADSINetwork Then - Dim entry As DirectoryEntry - - entry = Utilities.GetUserEntryByName(LoggedOnUserName) -#If DEBUG Then - Dim key As String - For Each key In entry.Properties.PropertyNames - Dim sPropertyValues As String = "" - For Each value As Object In entry.Properties(key) - sPropertyValues += Convert.ToString(value) + ";" - Next - sPropertyValues = sPropertyValues.Substring(0, sPropertyValues.Length - 1) - Debug.Print(key + "=" + sPropertyValues) - Next -#End If - - If Not entry Is Nothing Then - objAuthUser = New ADUserInfo - 'ACD-6760 - InitializeUser(objAuthUser) - Dim location As String = Utilities.GetEntryLocation(entry) - If location.Length = 0 Then - location = _adsiConfig.ConfigDomainPath - End If - - With objAuthUser - .PortalID = _portalSettings.PortalId - .IsNotSimplyUser = True - .Username = LoggedOnUserName - .Membership.Password = Utilities.GetRandomPassword() - End With - - FillUserInfo(entry, objAuthUser) - - Else - objAuthUser = GetSimplyUser(LoggedOnUserName) - End If - - Else ' could not find it in AD, so populate user object with minumum info - objAuthUser = GetSimplyUser(LoggedOnUserName) - End If - - Return objAuthUser - - Catch exc As COMException - LogException(exc) - Return Nothing - End Try - End Function - - Public Overloads Overrides Function GetGroups() As ArrayList - ' Normally number of roles in DNN less than groups in Authentication, - ' so start from DNN roles to get better performance - Try - Dim colGroup As New ArrayList - Dim objRoleController As New RoleController - Dim lstRoles As List(Of RoleInfo) = objRoleController.GetRoles(_portalSettings.PortalId) - Dim objRole As RoleInfo - Dim AllAdGroupNames As ArrayList = Utilities.GetAllGroupnames - - For Each objRole In lstRoles - ' Auto assignment roles have been added by DNN, so don't need to get them - If Not objRole.AutoAssignment Then - - ' It's possible in multiple domains network that search result return more than one group with the same name (i.e Administrators) - ' We better check them all - If AllAdGroupNames.Contains(objRole.RoleName) Then - Dim group As New GroupInfo - - With group - .PortalID = objRole.PortalID - .RoleID = objRole.RoleID - .RoleName = objRole.RoleName - .Description = objRole.Description - .ServiceFee = objRole.ServiceFee - .BillingFrequency = objRole.BillingFrequency - .TrialPeriod = objRole.TrialPeriod - .TrialFrequency = objRole.TrialFrequency - .BillingPeriod = objRole.BillingPeriod - .TrialFee = objRole.TrialFee - .IsPublic = objRole.IsPublic - .AutoAssignment = objRole.AutoAssignment - End With - - colGroup.Add(group) - End If - End If - Next - - Return colGroup - - Catch exc As COMException - LogException(exc) - Return Nothing - End Try - End Function - - - - Public Overloads Overrides Function GetGroups(ByVal arrUserPortalRoles As ArrayList) As ArrayList - ' Normally number of roles in DNN less than groups in Authentication, - ' so start from DNN roles to get better performance - Try - Dim colGroup As New ArrayList - 'Dim objRoleController As New RoleController - 'Dim lstRoles As ArrayList = objRoleController.GetPortalRoles(_portalSettings.PortalId) - Dim objRole As RoleInfo - 'Dim AllAdGroupNames As ArrayList = Utilities.GetAllGroupnames - - For Each objRole In arrUserPortalRoles - ' Auto assignment roles have been added by DNN, so don't need to get them - If Not objRole.AutoAssignment Then - - ' It's possible in multiple domains network that search result return more than one group with the same name (i.e Administrators) - ' We better check them all - Dim entry As DirectoryEntry - For Each entry In Utilities.GetGroupEntriesByName(objRole.RoleName) - Dim group As New GroupInfo - - With group - .PortalID = objRole.PortalID - .RoleID = objRole.RoleID - .RoleName = objRole.RoleName - .Description = objRole.Description - .ServiceFee = objRole.ServiceFee - .BillingFrequency = objRole.BillingFrequency - .TrialPeriod = objRole.TrialPeriod - .TrialFrequency = objRole.TrialFrequency - .BillingPeriod = objRole.BillingPeriod - .TrialFee = objRole.TrialFee - .IsPublic = objRole.IsPublic - .AutoAssignment = objRole.AutoAssignment - End With - - colGroup.Add(group) - Next - - End If - Next - - Return colGroup - - Catch exc As COMException - LogException(exc) - Return Nothing - End Try - End Function - - Public Overrides Function GetAuthenticationTypes() As Array - Return [Enum].GetValues(GetType(AuthenticationTypes)) - End Function - - Public Overrides Function GetNetworkStatus() As String - Dim sb As New StringBuilder - ' Refresh settings cache first - Configuration.ResetConfig() - _adsiConfig = Configuration.GetConfig - - sb.Append("[Global Catalog Status]" & "
") - Try - If _adsiConfig.ADSINetwork Then - sb.Append("OK
") - Else - sb.Append("FAIL
") - End If - Catch ex As COMException - sb.Append("FAIL
") - sb.Append(ex.Message & "
") - End Try - - sb.Append("[Root Domain Status]
") - Try - If Not Utilities.GetRootEntry() Is Nothing Then - sb.Append("OK
") - Else - sb.Append("FAIL
") - End If - Catch ex As COMException - sb.Append("FAIL
") - sb.Append(ex.Message & "
") - End Try - - sb.Append("[LDAP Status]
") - Try - If _adsiConfig.LDAPAccesible Then - sb.Append("OK
") - Else - sb.Append("FAIL
") - End If - Catch ex As COMException - sb.Append("FAIL
") - sb.Append(ex.Message & "
") - End Try - - sb.Append("[Network Domains Status]
") - Try - If Not _adsiConfig.RefCollection Is Nothing AndAlso _adsiConfig.RefCollection.Count > 0 Then - sb.Append(_adsiConfig.RefCollection.Count.ToString) - sb.Append(" Domain(s):
") - Dim crossRef As CrossReferenceCollection.CrossReference - For Each crossRef In _adsiConfig.RefCollection - sb.Append(crossRef.CanonicalName) - sb.Append(" (") - sb.Append(crossRef.NetBIOSName) - sb.Append(")
") - Next - - If _adsiConfig.RefCollection.ProcesssLog.Length > 0 Then - sb.Append(_adsiConfig.RefCollection.ProcesssLog & "
") - End If - - Else - sb.Append("[LDAP Error Message]
") - End If - Catch ex As COMException - sb.Append("[LDAP Error Message]
") - sb.Append(ex.Message & "
") - End Try - - If _adsiConfig.ProcessLog.Length > 0 Then - sb.Append(_adsiConfig.ProcessLog & "
") - End If - - Return sb.ToString - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 27/04/2004 Initially the preferred local was set to the - ''' CurrentCulture. Occasionaly this is reset to English and it - ''' overwrites the user's Preferredlocale. I set it here to always - ''' use the portal's language setting. - ''' [mhorton] 27/04/2009 Initialize the TimeZone. - ''' - ''' ------------------------------------------------------------------- - - Private Sub InitializeUser(ByVal objUser As ADUserInfo) - objUser.Profile.InitialiseProfile(_portalSettings.PortalId) - - 'ACD-9442 - objUser.Profile.PreferredLocale = _portalSettings.DefaultLanguage - objUser.Profile.PreferredTimeZone = _portalSettings.TimeZone - End Sub - End Class +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports System.DirectoryServices +Imports DotNetNuke.Entities.Portals +Imports System.Runtime.InteropServices +Imports DotNetNuke.Services.Exceptions +Imports DotNetNuke.Security.Roles + +Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI + Public Class ADSIProvider + Inherits AuthenticationProvider + + Private _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Private _adsiConfig As Configuration = Configuration.GetConfig() + Private _config As ActiveDirectory.Configuration = ActiveDirectory.Configuration.GetConfig() + +#Region "Private Methods" + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 10/05/2009 Changed - WorkItem:2943 + ''' + ''' ------------------------------------------------------------------- + + Private Function GetSimplyUser(ByVal UserName As String) As ADUserInfo + Dim objAuthUser As New ADUserInfo + + With objAuthUser + .PortalID = _portalSettings.PortalId + .IsNotSimplyUser = False + .Username = UserName + .FirstName = Utilities.TrimUserDomainName(UserName) + .LastName = Utilities.GetUserDomainName(UserName) + .IsSuperUser = False + .DistinguishedName = Utilities.ConvertToDistinguished(UserName) + + Dim strEmail As String = _adsiConfig.DefaultEmailDomain + If Not strEmail.Length = 0 Then + If strEmail.IndexOf("@") = -1 Then + strEmail = "@" & strEmail + End If + strEmail = .FirstName & strEmail + Else + strEmail = .FirstName & "@" & .LastName & ".com" + ' confusing? + End If + ' Membership properties + .Username = UserName + .Email = strEmail + .Membership.Approved = True + .Membership.LastLoginDate = Date.Now + .Membership.Password = Utilities.GetRandomPassword() + .AuthenticationExists = False + End With + + Return objAuthUser + + End Function + + Private Function IsAuthenticated(ByVal Path As String, ByVal UserName As String, ByVal Password As String) _ + As Boolean + Try + 'Moved to private global for access from other functions - sawest + 'Dim _config As ActiveDirectory.Configuration = ActiveDirectory.Configuration.GetConfig() + If _config.StripDomainName Then + Dim crossRef As CrossReferenceCollection.CrossReference + For Each crossRef In Configuration.GetConfig.RefCollection + UserName = crossRef.NetBIOSName & "\" & UserName + Next + End If + Dim userEntry As New DirectoryEntry(Path, UserName, Password, AuthenticationTypes.Signing) + ' Bind to the native AdsObject to force authentication. + Dim obj As Object = userEntry.NativeObject + + Catch exc As COMException + Return False + End Try + + Return True + + End Function + + ''' + ''' Fill UserInfo object + ''' + ''' + ''' + ''' + ''' [sawest] 12/16/2016 Added set photo + ''' + Private Sub FillUserInfo(ByVal UserEntry As DirectoryEntry, ByRef UserInfo As ADUserInfo) + + With UserInfo + .IsSuperUser = False + .Username = UserInfo.Username + .Membership.Approved = True + .Membership.LastLoginDate = Date.Now + If Not UserEntry Is Nothing Then + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_EMAIL).Value) = "") Then + .Email = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_EMAIL).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CNAME).Value.ToString) = "") _ + Then + .CName = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CNAME).Value.ToString) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_DISPLAYNAME).Value) = "") _ + Then + .DisplayName = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_DISPLAYNAME).Value) + End If + If _ + Not _ + (Utilities.CheckNullString( + UserEntry.Properties(Configuration.ADSI_DISTINGUISHEDNAME).Value. + ToString) = "") Then + .DistinguishedName = + Utilities.CheckNullString( + UserEntry.Properties(Configuration.ADSI_DISTINGUISHEDNAME).Value. + ToString) + End If + If _ + Not _ + (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_ACCOUNTNAME).Value.ToString) = + "") Then + .sAMAccountName = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_ACCOUNTNAME).Value.ToString) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CNAME).Value) = "") Then + .Profile.FirstName = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_FIRSTNAME).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_LASTNAME).Value) = "") Then + .Profile.LastName = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_LASTNAME).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_STREET).Value) = "") Then + .Profile.Street = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_STREET).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CITY).Value) = "") Then + .Profile.City = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CITY).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_REGION).Value) = "") Then + .Profile.Region = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_REGION).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_POSTALCODE).Value) = "") _ + Then + .Profile.PostalCode = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_POSTALCODE).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_COUNTRY).Value) = "") Then + .Profile.Country = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_COUNTRY).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_TELEPHONE).Value) = "") Then + .Profile.Telephone = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_TELEPHONE).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_FAX).Value) = "") Then + .Profile.Fax = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_FAX).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CELL).Value) = "") Then + .Profile.Cell = Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_CELL).Value) + End If + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_WEBSITE).Value) = "") Then + .Profile.Website = + Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_WEBSITE).Value) + End If + If _config.Photo Then + 'sync photo from AD if checked in settings + If Not (Utilities.CheckNullString(UserEntry.Properties(Configuration.ADSI_PHOTO).Value) = "") Then + .Profile.Photo = + Utilities.WritePhoto(UserInfo, UserEntry.Properties(Configuration.ADSI_PHOTO).Value) + End If + End If + End If + + If .Email = "" Then + .Email = Utilities.TrimUserDomainName(UserInfo.Username) & _adsiConfig.DefaultEmailDomain + End If + If .DisplayName = "" Then + .DisplayName = .CName + End If + + .AuthenticationExists = True + ' obtain firstname from username if admin has not enter enough user info + If .Profile.FirstName.Length = 0 Then + .Profile.FirstName = Utilities.TrimUserDomainName(UserInfo.Username) + End If + End With + End Sub + +#End Region + + + Public Overloads Overrides Function GetUser(ByVal LoggedOnUserName As String, ByVal LoggedOnPassword As String) _ + As ADUserInfo + Dim objAuthUser As ADUserInfo + + If Not _adsiConfig.ADSINetwork Then + Return Nothing + End If + + Try + Dim entry As DirectoryEntry = Utilities.GetUserEntryByName(LoggedOnUserName) +#If DEBUG Then + Dim key As String + For Each key In entry.Properties.PropertyNames + Dim sPropertyValues As String = "" + For Each value As Object In entry.Properties(key) + sPropertyValues += Convert.ToString(value) + ";" + Next + sPropertyValues = sPropertyValues.Substring(0, sPropertyValues.Length - 1) + Debug.Print(key + "=" + sPropertyValues) + Next +#End If + 'Check authenticated + Dim path As String + If Not entry Is Nothing Then + path = entry.Path + Else + path = _adsiConfig.RootDomainPath + End If + If Not IsAuthenticated(path, LoggedOnUserName, LoggedOnPassword) Then + Return Nothing + End If + + ' Return authenticated if no error + objAuthUser = New ADUserInfo + 'ACD-6760 + InitializeUser(objAuthUser) + Dim location As String = Utilities.GetEntryLocation(entry) + If location.Length = 0 Then + location = _adsiConfig.ConfigDomainPath + End If + + With objAuthUser + .PortalID = _portalSettings.PortalId + .IsNotSimplyUser = True + .Username = LoggedOnUserName + .Membership.Password = LoggedOnPassword + End With + + FillUserInfo(entry, objAuthUser) + + Return objAuthUser + + Catch exc As Exception + LogException(exc) + Return Nothing + End Try + End Function + + Public Overloads Overrides Function GetUser(ByVal LoggedOnUserName As String) As ADUserInfo + Dim objAuthUser As ADUserInfo + Try + If _adsiConfig.ADSINetwork Then + Dim entry As DirectoryEntry + + entry = Utilities.GetUserEntryByName(LoggedOnUserName) +#If DEBUG Then + Dim key As String + For Each key In entry.Properties.PropertyNames + Dim sPropertyValues As String = "" + For Each value As Object In entry.Properties(key) + sPropertyValues += Convert.ToString(value) + ";" + Next + sPropertyValues = sPropertyValues.Substring(0, sPropertyValues.Length - 1) + Debug.Print(key + "=" + sPropertyValues) + Next +#End If + + If Not entry Is Nothing Then + objAuthUser = New ADUserInfo + 'ACD-6760 + InitializeUser(objAuthUser) + Dim location As String = Utilities.GetEntryLocation(entry) + If location.Length = 0 Then + location = _adsiConfig.ConfigDomainPath + End If + + With objAuthUser + .PortalID = _portalSettings.PortalId + .IsNotSimplyUser = True + .Username = LoggedOnUserName + .Membership.Password = Utilities.GetRandomPassword() + End With + + FillUserInfo(entry, objAuthUser) + + Else + objAuthUser = GetSimplyUser(LoggedOnUserName) + End If + + Else ' could not find it in AD, so populate user object with minumum info + objAuthUser = GetSimplyUser(LoggedOnUserName) + End If + + Return objAuthUser + + Catch exc As COMException + LogException(exc) + Return Nothing + End Try + End Function + + Public Overloads Overrides Function GetGroups() As ArrayList + ' Normally number of roles in DNN less than groups in Authentication, + ' so start from DNN roles to get better performance + Try + Dim colGroup As New ArrayList + Dim objRoleController As New RoleController + Dim lstRoles As List(Of RoleInfo) = objRoleController.GetRoles(_portalSettings.PortalId) + Dim objRole As RoleInfo + Dim AllAdGroupNames As ArrayList = Utilities.GetAllGroupnames + + For Each objRole In lstRoles + ' Auto assignment roles have been added by DNN, so don't need to get them + If Not objRole.AutoAssignment Then + + ' It's possible in multiple domains network that search result return more than one group with the same name (i.e Administrators) + ' We better check them all + If AllAdGroupNames.Contains(objRole.RoleName) Then + Dim group As New GroupInfo + + With group + .PortalID = objRole.PortalID + .RoleID = objRole.RoleID + .RoleName = objRole.RoleName + .Description = objRole.Description + .ServiceFee = objRole.ServiceFee + .BillingFrequency = objRole.BillingFrequency + .TrialPeriod = objRole.TrialPeriod + .TrialFrequency = objRole.TrialFrequency + .BillingPeriod = objRole.BillingPeriod + .TrialFee = objRole.TrialFee + .IsPublic = objRole.IsPublic + .AutoAssignment = objRole.AutoAssignment + End With + + colGroup.Add(group) + End If + End If + Next + + Return colGroup + + Catch exc As COMException + LogException(exc) + Return Nothing + End Try + End Function + + + + Public Overloads Overrides Function GetGroups(ByVal arrUserPortalRoles As ArrayList) As ArrayList + ' Normally number of roles in DNN less than groups in Authentication, + ' so start from DNN roles to get better performance + Try + Dim colGroup As New ArrayList + 'Dim objRoleController As New RoleController + 'Dim lstRoles As ArrayList = objRoleController.GetPortalRoles(_portalSettings.PortalId) + Dim objRole As RoleInfo + 'Dim AllAdGroupNames As ArrayList = Utilities.GetAllGroupnames + + For Each objRole In arrUserPortalRoles + ' Auto assignment roles have been added by DNN, so don't need to get them + If Not objRole.AutoAssignment Then + + ' It's possible in multiple domains network that search result return more than one group with the same name (i.e Administrators) + ' We better check them all + Dim entry As DirectoryEntry + For Each entry In Utilities.GetGroupEntriesByName(objRole.RoleName) + Dim group As New GroupInfo + + With group + .PortalID = objRole.PortalID + .RoleID = objRole.RoleID + .RoleName = objRole.RoleName + .Description = objRole.Description + .ServiceFee = objRole.ServiceFee + .BillingFrequency = objRole.BillingFrequency + .TrialPeriod = objRole.TrialPeriod + .TrialFrequency = objRole.TrialFrequency + .BillingPeriod = objRole.BillingPeriod + .TrialFee = objRole.TrialFee + .IsPublic = objRole.IsPublic + .AutoAssignment = objRole.AutoAssignment + End With + + colGroup.Add(group) + Next + + End If + Next + + Return colGroup + + Catch exc As COMException + LogException(exc) + Return Nothing + End Try + End Function + + Public Overrides Function GetAuthenticationTypes() As Array + Return [Enum].GetValues(GetType(AuthenticationTypes)) + End Function + + Public Overrides Function GetNetworkStatus() As String + Dim sb As New StringBuilder + ' Refresh settings cache first + Configuration.ResetConfig() + _adsiConfig = Configuration.GetConfig + + sb.Append("[Global Catalog Status]" & "
") + Try + If _adsiConfig.ADSINetwork Then + sb.Append("OK
") + Else + sb.Append("FAIL
") + End If + Catch ex As COMException + sb.Append("FAIL
") + sb.Append(ex.Message & "
") + End Try + + sb.Append("[Root Domain Status]
") + Try + If Not Utilities.GetRootEntry() Is Nothing Then + sb.Append("OK
") + Else + sb.Append("FAIL
") + End If + Catch ex As COMException + sb.Append("FAIL
") + sb.Append(ex.Message & "
") + End Try + + sb.Append("[LDAP Status]
") + Try + If _adsiConfig.LDAPAccesible Then + sb.Append("OK
") + Else + sb.Append("FAIL
") + End If + Catch ex As COMException + sb.Append("FAIL
") + sb.Append(ex.Message & "
") + End Try + + sb.Append("[Network Domains Status]
") + Try + If Not _adsiConfig.RefCollection Is Nothing AndAlso _adsiConfig.RefCollection.Count > 0 Then + sb.Append(_adsiConfig.RefCollection.Count.ToString) + sb.Append(" Domain(s):
") + Dim crossRef As CrossReferenceCollection.CrossReference + For Each crossRef In _adsiConfig.RefCollection + sb.Append(crossRef.CanonicalName) + sb.Append(" (") + sb.Append(crossRef.NetBIOSName) + sb.Append(")
") + Next + + If _adsiConfig.RefCollection.ProcesssLog.Length > 0 Then + sb.Append(_adsiConfig.RefCollection.ProcesssLog & "
") + End If + + Else + sb.Append("[LDAP Error Message]
") + End If + Catch ex As COMException + sb.Append("[LDAP Error Message]
") + sb.Append(ex.Message & "
") + End Try + + If _adsiConfig.ProcessLog.Length > 0 Then + sb.Append(_adsiConfig.ProcessLog & "
") + End If + + Return sb.ToString + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 27/04/2004 Initially the preferred local was set to the + ''' CurrentCulture. Occasionaly this is reset to English and it + ''' overwrites the user's Preferredlocale. I set it here to always + ''' use the portal's language setting. + ''' [mhorton] 27/04/2009 Initialize the TimeZone. + ''' + ''' ------------------------------------------------------------------- + + Private Sub InitializeUser(ByVal objUser As ADUserInfo) + objUser.Profile.InitialiseProfile(_portalSettings.PortalId) + + 'ACD-9442 + objUser.Profile.PreferredLocale = _portalSettings.DefaultLanguage + objUser.Profile.PreferredTimeZone = _portalSettings.TimeZone + End Sub + End Class End Namespace \ No newline at end of file diff --git a/Providers/ADSIProvider/Configuration.vb b/Providers/ADSIProvider/Configuration.vb index 551f735..c2c85db 100644 --- a/Providers/ADSIProvider/Configuration.vb +++ b/Providers/ADSIProvider/Configuration.vb @@ -1,540 +1,540 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.DirectoryServices -Imports System.Runtime.InteropServices -Imports DotNetNuke.Services.Exceptions -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Common.Utilities - -Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI - -#Region "Enum" - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum Path - GC - LDAP - ADs - WinNT - End Enum - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum CompareOperator As Integer - [Is] - [IsNot] - [StartsWith] - [EndsWith] - [Present] - [NotPresent] - End Enum - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum GroupType - UNIVERSAL_GROUP = - 2147483640 - GLOBAL_GROUP = - 2147483646 - DOMAIN_LOCAL_GROUP = - 2147483644 - End Enum - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Enum UserFlag - ADS_UF_SCRIPTADS_UF_SCRIPT = 1 - '0x1 The logon script is executed. This flag does not work for the ADSI LDAP provider on either read or write operations. For the ADSI WinNT provider, this flag is read-only data, and it cannot be set for user objects. = 1 - ADS_UF_ACCOUNTDISABLE = 2 - '0x2 user account is disabled. - ADS_UF_HOMEDIR_REQUIRED = 8 - '0x8 The home directory is required. - ADS_UF_LOCKOUT = 16 - '0x10 The account is currently locked out. - ADS_UF_PASSWD_NOTREQD = 32 - '0x20 No password is required. - ADS_UF_PASSWD_CANT_CHANGE = 64 - '0x40 The user cannot change the password. This flag can be read, but not set directly. For more information and a code example that shows how to prevent a user from changing the password, see User Cannot Change Password. - ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = 128 - '0x80 The user can send an encrypted password. - ADS_UF_TEMP_DUPLICATE_ACCOUNT = 256 - '0x100 This is an account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. Also known as a local user account. = 256, - ADS_UF_NORMAL_ACCOUNT = 512 - '0x200 This is a default account type that represents a typical user. - ADS_UF_INTERDOMAIN_TRUST_ACCOUNT = 2048 - '0x800 This is a permit to trust account for a system domain that trusts other domains. - ADS_UF_WORKSTATION_TRUST_ACCOUNT = 4096 - 'This is a computer account for a Microsoft Windows NT Workstation/Windows 2000 Professional or Windows NT Server/Windows 2000 Server that is a member of this domain. 0x1000 - ADS_UF_SERVER_TRUST_ACCOUNT = 8192 - 'This is a computer account for a system backup domain controller that is a member of this domain. 0x2000 - ADS_UF_DONT_EXPIRE_PASSWD = 65536 - '0x10000 When set, the password will not expire on this account. - ADS_UF_MNS_LOGON_ACCOUNT = 131072 - ' 0x20000 This is an MNS logon account. - ADS_UF_SMARTCARD_REQUIRED = 262144 - '0x40000 When set, this flag will force the user to log on using a smart card. - ADS_UF_TRUSTED_FOR_DELEGATION = 524288 - '0x80000 When set, the service account (user or computer account), under which a service runs, is trusted for Kerberos delegation. Any such service can impersonate a client requesting the service. To enable a service for Kerberos delegation, set this flag on the userAccountControl property of the service account. - ADS_UF_NOT_DELEGATED = 1048576 - '0x100000 When set, the security context of the user will not be delegated to a service even if the service account is set as trusted for Kerberos delegation. - ADS_UF_USE_DES_KEY_ONLY = 2097152 - '0x200000 Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys.Active Directory Client Extension: Not supported. - ADS_UF_DONT_REQUIRE_PREAUTH = 4194304 - '0x400000 This account does not require Kerberos preauthentication for logon.Active Directory Client Extension: Not supported. - ADS_UF_PASSWORD_EXPIRED = 8388608 - '0x800000 The user password has expired. This flag is created by the system using data from the password last set attribute and the domain policy. It is read-only and cannot be set. To manually set a user password as expired, use the NetUserSetInfo function with the USER_INFO_3 (usri3_password_expired member) or USER_INFO_4 (usri4_password_expired member) structure.Active Directory Client Extension: Not supported. - ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 16777216 - 'The account is enabled for delegation. This is a security-sensitive setting; accounts with this option enabled should be strictly controlled. This setting enables a service running under the account to assume a client identity and authenticate as that user to other remote servers on the network.Active Directory Client Extension: Not supported. - End Enum - -#End Region - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [sawest] 12/16/2016 Added photo constant - ''' - ''' ------------------------------------------------------------------- - Public Class Configuration - Public Const ADSI_CONFIGURATIONNAMIMGCONTEXT As String = "configurationNamingContext" - Public Const ADSI_DEFAULTNAMIMGCONTEXT As String = "defaultNamingContext" - Public Const ADSI_ROOTDOMAINNAMIMGCONTEXT As String = "rootDomainNamingContext" - Public Const ADSI_USERACCOUNTCONTROL As String = "userAccountControl" - Public Const ADSI_CLASS As String = "objectClass" - Public Const ADSI_CATEGORY As String = "objectCategory" - Public Const ADSI_DC As String = "dc" - Public Const ADSI_NCNAME As String = "nCName" - Public Const ADSI_DNSROOT As String = "dnsRoot" - Public Const ADSI_GROUPTYPE As String = "groupType" - Public Const ADSI_MEMBER As String = "member" - Public Const ADSI_CNAME As String = "cn" - Public Const ADSI_ACCOUNTNAME As String = "sAMAccountName" - Public Const ADSI_DISTINGUISHEDNAME As String = "distinguishedName" - Public Const ADSI_CANONICALNAME As String = "canonicalName" - Public Const ADSI_UPN As String = "userPrincipalName" - Public Const ADSI_DISPLAYNAME As String = "displayName" - Public Const ADSI_FIRSTNAME As String = "givenName" - Public Const ADSI_LASTNAME As String = "sn" - Public Const ADSI_STREET As String = "streetAddress" - Public Const ADSI_CITY As String = "l" - Public Const ADSI_POSTALCODE As String = "postalCode" - Public Const ADSI_REGION As String = "st" - Public Const ADSI_COUNTRY As String = "co" - Public Const ADSI_TELEPHONE As String = "telephoneNumber" - Public Const ADSI_FAX As String = "facsimileTelephoneNumber" - Public Const ADSI_CELL As String = "mobile" - Public Const ADSI_HOMEPHONE As String = "homePhone" - Public Const ADSI_EMAIL As String = "mail" - Public Const ADSI_WEBSITE As String = "url" - Public Const ADSI_DESCRIPTION As String = "description" - Public Const ADSI_EMPLOYEEID As String = "employeeID" - Public Const ADSI_COMPANY As String = "company" - Public Const ADSI_MANAGER As String = "manager" - Public Const ADSI_DEPARTMENT As String = "department" - Public Const ADSI_ASSISTANT As String = "assistant" - Public Const ADSI_PHOTO As String = "thumbnailPhoto" - - Private Const ADSI_CONFIG_CACHE_PREFIX As String = "ADSI.Configuration" - - Private mPortalId As Integer - Private mSettingModuleId As Integer - - ' mRootDomainPath will be stored in DC=ttt,DC=com,DC=vn format (without ADSIPath) - ' ADSIPath to be added depends on Authentication accessing method - Private mADSINetwork As Boolean = False - Private mLDAPAccesible As Boolean = False - Private mConfigDomainPath As String = "" - ' Row value user input in site settings - Private mDefaultEmailDomain As String = "" - ' Row value user input in site settings - without @ - Private mRootDomainPath As String = "" - Private mConfigurationPath As String = "" - Private mAuthenticationType As AuthenticationTypes = AuthenticationTypes.Delegation - Private mUserName As String = "" - Private mPassword As String = "" - Private mSearchPageSize As Integer = 1000 - Private mADSIPath As Path = Path.GC - Private mProcessLog As String = "" - - ' For Domain Reference Configuration - Private mRefCollection As CrossReferenceCollection - - ''' ------------------------------------------------------------------- - ''' - ''' Obtain Authentication settings from database - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - Dim authConfig As ActiveDirectory.Configuration = ActiveDirectory.Configuration.GetConfig() - mPortalId = authConfig.PortalId - - Try - 'Temporary fix this setting as TRUE for design, to be removed when release - mConfigDomainPath = authConfig.RootDomain - mDefaultEmailDomain = authConfig.EmailDomain - mUserName = authConfig.UserName - mPassword = authConfig.Password - mAuthenticationType = _ - CType ([Enum].Parse (GetType (AuthenticationTypes), authConfig.AuthenticationType), _ - AuthenticationTypes) - ' IMPORTANT: Remove ADSIPath, to be added later depends on accessing method - - mRootDomainPath = Utilities.ValidateDomainPath (mConfigDomainPath) - mRootDomainPath = Right (mRootDomainPath, mRootDomainPath.Length - mRootDomainPath.IndexOf ("DC=")) - - Catch exc As Exception - mProcessLog += exc.Message & "
" - End Try - - ' Also check if Authentication implemented in this Windows Network - Dim gc As New DirectoryEntry - Try - If DirectoryEntry.Exists ("GC://rootDSE") Then - Dim rootGC As DirectoryEntry - 'If (mUserName.Length > 0) AndAlso (mPassword.Length > 0) Then - 'rootGC = New DirectoryEntry("GC://rootDSE", mUserName, mPassword, mAuthenticationType) - 'Else - rootGC = New DirectoryEntry ("GC://rootDSE") - 'End If - mConfigurationPath = rootGC.Properties (ADSI_CONFIGURATIONNAMIMGCONTEXT).Value.ToString - mADSINetwork = True - End If - Catch exc As COMException - mADSINetwork = False - mLDAPAccesible = False - mProcessLog += exc.Message & "
" - LogException (exc) - ' Nothing to do if we could not access Global Catalog, so return - 'Return - End Try - - ' Also check if LDAP fully accessible - Dim ldap As New DirectoryEntry - Try - If DirectoryEntry.Exists ("LDAP://rootDSE") Then - mLDAPAccesible = True - mRefCollection = New CrossReferenceCollection (mUserName, mPassword, mAuthenticationType) - End If - Catch exc As COMException - mLDAPAccesible = False - mProcessLog += exc.Message & "
" - LogException (exc) - End Try - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' Obtain Authentication Configuration - ''' - ''' - ''' Accessing Active Directory also cost lots of resource, - ''' so we only do it once then save into application cache for later use - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetConfig() As Configuration - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim strKey As String = ADSI_CONFIG_CACHE_PREFIX & "." & CStr (_portalSettings.PortalId) - - Dim config As Configuration = CType (DataCache.GetCache (strKey), Configuration) - If config Is Nothing Then - config = New Configuration - DataCache.SetCache (strKey, config) - End If - - Return config - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Sub ResetConfig() - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - Dim strKey As String = ADSI_CONFIG_CACHE_PREFIX & "." & CStr (_portalSettings.PortalId) - DataCache.RemoveCache (strKey) - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Sub SetSecurity (ByVal Entry As DirectoryEntry) - Try - Entry.AuthenticationType = mAuthenticationType - If (mUserName.Length > 0) AndAlso (mPassword.Length > 0) Then - Entry.Username = mUserName - Entry.Password = mPassword - End If - - Catch ex As COMException - LogException (ex) - End Try - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property PortalId() As Integer - Get - Return mPortalId - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property UserName() As String - Get - Return mUserName - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property Password() As String - Get - Return mPassword - End Get - End Property - - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property RefCollection() As CrossReferenceCollection - Get - Return mRefCollection - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property AuthenticationType() As AuthenticationTypes - Get - Return mAuthenticationType - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property RootDomainPath() As String - Get - Return mRootDomainPath - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ConfigDomainPath() As String - Get - Return mConfigDomainPath - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ConfigurationPath() As String - Get - Return mConfigurationPath - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property DefaultEmailDomain() As String - Get - Return mDefaultEmailDomain - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ADSINetwork() As Boolean - Get - Return mADSINetwork - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property LDAPAccesible() As Boolean - Get - Return mLDAPAccesible - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ProcessLog() As String - Get - Return mProcessLog - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' Used to determine if a valid input is provided, if not, return default value - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Private Function GetValue (ByVal Input As Object, ByVal DefaultValue As String) As String - If Input Is Nothing Then - Return DefaultValue - Else - Return CStr (Input) - End If - End Function - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports System.DirectoryServices +Imports System.Runtime.InteropServices +Imports DotNetNuke.Services.Exceptions +Imports DotNetNuke.Entities.Portals +Imports DotNetNuke.Common.Utilities + +Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI + +#Region "Enum" + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum Path + GC + LDAP + ADs + WinNT + End Enum + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum CompareOperator As Integer + [Is] + [IsNot] + [StartsWith] + [EndsWith] + [Present] + [NotPresent] + End Enum + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum GroupType + UNIVERSAL_GROUP = - 2147483640 + GLOBAL_GROUP = - 2147483646 + DOMAIN_LOCAL_GROUP = - 2147483644 + End Enum + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Enum UserFlag + ADS_UF_SCRIPTADS_UF_SCRIPT = 1 + '0x1 The logon script is executed. This flag does not work for the ADSI LDAP provider on either read or write operations. For the ADSI WinNT provider, this flag is read-only data, and it cannot be set for user objects. = 1 + ADS_UF_ACCOUNTDISABLE = 2 + '0x2 user account is disabled. + ADS_UF_HOMEDIR_REQUIRED = 8 + '0x8 The home directory is required. + ADS_UF_LOCKOUT = 16 + '0x10 The account is currently locked out. + ADS_UF_PASSWD_NOTREQD = 32 + '0x20 No password is required. + ADS_UF_PASSWD_CANT_CHANGE = 64 + '0x40 The user cannot change the password. This flag can be read, but not set directly. For more information and a code example that shows how to prevent a user from changing the password, see User Cannot Change Password. + ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = 128 + '0x80 The user can send an encrypted password. + ADS_UF_TEMP_DUPLICATE_ACCOUNT = 256 + '0x100 This is an account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. Also known as a local user account. = 256, + ADS_UF_NORMAL_ACCOUNT = 512 + '0x200 This is a default account type that represents a typical user. + ADS_UF_INTERDOMAIN_TRUST_ACCOUNT = 2048 + '0x800 This is a permit to trust account for a system domain that trusts other domains. + ADS_UF_WORKSTATION_TRUST_ACCOUNT = 4096 + 'This is a computer account for a Microsoft Windows NT Workstation/Windows 2000 Professional or Windows NT Server/Windows 2000 Server that is a member of this domain. 0x1000 + ADS_UF_SERVER_TRUST_ACCOUNT = 8192 + 'This is a computer account for a system backup domain controller that is a member of this domain. 0x2000 + ADS_UF_DONT_EXPIRE_PASSWD = 65536 + '0x10000 When set, the password will not expire on this account. + ADS_UF_MNS_LOGON_ACCOUNT = 131072 + ' 0x20000 This is an MNS logon account. + ADS_UF_SMARTCARD_REQUIRED = 262144 + '0x40000 When set, this flag will force the user to log on using a smart card. + ADS_UF_TRUSTED_FOR_DELEGATION = 524288 + '0x80000 When set, the service account (user or computer account), under which a service runs, is trusted for Kerberos delegation. Any such service can impersonate a client requesting the service. To enable a service for Kerberos delegation, set this flag on the userAccountControl property of the service account. + ADS_UF_NOT_DELEGATED = 1048576 + '0x100000 When set, the security context of the user will not be delegated to a service even if the service account is set as trusted for Kerberos delegation. + ADS_UF_USE_DES_KEY_ONLY = 2097152 + '0x200000 Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys.Active Directory Client Extension: Not supported. + ADS_UF_DONT_REQUIRE_PREAUTH = 4194304 + '0x400000 This account does not require Kerberos preauthentication for logon.Active Directory Client Extension: Not supported. + ADS_UF_PASSWORD_EXPIRED = 8388608 + '0x800000 The user password has expired. This flag is created by the system using data from the password last set attribute and the domain policy. It is read-only and cannot be set. To manually set a user password as expired, use the NetUserSetInfo function with the USER_INFO_3 (usri3_password_expired member) or USER_INFO_4 (usri4_password_expired member) structure.Active Directory Client Extension: Not supported. + ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 16777216 + 'The account is enabled for delegation. This is a security-sensitive setting; accounts with this option enabled should be strictly controlled. This setting enables a service running under the account to assume a client identity and authenticate as that user to other remote servers on the network.Active Directory Client Extension: Not supported. + End Enum + +#End Region + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [sawest] 12/16/2016 Added photo constant + ''' + ''' ------------------------------------------------------------------- + Public Class Configuration + Public Const ADSI_CONFIGURATIONNAMIMGCONTEXT As String = "configurationNamingContext" + Public Const ADSI_DEFAULTNAMIMGCONTEXT As String = "defaultNamingContext" + Public Const ADSI_ROOTDOMAINNAMIMGCONTEXT As String = "rootDomainNamingContext" + Public Const ADSI_USERACCOUNTCONTROL As String = "userAccountControl" + Public Const ADSI_CLASS As String = "objectClass" + Public Const ADSI_CATEGORY As String = "objectCategory" + Public Const ADSI_DC As String = "dc" + Public Const ADSI_NCNAME As String = "nCName" + Public Const ADSI_DNSROOT As String = "dnsRoot" + Public Const ADSI_GROUPTYPE As String = "groupType" + Public Const ADSI_MEMBER As String = "member" + Public Const ADSI_CNAME As String = "cn" + Public Const ADSI_ACCOUNTNAME As String = "sAMAccountName" + Public Const ADSI_DISTINGUISHEDNAME As String = "distinguishedName" + Public Const ADSI_CANONICALNAME As String = "canonicalName" + Public Const ADSI_UPN As String = "userPrincipalName" + Public Const ADSI_DISPLAYNAME As String = "displayName" + Public Const ADSI_FIRSTNAME As String = "givenName" + Public Const ADSI_LASTNAME As String = "sn" + Public Const ADSI_STREET As String = "streetAddress" + Public Const ADSI_CITY As String = "l" + Public Const ADSI_POSTALCODE As String = "postalCode" + Public Const ADSI_REGION As String = "st" + Public Const ADSI_COUNTRY As String = "co" + Public Const ADSI_TELEPHONE As String = "telephoneNumber" + Public Const ADSI_FAX As String = "facsimileTelephoneNumber" + Public Const ADSI_CELL As String = "mobile" + Public Const ADSI_HOMEPHONE As String = "homePhone" + Public Const ADSI_EMAIL As String = "mail" + Public Const ADSI_WEBSITE As String = "url" + Public Const ADSI_DESCRIPTION As String = "description" + Public Const ADSI_EMPLOYEEID As String = "employeeID" + Public Const ADSI_COMPANY As String = "company" + Public Const ADSI_MANAGER As String = "manager" + Public Const ADSI_DEPARTMENT As String = "department" + Public Const ADSI_ASSISTANT As String = "assistant" + Public Const ADSI_PHOTO As String = "thumbnailPhoto" + + Private Const ADSI_CONFIG_CACHE_PREFIX As String = "ADSI.Configuration" + + Private mPortalId As Integer + Private mSettingModuleId As Integer + + ' mRootDomainPath will be stored in DC=ttt,DC=com,DC=vn format (without ADSIPath) + ' ADSIPath to be added depends on Authentication accessing method + Private mADSINetwork As Boolean = False + Private mLDAPAccesible As Boolean = False + Private mConfigDomainPath As String = "" + ' Row value user input in site settings + Private mDefaultEmailDomain As String = "" + ' Row value user input in site settings - without @ + Private mRootDomainPath As String = "" + Private mConfigurationPath As String = "" + Private mAuthenticationType As AuthenticationTypes = AuthenticationTypes.Delegation + Private mUserName As String = "" + Private mPassword As String = "" + Private mSearchPageSize As Integer = 1000 + Private mADSIPath As Path = Path.GC + Private mProcessLog As String = "" + + ' For Domain Reference Configuration + Private mRefCollection As CrossReferenceCollection + + ''' ------------------------------------------------------------------- + ''' + ''' Obtain Authentication settings from database + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + Dim authConfig As ActiveDirectory.Configuration = ActiveDirectory.Configuration.GetConfig() + mPortalId = authConfig.PortalId + + Try + 'Temporary fix this setting as TRUE for design, to be removed when release + mConfigDomainPath = authConfig.RootDomain + mDefaultEmailDomain = authConfig.EmailDomain + mUserName = authConfig.UserName + mPassword = authConfig.Password + mAuthenticationType = _ + CType ([Enum].Parse (GetType (AuthenticationTypes), authConfig.AuthenticationType), _ + AuthenticationTypes) + ' IMPORTANT: Remove ADSIPath, to be added later depends on accessing method + + mRootDomainPath = Utilities.ValidateDomainPath (mConfigDomainPath) + mRootDomainPath = Right (mRootDomainPath, mRootDomainPath.Length - mRootDomainPath.IndexOf ("DC=")) + + Catch exc As Exception + mProcessLog += exc.Message & "
" + End Try + + ' Also check if Authentication implemented in this Windows Network + Dim gc As New DirectoryEntry + Try + If DirectoryEntry.Exists ("GC://rootDSE") Then + Dim rootGC As DirectoryEntry + 'If (mUserName.Length > 0) AndAlso (mPassword.Length > 0) Then + 'rootGC = New DirectoryEntry("GC://rootDSE", mUserName, mPassword, mAuthenticationType) + 'Else + rootGC = New DirectoryEntry ("GC://rootDSE") + 'End If + mConfigurationPath = rootGC.Properties (ADSI_CONFIGURATIONNAMIMGCONTEXT).Value.ToString + mADSINetwork = True + End If + Catch exc As COMException + mADSINetwork = False + mLDAPAccesible = False + mProcessLog += exc.Message & "
" + LogException (exc) + ' Nothing to do if we could not access Global Catalog, so return + 'Return + End Try + + ' Also check if LDAP fully accessible + Dim ldap As New DirectoryEntry + Try + If DirectoryEntry.Exists ("LDAP://rootDSE") Then + mLDAPAccesible = True + mRefCollection = New CrossReferenceCollection (mUserName, mPassword, mAuthenticationType) + End If + Catch exc As COMException + mLDAPAccesible = False + mProcessLog += exc.Message & "
" + LogException (exc) + End Try + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' Obtain Authentication Configuration + ''' + ''' + ''' Accessing Active Directory also cost lots of resource, + ''' so we only do it once then save into application cache for later use + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetConfig() As Configuration + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim strKey As String = ADSI_CONFIG_CACHE_PREFIX & "." & CStr (_portalSettings.PortalId) + + Dim config As Configuration = CType (DataCache.GetCache (strKey), Configuration) + If config Is Nothing Then + config = New Configuration + DataCache.SetCache (strKey, config) + End If + + Return config + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Sub ResetConfig() + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + Dim strKey As String = ADSI_CONFIG_CACHE_PREFIX & "." & CStr (_portalSettings.PortalId) + DataCache.RemoveCache (strKey) + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Sub SetSecurity (ByVal Entry As DirectoryEntry) + Try + Entry.AuthenticationType = mAuthenticationType + If (mUserName.Length > 0) AndAlso (mPassword.Length > 0) Then + Entry.Username = mUserName + Entry.Password = mPassword + End If + + Catch ex As COMException + LogException (ex) + End Try + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property PortalId() As Integer + Get + Return mPortalId + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property UserName() As String + Get + Return mUserName + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property Password() As String + Get + Return mPassword + End Get + End Property + + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property RefCollection() As CrossReferenceCollection + Get + Return mRefCollection + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property AuthenticationType() As AuthenticationTypes + Get + Return mAuthenticationType + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property RootDomainPath() As String + Get + Return mRootDomainPath + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ConfigDomainPath() As String + Get + Return mConfigDomainPath + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ConfigurationPath() As String + Get + Return mConfigurationPath + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property DefaultEmailDomain() As String + Get + Return mDefaultEmailDomain + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ADSINetwork() As Boolean + Get + Return mADSINetwork + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property LDAPAccesible() As Boolean + Get + Return mLDAPAccesible + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ProcessLog() As String + Get + Return mProcessLog + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' Used to determine if a valid input is provided, if not, return default value + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Private Function GetValue (ByVal Input As Object, ByVal DefaultValue As String) As String + If Input Is Nothing Then + Return DefaultValue + Else + Return CStr (Input) + End If + End Function + End Class +End Namespace diff --git a/Providers/ADSIProvider/CrossReferenceCollection.vb b/Providers/ADSIProvider/CrossReferenceCollection.vb index 8addcc7..d89e83d 100644 --- a/Providers/ADSIProvider/CrossReferenceCollection.vb +++ b/Providers/ADSIProvider/CrossReferenceCollection.vb @@ -1,238 +1,238 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports System.DirectoryServices -Imports System.Runtime.InteropServices - -Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI - Public Class CrossReferenceCollection - Inherits CollectionBase - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Class CrossReference - Friend mDomainPath As String - Friend mCanonicalName As String - Friend mNetBIOSName As String - - Friend Sub New(ByVal Path As String, ByVal NetBIOS As String, ByVal Canonical As String) - mDomainPath = Path - mCanonicalName = Canonical - mNetBIOSName = NetBIOS - End Sub - - Public ReadOnly Property DomainPath() As String - Get - Return mDomainPath - End Get - End Property - - Public ReadOnly Property CanonicalName() As String - Get - Return mCanonicalName - End Get - End Property - - Public ReadOnly Property NetBIOSName() As String - Get - Return mNetBIOSName - End Get - End Property - End Class - - ' Allows access to items by both NetBiosName or CanonicalName - Private mNetBIOSLookup As Hashtable = New Hashtable - Private mCanonicalLookup As Hashtable = New Hashtable - Private mProcessLog As String = "" - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Sub New (ByVal UserName As String, ByVal Password As String, ByVal AuthType As AuthenticationTypes) - MyBase.New() - Try - ' Obtain NETBIOS only if LDAP accessible to prevent error - Dim rootLDAP As New DirectoryEntry ("LDAP://rootDSE", UserName, Password, AuthType) - Dim _ - crossRefPath As String = "LDAP://CN=Partitions," & _ - rootLDAP.Properties ("configurationNamingContext").Value.ToString - Dim objCrossRefContainer As DirectoryEntry - - If (UserName.Length > 0) AndAlso (Password.Length > 0) Then - objCrossRefContainer = New DirectoryEntry (crossRefPath, UserName, Password, AuthType) - Else - objCrossRefContainer = New DirectoryEntry (crossRefPath) - End If - - Dim objCrossRef As DirectoryEntry - For Each objCrossRef In objCrossRefContainer.Children - If Not objCrossRef.Properties ("nETBIOSName").Value Is Nothing Then - Dim netBIOSName As String = CType (objCrossRef.Properties ("nETBIOSName").Value, String) - Dim canonicalName As String = CType (objCrossRef.Properties ("dnsRoot").Value, String) - Dim domainPath As String = CType (objCrossRef.Properties ("nCName").Value, String) - Dim crossRef As CrossReference = New CrossReference (domainPath, netBIOSName, canonicalName) - Me.Add (crossRef) - End If - Next - Catch ex As COMException - mProcessLog += ex.Message & "
" - End Try - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Friend Shadows Sub Clear() - mNetBIOSLookup.Clear() - mCanonicalLookup.Clear() - MyBase.Clear() - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Friend Sub Add (ByVal RefObject As CrossReference) - Dim index As Integer - Try - index = MyBase.List.Add (RefObject) - mCanonicalLookup.Add (RefObject.CanonicalName, index) - mNetBIOSLookup.Add (RefObject.NetBIOSName, index) - Catch ex As COMException - mProcessLog += ex.Message - End Try - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function Item (ByVal index As Integer) As CrossReference - Try - Dim obj As Object - obj = MyBase.List.Item (index) - Return CType (obj, CrossReference) - Catch Exc As Exception - Return Nothing - End Try - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function Item (ByVal Name As String) As CrossReference - Dim index As Integer - Dim obj As Object - - ' Do validation first - Try - If mCanonicalLookup.Item (Name) Is Nothing Then - Return Nothing - End If - Catch ex As Exception - Return Nothing - End Try - - index = CInt (mCanonicalLookup.Item (Name)) - obj = MyBase.List.Item (index) - - Return CType (obj, CrossReference) - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Function ItemByNetBIOS (ByVal Name As String) As CrossReference - Dim index As Integer - Dim obj As Object - - ' Do validation first - Try - If mNetBIOSLookup.Item (Name) Is Nothing Then - Return Nothing - End If - Catch ex As Exception - Return Nothing - End Try - - index = CInt (mNetBIOSLookup.Item (Name)) - obj = MyBase.List.Item (index) - - Return CType (obj, CrossReference) - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ProcesssLog() As String - Get - Return mProcessLog - End Get - End Property - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + +Imports System.DirectoryServices +Imports System.Runtime.InteropServices + +Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI + Public Class CrossReferenceCollection + Inherits CollectionBase + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Class CrossReference + Friend mDomainPath As String + Friend mCanonicalName As String + Friend mNetBIOSName As String + + Friend Sub New(ByVal Path As String, ByVal NetBIOS As String, ByVal Canonical As String) + mDomainPath = Path + mCanonicalName = Canonical + mNetBIOSName = NetBIOS + End Sub + + Public ReadOnly Property DomainPath() As String + Get + Return mDomainPath + End Get + End Property + + Public ReadOnly Property CanonicalName() As String + Get + Return mCanonicalName + End Get + End Property + + Public ReadOnly Property NetBIOSName() As String + Get + Return mNetBIOSName + End Get + End Property + End Class + + ' Allows access to items by both NetBiosName or CanonicalName + Private mNetBIOSLookup As Hashtable = New Hashtable + Private mCanonicalLookup As Hashtable = New Hashtable + Private mProcessLog As String = "" + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Sub New (ByVal UserName As String, ByVal Password As String, ByVal AuthType As AuthenticationTypes) + MyBase.New() + Try + ' Obtain NETBIOS only if LDAP accessible to prevent error + Dim rootLDAP As New DirectoryEntry ("LDAP://rootDSE", UserName, Password, AuthType) + Dim _ + crossRefPath As String = "LDAP://CN=Partitions," & _ + rootLDAP.Properties ("configurationNamingContext").Value.ToString + Dim objCrossRefContainer As DirectoryEntry + + If (UserName.Length > 0) AndAlso (Password.Length > 0) Then + objCrossRefContainer = New DirectoryEntry (crossRefPath, UserName, Password, AuthType) + Else + objCrossRefContainer = New DirectoryEntry (crossRefPath) + End If + + Dim objCrossRef As DirectoryEntry + For Each objCrossRef In objCrossRefContainer.Children + If Not objCrossRef.Properties ("nETBIOSName").Value Is Nothing Then + Dim netBIOSName As String = CType (objCrossRef.Properties ("nETBIOSName").Value, String) + Dim canonicalName As String = CType (objCrossRef.Properties ("dnsRoot").Value, String) + Dim domainPath As String = CType (objCrossRef.Properties ("nCName").Value, String) + Dim crossRef As CrossReference = New CrossReference (domainPath, netBIOSName, canonicalName) + Me.Add (crossRef) + End If + Next + Catch ex As COMException + mProcessLog += ex.Message & "
" + End Try + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Friend Shadows Sub Clear() + mNetBIOSLookup.Clear() + mCanonicalLookup.Clear() + MyBase.Clear() + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Friend Sub Add (ByVal RefObject As CrossReference) + Dim index As Integer + Try + index = MyBase.List.Add (RefObject) + mCanonicalLookup.Add (RefObject.CanonicalName, index) + mNetBIOSLookup.Add (RefObject.NetBIOSName, index) + Catch ex As COMException + mProcessLog += ex.Message + End Try + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function Item (ByVal index As Integer) As CrossReference + Try + Dim obj As Object + obj = MyBase.List.Item (index) + Return CType (obj, CrossReference) + Catch Exc As Exception + Return Nothing + End Try + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function Item (ByVal Name As String) As CrossReference + Dim index As Integer + Dim obj As Object + + ' Do validation first + Try + If mCanonicalLookup.Item (Name) Is Nothing Then + Return Nothing + End If + Catch ex As Exception + Return Nothing + End Try + + index = CInt (mCanonicalLookup.Item (Name)) + obj = MyBase.List.Item (index) + + Return CType (obj, CrossReference) + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Function ItemByNetBIOS (ByVal Name As String) As CrossReference + Dim index As Integer + Dim obj As Object + + ' Do validation first + Try + If mNetBIOSLookup.Item (Name) Is Nothing Then + Return Nothing + End If + Catch ex As Exception + Return Nothing + End Try + + index = CInt (mNetBIOSLookup.Item (Name)) + obj = MyBase.List.Item (index) + + Return CType (obj, CrossReference) + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ProcesssLog() As String + Get + Return mProcessLog + End Get + End Property + End Class +End Namespace diff --git a/Providers/ADSIProvider/Domain.vb b/Providers/ADSIProvider/Domain.vb index 33fedf3..3b1f86b 100644 --- a/Providers/ADSIProvider/Domain.vb +++ b/Providers/ADSIProvider/Domain.vb @@ -1,299 +1,299 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.DirectoryServices -Imports DotNetNuke.Common.Utilities - -Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI - Public Class Domain - Inherits DirectoryEntry - - Private mChildDomains As New ArrayList - 'One level child - Private mAllChildDomains As New ArrayList - 'All level child - Private mParentDomain As Domain - Private mDistinguishedName As String = "" - Private mNetBIOSName As String = "" - Private mCanonicalName As String = "" - Private mLevel As Integer - Private mChildPopulate As Boolean = False - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - MyBase.New() - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New (ByVal Path As String, ByVal UserName As String, ByVal Password As String, _ - ByVal AuthenticationType As AuthenticationTypes) - MyBase.New (Path, UserName, Password, AuthenticationType) - PopulateInfo() - PopulateChild (Me) - mChildPopulate = True - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New (ByVal Path As String) - MyBase.New (Path) - PopulateInfo() - PopulateChild (Me) - mChildPopulate = True - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Private Sub PopulateInfo() - Dim config As Configuration = Configuration.GetConfig() - - mDistinguishedName = CType (MyBase.Properties (Configuration.ADSI_DISTINGUISHEDNAME).Value, String) - mCanonicalName = Utilities.ConvertToCanonical (mDistinguishedName, False) - - ' Note that this property will be null string if LDAP is unaccessible - mNetBIOSName = Utilities.CanonicalToNetBIOS (mCanonicalName) - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Private Sub PopulateChild (ByVal Domain As Domain) - Dim objSearch As New Search (Domain) - - objSearch.SearchScope = SearchScope.OneLevel - objSearch.AddFilter (Configuration.ADSI_CLASS, CompareOperator.Is, ObjectClass.domainDNS.ToString) - - Dim resDomains As ArrayList = objSearch.GetEntries - Dim entry As DirectoryEntry - - For Each entry In resDomains - Dim child As Domain = GetDomain (entry.Path) - - If Not child Is Nothing Then - child.ParentDomain = Domain - child.Level = Domain.Level + 1 - ' Add this child into childDomains collection - Domain.ChildDomains.Add (child) - ' add this child and all it's child into allchilddomains collection - Domain.AllChildDomains.Add (child) - Domain.AllChildDomains.AddRange (child.AllChildDomains) - End If - Next - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Accessing ADs costs lots of resource so we better put ADs object into app cache - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetDomain (ByVal Path As String) As Domain - Return GetDomain(Path, "", "", AuthenticationTypes.Delegation) - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Accessing ADs costs lots of resource so we better put ADs object into app cache - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetDomain (ByVal Path As String, ByVal UserName As String, ByVal Password As String, _ - ByVal AuthenticationType As AuthenticationTypes) As Domain - - Dim Domain As Domain = CType (DataCache.GetCache (Path), Domain) - If Domain Is Nothing Then - If (UserName.Length > 0) AndAlso (Password.Length > 0) Then - Domain = New Domain (Path, UserName, Password, AuthenticationType) - Else - Domain = New Domain (Path) - End If - - DataCache.SetCache (Path, Domain) - End If - - Return Domain - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Clear domain object in cache - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Sub ResetDomain (ByVal Path As String) - DataCache.RemoveCache (Path) - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Return one level child domains - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property ChildDomains() As ArrayList - Get - Return mChildDomains - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Return child all level child domains - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property AllChildDomains() As ArrayList - Get - Return mAllChildDomains - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' Return parent domain of this domain - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property ParentDomain() As Domain - Get - Return mParentDomain - End Get - Set (ByVal Value As Domain) - mParentDomain = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property Level() As Integer - Get - Return mLevel - End Get - Set (ByVal Value As Integer) - mLevel = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property DistinguishedName() As String - Get - Return mDistinguishedName - End Get - Set (ByVal Value As String) - mDistinguishedName = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property ChildPopulate() As Boolean - Get - Return mChildPopulate - End Get - Set (ByVal Value As Boolean) - mChildPopulate = Value - End Set - End Property - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports System.DirectoryServices +Imports DotNetNuke.Common.Utilities + +Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI + Public Class Domain + Inherits DirectoryEntry + + Private mChildDomains As New ArrayList + 'One level child + Private mAllChildDomains As New ArrayList + 'All level child + Private mParentDomain As Domain + Private mDistinguishedName As String = "" + Private mNetBIOSName As String = "" + Private mCanonicalName As String = "" + Private mLevel As Integer + Private mChildPopulate As Boolean = False + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + MyBase.New() + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New (ByVal Path As String, ByVal UserName As String, ByVal Password As String, _ + ByVal AuthenticationType As AuthenticationTypes) + MyBase.New (Path, UserName, Password, AuthenticationType) + PopulateInfo() + PopulateChild (Me) + mChildPopulate = True + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New (ByVal Path As String) + MyBase.New (Path) + PopulateInfo() + PopulateChild (Me) + mChildPopulate = True + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Private Sub PopulateInfo() + Dim config As Configuration = Configuration.GetConfig() + + mDistinguishedName = CType (MyBase.Properties (Configuration.ADSI_DISTINGUISHEDNAME).Value, String) + mCanonicalName = Utilities.ConvertToCanonical (mDistinguishedName, False) + + ' Note that this property will be null string if LDAP is unaccessible + mNetBIOSName = Utilities.CanonicalToNetBIOS (mCanonicalName) + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Private Sub PopulateChild (ByVal Domain As Domain) + Dim objSearch As New Search (Domain) + + objSearch.SearchScope = SearchScope.OneLevel + objSearch.AddFilter (Configuration.ADSI_CLASS, CompareOperator.Is, ObjectClass.domainDNS.ToString) + + Dim resDomains As ArrayList = objSearch.GetEntries + Dim entry As DirectoryEntry + + For Each entry In resDomains + Dim child As Domain = GetDomain (entry.Path) + + If Not child Is Nothing Then + child.ParentDomain = Domain + child.Level = Domain.Level + 1 + ' Add this child into childDomains collection + Domain.ChildDomains.Add (child) + ' add this child and all it's child into allchilddomains collection + Domain.AllChildDomains.Add (child) + Domain.AllChildDomains.AddRange (child.AllChildDomains) + End If + Next + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Accessing ADs costs lots of resource so we better put ADs object into app cache + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetDomain (ByVal Path As String) As Domain + Return GetDomain(Path, "", "", AuthenticationTypes.Delegation) + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Accessing ADs costs lots of resource so we better put ADs object into app cache + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetDomain (ByVal Path As String, ByVal UserName As String, ByVal Password As String, _ + ByVal AuthenticationType As AuthenticationTypes) As Domain + + Dim Domain As Domain = CType (DataCache.GetCache (Path), Domain) + If Domain Is Nothing Then + If (UserName.Length > 0) AndAlso (Password.Length > 0) Then + Domain = New Domain (Path, UserName, Password, AuthenticationType) + Else + Domain = New Domain (Path) + End If + + DataCache.SetCache (Path, Domain) + End If + + Return Domain + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Clear domain object in cache + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Sub ResetDomain (ByVal Path As String) + DataCache.RemoveCache (Path) + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Return one level child domains + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property ChildDomains() As ArrayList + Get + Return mChildDomains + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Return child all level child domains + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property AllChildDomains() As ArrayList + Get + Return mAllChildDomains + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' Return parent domain of this domain + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property ParentDomain() As Domain + Get + Return mParentDomain + End Get + Set (ByVal Value As Domain) + mParentDomain = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property Level() As Integer + Get + Return mLevel + End Get + Set (ByVal Value As Integer) + mLevel = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property DistinguishedName() As String + Get + Return mDistinguishedName + End Get + Set (ByVal Value As String) + mDistinguishedName = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property ChildPopulate() As Boolean + Get + Return mChildPopulate + End Get + Set (ByVal Value As Boolean) + mChildPopulate = Value + End Set + End Property + End Class +End Namespace diff --git a/Providers/ADSIProvider/Search.vb b/Providers/ADSIProvider/Search.vb index 461b044..170212d 100644 --- a/Providers/ADSIProvider/Search.vb +++ b/Providers/ADSIProvider/Search.vb @@ -1,337 +1,337 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.DirectoryServices -Imports System.Runtime.InteropServices - -Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI - Public Class Search - Inherits DirectorySearcher - - Private mSearchFilters As New ArrayList - Private mFilterString As String - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New() - MyBase.New() - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New (ByVal rearchRoot As DirectoryEntry) - MyBase.New (rearchRoot) - PopulateDefaultProperties() - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Sub New (ByVal rearchRoot As DirectoryEntry, ByVal Filter As String, _ - Optional ByVal SortProperty As String = Configuration.ADSI_CNAME) - MyBase.New (rearchRoot, Filter) - PopulateDefaultProperties() - - Sort.PropertyName = SortProperty - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 10/05/2009 Added PropertyNamesOnly - WorkItem:2943 - ''' - ''' ------------------------------------------------------------------- - Private Sub PopulateDefaultProperties() - CacheResults = True - ' default is True - ReferralChasing = ReferralChasingOption.All - 'default is External - SearchScope = DirectoryServices.SearchScope.Subtree - 'default is Subtree - PropertyNamesOnly = False - PageSize = 1000 - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Overloads Function GetEntry() As DirectoryEntry - Dim result As SearchResult - - Try - Filter = FilterString - result = FindOne() - - If Not result Is Nothing Then - Return result.GetDirectoryEntry - Else - Return Nothing - End If - Catch ex As COMException - Return Nothing - End Try - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Overloads Function GetEntries() As ArrayList - Dim resultCollection As SearchResultCollection - Dim result As SearchResult - Dim entries As New ArrayList - Try - Filter = FilterString - resultCollection = FindAll() - For Each result In resultCollection - entries.Add (result.GetDirectoryEntry) - Next - - 'Item 4230 - Explicit call of Dispose() is required, according to - 'http://msdn.microsoft.com/library/system.directoryservices.directorysearcher.findall.aspx - resultCollection.Dispose() - - Catch ex As COMException - End Try - - Return entries - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' [mhorton] 10/05/2009 Added PropertyNamesOnly - WorkItem:2943 - ''' - ''' ------------------------------------------------------------------- - - Public Overloads Function GetPropertyEntries (ByVal Propertyname As String) As ArrayList - Dim resultCollection As SearchResultCollection - Dim entries As New ArrayList - Try - Filter = FilterString - resultCollection = FindAll() - For Each result As SearchResult In resultCollection - entries.Add (result.GetDirectoryEntry.Properties (Propertyname) (0)) - Next - - 'Explicit call of Dispose() is required, according to - 'http://msdn.microsoft.com/library/system.directoryservices.directorysearcher.findall.aspx - resultCollection.Dispose() - - Catch ex As COMException - End Try - - Return entries - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Sub AddFilter (ByVal Name As String, ByVal [Operator] As CompareOperator, _ - Optional ByVal Value As String = "*") - Dim filter As New SearchFilter - - filter.SetFilter (Name, [Operator], Value) - mSearchFilters.Add (filter) - - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Property SearchFilters() As ArrayList - Get - Return mSearchFilters - End Get - Set (ByVal Value As ArrayList) - mSearchFilters = Value - End Set - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public ReadOnly Property FilterString() As String - Get - Dim filter As SearchFilter - Dim sb As New StringBuilder - - sb.Append ("(&") - For Each filter In Me.SearchFilters - sb.Append (AppendFilter (filter)) - Next - sb.Append (")") - Return sb.ToString - End Get - End Property - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Private Function AppendFilter (ByVal Filter As SearchFilter) As String - Dim sb As New StringBuilder - With Filter - Select Case Filter.ADSICompareOperator - Case CompareOperator.Is - sb.Append ("(") - sb.Append (.Name) - sb.Append ("=") - sb.Append (.Value) - sb.Append (")") - Case CompareOperator.[IsNot] - sb.Append ("(!") - sb.Append (.Name) - sb.Append ("=") - sb.Append (.Value) - sb.Append (")") - Case CompareOperator.StartsWith - sb.Append ("(") - sb.Append (.Name) - sb.Append ("=") - sb.Append (.Value) - sb.Append ("*)") - Case CompareOperator.EndsWith - sb.Append ("(") - sb.Append (.Name) - sb.Append ("=*") - sb.Append (.Value) - sb.Append (")") - Case CompareOperator.Present - sb.Append ("(") - sb.Append (.Name) - sb.Append ("=") - sb.Append ("*)") - Case CompareOperator.NotPresent - sb.Append ("(!") - sb.Append (.Name) - sb.Append ("=") - sb.Append ("*)") - End Select - End With - - Return sb.ToString - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Structure SearchFilter - Friend mName As String - Friend mValue As String - Friend mCompareOperator As CompareOperator - - Friend Sub SetFilter (ByVal Name As String, ByVal [Operator] As CompareOperator, ByVal Value As String) - mName = Name - mValue = Value - mCompareOperator = [Operator] - End Sub - - Public ReadOnly Property Name() As String - Get - Return mName - End Get - End Property - - Public ReadOnly Property Value() As String - Get - Return mValue - End Get - End Property - - Public ReadOnly Property ADSICompareOperator() As CompareOperator - Get - Return mCompareOperator - End Get - End Property - End Structure - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports System.DirectoryServices +Imports System.Runtime.InteropServices + +Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI + Public Class Search + Inherits DirectorySearcher + + Private mSearchFilters As New ArrayList + Private mFilterString As String + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New() + MyBase.New() + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New (ByVal rearchRoot As DirectoryEntry) + MyBase.New (rearchRoot) + PopulateDefaultProperties() + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Sub New (ByVal rearchRoot As DirectoryEntry, ByVal Filter As String, _ + Optional ByVal SortProperty As String = Configuration.ADSI_CNAME) + MyBase.New (rearchRoot, Filter) + PopulateDefaultProperties() + + Sort.PropertyName = SortProperty + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 10/05/2009 Added PropertyNamesOnly - WorkItem:2943 + ''' + ''' ------------------------------------------------------------------- + Private Sub PopulateDefaultProperties() + CacheResults = True + ' default is True + ReferralChasing = ReferralChasingOption.All + 'default is External + SearchScope = DirectoryServices.SearchScope.Subtree + 'default is Subtree + PropertyNamesOnly = False + PageSize = 1000 + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Overloads Function GetEntry() As DirectoryEntry + Dim result As SearchResult + + Try + Filter = FilterString + result = FindOne() + + If Not result Is Nothing Then + Return result.GetDirectoryEntry + Else + Return Nothing + End If + Catch ex As COMException + Return Nothing + End Try + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Overloads Function GetEntries() As ArrayList + Dim resultCollection As SearchResultCollection + Dim result As SearchResult + Dim entries As New ArrayList + Try + Filter = FilterString + resultCollection = FindAll() + For Each result In resultCollection + entries.Add (result.GetDirectoryEntry) + Next + + 'Item 4230 - Explicit call of Dispose() is required, according to + 'http://msdn.microsoft.com/library/system.directoryservices.directorysearcher.findall.aspx + resultCollection.Dispose() + + Catch ex As COMException + End Try + + Return entries + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' [mhorton] 10/05/2009 Added PropertyNamesOnly - WorkItem:2943 + ''' + ''' ------------------------------------------------------------------- + + Public Overloads Function GetPropertyEntries (ByVal Propertyname As String) As ArrayList + Dim resultCollection As SearchResultCollection + Dim entries As New ArrayList + Try + Filter = FilterString + resultCollection = FindAll() + For Each result As SearchResult In resultCollection + entries.Add (result.GetDirectoryEntry.Properties (Propertyname) (0)) + Next + + 'Explicit call of Dispose() is required, according to + 'http://msdn.microsoft.com/library/system.directoryservices.directorysearcher.findall.aspx + resultCollection.Dispose() + + Catch ex As COMException + End Try + + Return entries + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Sub AddFilter (ByVal Name As String, ByVal [Operator] As CompareOperator, _ + Optional ByVal Value As String = "*") + Dim filter As New SearchFilter + + filter.SetFilter (Name, [Operator], Value) + mSearchFilters.Add (filter) + + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Property SearchFilters() As ArrayList + Get + Return mSearchFilters + End Get + Set (ByVal Value As ArrayList) + mSearchFilters = Value + End Set + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public ReadOnly Property FilterString() As String + Get + Dim filter As SearchFilter + Dim sb As New StringBuilder + + sb.Append ("(&") + For Each filter In Me.SearchFilters + sb.Append (AppendFilter (filter)) + Next + sb.Append (")") + Return sb.ToString + End Get + End Property + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Private Function AppendFilter (ByVal Filter As SearchFilter) As String + Dim sb As New StringBuilder + With Filter + Select Case Filter.ADSICompareOperator + Case CompareOperator.Is + sb.Append ("(") + sb.Append (.Name) + sb.Append ("=") + sb.Append (.Value) + sb.Append (")") + Case CompareOperator.[IsNot] + sb.Append ("(!") + sb.Append (.Name) + sb.Append ("=") + sb.Append (.Value) + sb.Append (")") + Case CompareOperator.StartsWith + sb.Append ("(") + sb.Append (.Name) + sb.Append ("=") + sb.Append (.Value) + sb.Append ("*)") + Case CompareOperator.EndsWith + sb.Append ("(") + sb.Append (.Name) + sb.Append ("=*") + sb.Append (.Value) + sb.Append (")") + Case CompareOperator.Present + sb.Append ("(") + sb.Append (.Name) + sb.Append ("=") + sb.Append ("*)") + Case CompareOperator.NotPresent + sb.Append ("(!") + sb.Append (.Name) + sb.Append ("=") + sb.Append ("*)") + End Select + End With + + Return sb.ToString + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Structure SearchFilter + Friend mName As String + Friend mValue As String + Friend mCompareOperator As CompareOperator + + Friend Sub SetFilter (ByVal Name As String, ByVal [Operator] As CompareOperator, ByVal Value As String) + mName = Name + mValue = Value + mCompareOperator = [Operator] + End Sub + + Public ReadOnly Property Name() As String + Get + Return mName + End Get + End Property + + Public ReadOnly Property Value() As String + Get + Return mValue + End Get + End Property + + Public ReadOnly Property ADSICompareOperator() As CompareOperator + Get + Return mCompareOperator + End Get + End Property + End Structure + End Class +End Namespace diff --git a/Providers/ADSIProvider/Utilities.vb b/Providers/ADSIProvider/Utilities.vb index b94c737..cc363a2 100644 --- a/Providers/ADSIProvider/Utilities.vb +++ b/Providers/ADSIProvider/Utilities.vb @@ -1,732 +1,732 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' -Imports System.DirectoryServices -Imports System.Security.Principal -Imports System.Runtime.InteropServices -Imports DotNetNuke.Services.Exceptions -Imports System.Net -Imports SecurityException = System.Security.SecurityException -Imports DotNetNuke.Services.Log.EventLog -Imports DotNetNuke.Services.FileSystem -Imports DotNetNuke.Entities.Users - -Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI - Public Class Utilities - Public Shared objEventLog As New EventLogController - Public Const AD_IMAGE_FOLDER_PATH As String = "Images/AD Photos" - Sub New() - End Sub - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Overloads Shared Function GetRootDomain(ByVal ADSIPath As Path) As Domain - Try - Dim adsiConfig As Configuration = Configuration.GetConfig() - - Dim rootDomainFullPath As String = AddADSIPath(adsiConfig.RootDomainPath, ADSIPath) - Dim _ - rootDomainEntry As Domain = - Domain.GetDomain(rootDomainFullPath, adsiConfig.UserName, adsiConfig.Password, - adsiConfig.AuthenticationType) - Return rootDomainEntry - Catch exc As COMException - LogException(exc) - Return Nothing - End Try - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Overloads Shared Function GetRootDomain() As Domain - Try - Dim adsiConfig As Configuration = Configuration.GetConfig() - - Dim rootDomainFullPath As String = AddADSIPath(adsiConfig.RootDomainPath) - Dim _ - rootDomainEntry As Domain = - Domain.GetDomain(rootDomainFullPath, adsiConfig.UserName, adsiConfig.Password, - adsiConfig.AuthenticationType) - Return rootDomainEntry - Catch exc As COMException - LogException(exc) - Return Nothing - End Try - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetDomainByBIOSName(ByVal Name As String) As Domain - Dim adsiConfig As Configuration = Configuration.GetConfig() - - ' Only access CrossRefCollection if LDAP is accessible - If Not adsiConfig.RefCollection Is Nothing AndAlso adsiConfig.RefCollection.Count > 0 Then - Dim refObject As CrossReferenceCollection.CrossReference = adsiConfig.RefCollection.ItemByNetBIOS(Name) - Dim path As String = AddADSIPath(refObject.DomainPath) - Dim _ - domain As Domain = - Domain.GetDomain(path, adsiConfig.UserName, adsiConfig.Password, adsiConfig.AuthenticationType) - - Return domain - Else - Return Nothing - End If - - End Function - - Public Overloads Shared Function GetRootEntry() As DirectoryEntry - Return GetRootEntry(Path.GC) - End Function - - Public Overloads Shared Function GetRootEntry(ByVal ADSIPath As Path) As DirectoryEntry - Try - Dim adsiConfig As Configuration = Configuration.GetConfig() - Dim entry As DirectoryEntry = Nothing - If Not adsiConfig Is Nothing Then - Dim rootDomainFullPath As String = AddADSIPath(adsiConfig.RootDomainPath, ADSIPath) - If Not rootDomainFullPath Is Nothing Then - entry = GetDirectoryEntry(rootDomainFullPath) - End If - End If - If Not entry Is Nothing AndAlso entry.Name.Length > 0 Then - Return entry - Else - Return Nothing - End If - Catch exc As COMException - LogException(exc) - Return Nothing - End Try - - End Function - - - ''' ------------------------------------------------------------------- - ''' - ''' Depends on how User/Password specified, 2 different method to obtain directory entry - ''' - ''' - ''' Admin might not enter User/Password to access AD in web.config - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetDirectoryEntry(ByVal Path As String) As DirectoryEntry - Dim adsiConfig As Configuration = Configuration.GetConfig() - Dim returnEntry As DirectoryEntry - - If (adsiConfig.UserName.Length > 0) AndAlso (adsiConfig.Password.Length > 0) Then - returnEntry = - New DirectoryEntry(Path, adsiConfig.UserName, adsiConfig.Password, AuthenticationTypes.Delegation) - Else - returnEntry = New DirectoryEntry(Path) - End If - - Return returnEntry - - End Function - - '''------------------------------------------------------------------- - ''' - ''' Obtain the path to access top level domain entry in Windows Active Directory - ''' - '''For better performance and avoid error, Global Catalog is preferer accessing method - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - '''------------------------------------------------------------------- - Public Shared Function GetRootForestPath(Optional ByVal ADSIPath As Path = Path.GC) As String - Try - Dim strADSIPath As String = ADSIPath.ToString & "://" - Dim ADsRoot As New DirectoryEntry(strADSIPath & "rootDSE") - Dim _ - strRootDomain As String = strADSIPath & - CType( - ADsRoot.Properties(Configuration.ADSI_ROOTDOMAINNAMIMGCONTEXT).Value, - String) - - Return strRootDomain - Catch ex As COMException - LogException(ex) - Return Nothing - End Try - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Obtain location of the domain contains this entry, - ''' - ''' - ''' Return string is in canonical format (ttt.com.vn) - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetEntryLocation(ByVal Entry As DirectoryEntry) As String - Dim strReturn As String = "" - If Not Entry Is Nothing Then - Dim entryPath As String = CheckNullString(Entry.Path) - - If entryPath.Length > 0 Then - strReturn = Right(entryPath, entryPath.Length - entryPath.IndexOf("DC=")) - strReturn = ConvertToCanonical(strReturn, False) - End If - End If - - Return strReturn - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [mhorton] 10/05/2009 Created - WorkItem:2943 - ''' - ''' ------------------------------------------------------------------- - - Public Shared Function GetAllGroupnames() As ArrayList - Dim RootDomain As Domain = GetRootDomain() - Dim objSearch As New Search(RootDomain) - - objSearch.AddFilter(Configuration.ADSI_CLASS, CompareOperator.Is, ObjectClass.group.ToString) - objSearch.PropertiesToLoad.Add(Configuration.ADSI_CNAME) - - Return objSearch.GetPropertyEntries(Configuration.ADSI_CNAME) - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Obtain user from Windows Active Directory using LogonName format - NETBIOSNAME\USERNAME - ''' - ''' - ''' -In multiple domains network, search result might return more than one user with the same name - ''' -Additional steps to check by domain name to get correct user - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetUserEntryByName(ByVal Name As String) As DirectoryEntry - ' Create search object then assign required params to get user entry in Active Directory - Dim objSearch As New Search(GetRootDomain) - Dim userEntries As ArrayList - Dim userEntry As DirectoryEntry - Dim userDomain As Domain - - With objSearch - .AddFilter(Configuration.ADSI_CLASS, CompareOperator.Is, ObjectClass.person.ToString) - .AddFilter(Configuration.ADSI_ACCOUNTNAME, CompareOperator.Is, TrimUserDomainName(Name)) - - userEntries = .GetEntries - Select Case userEntries.Count - Case 0 - 'Found no entry, return nothing - Return Nothing - Case 1 - ' Find only one entry, return it - Return CType(userEntries.Item(0), DirectoryEntry) - Case Else - ' Find more than one entry, so we have to check to obtain correct user - ' Get user domain - userDomain = GetDomainByBIOSName(GetUserDomainName(Name)) - If Not userDomain Is Nothing Then - For Each userEntry In userEntries - Dim entryPath As String = userEntry.Path - Dim _ - entryLocation As String = - Right(entryPath, entryPath.Length - entryPath.IndexOf("DC=")) - If entryLocation.ToLower = userDomain.DistinguishedName.ToLower Then - Return userEntry - End If - Next - Else - ' If an error occurs while accessing LDAP (i.e double-hop issue), we return the first entry - ' This method not very accurately, however it would be OK for ALMOST network - Return CType(userEntries.Item(0), DirectoryEntry) - End If - - End Select - - End With - - Return Nothing - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' This function's reserved for simple network which have single domain and logon username in simple format - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function CanonicalToNetBIOS(ByVal CanonicalName As String) As String - Dim config As Configuration = Configuration.GetConfig() - - ' Only access CrossRefCollection if LDAP is accessible - If Not config.RefCollection Is Nothing AndAlso config.RefCollection.Count > 0 Then - Dim refObject As CrossReferenceCollection.CrossReference = config.RefCollection.Item(CanonicalName) - If Not refObject Is Nothing Then - Return refObject.mNetBIOSName - Else - Return "" - End If - Else - Return "" - End If - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Convert input string USERNAME@DOMAIN into NETBIOSNAME\USERNAME - ''' - ''' - ''' - We could do it only if LDAP is accessible to obtain NetBIOSName - ''' - If LDAP is unaccessible, return original user name (UPN format) - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function UPNToLogonName0(ByVal UserPrincipalName As String) As String - Dim config As Configuration = Configuration.GetConfig() - Dim userName As String = UserPrincipalName - - If config.LDAPAccesible Then - Dim _ - userDomain As String = - Right(UserPrincipalName, UserPrincipalName.Length - (UserPrincipalName.IndexOf("@") + 1)) - Dim userNetBIOS As String = CanonicalToNetBIOS(userDomain) - If Not userNetBIOS.Length = 0 Then - userName = userNetBIOS & "\" & TrimUserDomainName(UserPrincipalName) - End If - End If - - Return userName - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Get domain name (NETBIOS) from user logon name - ''' - ''' - ''' Input string must be LogonName format (NETBIOSNAME\USERNAME) - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetUserDomainName(ByVal UserName As String) As String - Dim strReturn As String = "" - If UserName.IndexOf("\") > 0 Then - strReturn = Left(UserName, (UserName.IndexOf("\"))) - End If - Return strReturn - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Trim user logon string to get simple user name - ''' - ''' - ''' Accept 3 different formats : - ''' - LogonName format (NETBIOSNAME\USERNAME) - ''' - UPN format (USERNAME@DOMAINNAME) - ''' - Simple format (USERNAME only) - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function TrimUserDomainName(ByVal UserName As String) As String - Dim strReturn As String - If UserName.IndexOf("\") > -1 Then - strReturn = Right(UserName, UserName.Length - (UserName.IndexOf("\") + 1)) - ElseIf UserName.IndexOf("@") > -1 Then - strReturn = Left(UserName, UserName.IndexOf("@")) - Else - strReturn = UserName - End If - - Return strReturn - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function AddADSIPath(ByVal Path As String, Optional ByVal ADSIPath As Path = ADSI.Path.GC) _ - As String - If Path.IndexOf("LDAP://") <> -1 Then - Return Path - ElseIf Path.IndexOf("://") <> -1 Then - 'Clean existing ADs path first - Path = Right(Path, Path.Length - (Path.IndexOf("://") + 3)) - End If - Return ADSIPath.ToString & "://" & Path - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function ValidateDomainPath(ByVal Path As String, Optional ByVal ADSIPath As Path = ADSI.Path.GC) _ - As String - ' If root domain is not specified in site settings, we start from top root forest - If Path.Length = 0 Then - Return GetRootForestPath() - ElseIf (Path.IndexOf("DC=") <> -1) And (Path.IndexOf("://") <> -1) Then - Return Path - ElseIf (Path.IndexOf("LDAP://") <> -1) And (Path.IndexOf("://") <> -1) Then - Return Path - ElseIf (Path.IndexOf(".") <> -1) Then - ' "ttt.com.vn" format, it's possible for "LDAP://ttt.com.vn" format to access Authentication, however GC:// gives better performance - Return ConvertToDistinguished(Path) - Else - ' Invalid path, so we get root path from Active Directory - Return GetRootForestPath() - End If - 'End If - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function ConvertToDistinguished(ByVal Canonical As String, - Optional ByVal ADSIPath As Path = Path.GC) As String - Dim strDistinguished As String - - ' Clean up ADSI.Path to make sure we get a proper path - If Canonical.IndexOf("://") <> -1 Then - strDistinguished = Right(Canonical, Canonical.Length - (Canonical.IndexOf("://") + 3)) - Else - strDistinguished = Canonical - End If - - strDistinguished = Replace(strDistinguished, ".", ",DC=") - strDistinguished = "DC=" & strDistinguished - - If Canonical.IndexOf("://") <> -1 Then - strDistinguished = AddADSIPath(strDistinguished, ADSIPath) - End If - - Return strDistinguished - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function ConvertToCanonical(ByVal Distinguished As String, ByVal IncludeADSIPath As Boolean) _ - As String - Dim strCanonical As String = Distinguished - - If Not IncludeADSIPath AndAlso Distinguished.IndexOf("://") <> -1 Then - strCanonical = Right(Distinguished, Distinguished.Length - (Distinguished.IndexOf("://") + 3)) - End If - - strCanonical = Replace(strCanonical, "DC=", "") - strCanonical = Replace(strCanonical, "dc=", "") - strCanonical = Replace(strCanonical, "CN=", "") - strCanonical = Replace(strCanonical, "cn=", "") - strCanonical = Replace(strCanonical, ",", ".") - - Return strCanonical - - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function CheckNullString(ByVal value As Object) As String - If value Is Nothing Then - Return "" - Else - Return value.ToString - End If - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetRandomPassword() As String - Dim rd As New Random - Return Convert.ToString(rd.Next) - End Function - - ' See http://www.aspalliance.com/bbilbro/viewarticle.aspx?paged_article_id=4 - Public Shared Function ReplaceCaseInsensitive(ByVal text As String, ByVal oldValue As String, - ByVal newValue As String) As String - oldValue = GetCaseInsensitiveSearch(oldValue) - - Return Regex.Replace([text], oldValue, newValue) - - End Function - - 'ReplaceCaseInsensitive - - Shared Function GetCaseInsensitiveSearch(ByVal search As String) As String - Dim result As String = String.Empty - - Dim index As Integer - - For index = 0 To search.Length - 1 - Dim character As Char = search.Chars(index) - Dim characterLower As Char = Char.ToLower(character) - Dim characterUpper As Char = Char.ToUpper(character) - - If characterUpper = characterLower Then - result = result + character - Else - result = result + "[" + characterLower + characterUpper + "]" - End If - - Next index - Return result - End Function - - 'GetCaseInsensitiveSearch - - 'ACD-7422 - Role Synchronization Not Working On W2K Domain Controllers - 'By using TokenGroups it should work with W2K. - Public Shared Function GetADGroups(ByVal Name As String) As ArrayList - Dim user As DirectoryEntry = GetUserEntryByName(Name) - Dim irc As IdentityReferenceCollection = ExpandTokenGroups(user).Translate(GetType(NTAccount)) - Dim arrAccounts As New ArrayList - - For Each account As IdentityReference In irc - If (TypeOf account Is NTAccount) Then -#If DEBUG Then - Debug.Print("Account=" + account.Value) -#End If - 'arrAccounts.Add (account.Value) - 'Trim the leading Group Name off the group (i.e. Remove DOMAIN\ from DOMAIN\Group) - If InStr(account.Value, "\") Then - If Not (arrAccounts.Contains(account.Value.Substring(InStr(account.Value, "\")))) Then - arrAccounts.Add(account.Value.Substring(InStr(account.Value, "\"))) - End If - Else - arrAccounts.Add(account.Value) - End If - End If - Next - - Return arrAccounts - End Function - - Private Shared Function ExpandTokenGroups(ByVal user As DirectoryEntry) As IdentityReferenceCollection - user.RefreshCache(New String() {"tokenGroups"}) - - Dim irc As New IdentityReferenceCollection() - - For Each sidBytes As Byte() In user.Properties("tokenGroups") - irc.Add(New SecurityIdentifier(sidBytes, 0)) - Next - Return irc - End Function - - Public Shared Function GetIP4Address(ByVal strPassedIP As String) As String - Dim IP4Address As String = String.Empty - - For Each IPA As IPAddress In Dns.GetHostAddresses(strPassedIP) - If IPA.AddressFamily.ToString() = "InterNetwork" Then - IP4Address = IPA.ToString() - Exit For - End If - Next - - If IP4Address <> String.Empty Then - Return IP4Address - End If - - For Each IPA As IPAddress In Dns.GetHostAddresses(Dns.GetHostName()) - If IPA.AddressFamily.ToString() = "InterNetwork" Then - IP4Address = IPA.ToString() - Exit For - End If - Next - - Return IP4Address - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' Checks the trust level of the portal. - ''' - ''' - ''' - ''' - ''' [mhorton] 08/10/2008 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetCurrentTrustLevel() As AspNetHostingPermissionLevel - For Each trustLevel As AspNetHostingPermissionLevel In - New AspNetHostingPermissionLevel() _ - {AspNetHostingPermissionLevel.Unrestricted, AspNetHostingPermissionLevel.High, - AspNetHostingPermissionLevel.Medium, AspNetHostingPermissionLevel.Low, - AspNetHostingPermissionLevel.Minimal} - Try - Dim perm As New AspNetHostingPermission(trustLevel) - perm.Demand() - Catch generatedExceptionName As SecurityException - Continue For - End Try - - Return trustLevel - Next - - Return AspNetHostingPermissionLevel.None - End Function - - ''' ------------------------------------------------------------------- - ''' - ''' - ''' - ''' in multiple domains network that search result return more than one group with the same name (i.e Administrators) - ''' - ''' - ''' [tamttt] 08/01/2004 Created - ''' - ''' ------------------------------------------------------------------- - Public Shared Function GetGroupEntriesByName(ByVal GroupName As String) As ArrayList - Dim RootDomain As ADSI.Domain = GetRootDomain() - Dim objSearch As New Search(RootDomain) - - objSearch.AddFilter(Configuration.ADSI_CLASS, ADSI.CompareOperator.Is, ObjectClass.group.ToString) - objSearch.AddFilter(Configuration.ADSI_ACCOUNTNAME, ADSI.CompareOperator.Is, GroupName) - - Dim groupEntries As ArrayList = objSearch.GetEntries - - If Not groupEntries Is Nothing Then - Return groupEntries - Else - Return Nothing - End If - - End Function - - Public Shared Function AddEventLog(portalsettings As Portals.PortalSettings, description As String) As Boolean - objEventLog.AddLog("Description", description, portalsettings, -1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT) - End Function - - ''' - ''' Uses the byte data from active directory and writes an image file to the specified folder. Returns the FileID - ''' - ''' User object - ''' Byte array containing photo bytes - ''' - ''' [sawest] 12/16/2016 Created - ''' - Public Shared Function WritePhoto(ByVal objUserInfo As ADUserInfo, ByVal photo() As Byte) As String - - Dim _folderinfo As IFolderInfo - Dim _fileinfo As IFileInfo - - _folderinfo = FolderManager.Instance.GetUserFolder(objUserInfo) - - If Not _folderinfo Is Nothing Then - Using stream As New System.IO.MemoryStream(photo) - Dim fname As String = Replace(objUserInfo.Username, "\", "_") & "_profile_photo.jpg" - _fileinfo = FileManager.Instance.AddFile(_folderinfo, fname, stream) - stream.Close() - _folderinfo = Nothing - If Not _fileinfo Is Nothing Then - Return _fileinfo.FileId - Else - Return "" - End If - End Using - Else - Return "" - End If - End Function - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' +Imports System.DirectoryServices +Imports System.Security.Principal +Imports System.Runtime.InteropServices +Imports DotNetNuke.Services.Exceptions +Imports System.Net +Imports SecurityException = System.Security.SecurityException +Imports DotNetNuke.Services.Log.EventLog +Imports DotNetNuke.Services.FileSystem +Imports DotNetNuke.Entities.Users + +Namespace DotNetNuke.Authentication.ActiveDirectory.ADSI + Public Class Utilities + Public Shared objEventLog As New EventLogController + Public Const AD_IMAGE_FOLDER_PATH As String = "Images/AD Photos" + Sub New() + End Sub + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Overloads Shared Function GetRootDomain(ByVal ADSIPath As Path) As Domain + Try + Dim adsiConfig As Configuration = Configuration.GetConfig() + + Dim rootDomainFullPath As String = AddADSIPath(adsiConfig.RootDomainPath, ADSIPath) + Dim _ + rootDomainEntry As Domain = + Domain.GetDomain(rootDomainFullPath, adsiConfig.UserName, adsiConfig.Password, + adsiConfig.AuthenticationType) + Return rootDomainEntry + Catch exc As COMException + LogException(exc) + Return Nothing + End Try + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Overloads Shared Function GetRootDomain() As Domain + Try + Dim adsiConfig As Configuration = Configuration.GetConfig() + + Dim rootDomainFullPath As String = AddADSIPath(adsiConfig.RootDomainPath) + Dim _ + rootDomainEntry As Domain = + Domain.GetDomain(rootDomainFullPath, adsiConfig.UserName, adsiConfig.Password, + adsiConfig.AuthenticationType) + Return rootDomainEntry + Catch exc As COMException + LogException(exc) + Return Nothing + End Try + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetDomainByBIOSName(ByVal Name As String) As Domain + Dim adsiConfig As Configuration = Configuration.GetConfig() + + ' Only access CrossRefCollection if LDAP is accessible + If Not adsiConfig.RefCollection Is Nothing AndAlso adsiConfig.RefCollection.Count > 0 Then + Dim refObject As CrossReferenceCollection.CrossReference = adsiConfig.RefCollection.ItemByNetBIOS(Name) + Dim path As String = AddADSIPath(refObject.DomainPath) + Dim _ + domain As Domain = + Domain.GetDomain(path, adsiConfig.UserName, adsiConfig.Password, adsiConfig.AuthenticationType) + + Return domain + Else + Return Nothing + End If + + End Function + + Public Overloads Shared Function GetRootEntry() As DirectoryEntry + Return GetRootEntry(Path.GC) + End Function + + Public Overloads Shared Function GetRootEntry(ByVal ADSIPath As Path) As DirectoryEntry + Try + Dim adsiConfig As Configuration = Configuration.GetConfig() + Dim entry As DirectoryEntry = Nothing + If Not adsiConfig Is Nothing Then + Dim rootDomainFullPath As String = AddADSIPath(adsiConfig.RootDomainPath, ADSIPath) + If Not rootDomainFullPath Is Nothing Then + entry = GetDirectoryEntry(rootDomainFullPath) + End If + End If + If Not entry Is Nothing AndAlso entry.Name.Length > 0 Then + Return entry + Else + Return Nothing + End If + Catch exc As COMException + LogException(exc) + Return Nothing + End Try + + End Function + + + ''' ------------------------------------------------------------------- + ''' + ''' Depends on how User/Password specified, 2 different method to obtain directory entry + ''' + ''' + ''' Admin might not enter User/Password to access AD in web.config + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetDirectoryEntry(ByVal Path As String) As DirectoryEntry + Dim adsiConfig As Configuration = Configuration.GetConfig() + Dim returnEntry As DirectoryEntry + + If (adsiConfig.UserName.Length > 0) AndAlso (adsiConfig.Password.Length > 0) Then + returnEntry = + New DirectoryEntry(Path, adsiConfig.UserName, adsiConfig.Password, AuthenticationTypes.Delegation) + Else + returnEntry = New DirectoryEntry(Path) + End If + + Return returnEntry + + End Function + + '''------------------------------------------------------------------- + ''' + ''' Obtain the path to access top level domain entry in Windows Active Directory + ''' + '''For better performance and avoid error, Global Catalog is preferer accessing method + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + '''------------------------------------------------------------------- + Public Shared Function GetRootForestPath(Optional ByVal ADSIPath As Path = Path.GC) As String + Try + Dim strADSIPath As String = ADSIPath.ToString & "://" + Dim ADsRoot As New DirectoryEntry(strADSIPath & "rootDSE") + Dim _ + strRootDomain As String = strADSIPath & + CType( + ADsRoot.Properties(Configuration.ADSI_ROOTDOMAINNAMIMGCONTEXT).Value, + String) + + Return strRootDomain + Catch ex As COMException + LogException(ex) + Return Nothing + End Try + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Obtain location of the domain contains this entry, + ''' + ''' + ''' Return string is in canonical format (ttt.com.vn) + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetEntryLocation(ByVal Entry As DirectoryEntry) As String + Dim strReturn As String = "" + If Not Entry Is Nothing Then + Dim entryPath As String = CheckNullString(Entry.Path) + + If entryPath.Length > 0 Then + strReturn = Right(entryPath, entryPath.Length - entryPath.IndexOf("DC=")) + strReturn = ConvertToCanonical(strReturn, False) + End If + End If + + Return strReturn + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [mhorton] 10/05/2009 Created - WorkItem:2943 + ''' + ''' ------------------------------------------------------------------- + + Public Shared Function GetAllGroupnames() As ArrayList + Dim RootDomain As Domain = GetRootDomain() + Dim objSearch As New Search(RootDomain) + + objSearch.AddFilter(Configuration.ADSI_CLASS, CompareOperator.Is, ObjectClass.group.ToString) + objSearch.PropertiesToLoad.Add(Configuration.ADSI_CNAME) + + Return objSearch.GetPropertyEntries(Configuration.ADSI_CNAME) + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Obtain user from Windows Active Directory using LogonName format - NETBIOSNAME\USERNAME + ''' + ''' + ''' -In multiple domains network, search result might return more than one user with the same name + ''' -Additional steps to check by domain name to get correct user + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetUserEntryByName(ByVal Name As String) As DirectoryEntry + ' Create search object then assign required params to get user entry in Active Directory + Dim objSearch As New Search(GetRootDomain) + Dim userEntries As ArrayList + Dim userEntry As DirectoryEntry + Dim userDomain As Domain + + With objSearch + .AddFilter(Configuration.ADSI_CLASS, CompareOperator.Is, ObjectClass.person.ToString) + .AddFilter(Configuration.ADSI_ACCOUNTNAME, CompareOperator.Is, TrimUserDomainName(Name)) + + userEntries = .GetEntries + Select Case userEntries.Count + Case 0 + 'Found no entry, return nothing + Return Nothing + Case 1 + ' Find only one entry, return it + Return CType(userEntries.Item(0), DirectoryEntry) + Case Else + ' Find more than one entry, so we have to check to obtain correct user + ' Get user domain + userDomain = GetDomainByBIOSName(GetUserDomainName(Name)) + If Not userDomain Is Nothing Then + For Each userEntry In userEntries + Dim entryPath As String = userEntry.Path + Dim _ + entryLocation As String = + Right(entryPath, entryPath.Length - entryPath.IndexOf("DC=")) + If entryLocation.ToLower = userDomain.DistinguishedName.ToLower Then + Return userEntry + End If + Next + Else + ' If an error occurs while accessing LDAP (i.e double-hop issue), we return the first entry + ' This method not very accurately, however it would be OK for ALMOST network + Return CType(userEntries.Item(0), DirectoryEntry) + End If + + End Select + + End With + + Return Nothing + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' This function's reserved for simple network which have single domain and logon username in simple format + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function CanonicalToNetBIOS(ByVal CanonicalName As String) As String + Dim config As Configuration = Configuration.GetConfig() + + ' Only access CrossRefCollection if LDAP is accessible + If Not config.RefCollection Is Nothing AndAlso config.RefCollection.Count > 0 Then + Dim refObject As CrossReferenceCollection.CrossReference = config.RefCollection.Item(CanonicalName) + If Not refObject Is Nothing Then + Return refObject.mNetBIOSName + Else + Return "" + End If + Else + Return "" + End If + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Convert input string USERNAME@DOMAIN into NETBIOSNAME\USERNAME + ''' + ''' + ''' - We could do it only if LDAP is accessible to obtain NetBIOSName + ''' - If LDAP is unaccessible, return original user name (UPN format) + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function UPNToLogonName0(ByVal UserPrincipalName As String) As String + Dim config As Configuration = Configuration.GetConfig() + Dim userName As String = UserPrincipalName + + If config.LDAPAccesible Then + Dim _ + userDomain As String = + Right(UserPrincipalName, UserPrincipalName.Length - (UserPrincipalName.IndexOf("@") + 1)) + Dim userNetBIOS As String = CanonicalToNetBIOS(userDomain) + If Not userNetBIOS.Length = 0 Then + userName = userNetBIOS & "\" & TrimUserDomainName(UserPrincipalName) + End If + End If + + Return userName + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Get domain name (NETBIOS) from user logon name + ''' + ''' + ''' Input string must be LogonName format (NETBIOSNAME\USERNAME) + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetUserDomainName(ByVal UserName As String) As String + Dim strReturn As String = "" + If UserName.IndexOf("\") > 0 Then + strReturn = Left(UserName, (UserName.IndexOf("\"))) + End If + Return strReturn + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Trim user logon string to get simple user name + ''' + ''' + ''' Accept 3 different formats : + ''' - LogonName format (NETBIOSNAME\USERNAME) + ''' - UPN format (USERNAME@DOMAINNAME) + ''' - Simple format (USERNAME only) + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function TrimUserDomainName(ByVal UserName As String) As String + Dim strReturn As String + If UserName.IndexOf("\") > -1 Then + strReturn = Right(UserName, UserName.Length - (UserName.IndexOf("\") + 1)) + ElseIf UserName.IndexOf("@") > -1 Then + strReturn = Left(UserName, UserName.IndexOf("@")) + Else + strReturn = UserName + End If + + Return strReturn + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function AddADSIPath(ByVal Path As String, Optional ByVal ADSIPath As Path = ADSI.Path.GC) _ + As String + If Path.IndexOf("LDAP://") <> -1 Then + Return Path + ElseIf Path.IndexOf("://") <> -1 Then + 'Clean existing ADs path first + Path = Right(Path, Path.Length - (Path.IndexOf("://") + 3)) + End If + Return ADSIPath.ToString & "://" & Path + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function ValidateDomainPath(ByVal Path As String, Optional ByVal ADSIPath As Path = ADSI.Path.GC) _ + As String + ' If root domain is not specified in site settings, we start from top root forest + If Path.Length = 0 Then + Return GetRootForestPath() + ElseIf (Path.IndexOf("DC=") <> -1) And (Path.IndexOf("://") <> -1) Then + Return Path + ElseIf (Path.IndexOf("LDAP://") <> -1) And (Path.IndexOf("://") <> -1) Then + Return Path + ElseIf (Path.IndexOf(".") <> -1) Then + ' "ttt.com.vn" format, it's possible for "LDAP://ttt.com.vn" format to access Authentication, however GC:// gives better performance + Return ConvertToDistinguished(Path) + Else + ' Invalid path, so we get root path from Active Directory + Return GetRootForestPath() + End If + 'End If + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function ConvertToDistinguished(ByVal Canonical As String, + Optional ByVal ADSIPath As Path = Path.GC) As String + Dim strDistinguished As String + + ' Clean up ADSI.Path to make sure we get a proper path + If Canonical.IndexOf("://") <> -1 Then + strDistinguished = Right(Canonical, Canonical.Length - (Canonical.IndexOf("://") + 3)) + Else + strDistinguished = Canonical + End If + + strDistinguished = Replace(strDistinguished, ".", ",DC=") + strDistinguished = "DC=" & strDistinguished + + If Canonical.IndexOf("://") <> -1 Then + strDistinguished = AddADSIPath(strDistinguished, ADSIPath) + End If + + Return strDistinguished + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function ConvertToCanonical(ByVal Distinguished As String, ByVal IncludeADSIPath As Boolean) _ + As String + Dim strCanonical As String = Distinguished + + If Not IncludeADSIPath AndAlso Distinguished.IndexOf("://") <> -1 Then + strCanonical = Right(Distinguished, Distinguished.Length - (Distinguished.IndexOf("://") + 3)) + End If + + strCanonical = Replace(strCanonical, "DC=", "") + strCanonical = Replace(strCanonical, "dc=", "") + strCanonical = Replace(strCanonical, "CN=", "") + strCanonical = Replace(strCanonical, "cn=", "") + strCanonical = Replace(strCanonical, ",", ".") + + Return strCanonical + + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function CheckNullString(ByVal value As Object) As String + If value Is Nothing Then + Return "" + Else + Return value.ToString + End If + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetRandomPassword() As String + Dim rd As New Random + Return Convert.ToString(rd.Next) + End Function + + ' See http://www.aspalliance.com/bbilbro/viewarticle.aspx?paged_article_id=4 + Public Shared Function ReplaceCaseInsensitive(ByVal text As String, ByVal oldValue As String, + ByVal newValue As String) As String + oldValue = GetCaseInsensitiveSearch(oldValue) + + Return Regex.Replace([text], oldValue, newValue) + + End Function + + 'ReplaceCaseInsensitive + + Shared Function GetCaseInsensitiveSearch(ByVal search As String) As String + Dim result As String = String.Empty + + Dim index As Integer + + For index = 0 To search.Length - 1 + Dim character As Char = search.Chars(index) + Dim characterLower As Char = Char.ToLower(character) + Dim characterUpper As Char = Char.ToUpper(character) + + If characterUpper = characterLower Then + result = result + character + Else + result = result + "[" + characterLower + characterUpper + "]" + End If + + Next index + Return result + End Function + + 'GetCaseInsensitiveSearch + + 'ACD-7422 - Role Synchronization Not Working On W2K Domain Controllers + 'By using TokenGroups it should work with W2K. + Public Shared Function GetADGroups(ByVal Name As String) As ArrayList + Dim user As DirectoryEntry = GetUserEntryByName(Name) + Dim irc As IdentityReferenceCollection = ExpandTokenGroups(user).Translate(GetType(NTAccount)) + Dim arrAccounts As New ArrayList + + For Each account As IdentityReference In irc + If (TypeOf account Is NTAccount) Then +#If DEBUG Then + Debug.Print("Account=" + account.Value) +#End If + 'arrAccounts.Add (account.Value) + 'Trim the leading Group Name off the group (i.e. Remove DOMAIN\ from DOMAIN\Group) + If InStr(account.Value, "\") Then + If Not (arrAccounts.Contains(account.Value.Substring(InStr(account.Value, "\")))) Then + arrAccounts.Add(account.Value.Substring(InStr(account.Value, "\"))) + End If + Else + arrAccounts.Add(account.Value) + End If + End If + Next + + Return arrAccounts + End Function + + Private Shared Function ExpandTokenGroups(ByVal user As DirectoryEntry) As IdentityReferenceCollection + user.RefreshCache(New String() {"tokenGroups"}) + + Dim irc As New IdentityReferenceCollection() + + For Each sidBytes As Byte() In user.Properties("tokenGroups") + irc.Add(New SecurityIdentifier(sidBytes, 0)) + Next + Return irc + End Function + + Public Shared Function GetIP4Address(ByVal strPassedIP As String) As String + Dim IP4Address As String = String.Empty + + For Each IPA As IPAddress In Dns.GetHostAddresses(strPassedIP) + If IPA.AddressFamily.ToString() = "InterNetwork" Then + IP4Address = IPA.ToString() + Exit For + End If + Next + + If IP4Address <> String.Empty Then + Return IP4Address + End If + + For Each IPA As IPAddress In Dns.GetHostAddresses(Dns.GetHostName()) + If IPA.AddressFamily.ToString() = "InterNetwork" Then + IP4Address = IPA.ToString() + Exit For + End If + Next + + Return IP4Address + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' Checks the trust level of the portal. + ''' + ''' + ''' + ''' + ''' [mhorton] 08/10/2008 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetCurrentTrustLevel() As AspNetHostingPermissionLevel + For Each trustLevel As AspNetHostingPermissionLevel In + New AspNetHostingPermissionLevel() _ + {AspNetHostingPermissionLevel.Unrestricted, AspNetHostingPermissionLevel.High, + AspNetHostingPermissionLevel.Medium, AspNetHostingPermissionLevel.Low, + AspNetHostingPermissionLevel.Minimal} + Try + Dim perm As New AspNetHostingPermission(trustLevel) + perm.Demand() + Catch generatedExceptionName As SecurityException + Continue For + End Try + + Return trustLevel + Next + + Return AspNetHostingPermissionLevel.None + End Function + + ''' ------------------------------------------------------------------- + ''' + ''' + ''' + ''' in multiple domains network that search result return more than one group with the same name (i.e Administrators) + ''' + ''' + ''' [tamttt] 08/01/2004 Created + ''' + ''' ------------------------------------------------------------------- + Public Shared Function GetGroupEntriesByName(ByVal GroupName As String) As ArrayList + Dim RootDomain As ADSI.Domain = GetRootDomain() + Dim objSearch As New Search(RootDomain) + + objSearch.AddFilter(Configuration.ADSI_CLASS, ADSI.CompareOperator.Is, ObjectClass.group.ToString) + objSearch.AddFilter(Configuration.ADSI_ACCOUNTNAME, ADSI.CompareOperator.Is, GroupName) + + Dim groupEntries As ArrayList = objSearch.GetEntries + + If Not groupEntries Is Nothing Then + Return groupEntries + Else + Return Nothing + End If + + End Function + + Public Shared Function AddEventLog(portalsettings As Portals.PortalSettings, description As String) As Boolean + objEventLog.AddLog("Description", description, portalsettings, -1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT) + End Function + + ''' + ''' Uses the byte data from active directory and writes an image file to the specified folder. Returns the FileID + ''' + ''' User object + ''' Byte array containing photo bytes + ''' + ''' [sawest] 12/16/2016 Created + ''' + Public Shared Function WritePhoto(ByVal objUserInfo As ADUserInfo, ByVal photo() As Byte) As String + + Dim _folderinfo As IFolderInfo + Dim _fileinfo As IFileInfo + + _folderinfo = FolderManager.Instance.GetUserFolder(objUserInfo) + + If Not _folderinfo Is Nothing Then + Using stream As New System.IO.MemoryStream(photo) + Dim fname As String = Replace(objUserInfo.Username, "\", "_") & "_profile_photo.jpg" + _fileinfo = FileManager.Instance.AddFile(_folderinfo, fname, stream) + stream.Close() + _folderinfo = Nothing + If Not _fileinfo Is Nothing Then + Return _fileinfo.FileId + Else + Return "" + End If + End Using + Else + Return "" + End If + End Function + End Class +End Namespace diff --git a/README.md b/README.md index 833cfeb..021bd21 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# DNN.ActiveDirectory -Active Directory authentication for DNN +# DNN.ActiveDirectory +Active Directory authentication for DNN diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 72dcb11..1b93ae3 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,42 +1,46 @@ -

DotNetNuke.Authentication.ActiveDirectory

-

- DotNetNuke®
- support@dotnetnuke.com
- http://www.dotnetnuke.com
-

-
-
-

About the DotNetNuke.Authentication.ActiveDirectory

-

- Version 6.0.0

-

-

This version of the provider requires DotNetNuke Core 7.0.0 or greater. - FYI: Developers should be aware that the provider uses Visual Studio 2010+ only.

- -

Bug Fixes

-
    Version 5.0.6 -
  • 8512: Settings not saved properly and two user accounts created.
  • -
  • 8571: Users not being logged into the correct portal when going to child portal.
  • -
-
    Version 6.0.0 -
  • Compatible with DNN 7, 8, and 9 -
-
    Version 6.0.2 -
  • Better UPN handling Issue #12 -
-

Features

-
    Version 6.0.0 -
  • Ability to sync AD thumbnail photo to profile pic in DNN portal.
  • -
-
    Version 6.0.2 -
  • Keyboard Enter elicits Login function Issue #13
  • -
-

- To run the provider under IIS 7.x in integrated mode two commands are needed to be run from a command prompt on the server. -

    -
  • %windir%\system32\inetsrv\appcmd unlock config /section:anonymousAuthentication
  • -
  • %windir%\system32\inetsrv\appcmd unlock config /section:windowsAuthentication
  • -
-

- +

DotNetNuke.Authentication.ActiveDirectory

+

+ DotNetNuke®
+ support@dotnetnuke.com
+ http://www.dotnetnuke.com
+

+
+
+

About the DotNetNuke.Authentication.ActiveDirectory

+

+ Version 6.0.0

+

+

This version of the provider requires DotNetNuke Core 7.0.0 or greater. + FYI: Developers should be aware that the provider uses Visual Studio 2010+ only.

+ +

Bug Fixes

+
    Version 5.0.6 +
  • 8512: Settings not saved properly and two user accounts created.
  • +
  • 8571: Users not being logged into the correct portal when going to child portal.
  • +
+
    Version 6.0.0 +
  • Compatible with DNN 7, 8, and 9 +
+
    Version 6.0.2 +
  • Better UPN handling Issue #12 +
+

Features

+
    Version 6.0.0 +
  • Ability to sync AD thumbnail photo to profile pic in DNN portal.
  • +
+
    Version 6.0.2 +
  • Keyboard Enter elicits Login function Issue #13
  • +
+
    Version 6.1.2 +
  • Fixed Issue: 47
  • +
  • Fixed Issue: 36
  • +
+

+ To run the provider under IIS 7.x in integrated mode two commands are needed to be run from a command prompt on the server. +

    +
  • %windir%\system32\inetsrv\appcmd unlock config /section:anonymousAuthentication
  • +
  • %windir%\system32\inetsrv\appcmd unlock config /section:windowsAuthentication
  • +
+

+
\ No newline at end of file diff --git a/Resources.zip b/Resources.zip index eebb61313b560b3fe0869cae70d9b61275621727..e00c305562329de861dcb54783d274cc6fdf2e6a 100644 GIT binary patch delta 29549 zcmZUaV{oQjv+wWNb}}(0nb z^Um+A!GHAA*DwK-wD}6=qI+mu@kpck)=Z@emH6*WsE}_?a zT?zZW0l|1sLFCDp?Fmm|#NY{j;3qzrltK(kHwYO!&JVX_c~7*-USaATKL&T;LFfH% zotIA+Xo%EBn0sX)DK72eME&i{8(ESOglT{<4bFDPfjx*)97i1N7`2qy>7x-T84aF^ z*!AaZF2DOe#tAHN2xf+CGXlfg^{1zg=00@-xX8qxqTqmTIzT2PCnV<*u_liaNFEzW z+rb4=p`b`kNZVLMJ;ooOe4Krtv|MWl*%$=$BUTQ50EHE;+$rK2ZX{Pr+#ro;9IJ8; zW9vxA2gTR+A%BZ=vw`;a(WF>a1h))Gd}WAm06rgw<_ zNB7HR$?@n_rXGz=Y=rTUg4_{i2%6~4UKP#ZHAHIhKk!NbR35%NzBMGE?v@17vLQzS zG7L6zse(SFw~hFOSwS#6rbJN^(o9MU`PZ2;?P@|h*h?IAr(Wlch*4M;l9ag6aih?2 zVa8%avwtB+;P%DYbKmUrmsx?gyD59XQlms}%NVvYwFrx}^4w5RIhI=OJuccp!V_)= zK$l8EQ+R|BGQ0&GFvM6fY15$P|L-Nq1@_cm!( zrM#y`ZNlqu1idIXY&+A{;k$n8ZZ>FO{Q%W^Ck$m;ONx2HD1t)$Li{q1G3>Bag+=g5tKfg>d3Zs@%YQVXw?+ zt4C&uo57!AD|RLEdXIx$Ohn8eciq>Z$HW4TcOLY?xeYepJ&nBTFQm<$qmlUmcX91j z1%vB6Df}BtnF5C`Hk#jm6tq0vuUnpN)A$yyUcE9$qffTfp7`eXX_rJUCG@?>9o*Hl zwmh?grt3#VxhL-6w=y*&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k`$6GSA_P2&K`yY+F(1#DJN82-$ zE$l&KNb-+{?F-N|{6|~$-vvX(6hXufv}nH@#ltl!_j?Er{-Z7YzuIjY|Ik)?{pSU& x!a<~u_jhPw_`?$T-~7>72nSKnJ^BXlFe&`Q?gIn!?BP%NVHY=c0zLfq{{Z6H;|l-) diff --git a/Settings.ascx b/Settings.ascx index 2167d03..bf5e6f0 100644 --- a/Settings.ascx +++ b/Settings.ascx @@ -1,89 +1,93 @@ -<%@ Control Language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.Authentication.ActiveDirectory.Settings, DotNetNuke.Authentication.ActiveDirectory" - Codebehind="Settings.ascx.vb" %> -<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
+<%@ Control Language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.Authentication.ActiveDirectory.Settings, DotNetNuke.Authentication.ActiveDirectory" + Codebehind="Settings.ascx.vb" %> +<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
diff --git a/Settings.ascx.designer.vb b/Settings.ascx.designer.vb index 3c4b3d6..d7429f9 100644 --- a/Settings.ascx.designer.vb +++ b/Settings.ascx.designer.vb @@ -1,467 +1,485 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Namespace DotNetNuke.Authentication.ActiveDirectory - - Partial Public Class Settings - - '''

- '''pnlError control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents pnlError As Global.System.Web.UI.WebControls.Panel - - ''' - '''Image1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Image1 As Global.System.Web.UI.WebControls.Image - - ''' - '''lblError control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents lblError As Global.System.Web.UI.WebControls.Label - - ''' - '''tblSettings control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents tblSettings As Global.System.Web.UI.HtmlControls.HtmlTable - - ''' - '''MessageCell control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents MessageCell As Global.System.Web.UI.HtmlControls.HtmlTableCell - - ''' - '''plAuthentication control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAuthentication As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAuthentication control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAuthentication As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plHidden control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plHidden As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkHidden control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkHidden As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plSynchronizeRole control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSynchronizeRole As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkSynchronizeRole control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkSynchronizeRole As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plSynchronizePhoto control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSynchronizePhoto As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkSynchronizePhoto control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkSynchronizePhoto As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''rowSynchornizePassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowSynchornizePassword As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plSynchornizePassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSynchornizePassword As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkSynchronizePassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkSynchronizePassword As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''rowAutoCreate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowAutoCreate As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plAutoCreate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAutoCreate As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkAutoCreate control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkAutoCreate As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plStripDomainName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plStripDomainName As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''chkStripDomainName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents chkStripDomainName As Global.System.Web.UI.WebControls.CheckBox - - ''' - '''plProvider control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plProvider As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cboProviders control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cboProviders As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''plAuthenticationType control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAuthenticationType As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''cboAuthenticationType control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents cboAuthenticationType As Global.System.Web.UI.WebControls.DropDownList - - ''' - '''rowRootDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowRootDomain As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plRootDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plRootDomain As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtRootDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtRootDomain As Global.System.Web.UI.WebControls.TextBox - - ''' - '''rowUserName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowUserName As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plUserName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plUserName As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtUserName control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtUserName As Global.System.Web.UI.WebControls.TextBox - - ''' - '''rowPassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowPassword As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plPassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plPassword As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtPassword control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtPassword As Global.System.Web.UI.WebControls.TextBox - - ''' - '''rowConfirm control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowConfirm As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plConfirm control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plConfirm As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtConfirm control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtConfirm As Global.System.Web.UI.WebControls.TextBox - - ''' - '''valConfirm control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents valConfirm As Global.System.Web.UI.WebControls.CompareValidator - - ''' - '''rowEmailDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowEmailDomain As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plEmailDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plEmailDomain As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtEmailDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtEmailDomain As Global.System.Web.UI.WebControls.TextBox - - ''' - '''rowDefaultDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowDefaultDomain As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plDefaultDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plDefaultDomain As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtDefaultDomain control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtDefaultDomain As Global.System.Web.UI.WebControls.TextBox - - ''' - '''rowSubNet control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowSubNet As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plAutoIP control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plAutoIP As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtAutoIP control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtAutoIP As Global.System.Web.UI.WebControls.TextBox - - ''' - '''rowBots control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents rowBots As Global.System.Web.UI.HtmlControls.HtmlTableRow - - ''' - '''plBots control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plBots As Global.DotNetNuke.UI.UserControls.LabelControl - - ''' - '''txtBots control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents txtBots As Global.System.Web.UI.WebControls.TextBox - End Class -End Namespace +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Namespace DotNetNuke.Authentication.ActiveDirectory + + Partial Public Class Settings + + ''' + '''pnlError control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents pnlError As Global.System.Web.UI.WebControls.Panel + + ''' + '''Image1 control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents Image1 As Global.System.Web.UI.WebControls.Image + + ''' + '''lblError control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents lblError As Global.System.Web.UI.WebControls.Label + + ''' + '''tblSettings control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents tblSettings As Global.System.Web.UI.HtmlControls.HtmlTable + + ''' + '''MessageCell control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents MessageCell As Global.System.Web.UI.HtmlControls.HtmlTableCell + + ''' + '''plAuthentication control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plAuthentication As Global.System.Web.UI.UserControl + + ''' + '''chkAuthentication control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkAuthentication As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''plHidden control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plHidden As Global.System.Web.UI.UserControl + + ''' + '''chkHidden control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkHidden As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''plSynchronizeRole control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plSynchronizeRole As Global.System.Web.UI.UserControl + + ''' + '''chkSynchronizeRole control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkSynchronizeRole As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''plSynchronizePhoto control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plSynchronizePhoto As Global.System.Web.UI.UserControl + + ''' + '''chkSynchronizePhoto control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkSynchronizePhoto As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''plAutoLogin control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plAutoLogin As Global.System.Web.UI.UserControl + + ''' + '''chkAutoLogin control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkAutoLogin As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''rowSynchornizePassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowSynchornizePassword As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plSynchornizePassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plSynchornizePassword As Global.System.Web.UI.UserControl + + ''' + '''chkSynchronizePassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkSynchronizePassword As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''rowAutoCreate control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowAutoCreate As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plAutoCreate control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plAutoCreate As Global.System.Web.UI.UserControl + + ''' + '''chkAutoCreate control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkAutoCreate As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''plStripDomainName control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plStripDomainName As Global.System.Web.UI.UserControl + + ''' + '''chkStripDomainName control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents chkStripDomainName As Global.System.Web.UI.WebControls.CheckBox + + ''' + '''plProvider control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plProvider As Global.System.Web.UI.UserControl + + ''' + '''cboProviders control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents cboProviders As Global.System.Web.UI.WebControls.DropDownList + + ''' + '''plAuthenticationType control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plAuthenticationType As Global.System.Web.UI.UserControl + + ''' + '''cboAuthenticationType control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents cboAuthenticationType As Global.System.Web.UI.WebControls.DropDownList + + ''' + '''rowRootDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowRootDomain As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plRootDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plRootDomain As Global.System.Web.UI.UserControl + + ''' + '''txtRootDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtRootDomain As Global.System.Web.UI.WebControls.TextBox + + ''' + '''rowUserName control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowUserName As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plUserName control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plUserName As Global.System.Web.UI.UserControl + + ''' + '''txtUserName control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtUserName As Global.System.Web.UI.WebControls.TextBox + + ''' + '''rowPassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowPassword As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plPassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plPassword As Global.System.Web.UI.UserControl + + ''' + '''txtPassword control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtPassword As Global.System.Web.UI.WebControls.TextBox + + ''' + '''rowConfirm control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowConfirm As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plConfirm control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plConfirm As Global.System.Web.UI.UserControl + + ''' + '''txtConfirm control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtConfirm As Global.System.Web.UI.WebControls.TextBox + + ''' + '''valConfirm control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents valConfirm As Global.System.Web.UI.WebControls.CompareValidator + + ''' + '''rowEmailDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowEmailDomain As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plEmailDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plEmailDomain As Global.System.Web.UI.UserControl + + ''' + '''txtEmailDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtEmailDomain As Global.System.Web.UI.WebControls.TextBox + + ''' + '''rowDefaultDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowDefaultDomain As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plDefaultDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plDefaultDomain As Global.System.Web.UI.UserControl + + ''' + '''txtDefaultDomain control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtDefaultDomain As Global.System.Web.UI.WebControls.TextBox + + ''' + '''rowSubNet control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowSubNet As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plAutoIP control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plAutoIP As Global.System.Web.UI.UserControl + + ''' + '''txtAutoIP control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtAutoIP As Global.System.Web.UI.WebControls.TextBox + + ''' + '''rowBots control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents rowBots As Global.System.Web.UI.HtmlControls.HtmlTableRow + + ''' + '''plBots control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plBots As Global.System.Web.UI.UserControl + + ''' + '''txtBots control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents txtBots As Global.System.Web.UI.WebControls.TextBox + End Class +End Namespace diff --git a/Settings.ascx.vb b/Settings.ascx.vb index ab0ac55..ab1924b 100644 --- a/Settings.ascx.vb +++ b/Settings.ascx.vb @@ -1,289 +1,289 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.UI.Skins.Controls -Imports DotNetNuke.Authentication.ActiveDirectory.ADSI -Imports DotNetNuke.Services.Authentication -Imports DotNetNuke.Entities.Portals -Imports DotNetNuke.Framework.Providers - - -Namespace DotNetNuke.Authentication.ActiveDirectory - Partial Class Settings - Inherits AuthenticationSettingsBase - -#Region "Private Members" - - Private _strError As String = Null.NullString - -#End Region - -#Region "Private Methods" - - Private Sub DisplayIpError(ByVal strInvalidIP As String) - Dim _ - strError As String = strInvalidIP & " " & - Localization.GetString("InValidIPAddress", Me.LocalResourceFile) - tblSettings.Visible = True - pnlError.Visible = True - lblError.Text = strError - End Sub - - Private Function GetUserDomainName(ByVal UserName As String) As String - Dim strReturn As String = "" - If UserName.IndexOf("\") > 0 Then - strReturn = Left(UserName, (UserName.IndexOf("\"))) - End If - Return strReturn - End Function - - Private Function LocalizedStatus(ByVal InputText As String) As String - 'Return InputText - Dim strReturn As String = InputText - strReturn = - strReturn.Replace("[Global Catalog Status]", - Localization.GetString("[Global Catalog Status]", Me.LocalResourceFile)) - strReturn = - strReturn.Replace("[Root Domain Status]", - Localization.GetString("[Root Domain Status]", Me.LocalResourceFile)) - strReturn = - strReturn.Replace("[LDAP Status]", Localization.GetString("[LDAP Status]", Me.LocalResourceFile)) - strReturn = - strReturn.Replace("[Network Domains Status]", - Localization.GetString("[Network Domains Status]", Me.LocalResourceFile)) - strReturn = - strReturn.Replace("[LDAP Error Message]", - Localization.GetString("[LDAP Error Message]", Me.LocalResourceFile)) - strReturn = strReturn.Replace("OK", Localization.GetString("OK", Me.LocalResourceFile)) - strReturn = strReturn.Replace("FAIL", Localization.GetString("FAIL", Me.LocalResourceFile)) - ' - Return strReturn - - End Function - - Private Function CheckEnteredIPAddr() As Boolean - If Right(Me.txtAutoIP.Text, 1) = ";" Then - Me.txtAutoIP.Text = Left(Me.txtAutoIP.Text, Me.txtAutoIP.Text.Length - 1) - End If - Dim arrIPArray As New ArrayList - Dim arrAutoIP() = Me.txtAutoIP.Text.Split(";") - For intCount As Integer = 0 To arrAutoIP.Length - 1 - Dim strAutoIP As String = arrAutoIP(intCount) - Dim intFullIPAddr As Integer = 0 - If (InStr(strAutoIP, "-")) Then - Dim arrIPRange() = strAutoIP.Split("-") - For intIPCount As Integer = 0 To arrIPRange.Length - 1 - intFullIPAddr = arrIPRange(intIPCount).ToString.Split(".").GetUpperBound(0) - Select Case intFullIPAddr - Case 3 - arrIPArray.Add(arrIPRange(intIPCount).ToString) - Case Else - DisplayIpError(arrIPRange(intIPCount).ToString) - Return False - 'Exit Function - End Select - Next - Else - intFullIPAddr = arrAutoIP(intCount).ToString.Split(".").GetUpperBound(0) - Select Case intFullIPAddr - Case 3 - arrIPArray.Add(arrAutoIP(intCount).ToString) - Case Else - DisplayIpError(arrAutoIP(intCount).ToString) - Return False - 'Exit Function - End Select - End If - Next - For intIPCheck As Integer = 0 To arrIPArray.Count - 1 - Try - Dim strIPAddr As String = Utilities.GetIP4Address(arrIPArray(intIPCheck)) - Catch ex As Exception - DisplayIpError(arrIPArray(intIPCheck)) - Return False - 'Exit Function - End Try - Next - Return True - End Function - -#End Region - -#Region "Public Methods" - - Public Overrides Sub UpdateSettings() - Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings) - Try - - 'Code Cleanup - If Not chkAuthentication.Checked Then - Configuration.UpdateConfig(_portalSettings.PortalId, False, False, "", "", "", "", False, False, - False, "", "", "", "", False, "", False) - Configuration.ResetConfig() - Else - Dim providerTypeName As String = cboProviders.SelectedItem.Value - Dim authenticationType As String = cboAuthenticationType.SelectedItem.Value - If Not (txtAutoIP.Text = String.Empty) Then - If Not (CheckEnteredIPAddr()) Then - Exit Sub - End If - End If - 'ACD-5585 - 'WorkItems 4766 and 4077 - If chkAuthentication.Checked And Not chkHidden.Checked Then - Configuration.UpdateConfig(_portalSettings.PortalId, chkAuthentication.Checked, - chkHidden.Checked, - txtRootDomain.Text, txtEmailDomain.Text, txtUserName.Text, - txtPassword.Text, chkSynchronizeRole.Checked, - chkSynchronizePassword.Checked, chkStripDomainName.Checked, - providerTypeName, authenticationType, txtAutoIP.Text, - txtDefaultDomain.Text, chkAutoCreate.Checked, txtBots.Text, chkSynchronizePhoto.Checked) - Else - Configuration.UpdateConfig(_portalSettings.PortalId, False, chkHidden.Checked, - txtRootDomain.Text, txtEmailDomain.Text, - txtUserName.Text, txtPassword.Text, chkSynchronizeRole.Checked, - chkSynchronizePassword.Checked, - chkStripDomainName.Checked, providerTypeName, authenticationType, - txtAutoIP.Text, txtDefaultDomain.Text, chkAutoCreate.Checked, txtBots.Text, chkSynchronizePhoto.Checked) - End If - Configuration.ResetConfig() - Dim objAuthenticationController As New AuthenticationController - Dim statusMessage As String = objAuthenticationController.NetworkStatus - If statusMessage.ToLower.IndexOf("fail") > -1 Then - MessageCell.Controls.Add(Skins.Skin.GetModuleMessageControl("", LocalizedStatus( - statusMessage), - ModuleMessage. - ModuleMessageType _ - .RedError)) - Else - MessageCell.Controls.Add(Skins.Skin.GetModuleMessageControl("", LocalizedStatus( - statusMessage), - ModuleMessage. - ModuleMessageType _ - .GreenSuccess)) - End If - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - -#Region "Event Handlers" - - Private Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init - Dim objAuthenticationController As New AuthenticationController - Dim _ - objProviderConfiguration As ProviderConfiguration = - ProviderConfiguration.GetProviderConfiguration(Configuration.AUTHENTICATION_KEY) - Dim _Provider As Object - ' Bind Authentication provider list, this allows each portal could use different provider for authentication - For Each _Provider In objProviderConfiguration.Providers - Dim objProvider As DictionaryEntry = CType(_Provider, DictionaryEntry) - Dim ProviderName As String = CType(objProvider.Key, String) - Dim ProviderType As String = CType(objProvider.Value, Provider).Type - - Me.cboProviders.Items.Add(New ListItem(ProviderName, ProviderType)) - Next - - ' Bind AuthenticationTypes list, on first configure, it could obtains only from default authentication provider - Try - Me.cboAuthenticationType.DataSource = objAuthenticationController.AuthenticationTypes - Catch exc As TypeInitializationException - _strError = Localization.GetString("AuthProviderError", Me.LocalResourceFile) - End Try - Me.cboAuthenticationType.DataBind() - End Sub - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load - 'Put user code to initialize the page here - Try - 'ACD-8217 - 'Test for Full Trust - Dim permission As AspNetHostingPermissionLevel = Utilities.GetCurrentTrustLevel() - If Not (permission = AspNetHostingPermissionLevel.Unrestricted) Then - Response.Redirect("~/DesktopModules/AuthenticationServices/ActiveDirectory/trusterror.htm", True) - Else - ' Obtain PortalSettings from Current Context - Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings - - ' Reset config - Configuration.ResetConfig() - Dim config As Configuration = Configuration.GetConfig() - - If UserInfo.Username.IndexOf("\") > 0 Then - Dim strDomain As String = GetUserDomainName(UserInfo.Username) - If strDomain.ToLower = Request.ServerVariables("SERVER_NAME").ToLower Then - _strError = - String.Format(Localization.GetString("SameDomainError", Me.LocalResourceFile), - strDomain, - HttpUtility.HtmlEncode(Request.ServerVariables("SERVER_NAME"))) - End If - End If - - If Not Page.IsPostBack Then - - chkAuthentication.Checked = config.WindowsAuthentication - chkHidden.Checked = config.HideWindowsLogin - If chkHidden.Checked Then - chkAuthentication.Checked = True - End If - chkSynchronizeRole.Checked = config.SynchronizeRole - chkSynchronizePhoto.Checked = config.Photo - chkSynchronizePassword.Checked = config.SynchronizePassword - chkStripDomainName.Checked = config.StripDomainName - txtRootDomain.Text = config.RootDomain - txtUserName.Text = config.UserName - txtEmailDomain.Text = config.EmailDomain - txtAutoIP.Text = config.AutoIP - 'ACD-5585 - txtDefaultDomain.Text = config.DefaultDomain - 'ACD-4259 - chkAutoCreate.Checked = config.AutoCreateUsers - 'WorkItems 4766 and 4077 - txtBots.Text = config.Bots - If (txtBots.Text = "") Then - txtBots.Text = "gsa-crawler;MS Search 5.0 Robot" - End If - - Me.cboAuthenticationType.Items.FindByText(config.AuthenticationType).Selected = True - - End If - - valConfirm.ErrorMessage = Localization.GetString("PasswordMatchFailure", Me.LocalResourceFile) - - If String.IsNullOrEmpty(_strError) Then - tblSettings.Visible = True - pnlError.Visible = False - Else - tblSettings.Visible = False - pnlError.Visible = True - lblError.Text = _strError - End If - End If - Catch exc As Exception 'Module failed to load - ProcessModuleLoadException(Me, exc) - End Try - End Sub - -#End Region - End Class -End Namespace +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + +Imports DotNetNuke.UI.Skins.Controls +Imports DotNetNuke.Authentication.ActiveDirectory.ADSI +Imports DotNetNuke.Services.Authentication +Imports DotNetNuke.Entities.Portals +Imports DotNetNuke.Framework.Providers + + +Namespace DotNetNuke.Authentication.ActiveDirectory + Partial Class Settings + Inherits AuthenticationSettingsBase + +#Region "Private Members" + + Private _strError As String = Null.NullString + +#End Region + +#Region "Private Methods" + + Private Sub DisplayIpError(ByVal strInvalidIP As String) + Dim _ + strError As String = strInvalidIP & " " & + Localization.GetString("InValidIPAddress", Me.LocalResourceFile) + tblSettings.Visible = True + pnlError.Visible = True + lblError.Text = strError + End Sub + + Private Function GetUserDomainName(ByVal UserName As String) As String + Dim strReturn As String = "" + If UserName.IndexOf("\") > 0 Then + strReturn = Left(UserName, (UserName.IndexOf("\"))) + End If + Return strReturn + End Function + + Private Function LocalizedStatus(ByVal InputText As String) As String + 'Return InputText + Dim strReturn As String = InputText + strReturn = + strReturn.Replace("[Global Catalog Status]", + Localization.GetString("[Global Catalog Status]", Me.LocalResourceFile)) + strReturn = + strReturn.Replace("[Root Domain Status]", + Localization.GetString("[Root Domain Status]", Me.LocalResourceFile)) + strReturn = + strReturn.Replace("[LDAP Status]", Localization.GetString("[LDAP Status]", Me.LocalResourceFile)) + strReturn = + strReturn.Replace("[Network Domains Status]", + Localization.GetString("[Network Domains Status]", Me.LocalResourceFile)) + strReturn = + strReturn.Replace("[LDAP Error Message]", + Localization.GetString("[LDAP Error Message]", Me.LocalResourceFile)) + strReturn = strReturn.Replace("OK", Localization.GetString("OK", Me.LocalResourceFile)) + strReturn = strReturn.Replace("FAIL", Localization.GetString("FAIL", Me.LocalResourceFile)) + ' + Return strReturn + + End Function + + Private Function CheckEnteredIPAddr() As Boolean + If Right(Me.txtAutoIP.Text, 1) = ";" Then + Me.txtAutoIP.Text = Left(Me.txtAutoIP.Text, Me.txtAutoIP.Text.Length - 1) + End If + Dim arrIPArray As New ArrayList + Dim arrAutoIP() = Me.txtAutoIP.Text.Split(";") + For intCount As Integer = 0 To arrAutoIP.Length - 1 + Dim strAutoIP As String = arrAutoIP(intCount) + Dim intFullIPAddr As Integer = 0 + If (InStr(strAutoIP, "-")) Then + Dim arrIPRange() = strAutoIP.Split("-") + For intIPCount As Integer = 0 To arrIPRange.Length - 1 + intFullIPAddr = arrIPRange(intIPCount).ToString.Split(".").GetUpperBound(0) + Select Case intFullIPAddr + Case 3 + arrIPArray.Add(arrIPRange(intIPCount).ToString) + Case Else + DisplayIpError(arrIPRange(intIPCount).ToString) + Return False + 'Exit Function + End Select + Next + Else + intFullIPAddr = arrAutoIP(intCount).ToString.Split(".").GetUpperBound(0) + Select Case intFullIPAddr + Case 3 + arrIPArray.Add(arrAutoIP(intCount).ToString) + Case Else + DisplayIpError(arrAutoIP(intCount).ToString) + Return False + 'Exit Function + End Select + End If + Next + For intIPCheck As Integer = 0 To arrIPArray.Count - 1 + Try + Dim strIPAddr As String = Utilities.GetIP4Address(arrIPArray(intIPCheck)) + Catch ex As Exception + DisplayIpError(arrIPArray(intIPCheck)) + Return False + 'Exit Function + End Try + Next + Return True + End Function + +#End Region + +#Region "Public Methods" + + Public Overrides Sub UpdateSettings() + Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings) + Try + + 'Code Cleanup + If Not chkAuthentication.Checked Then + Configuration.UpdateConfig(_portalSettings.PortalId, False, False, "", "", "", "", False, False, + False, "", "", "", "", False, "", False, False) + Configuration.ResetConfig() + Else + Dim providerTypeName As String = cboProviders.SelectedItem.Value + Dim authenticationType As String = cboAuthenticationType.SelectedItem.Value + If Not (txtAutoIP.Text = String.Empty) Then + If Not (CheckEnteredIPAddr()) Then + Exit Sub + End If + End If + 'ACD-5585 + 'WorkItems 4766 and 4077 + If chkAuthentication.Checked And Not chkHidden.Checked Then + Configuration.UpdateConfig(_portalSettings.PortalId, chkAuthentication.Checked, + chkHidden.Checked, + txtRootDomain.Text, txtEmailDomain.Text, txtUserName.Text, + txtPassword.Text, chkSynchronizeRole.Checked, + chkSynchronizePassword.Checked, chkStripDomainName.Checked, + providerTypeName, authenticationType, txtAutoIP.Text, + txtDefaultDomain.Text, chkAutoCreate.Checked, txtBots.Text, chkSynchronizePhoto.Checked, chkAutoLogin.Checked) + Else + Configuration.UpdateConfig(_portalSettings.PortalId, False, chkHidden.Checked, + txtRootDomain.Text, txtEmailDomain.Text, + txtUserName.Text, txtPassword.Text, chkSynchronizeRole.Checked, + chkSynchronizePassword.Checked, + chkStripDomainName.Checked, providerTypeName, authenticationType, + txtAutoIP.Text, txtDefaultDomain.Text, chkAutoCreate.Checked, txtBots.Text, chkSynchronizePhoto.Checked, chkAutoLogin.Checked) + End If + Configuration.ResetConfig() + Dim objAuthenticationController As New AuthenticationController + Dim statusMessage As String = objAuthenticationController.NetworkStatus + If statusMessage.ToLower.IndexOf("fail") > -1 Then + MessageCell.Controls.Add(Skins.Skin.GetModuleMessageControl("", LocalizedStatus( + statusMessage), + ModuleMessage. + ModuleMessageType _ + .RedError)) + Else + MessageCell.Controls.Add(Skins.Skin.GetModuleMessageControl("", LocalizedStatus( + statusMessage), + ModuleMessage. + ModuleMessageType _ + .GreenSuccess)) + End If + End If + Catch exc As Exception 'Module failed to load + ProcessModuleLoadException(Me, exc) + End Try + End Sub + +#End Region + +#Region "Event Handlers" + + Private Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init + Dim objAuthenticationController As New AuthenticationController + Dim _ + objProviderConfiguration As ProviderConfiguration = + ProviderConfiguration.GetProviderConfiguration(Configuration.AUTHENTICATION_KEY) + Dim _Provider As Object + ' Bind Authentication provider list, this allows each portal could use different provider for authentication + For Each _Provider In objProviderConfiguration.Providers + Dim objProvider As DictionaryEntry = CType(_Provider, DictionaryEntry) + Dim ProviderName As String = CType(objProvider.Key, String) + Dim ProviderType As String = CType(objProvider.Value, Provider).Type + + Me.cboProviders.Items.Add(New ListItem(ProviderName, ProviderType)) + Next + + ' Bind AuthenticationTypes list, on first configure, it could obtains only from default authentication provider + Try + Me.cboAuthenticationType.DataSource = objAuthenticationController.AuthenticationTypes + Catch exc As TypeInitializationException + _strError = Localization.GetString("AuthProviderError", Me.LocalResourceFile) + End Try + Me.cboAuthenticationType.DataBind() + End Sub + + Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + 'Put user code to initialize the page here + Try + 'ACD-8217 + 'Test for Full Trust + Dim permission As AspNetHostingPermissionLevel = Utilities.GetCurrentTrustLevel() + If Not (permission = AspNetHostingPermissionLevel.Unrestricted) Then + Response.Redirect("~/DesktopModules/AuthenticationServices/ActiveDirectory/trusterror.htm", True) + Else + ' Obtain PortalSettings from Current Context + Dim _portalSettings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings + + ' Reset config + Configuration.ResetConfig() + Dim config As Configuration = Configuration.GetConfig() + + If UserInfo.Username.IndexOf("\") > 0 Then + Dim strDomain As String = GetUserDomainName(UserInfo.Username) + If strDomain.ToLower = Request.ServerVariables("SERVER_NAME").ToLower Then + _strError = + String.Format(Localization.GetString("SameDomainError", Me.LocalResourceFile), + strDomain, + HttpUtility.HtmlEncode(Request.ServerVariables("SERVER_NAME"))) + End If + End If + + If Not Page.IsPostBack Then + + chkAuthentication.Checked = config.WindowsAuthentication + chkHidden.Checked = config.HideWindowsLogin + If chkHidden.Checked Then + chkAuthentication.Checked = True + End If + chkSynchronizeRole.Checked = config.SynchronizeRole + chkSynchronizePhoto.Checked = config.Photo + chkSynchronizePassword.Checked = config.SynchronizePassword + chkStripDomainName.Checked = config.StripDomainName + txtRootDomain.Text = config.RootDomain + txtUserName.Text = config.UserName + txtEmailDomain.Text = config.EmailDomain + txtAutoIP.Text = config.AutoIP + 'ACD-5585 + txtDefaultDomain.Text = config.DefaultDomain + 'ACD-4259 + chkAutoCreate.Checked = config.AutoCreateUsers + 'WorkItems 4766 and 4077 + txtBots.Text = config.Bots + If (txtBots.Text = "") Then + txtBots.Text = "gsa-crawler;MS Search 5.0 Robot" + End If + + Me.cboAuthenticationType.Items.FindByText(config.AuthenticationType).Selected = True + + End If + + valConfirm.ErrorMessage = Localization.GetString("PasswordMatchFailure", Me.LocalResourceFile) + + If String.IsNullOrEmpty(_strError) Then + tblSettings.Visible = True + pnlError.Visible = False + Else + tblSettings.Visible = False + pnlError.Visible = True + lblError.Text = _strError + End If + End If + Catch exc As Exception 'Module failed to load + ProcessModuleLoadException(Me, exc) + End Try + End Sub + +#End Region + End Class +End Namespace diff --git a/TestCases.txt b/TestCases.txt index 6a5f446..7e43e1e 100644 --- a/TestCases.txt +++ b/TestCases.txt @@ -1,61 +1,61 @@ -Medium Trust -============ - -1. Portal should not run under Medium Trust with Active Directory Provider installed. - - Install Active Directory provider - - Enable Medium Trust - - Portal should be redirected to Error page - - -Full Trust -========== - -1. Configure Basic ActiveDirectory Settings - - Set web.config to Full Trust - - Log in as an Administrator or SuperUser - - Goto Admin/Authentication - - Check Enabled to Enable Active Directory - - Enter Root Domain information (eg: dc=domain,dc=com) - - Enter valid AD user (eg:domain\username) - - Enter AD user password and comfirm password - - Enter AD domain email (eg: @domain.com) - - Click "Update" - - Logout - - Goto Login page - - Active Directory "login control" should be displayed - -2. Enable ActiveDirectory Full Authentication - - Set web.config to Full Trust - - Log in as an Administrator or SuperUser - - Goto Admin/Authentication - - Check Enabled to Enable Active Directory - - Enter Root Domain information (eg: dc=domain,dc=com) - - Enter valid AD user (eg:domain\username) - - Enter AD user password and comfirm password - - Enter AD domain email (eg: @domain.com) - - Click "Update" - - Logout and Close DNN - - Restart ASPNet process or IIS Application pool - - Launch DNN - - Verify that your currently logged in domain account automatically logs into DNN - -3. Enable ActiveDirectory Mixed-Mode Authentication - - Set web.config to Full Trust - - Log in as an Administrator or SuperUser - - Goto Admin/Authentication - - Check Enabled to Enable Active Directory - - Enter Root Domain information (eg: dc=domain,dc=com) - - Enter valid AD user (eg:domain\username) - - Enter AD user password and comfirm password - - Enter AD domain email (eg: @domain.com) - - Click "Update" - - Logout and Close DNN - - Edit web.config and comment out in section - - Restart ASPNet process or IIS Application pool - - Launch DNN - - Goto Login page - - Verify that you can log into Windows Login section with your domain credentials - - - +Medium Trust +============ + +1. Portal should not run under Medium Trust with Active Directory Provider installed. + - Install Active Directory provider + - Enable Medium Trust + - Portal should be redirected to Error page + + +Full Trust +========== + +1. Configure Basic ActiveDirectory Settings + - Set web.config to Full Trust + - Log in as an Administrator or SuperUser + - Goto Admin/Authentication + - Check Enabled to Enable Active Directory + - Enter Root Domain information (eg: dc=domain,dc=com) + - Enter valid AD user (eg:domain\username) + - Enter AD user password and comfirm password + - Enter AD domain email (eg: @domain.com) + - Click "Update" + - Logout + - Goto Login page + - Active Directory "login control" should be displayed + +2. Enable ActiveDirectory Full Authentication + - Set web.config to Full Trust + - Log in as an Administrator or SuperUser + - Goto Admin/Authentication + - Check Enabled to Enable Active Directory + - Enter Root Domain information (eg: dc=domain,dc=com) + - Enter valid AD user (eg:domain\username) + - Enter AD user password and comfirm password + - Enter AD domain email (eg: @domain.com) + - Click "Update" + - Logout and Close DNN + - Restart ASPNet process or IIS Application pool + - Launch DNN + - Verify that your currently logged in domain account automatically logs into DNN + +3. Enable ActiveDirectory Mixed-Mode Authentication + - Set web.config to Full Trust + - Log in as an Administrator or SuperUser + - Goto Admin/Authentication + - Check Enabled to Enable Active Directory + - Enter Root Domain information (eg: dc=domain,dc=com) + - Enter valid AD user (eg:domain\username) + - Enter AD user password and comfirm password + - Enter AD domain email (eg: @domain.com) + - Click "Update" + - Logout and Close DNN + - Edit web.config and comment out in section + - Restart ASPNet process or IIS Application pool + - Launch DNN + - Goto Login page + - Verify that you can log into Windows Login section with your domain credentials + + + \ No newline at end of file diff --git a/WindowsSignin.aspx b/WindowsSignin.aspx index 8ed2246..817c7f9 100644 --- a/WindowsSignin.aspx +++ b/WindowsSignin.aspx @@ -1,5 +1,5 @@ -<%@ Page Language="vb" AutoEventWireup="false" Inherits="DotNetNuke.Authentication.ActiveDirectory.WindowsSignin, DotNetNuke.Authentication.ActiveDirectory" Codebehind="WindowsSignin.aspx.vb" %> -

- - -

+<%@ Page Language="vb" AutoEventWireup="false" Inherits="DotNetNuke.Authentication.ActiveDirectory.WindowsSignin, DotNetNuke.Authentication.ActiveDirectory" Codebehind="WindowsSignin.aspx.vb" %> +

+ + +

diff --git a/WindowsSignin.aspx.designer.vb b/WindowsSignin.aspx.designer.vb index ec912b9..5d089cc 100644 --- a/WindowsSignin.aspx.designer.vb +++ b/WindowsSignin.aspx.designer.vb @@ -1,43 +1,43 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.832 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict Off -Option Explicit On - - -Namespace DotNetNuke.Authentication.ActiveDirectory - - ''' - '''WindowsSignin class. - ''' - ''' - '''Auto-generated class. - ''' - Partial Public Class WindowsSignin - - ''' - '''plSetIIS control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plSetIIS As Global.System.Web.UI.HtmlControls.HtmlGenericControl - - ''' - '''plNoAuthentication control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents plNoAuthentication As Global.System.Web.UI.HtmlControls.HtmlGenericControl - End Class -End Namespace +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.832 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict Off +Option Explicit On + + +Namespace DotNetNuke.Authentication.ActiveDirectory + + ''' + '''WindowsSignin class. + ''' + ''' + '''Auto-generated class. + ''' + Partial Public Class WindowsSignin + + ''' + '''plSetIIS control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plSetIIS As Global.System.Web.UI.HtmlControls.HtmlGenericControl + + ''' + '''plNoAuthentication control. + ''' + ''' + '''Auto-generated field. + '''To modify move field declaration from designer file to code-behind file. + ''' + Protected WithEvents plNoAuthentication As Global.System.Web.UI.HtmlControls.HtmlGenericControl + End Class +End Namespace diff --git a/WindowsSignin.aspx.vb b/WindowsSignin.aspx.vb index a8d20c5..13dcfaa 100644 --- a/WindowsSignin.aspx.vb +++ b/WindowsSignin.aspx.vb @@ -1,65 +1,65 @@ -' -' DotNetNuke® - http://www.dotnetnuke.com -' Copyright (c) 2002-2013 -' by DotNetNuke Corporation -' -' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -' documentation files (the "Software"), to deal in the Software without restriction, including without limitation -' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -' to permit persons to whom the Software is furnished to do so, subject to the following conditions: -' -' The above copyright notice and this permission notice shall be included in all copies or substantial portions -' of the Software. -' -' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -' DEALINGS IN THE SOFTWARE. -' - -Imports DotNetNuke.Entities.Portals - -Namespace DotNetNuke.Authentication.ActiveDirectory - Partial Class WindowsSignin - Inherits Page - -#Region " Web Form Designer Generated Code " - - 'This call is required by the Web Form Designer. - _ - Private Sub InitializeComponent() - - End Sub - - 'NOTE: The following placeholder declaration is required by the Web Form Designer. - 'Do not delete or move it. - Private designerPlaceholderDeclaration As Object - - Private Sub Page_Init (ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Init - 'CODEGEN: This method call is required by the Web Form Designer - 'Do not modify it using the code editor. - InitializeComponent() - - If Request.ServerVariables("LOGON_USER").Length > 0 Then - Dim objAuthentication As New AuthenticationController - ' Reset config - Configuration.ResetConfig() - Dim config As Configuration = Configuration.GetConfig() - If (config.WindowsAuthentication Or config.HideWindowsLogin) Then - objAuthentication.AuthenticationLogon() - Else - Me.plNoAuthentication.Visible = True - Me.plSetIIS.Visible = False - End If - End If - - End Sub - -#End Region - - Private Sub Page_Load (ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load - 'Put user code to initialize the page here - End Sub - End Class +' +' DotNetNuke® - http://www.dotnetnuke.com +' Copyright (c) 2002-2013 +' by DotNetNuke Corporation +' +' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +' documentation files (the "Software"), to deal in the Software without restriction, including without limitation +' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +' to permit persons to whom the Software is furnished to do so, subject to the following conditions: +' +' The above copyright notice and this permission notice shall be included in all copies or substantial portions +' of the Software. +' +' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +' DEALINGS IN THE SOFTWARE. +' + +Imports DotNetNuke.Entities.Portals + +Namespace DotNetNuke.Authentication.ActiveDirectory + Partial Class WindowsSignin + Inherits Page + +#Region " Web Form Designer Generated Code " + + 'This call is required by the Web Form Designer. + _ + Private Sub InitializeComponent() + + End Sub + + 'NOTE: The following placeholder declaration is required by the Web Form Designer. + 'Do not delete or move it. + Private designerPlaceholderDeclaration As Object + + Private Sub Page_Init (ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Init + 'CODEGEN: This method call is required by the Web Form Designer + 'Do not modify it using the code editor. + InitializeComponent() + + If Request.ServerVariables("LOGON_USER").Length > 0 Then + Dim objAuthentication As New AuthenticationController + ' Reset config + Configuration.ResetConfig() + Dim config As Configuration = Configuration.GetConfig() + If (config.WindowsAuthentication Or config.HideWindowsLogin) Then + objAuthentication.AuthenticationLogon() + Else + Me.plNoAuthentication.Visible = True + Me.plSetIIS.Visible = False + End If + End If + + End Sub + +#End Region + + Private Sub Page_Load (ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + 'Put user code to initialize the page here + End Sub + End Class End Namespace \ No newline at end of file diff --git a/install.css b/install.css index 9d787ff..6b88449 100644 --- a/install.css +++ b/install.css @@ -1,161 +1,161 @@ - -Body, A -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 8pt; - font-weight: normal; - color: black; -} - -Body -{ - background-color: white; - background-image: url(installbg.gif); - background-repeat: repeat-x; - margin:25px 25px 0px 25px; -} - -.Normal -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 8pt; - font-weight: normal; - color: black; -} - -.NormalBold -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 8pt; - font-weight: bold; - color: black; -} - -.Help -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 8pt; - font-weight: normal; - color: black; - padding-left: 20px; -} -.FeedBack -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 9pt; - font-weight: normal; - color: black; - border: black 1px solid; - background-color: transparent; -} - -H1 -{ - font-size: 1.5em; - font-weight: bold; - color: #75808A; - text-decoration: underline; -} - -H2 { - font-size: 1.4em; - font-weight: bold; - color: #75808A; -} - -H3 { - font-size: 1.2em; - font-weight: bold; - color: #75808A; -} - -H4 { - font-size: 1.2em; - font-weight: bold; - color: #75808A; -} - -H5 { - font-size: 1.1em; - font-weight: bold; - color: #75808A; -} - -H6 { - font-size: 1.0em; - font-weight: bold; - color: #75808A; -} - -.Wizard, .Error -{ - width: 750px; - height:300px; - -} - -.WizardButton -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - background-color:Transparent; - font-size: 1.0em; - font-weight: bold; - text-decoration: none; - color: #990000; - border:solid 1px #999999; - padding: 10px; -} -A.WizardButton:link, A.WizardButton:visited, A.WizardButton:active, A.WizardButton:hover -{ - text-decoration: none; - color: #990000; -} -.WizardButtonDisabled -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - background-color: #eeeeee; - font-size: 1.0em; - font-weight: bold; - text-decoration: none; - color: #990000; - border: solid 1px #999999; - padding: 10px; -} -A.WizardButtonDisabled:link, A.WizardButtonDisabled:visited, A.WizardButtonDisabled:active, A.WizardButtonDisabled:hover -{ - text-decoration: none; - color: Silver; -} -A:link { - font-size: 1.0em; - font-weight: bold; - text-decoration: none; - color: #75808A; -} - -A:visited { - font-size: 1.0em; - font-weight: bold; - text-decoration: none; - color: #75808A; -} - -A:active { - font-size: 1.0em; - font-weight: bold; - text-decoration: none; - color: #75808A; -} - -A:hover { - font-size: 1.0em; - font-weight: bold; - text-decoration: underline; - color: #cc0000; -} - -HR { - color: #ededed; - height:1pt; - text-align:left -} + +Body, A +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + font-size: 8pt; + font-weight: normal; + color: black; +} + +Body +{ + background-color: white; + background-image: url(installbg.gif); + background-repeat: repeat-x; + margin:25px 25px 0px 25px; +} + +.Normal +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + font-size: 8pt; + font-weight: normal; + color: black; +} + +.NormalBold +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + font-size: 8pt; + font-weight: bold; + color: black; +} + +.Help +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + font-size: 8pt; + font-weight: normal; + color: black; + padding-left: 20px; +} +.FeedBack +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + font-size: 9pt; + font-weight: normal; + color: black; + border: black 1px solid; + background-color: transparent; +} + +H1 +{ + font-size: 1.5em; + font-weight: bold; + color: #75808A; + text-decoration: underline; +} + +H2 { + font-size: 1.4em; + font-weight: bold; + color: #75808A; +} + +H3 { + font-size: 1.2em; + font-weight: bold; + color: #75808A; +} + +H4 { + font-size: 1.2em; + font-weight: bold; + color: #75808A; +} + +H5 { + font-size: 1.1em; + font-weight: bold; + color: #75808A; +} + +H6 { + font-size: 1.0em; + font-weight: bold; + color: #75808A; +} + +.Wizard, .Error +{ + width: 750px; + height:300px; + +} + +.WizardButton +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + background-color:Transparent; + font-size: 1.0em; + font-weight: bold; + text-decoration: none; + color: #990000; + border:solid 1px #999999; + padding: 10px; +} +A.WizardButton:link, A.WizardButton:visited, A.WizardButton:active, A.WizardButton:hover +{ + text-decoration: none; + color: #990000; +} +.WizardButtonDisabled +{ + font-family: Verdana, Arial, Helvetica, Sans Serif; + background-color: #eeeeee; + font-size: 1.0em; + font-weight: bold; + text-decoration: none; + color: #990000; + border: solid 1px #999999; + padding: 10px; +} +A.WizardButtonDisabled:link, A.WizardButtonDisabled:visited, A.WizardButtonDisabled:active, A.WizardButtonDisabled:hover +{ + text-decoration: none; + color: Silver; +} +A:link { + font-size: 1.0em; + font-weight: bold; + text-decoration: none; + color: #75808A; +} + +A:visited { + font-size: 1.0em; + font-weight: bold; + text-decoration: none; + color: #75808A; +} + +A:active { + font-size: 1.0em; + font-weight: bold; + text-decoration: none; + color: #75808A; +} + +A:hover { + font-size: 1.0em; + font-weight: bold; + text-decoration: underline; + color: #cc0000; +} + +HR { + color: #ededed; + height:1pt; + text-align:left +} diff --git a/license.txt b/license.txt index 8ae5042..3be3747 100644 --- a/license.txt +++ b/license.txt @@ -1,21 +1,21 @@ -
-

License

-

- DotNetNuke® http://www.dotnetnuke.com
- Copyright (c) 2002-2013
- by DotNetNuke Corporation
-

-

- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and - to permit persons to whom the Software is furnished to do so, subject to the following conditions: -

-

- The above copyright notice and this permission notice shall be included in all copies or substantial portions - of the Software. -

-

- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -

+
+

License

+

+ DotNetNuke® http://www.dotnetnuke.com
+ Copyright (c) 2002-2013
+ by DotNetNuke Corporation
+

+

+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + to permit persons to whom the Software is furnished to do so, subject to the following conditions: +

+

+ The above copyright notice and this permission notice shall be included in all copies or substantial portions + of the Software. +

+

+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

\ No newline at end of file diff --git a/trusterror.htm b/trusterror.htm index 788f018..53d5a9e 100644 --- a/trusterror.htm +++ b/trusterror.htm @@ -1,17 +1,17 @@ - - - DotNetNuke - - - - -

 

-

 

-

This site is currently Unavailable

-

The Active Directory Provider requires the site to be running under Full Trust.

-

Commenting out the line:

-

- <add name="Authentication" type="DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory" />

-

in your web.config will allow you to get the site running until it meets the above requirements.

- + + + DotNetNuke + + + + +

 

+

 

+

This site is currently Unavailable

+

The Active Directory Provider requires the site to be running under Full Trust.

+

Commenting out the line:

+

+ <add name="Authentication" type="DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory" />

+

in your web.config will allow you to get the site running until it meets the above requirements.

+ \ No newline at end of file diff --git a/version.txt b/version.txt index 222f619..c72014b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -6.0.8.1 \ No newline at end of file +6.1.2.19 \ No newline at end of file