ATK User Management

LATEST VERSION: 3.1 (Dec, 6, 2008)

SUMMARY:

The ATK User Management module allows a web developer to leverage on the power of ATK to control access to modules and nodes to users and roles.

FEATURES:

This module extends its capability to:
- Control the overall authentication into an ATK system
- Track registrations and login history of system users.
- Force role login into a specific node
- Force user login into a specific node
- Activate or disactivate users from login into the system
- Specify user language
- Provides infrastructure for password recovery
- User own control to change basic profile information

REQUIREMENTS:

Now that you know what is possible, let me tell what is required:
- ATK 5.6+ (http://www.achievo.org/atk/download/)
- PHP 4+ (http://www.php.net/downloads.php)
- MySQL 4+ (http://dev.mysql.com/downloads/)
- DHTML Suite for Applications (already included on gktools module) (http://www.dhtmlgoodies.com/index.html?page=dhtml-suite)




Feel free to view the screenshots .

As soon as you're ready to try this application on your own, you may download the ATK User Management.

Enjoy,

Jorge Garifuna
Web Developer
info@gariSoft.com



Users Accounts (click to view larger)
Users General Tab Detail (click to view larger)
Specific User History Tab Details (click to view larger)
Users Profiles/Roles/Groups Listings (click to view larger)
Users Profiles/Roles/Groups Permission Tab (click to view larger)
Users Department Listings (click to view larger)
Users Departments Users Tab (click to view larger)
All Users Login History (click to view larger)
Users Registration Settings Listing (click to view larger)
Users Registration Settings Edit Detail (click to view larger)
Demo not available
Demo not available at the moment
 
 
Click on the desired version below to download this application
Version Date
3.1 12/07/08
3.0 6/15/07
2.2 2/7/07
   

ADMINISTRATION INSTALLATION:

1. Create the database from the file: db and docs/users_table_structrure.sql

2. Copy "users", "user_account", "gktools" to your ATK "modules" folder from the downloaded file

3. Add the following lines to your config.inc.php file:

$config_auth_usertable = "user";
$config_auth_userfield = "login";
$config_auth_passwordfield = "password";
$config_auth_userpk = "user_id";
//$auth_usernode = "users.user";
// If you work with groups/levels you need these parameters
//$config_auth_leveltable = "user";
$config_auth_leveltable = "user_user_profile";
$config_auth_levelfield = "profile_id";
$config_auth_userfk = "user_id";
$config_auth_accesstable = "user_accessright";

4. If you want to support multiple languages, including Spanish, add or modify the following at the bottom of config.inc.php:

from:
$config_supported_languages = array("EN","NL","DE");
to:
$config_supported_languages = array("EN","NL","DE","ES");

5. To be able to have user activation and disaction actually work, modify atk/defaultconfig.inc.php:
from:
$config_auth_accountenableexpression = "";
to:
$config_auth_accountenableexpression = "active=1";

6. To track user login add the following to app.php right above "$destination = "welcome.php";":

/*
Jorge Garifuna
10/22/06
Tracks user logins

*/
$user = &getUser();


if(!empty($user["user_id"]) && $user["user_id"]!=0){
$ulnode = &getNode("users.user_login_history");
$ulrs = $ulnode->selectDb("user_login_history.user_id=".$user["user_id"]." AND login_date='".date("Y-m-d")."'");
// added AND login_date='".date("Y-m-d")."'" on 1/20/07
if(count($ulrs)>0){ // user logged in before
$ulrecord =$ulrs[0];
$ulrecord["login_count"] = ($ulrecord["login_count"] + 1);
$ulrecord["login_date"] = date("Y-m-d");
$ulnode->updateDb($ulrecord);
}else{ // first user login
$ulrecord["user_id"] = $user["user_id"];
$ulrecord["login_count"] = 1;
$ulrecord["login_date"] = date("Y-m-d");
$ulnode->addDb($ulrecord);
}// end if

/*
// set language
if (!empty($user["lng"])) { // added 1/4/07
global $config_language;
//print "lang: ($config_language) ".$user["lng"];
$config_language=$user["lng"];
}
*/
}
// end user login tracking

7. To force user or profile(group) to logon to specific node, add the following to app.php after code from step 7 and replacing ""$destination = "welcome.php";"" into:

// start user on a specific node if set either to the user level or the profile level, added 1/20/07 by Jorge Garifuna
$start_page = "welcome.php";

if (!empty($user["start_node"])) { // check if user account has a specific start node
$start_node = str_replace(" ","",$user["start_node"]); // remove space
list($node_name, $action_name) = split("=",$start_node);
if (!empty($node_name) && !empty($action_name)) {
$start_page = dispatch_url($node_name, $action_name);
}// end if

}else if (!empty($user["profile_id"])) {// check if user profile has a specific start node
$db = &atkGetDb();
$query = "SELECT start_node FROM user_profile WHERE profile_id=".$user["profile_id"];
$rows = $db->getrows($query);

if (count($rows)>0) {
$start_node = $rows[0]["start_node"];
if (!empty($start_node)) {
$start_node = str_replace(" ","",$start_node); // remove space
list($node_name, $action_name) = split("=",$start_node);
if (!empty($node_name) && !empty($action_name)) {
$start_page = dispatch_url($node_name, $action_name);
}// end if
}// emd if
}// end if
}else if($user["user_id"] == 0 && $user["name"] == "administrator"){
$start_page = dispatch_url("dashboard.dashboard", "user_dashboard");
}// end if
//$destination = "welcome.php";
$destination = $start_page; //dispatch_url("dashboard.dashboard", "user_dashboard");


8. You are done :)

PUBLIC USER REGISTRATION INSTALLATION:

To allow public users to register to your ATK Admin section follow these steps:

1. Assuming you have setup the Admin Module for the User Module, logon to ATK Admin and click on "Registration Settings"

2. Customize the settings as you please, but more importantly select the profile web users should register for and make sure that profile only has access to modules intended for public users.

3. Now copy main.php file and the "include" folder from "web_public" into your website public root folder

4. You may call the initial registration form by linking to:

   main.php?module=users&node=gcms_front&action=get_registration_form

5. If everything is setup correctly, you should be good to go! Below are some sites that showcases this module:

- At the time of this writing this one is more complete:

http://www.nudawnproductions.com/main.php?module=users&node=gcms_front&action=get_registration_form

- At the time of this writing this one is missing the password recovery feature and is not yet made public:

http://www.garitv.com/main.php?module=users&node=gcms_front&action=get_registration_form


Click here to download the latest version of ATK.
download the ATK User Management