Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationGet Server TimeZoneGet Server TimeZone
Previous
 
Next
New Post
4/3/2006 3:03 AM
 

When a new user is inserted by the active directory module its time zone is always (UTC 00:00). There is a way to set it to the server time zone or to the dnn site default time zone?

It could be a feature request or is a problem only on my system.

Stefano

 
New Post
4/6/2006 9:26 AM
 

I'm having the same problem.  I want my intranet users to all use (UTC -05:00) since they are all in the same Eastern time zone.  I even tried going into the SQL table (aspnet_Profile) that seems to hold the time zone setting but when I change the numer from 1 to 4 nothing happens.

The website DNN install is set to the Eastern time zone.

 
New Post
5/2/2006 10:00 AM
 

I went ahead and modified the source so that when a new user is created through DNN Active Directory their timezone is automatically set to the time zone of the portal.  You will need to download the source and recompile it to make this change work.

The file that needs to be edited is located under DNN install at \Components\Authentication\UserController.vb

Simply replace all code in the file with the below code.  I hope this helps someone out there.

Stuart

NOTE:   This change has only been tested on DNN version 3.2.2

'

' DotNetNuke® - http://www.dotnetnuke.com

' Copyright (c) 2002-2005

' by Perpetual Motion Interactive Systems Inc. ( http://www.perpetualmotion.ca )

'

' 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.Security.Authentication

 

    Public Class UserController

 

        Private mProviderTypeName As String = ""

 

        Sub New()

            Dim _config As Authentication.Configuration = Authentication.Configuration.GetConfig()

            mProviderTypeName = _config.ProviderTypeName

        End Sub

 

        ''' -------------------------------------------------------------------

        ''' <summary>

        '''     User object with info obtained from Active Directory

        ''' </summary>

        ''' <remarks>

        ''' </remarks>

        ''' <history>

        '''     [tamttt]      08/01/2004  Created

        ''' </history>

        ''' -------------------------------------------------------------------

        Public Function GetUser(ByVal LoggedOnUserName As String) As Authentication.UserInfo

            Return AuthenticationProvider.Instance(mProviderTypeName).GetUser(LoggedOnUserName)

        End Function

 

        ''' -------------------------------------------------------------------

        ''' <summary>

        '''     User object with info obtained from Active Directory

        ''' </summary>

        ''' <remarks>

        ''' </remarks>

        ''' <history>

        '''     [tamttt]      08/01/2004  Created

        ''' </history>

        ''' -------------------------------------------------------------------

        Public Function GetUser(ByVal LoggedOnUserName As String, ByVal LoggedOnPassword As String) As Authentication.UserInfo

            Return AuthenticationProvider.Instance(mProviderTypeName).GetUser(LoggedOnUserName, LoggedOnPassword)

        End Function

 

        ''' -------------------------------------------------------------------

        ''' <summary>

        ''' </summary>

        ''' <remarks>

        ''' </remarks>

        ''' <history>

        '''     [tamttt]      08/01/2004  Created

        ''' </history>

        ''' -------------------------------------------------------------------

        Public Function AddDNNUser(ByVal AuthenticationUser As Authentication.UserInfo) As Integer

            Dim _portalSettings As PortalSettings = PortalController.GetCurrentPortalSettings

            Dim objSecurity As New PortalSecurity

 

            Dim objDNNUsers As New DotNetNuke.Entities.Users.UserController

            Dim objAuthUsers As New Authentication.UserController

 

            Dim objDNNUser As DotNetNuke.Entities.Users.UserInfo = CType(AuthenticationUser, DotNetNuke.Entities.Users.UserInfo)

            Dim AffiliateId As Integer = -1

 

            If Not HttpContext.Current.Request.Cookies("AffiliateId") Is Nothing Then

                AffiliateId = Integer.Parse(HttpContext.Current.Request.Cookies("AffiliateId").Value)

            End If

 

            '******************************************************

            '  Update:  Stuart Hilbert:   5/2/2006

            '******************************************************

            'Making so that a new User being created from AD login

            'will get the Sites TimeZone Settings.

            '******************************************************

            objDNNUser.Profile.TimeZone = _portalSettings.TimeZoneOffset

 

 

            Dim UserID As Integer = -1

            UserID = objDNNUsers.AddUser(objDNNUser)

 

            If AuthenticationUser.AuthenticationExists AndAlso UserID > -1 Then

                AuthenticationUser.UserID = UserID

                UserController.AddUserRoles(_portalSettings.PortalId, AuthenticationUser)

            End If

 

            Return UserID

        End Function

 

        ''' -------------------------------------------------------------------

        ''' <summary>

        ''' </summary>

        ''' <remarks>

        ''' This routine is more accurated,

        ''' Prevent user assign to admin role in case user logon as LOCAL\Administrator

        ''' </remarks>

        ''' <history>

        '''     [tamttt]      08/01/2004  Created

        ''' </history>

        ''' -------------------------------------------------------------------

        Public Overloads Shared Sub AddUserRoles(ByVal PortalID As Integer, ByVal AuthenticationUser As Authentication.UserInfo)

            Dim objGroupController As New GroupController

            Dim colGroup As ArrayList = objGroupController.GetGroups()

            Dim objRoles As New DotNetNuke.Security.Roles.RoleController

            Dim authenticationGroup As Authentication.GroupInfo

            Try

                For Each authenticationGroup In colGroup

                    If objGroupController.IsAuthenticationMember(authenticationGroup, AuthenticationUser) Then

                        objRoles.AddUserRole(PortalID, AuthenticationUser.UserID, authenticationGroup.RoleID, Null.NullDate)

                    End If

                Next

 

            Catch exc As Exception

                LogException(exc)

            End Try

        End Sub

 

    End Class

 

End Namespace

 


Hilbert Solutions, LLC
Owner, Hilbert Solutions, LLC
http://www.HilbertSolutions.com
A DNN Service Provider
From Module Development to DNN Upgrades, your one stop DNN Shop
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationGet Server TimeZoneGet Server TimeZone


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out