I've just got my personal site up and running online. I have created an admin account locally, and I can login successfully with it.
To test the membership system of the site, I have created another user myself. After registering, I got a message that this membership needs the approval of the administrator.
My question is, how do you approve/delete/modify roles of members in this case? I am not using any enhanced version of the Starter Kit which has online member management (although I'd like to get it...can anyone give me a direct link please?)
In order to manage users and roles in the PWS kit over the web, you will need to implement new code and pages that handle that functionality. If you want, you can register and download from my site a small project that consists of just the user management
pages. Or you can download my full source code that already has the functionality built in.
If you're using Visual Web Developer you can choose ASP.NET Configuration from the Website menu. This may be the same in Visual Studio 2005. That will load a web page that is only accessible on your local machine. Choose Security on the web page and you'll
see options for adding roles and users.
I get that, but what if a user registers himself from a remote machine? How do I approve/reject his/her registration. Is adding your source code the only way to do it?
I have your source code for User Management BTW. Should I just overwrite the existing files on the server?
I get that, but what if a user registers himself from a remote machine? How do I approve/reject his/her registration. Is adding your source code the only way to do it?
Yes, in order to manage users once they have registered on your site, you will need to implement user management pages. You can use my code, or there are other examples
on the web of how to do this.
NET.Bloke
I have your source code for User Management BTW. Should I just overwrite the existing files on the server?
If you have deployed my PWS project then you will not need to add the files from the UserManagement project. In fact, the user management in my PWS project is somewhat
different than what is in the UserManagement project.
If you wish to add what is in the UserManagement project to your existing PWS, you will need to follow these steps:
Copy to the Admin folder in your PWS project, everything in the Admin folder located in my UserManagement project.
Copy to the App_Code folder in your PWS, everything in the App_Code folder located in my UserManagement project.
If you want the styles applied you will need to:
Copy the declarations in the Default.skin that are used in the admin pages
Copy the css classes in the Default.css that are used in the admin pages
copy the images that are used in the admin pages.
Change the path of the images to point to theme you are using.
Create appropriate menu items in the Web.Sitemap for the admin pages. (make sure you set appropriate rights so that these pages don't show up to anyone visiting the site.)
Add the following from the web.config in my UserManagement project to your PWS projects web.config:
<
appSettings>
<!-- This key defines what role a new user will be assigned to by default. If set to blank, the user will be created but not assigned to any roles. The user would then need to be assigned to a role by the administrator
before they would have an special access to the website.-->
<add
key="DefaultRoleForNewUser"
value="Registered Users"/>
</appSettings>
<!--SECURITY NOTE: The most secure passwordFormat is hashed. The hashed option only supports enablePasswordReset. If you need to enablePasswordRetrieval the most secure format is encrypted. Encypting your password requires
a pre-defined machine key. To enable these samples to run on all machines without machine key configuration we are using the clear password format-->
</providers>
</membership>
<roleManager enabled="true"
cacheRolesInCookie="true"
defaultProvider="DefaultRoleProvider"
cookieName=".ASPXROLES"
cookiePath="/"
cookieTimeout="60"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
createPersistentCookie="false"
cookieProtection="All">
<providers>
<add
name="DefaultRoleProvider"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
applicationName="/"/>
</providers>
</roleManager>
</system.web>
Recreate the State table in the database for your PWS.
Well, as I do not know anything about importing and exporting data, all I can tell you is that you will need to create a script of the table and then manually enter the data into the table online.
NET.Bloke
Member
170 Points
34 Posts
How do I manage users?
Jun 14, 2006 11:46 AM|LINK
I've just got my personal site up and running online. I have created an admin account locally, and I can login successfully with it.
To test the membership system of the site, I have created another user myself. After registering, I got a message that this membership needs the approval of the administrator.
My question is, how do you approve/delete/modify roles of members in this case? I am not using any enhanced version of the Starter Kit which has online member management (although I'd like to get it...can anyone give me a direct link please?)
Thanks in advance.
jwadsworth
Contributor
2378 Points
542 Posts
Re: How do I manage users?
Jun 14, 2006 02:49 PM|LINK
Hello and welcome,
In order to manage users and roles in the PWS kit over the web, you will need to implement new code and pages that handle that functionality. If you want, you can register and download from my site a small project that consists of just the user management pages. Or you can download my full source code that already has the functionality built in.
Extended Personal Site Starter kit
NET.Bloke
Member
170 Points
34 Posts
Re: How do I manage users?
Jun 14, 2006 03:21 PM|LINK
Thanks for the prompt response. I will certainly try out your code. Is there any way to do it offline (from my computer i.e) though in the meantime?
NET.Bloke
Member
170 Points
34 Posts
Re: How do I manage users?
Jun 14, 2006 03:26 PM|LINK
NET.Bloke
Member
170 Points
34 Posts
Re: How do I manage users?
Jun 14, 2006 03:32 PM|LINK
Yet, is there still a way to do it offline?
jwadsworth
Contributor
2378 Points
542 Posts
Re: How do I manage users?
Jun 14, 2006 03:43 PM|LINK
Extended Personal Site Starter kit
NET.Bloke
Member
170 Points
34 Posts
Re: How do I manage users?
Jun 14, 2006 03:55 PM|LINK
I have your source code for User Management BTW. Should I just overwrite the existing files on the server?
Thanks again.
jwadsworth
Contributor
2378 Points
542 Posts
Re: How do I manage users?
Jun 14, 2006 09:22 PM|LINK
Yes, in order to manage users once they have registered on your site, you will need to implement user management pages. You can use my code, or there are other examples on the web of how to do this.
If you have deployed my PWS project then you will not need to add the files from the UserManagement project. In fact, the user management in my PWS project is somewhat different than what is in the UserManagement project.
If you wish to add what is in the UserManagement project to your existing PWS, you will need to follow these steps:
<
appSettings><!-- This key defines what role a new user will be assigned to by default. If set to blank, the user will be created but not assigned to any roles. The user would then need to be assigned to a role by the administrator before they would have an special access to the website.-->
<add key="DefaultRoleForNewUser" value="Registered Users"/>
</appSettings>
<system.web>
<pages styleSheetTheme="Default">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<profile>
<properties>
<add name="FirstName"/>
<add name="LastName"/>
<add name="Company"/>
<add name="Address1"/>
<add name="Address2"/>
<add name="City"/>
<add name="State"/>
<add name="Zip" />
<add name="PhoneNumber"/>
</properties>
</profile>
<membership defaultProvider="DefaultMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<add name="DefaultMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="true"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordStrengthRegularExpression=""
passwordFormat="Clear"/>
<!--SECURITY NOTE: The most secure passwordFormat is hashed. The hashed option only supports enablePasswordReset. If you need to enablePasswordRetrieval the most secure format is encrypted. Encypting your password requires a pre-defined machine key. To enable these samples to run on all machines without machine key configuration we are using the clear password format-->
</providers>
</membership>
<roleManager enabled="true"
cacheRolesInCookie="true"
defaultProvider="DefaultRoleProvider"
cookieName=".ASPXROLES"
cookiePath="/"
cookieTimeout="60"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
createPersistentCookie="false"
cookieProtection="All">
<providers>
<add name="DefaultRoleProvider"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
applicationName="/"/>
</providers>
</roleManager>
</system.web>
Recreate the State table in the database for your PWS.
Extended Personal Site Starter kit
NET.Bloke
Member
170 Points
34 Posts
Re: How do I manage users?
Jun 15, 2006 09:05 AM|LINK
jwadsworth
Contributor
2378 Points
542 Posts
Re: How do I manage users?
Jun 15, 2006 03:31 PM|LINK
Well, as I do not know anything about importing and exporting data, all I can tell you is that you will need to create a script of the table and then manually enter the data into the table online.
Extended Personal Site Starter kit