How to customize DNN's user account module
2/03/2008
One of the things that has delayed the release of my website is the register form. In my opinion the official module requests too much information from the user. I believe that just a login, email and password should be mandatory.
Unfortunately this module is not that flexible and can't be configured this way. If you want to change it you'll have to get to the source.
So I did.
1) First you have to download the DotNetNuke sources. I've customized them both with 4.07.00 and 4.08.00
2) You'll have to modify two files DotNetNuke_04.08.00_Source\Library\Components\Users\UserInfo.vb
and
DotNetNuke_04.08.00_Source\Library\Components\Users\Profile\ProfileController.vb
3) Hide the unneeded fields from the register form. Modify the DisplayName, FirstName, LastName, UserId and Username properties in UserInfo.vb as follows.
<Browsable(False)> Public Property DisplayName() As String
Get
Return _DisplayName
End Get
Set(ByVal Value As String)
_DisplayName = Value
End Set
End Property
<SortOrder(1), MaxLength(256), Required(True), _
RegularExpressionValidator(glbEmailRegEx)> _
Public Property Email() As String
Get
Return _Email
End Get
Set(ByVal Value As String)
_Email = Value
\'Continue to set the membership Property in case developers have used this
\'in their own code
Me.Membership.Email = Value
End Set
End Property
<Browsable(False)> Public Property FirstName() As String
Get
Return Profile.FirstName
End Get
Set(ByVal Value As String)
Profile.FirstName = Value
End Set
End Property
<Browsable(False)> Public Property LastName() As String
Get
Return Profile.LastName
End Get
Set(ByVal Value As String)
Profile.LastName = Value
End Set
End Property
<Browsable(False)> Public Property UserID() As Integer
Get
Return _UserID
End Get
Set(ByVal Value As Integer)
_UserID = Value
End Set
End Property
<SortOrder(0), IsReadOnly(True), Required(True)> Public Property Username() As String
Get
Return _Username
End Get
Set(ByVal Value As String)
_Username = Value
\' Set the First Name, Last Name and Display Name\'
Profile.FirstName = Value
Profile.LastName = Value
_DisplayName = Value
\'Continue to set the membership Property in case developers have used this
\'in their own code
Me.Membership.Username = Value
End Set
End Property
4) In the previous step we're preventing the first name and last name from being written to the database. Now we want dnn to stop complaining about an incomplete profile when we log in to the portal. Modify the UpdateUserProfile method in ProfileController.vb as follows
Public Shared Function UpdateUserProfile(ByVal objUser As UserInfo, ByVal profileProperties As ProfilePropertyDefinitionCollection) As UserInfo5) Finally you'll have to compile the library and upload DotNetNuke.dll to your DNN installation. After that the register module will only ask for a username, email and password.
Dim updateUser As Boolean = Null.NullBoolean
'Iterate through the Definitions
For Each propertyDefinition As ProfilePropertyDefinition In profileProperties
Dim propertyName As String = propertyDefinition.PropertyName
Dim propertyValue As String = propertyDefinition.PropertyValue
If propertyDefinition.IsDirty Then
'Update Profile
objUser.Profile.SetProfileProperty(propertyName, propertyValue)
'If propertyName.ToLower = "firstname" OrElse propertyName.ToLower = "lastname" Then
' updateUser = True
'End If
End If
Next
UpdateUserProfile(objUser)
If updateUser Then
UserController.UpdateUser(objUser.PortalID, objUser)
End If
Return objUser
End Function
Etiquetas: customize, DNN, dotnetnuke, user account module
Working with PHP extensions on IIS
7/11/2007
Getting PHP's extension to work with IIS can become a bit frustrating. I've had some problems using the postgres extension in my computer, and here's how I've solved them.
First you have to make sure that the extension that your trying to use is working. This can be done using a simple php page file like this:
< ?php
echo phpInfo();
?>
If you load this page in your web browser you'll get a lot of information about your current php setup. In this case we're looking for the postgres extension, hence the string "pgsql" must be present. Otherwise the extension is not loaded and we'll have to install it.
To do so, you'll have to download the PHP windows installer. Then run the installer and click on Change. Click on extensions and select the extension you're planning to use. In this case we'll click on PostgreSQL and select "Will be installed on local hard drive".
After the extension has been installed, go to the PHP's directory (usually located in Program Files/PHP) and edit the php.ini file. Look for the string "extension=php_pgsql.dll". If the installation process didn't update the file, then remove the semicolon from the line of your extension from the "; Windows Extensions" section of the file.
After that you'll have to restart the IIS process: go to Control Panel->Administrative Tools->Services, right click on World Wide Web Publishing and select Restart. Now your PHP+IIS setup will be able to deal with the extension.
Etiquetas: IIS, PHP extensions, PostgreSQL
Versión 4.5.1 Publicada
4/16/2007
Ya está lista la versión 4.5.1 para su descarga. Además de corregir fallos detectados en la versión 4.5.0, incluye un starter kit que puede utilizarse con Visual Web Developer de Microsoft
Una de las principales novedades de DotNetNuke 4.5 es que integra soporte para Microsoft ASP.NET AJAX.
Disclaimer DNN-Hispano
4/12/2007
Acabo de encontrar la página DNN-hispano y quería dejar claro que antes de inaugurar el blog desconocía de su existencia.
Por supuesto no tengo ninguna relación con dicha página y la elección del nombre de este blog no esconde intereses crematísticos.
De paso he incluído un lector de rss conectado al feed de su blog.... ¿esta frase no resulta muy hispana,verdad?
Server Error in '/dotnetnuke' Application
Tras instalar y probar DotNetNuke con el kit para Visual Web Developer decidí utilizar el paquete de instalación con el servidor IIS en lugar del servidor de desarrollo. Tras instalar IIS y poner en un directorio virtual el paquete de instalación, dirigí mi navegador a la página de instalación, pero no apareció la pantalla esperada sino este mensaje de error.
finalmente encontré la solución. El problema lo causa instalar IIS después de .NET framework 2.0, corrompiendo la base de datos interna de .NET. Basta con reparar la instalación de .NET para solucionar el problema.Server Error in '/dotnetnuke' Application.
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
(...)
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
Para reparar la instalación
Panel de Control-> Agregar o quitar programas -> Microsoft .NET framework 2.0 ->Cambiar quitar-> Reparar la instalación.
La única molestia es que después hay que reiniciar.
Technorati tags: dotnetnuke, IIS, .NET Framework 2.0
Bienvenida
4/10/2007
Hola a todos,
he creado este blog con el propósito de compartir mis experiencias con DotNetNuke. Además de comentarios generales, intentaré cubrir asuntos específicamente relacionados con los hispanoparlantes.