Adding a user

Implementation of personalized learning and working environments always have to deal with conceptual and programming details of user management in one way or another. On the basis of PHPsTeam, one can use simple designed functions for managing users, groups and access rights. The following listing demonstrates how easy it is to register and activate a new user; it takes the programmer only three commands.

$activation_code = steam_factory::create_user(
    
    $steam_con,            // steam_connector
        
"roth" ,               // login
        
"secret" ,             // password
        
"roth@upb.de" ,        // e-mail
        
"Alexander" , "Roth"// real name
    
    );
$user = steam_factory::user_name_to_object(
        
$steam_con , "roth" );
$user->activate( $activation_code );
The steam_factory is responsible for the dispension of the connection to all other objects. Therefore, you have to provide the steam_connector as argument for most of its functions.


If one needs to maintain a larger user profile, various attributes can be attached to the user object with the command set attributes(see manual page 5). The registration process provides a key (line 1), which is necessary for later profile activation. In practice, other than activating the profile in the same script asexemplarily shown (line 10), we automatically mail this key to the registered e-mail-address to verify the given data. After receiving the key, the user can activate the profile on its own,supported by a second script.