Basic User Administration


Open a browser and go to your Administration page. This chapter is concerned with three module links on this page. The first is User Administration at the bottom of the table. After you navigate to this page, you see the form in Figure 9.1.

Figure 9.1. Managing your site users.


The User Administration page has three sections: Edit User, Add a New User, and User Configuration. The Edit User form lets you modify or delete existing users. You must know the exact username beforehand to use the form, but exact case is not required. Delete operations do come with a confirmation screen before an erase is made.

Populate your site with some sample users. If you know the names of users you plan to add, you can use them now, or you can refer to Table 9.1 for suggested data. Enter in any 10 users using the Add a New User form. If you are entering the fabricated data from Table 9.1, simply use "password" for all users' passwords. You can use the Add a New User link to return to the main form after a successful submission.

Table 9.1. Twenty-Five Example Users

USERNAME

FIRST NAME

LAST NAME

EMAIL

mallen

Maria

Allen

mpallen@coolmail.com

canderson

Christopher

Anderson

chander@yahu.com

mclark

Mary

Clark

mc503493@quikmail.com

sgarcia

Steven

Garcia

sgar1003@mysite.com

jhall

Jennifer

Hall

jennhall3491@coolmail.com

dharris

Donald

Harris

dharris@mysite.com

mhernandez

Margaret

Hernandez

mhernandez@yahu.com

pjackson

Paul

Jackson

pjack@bestmail.com

mjones

Michael

Jones

jonesy43@bestmail.com

dking

Dorothy

King

dorthy133@quikmail.com

blee

Barbara

Lee

btlee45@bestmail.com

llewis

Linda

Lewis

lindal679845@mysite.com

gmartin

George

Martin

george876@bestmail.com

emartinez

Edward

Martinez

emartinez@coolmail.com

rmiller

Richard

Miller

dmiller@mysite.com

jmoore

Joseph

Moore

moore@yahu.com

brobinson

Brian

Robinson

robinson@bestmail.com

prodriguez

Patricia

Rodriguez

patr09765@bestmail.com

ttaylor

Thomas

Taylor

ttaylor@quikmail.com

dthomas

Daniel

Thomas

thomasd@quikmail.com

kthompson

Kenneth

Thompson

kennyt@coolmail.com

ewalker

Elizabeth

Walker

lizbeth@yahu.com

rwilliams

Robert

Williams

bobbygw@bestmail.com

cwilson

Charles

Wilson

chuckw98@mysite.com

syoung

Susan

Young

suyou592@coolmail.com


Adding new accounts with this form is the fastest way to enter user information into PostNuke short of a raw SQL statement.

Now enter the username of one of the new accounts into the Edit User form, select Modify from the drop-down menu, and click the Submit button. You see a screen very similar to Figure 9.2. The first field is the User ID. Every user account is made unique by its ID, so you can change the username or email for a given account as needed.

Figure 9.2. Modifying user account information.


The Extra Info field is a public comment for the user account. It can contain anything from biographic information to a simple quote. Each user has access to edit this field, and it appears when someone looks at a user's account profile.

The option Allow Other Users to View My E-mail Address toggles the display of an account's email address. Users can optionally enter a fake email that displays in place of their real email for privacy. You can also reset a user's password using this form. If you are managing user accounts manually, you might have a regular need to change passwords for users who have forgotten them.

You should also now try the delete operation for one or more of the demo accounts. You are given a confirmation screen, but the process is relatively swift. Try to maintain about 10 accounts for testing purposes when you are finished.

User Register Configuration

Return to the main User Administration page and select User Register Configuration. This form determines the way new users register their own accounts into your site (see Figure 9.3). Change the Require Unique Email Addresses field to "No." Normally, this is a good option to leave on, but you need it turned off for an upcoming test. Show Optional Fields toggles the display of all the extra information that can be entered with a user account. For a simple account registration, all those extra fields can be overwhelming for some users, so many sites might prefer leaving this option disabled. Those options are examined further in the next section.

Figure 9.3. Setting account registration options.


If you choose to disable the email verification, users are prompted for their password during registration, and they can log in to the site immediately. This can lead to bogus user accounts used to anonymously spam your site, so it's recommended you leave the verification enabled.

The Minimum Age requirement gives a prospective user a confirmation check for his age. Sites where users can post content to forums or even home page news with little or no moderation can be a cause for concern with visitors of all ages on the Internet. Regardless of your site's content, this check can help protect you from future legal problems. Secure environments, such as business intranets, most likely need this option turned completely off, which is accomplished by entering "0" into the form.

Submit the form with the unique email requirement changed and return to the main User Administration page.

User Configuration

Click the User Configuration link to customize the Personal Homepage users reach using the My Account link in the Main Menu. The two options on this page allow you to specify the path to the images used on the page, as well as toggle whether those images are displayed at all.

Dynamic User Data

Click the Dynamic User Data link at the bottom of the Administration page. The resulting table contains all of the information associated with a user account (see Figure 9.4). The rows are shown in the order they appear on a user's Personal Information page. The order can be adjusted using the Weight column, just like the block system discussed in Chapter 4, "Modules and Blocks."

Figure 9.4. Customizing the user account data table.


You can add additional user fields using the Add Fields form below the table. To see how it works, add a user field now. The Field Label contains the variable used to reference the name of the data entry. It must begin with an underscore character and should be in all caps. Enter "_PETNAME" into the field or add in an entry of your own.

The Data Type defines the type of information that will be stored in the variable. "String" is for a single line of text, whereas "Text" signifies a paragraph or more of data. Floats are real numbers, such as 45.6. For this example, leave the default "String" selected. Enter "20" into the Length field and submit the form.

Now you will set a variable name, however, the new item does not yet have a common language label. Start up your text editor and open this file for editing:

 /language/eng/global.php 

The global.php file contains all of the text label definitions for common variables like those in the user accounts. The listing is arranged in alphabetical order, and it's important to maintain that consistency. The _PETNAME variable should slot in at around line 312. Enter in the following line:

 define('_PETNAME','Your Pet\'s Name'); // User account data 

Quotes in the text need the preceding backslash character, as shown in the example. Save the file to commit your change.

Register Users

Next, you register users using the public account creation system. Log your account out of your site to have the Login block reappear. Click the Sign Up link at the base of the form and click Register from the subsequent options. You now see the age verification check. Visitors who click the Under 13 link are refused access to an account.

The New User Registration form you see now is the standard account submission screen that the majority of your users will likely use to create their accounts. The email address must be entered twice to help prevent data-entry errors. You can change the text appearing on this form by editing the variables in this file:

 /modules/NS-NewUser/lang/eng/global.php 

They are global variable definitions just like what you've been editing previously. Just look for the text you want to edit to determine which variable corresponds.

Add in two more users from Table 9.1, but use your email address instead of the ones provided in the table. Check your email for the registration confirmations. Chapter 23, "User System Hacks and Modules," covers the steps needed to change the email content. Notice the passwords mailed to you are randomly generated. Users need to enter their random password to log in for the first time.

Now return to your site and click the Members List link in the Main Menu. Now that your site has a few accounts created, you can see the usernames there for review. Click on the usernames to view the account profiles.



    PostNuke Content Management
    PostNuke Content Management
    ISBN: 0672326868
    EAN: 2147483647
    Year: 2003
    Pages: 207
    Authors: Kevin Hatch

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net