wing
 Nuker Posts:15

 |
06/24/2007 10:14 PM |
|
Hi, for the dnn site we can add the new user from the admin account directly. But can you guide me how to change the username? I tried to update the username from the db with the update statement. Like: update aspnet_users set username='Alice1' where username='Alice'
It refected in the db table, but not in my dnn site and I can not use the updated username to log in the dnn site, the old username still works. Thanks! |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
06/24/2007 11:37 PM |
|
I'm sure that you know this, but it's recommended that you not alter DotNetNuke's database tables directly unless you absolutely have to and also absolutely know what you are doing.
I believe that DotNetNuke does not provide a way to change a username. There's probably a good reason for that.
Also, looking at the table, I see that there are several tables that begin with aspnet_. There are 6 such tables, and 5 of them have counterparts. The table that doesn't have a counterpart is aspnet_Membership.
These tables and the design of the "Data model for users and roles" are discussed in Chapter 9 of "Professional DotNetNuke 4". Frankly, I've mostly glossed over all of this. The discussion discusses "Synchronization and Aggregation" of the two sets of tables.
So ... the two places that username appears are in the aspnet_Users and Users. Everything else seems to reference UserID.
I have no idea if changing a username in the two tables will do the trick. If you try it, I'd suggest that you do this on a test installation set up expressly for that purpose. I'd also suggest that you not get into the habit of routinely changing usernames. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Andy Hock
 Nuke Pro Posts:90

 |
06/25/2007 6:06 PM |
|
Just as an FYI, all of the aspnet_... tables are to implement the .NET Framework 2.0 SQL Membership Provider. You should be able to change the username, since there isn't a 'SALT' (encryption key) associated with it. There is a separate 'user id' int value to represent the user id in all relevant tables.
You would need to go into the aspnet_Users table and change the two user name columns (one is username and one is username lowered). You would also need to go into the dbo.[object_qualifier]Users DNN table and change the user name there also. The user id for the aspnet_ SQL Membership Provider tables uses a Guid as the ID, but DNN uses the user_id integer-based value.
I'm not sure why this is not user-editable--probably because for the AD Membership Provider, the functionality is not there to change the AD Username--in fact, I'm not sure you can change the Username in AD either...but if you are not using AD, you could change the username manually (or write a module to do it), using the above instructions.
If there's another reason why it's a bad idea though, a core team member would be a better person to answer this. I just know that I just tried it using the above instructions and it worked for me (but then, I'm not using the Active Directory Membership Provider!..at least not for side work)...
Let me know if this works for you or not. And make sure you back up your database before you do this!
Regards, Andy H. |
|
 DotNetNuke and .NET web parts, web services, modules and code snippets. |
|
|
wing
 Nuker Posts:15

 |
06/28/2007 2:30 AM |
|
Hi, I do appreciate for both of you two guys detailed information. I will try out later since I am unfamiliar with mssql db issue and don't know how to update the statement. Thanks! |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
06/28/2007 7:40 AM |
|
If you're not familiar with SQL, then I think that you probably don't want to go messing around with the database. You should do that only if you are really familiar with SQL.
Is it important that you change a username? You could have the person in question just sign up with a new username. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
wing
 Nuker Posts:15

 |
07/03/2007 10:25 PM |
|
Thanks! It's not very inpormtant to change a username, I will create another one within the site. Here is another problem I am encountering: I am upgrading my dnn site from 4.5.1 to 4.5.3, when I process the upgrade and got error: 00:00:04.580 - Executing Script: 04.05.01.SqlDataProvider Error! (see 04.05.01.log for more information) Now, when I browse my site and got this error: Module Load Warning One or more of the modules on this page did not load. This may be temporary. Please refresh the page (click F5 in most browsers). If the problem persists, please let the Site Administrator know.
I copy my old connection string, machine and validation key to the release.cofig, and rename it to web.config. Is anything else I missed or I did not copy the machine key and validation key completely? Thanks! |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
07/04/2007 12:25 AM |
|
You need to locate that log file, open it, and see that the error message says. The log is in a directory associated with the .04.05.01 SQL Data Provider. If you could report that error, it might give us a clue as to what went wrong. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
wing
 Nuker Posts:15

 |
07/04/2007 2:12 AM |
|
Please bare with me  can you tell me where can I find the log file, is it still in the dnn site? Is it the one within "providers\dataproviders\sqldataprovider"->04.05.01.SqlDataProvider? |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
07/04/2007 9:11 AM |
|
I think that the answer is yes to both questions. The file is in your DotNetNuke site. If there is a file in that directory with the right name and has a timestamp that corresponds to when you did the upgrade, then that's the file. You can open it with Windows Notepad. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
wing
 Nuker Posts:15

 |
07/04/2007 9:24 PM |
|
Thanks. I check the file, it seems not the correct error log file. And I re-upload some missed folders and files to the site, partial work now. Only the modules not work for the whole site. I thought I missed uploaded the modules folders and files, but I checked that seems all the files are the same as the backup of my dnn site. I checked the modules files from "DesktopModules". Anywhere else I need to check?
By the way, here is the log file that I get from the "04.05.01.SqlDataProvider", can you check if is it helpful for you to find a clue? Sorry for bug you so long:
/************************************************************/ /***** SqlDataProvider *****/ /***** *****/ /***** *****/ /***** Note: To manually execute this script you must *****/ /***** perform a search and replace operation *****/ /***** for {databaseOwner} and {objectQualifier} *****/ /***** *****/ /************************************************************/
/* add unique constraint to Folders table */ IF NOT EXISTS (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[IX_{objectQualifier}FolderPath]') and OBJECTPROPERTY(id, N'IsConstraint') = 1) BEGIN declare @PortalID int declare @FolderPath varchar(300) declare @FolderID int declare @MinFolderID int
select @PortalID = min(PortalID) from {databaseOwner}{objectQualifier}Portals while @PortalID is not null begin /* check for duplicate FolderPaths */ select @FolderPath = null select @FolderPath = FolderPath from {databaseOwner}{objectQualifier}Folders where PortalID = @PortalID group by FolderPath having COUNT(*) > 1 /* if duplicates exist */ if @FolderPath is not null begin /* iterate through the duplicates */ select @FolderID = min(FolderID) from {databaseOwner}{objectQualifier}Folders where PortalID = @PortalID and FolderPath = @FolderPath
/* save min FolderID */ select @MinFolderID = @FolderID
while @FolderID is not null begin if @FolderID <> @MinFolderID begin /* reassign FolderId to min FolderID for duplicate folders */ update {databaseOwner}{objectQualifier}Files set FolderID = @MinFolderID where FolderID = @FolderID
/* remove duplicate folder */ delete from {databaseOwner}{objectQualifier}Folders where FolderID = @FolderID end
select @FolderID = min(FolderID) from {databaseOwner}{objectQualifier}Folders where PortalID = @PortalID and FolderPath = @FolderPath and FolderID > @FolderID end end select @PortalID = min(PortalID) from {databaseOwner}{objectQualifier}Portals where PortalID > @PortalID end
/* add unique constraint */ ALTER TABLE {databaseOwner}{objectQualifier}Folders ADD CONSTRAINT IX_{objectQualifier}FolderPath UNIQUE NONCLUSTERED ( PortalID, FolderPath ) ON [PRIMARY] END GO
/* correct any File folderpaths which do not match the value in the Folders table */ update {databaseOwner}{objectQualifier}Files set Folder = FolderPath from {databaseOwner}{objectQualifier}Folders where {databaseOwner}{objectQualifier}Files.FolderID = {databaseOwner}{objectQualifier}Folders.FolderID and Folder <> FolderPath GO
/* add unique constraint to Files table */ IF NOT EXISTS (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[IX_{objectQualifier}FileName]') and OBJECTPROPERTY(id, N'IsConstraint') = 1) BEGIN declare @FolderID int declare @FileName nvarchar(100) declare @FileID int declare @MinFileID int
select @FolderID = min(FolderID) from {databaseOwner}{objectQualifier}Folders while @FolderID is not null begin /* check for duplicate Filenames */ select @FileName = null select @FileName = FileName from {databaseOwner}{objectQualifier}Files where FolderID = @FolderID group by FileName having COUNT(*) > 1 /* if duplicates exist */ if @FileName is not null begin /* iterate through the duplicates */ select @FileID = min(FileID) from {databaseOwner}{objectQualifier}Files where FolderID = @FolderID and FileName = @FileName
/* save min FileID */ select @MinFileID = @FileID
while @FileID is not null begin if @FileID <> @MinFileID begin /* remove duplicate file */ delete from {databaseOwner}{objectQualifier}Files where FileID = @FileID end
select @FileID = min(FileID) from {databaseOwner}{objectQualifier}Files where FolderID = @FolderID and FileName = @FileName and FileID > @FileID end end
select @FolderID = min(FolderID) from {databaseOwner}{objectQualifier}Folders where FolderID > @FolderID end ALTER TABLE {databaseOwner}{objectQualifier}Files ADD CONSTRAINT IX_{objectQualifier}FileName UNIQUE NONCLUSTERED ( FolderID, FileName ) ON [PRIMARY] END GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}AddModuleControl]') AND OBJECTPROPERTY(id, N'IsPROCEDURE') = 1) drop procedure {databaseOwner}{objectQualifier}AddModuleControl GO
CREATE PROCEDURE {databaseOwner}{objectQualifier}AddModuleControl @ModuleDefID int, @ControlKey nvarchar(50), @ControlTitle nvarchar(50), @ControlSrc nvarchar(256), @IconFile nvarchar(100), @ControlType int, @ViewOrder int, @HelpUrl nvarchar(200), @SupportsPartialRendering bit
AS INSERT INTO {databaseOwner}{objectQualifier}ModuleControls ( ModuleDefID, ControlKey, ControlTitle, ControlSrc, IconFile, ControlType, ViewOrder, HelpUrl, SupportsPartialRendering ) VALUES ( @ModuleDefID, @ControlKey, @ControlTitle, @ControlSrc, @IconFile, @ControlType, @ViewOrder, @HelpUrl, @SupportsPartialRendering )
SELECT SCOPE_IDENTITY() GO
/************************************************************/ /***** SqlDataProvider *****/ /************************************************************/
|
|
|
|
|