User management module

The next key feature of openbiz is to have a default user management module. We are looking for idea-sharing and code-contribution from openbiz users. Thanks!

This module should have

  • User Registration
    • Self registration
    • Email notification
    • Forget password
  • User management (by admin or permitted user)
    • User creation
    • List users
    • Edit user profile including status
    • Search user
  • Role Management
    • Role creation
    • List roles
    • Assign role to user

 

- users tableCREATE TABLE

- users table
CREATE TABLE `users` (                                
  `uid` int(10) unsigned NOT NULL auto_increment,     
  `name` varchar(60) NOT NULL default '',         
    

You might consider breaking up the name field into two. (ie. first_name, last_name)

the name stands for

the name stands for "username". The user table is atcually the base member table. it can the be base of other user table like contact, customer, employee ...

Suggested schema of user

Suggested schema of user management

- users table
CREATE TABLE `users` (                                
  `uid` int(10) unsigned NOT NULL auto_increment,     
  `name` varchar(60) NOT NULL default '',             
  `password` varchar(32) NOT NULL default '',             
  `email` varchar(64) default '',                                  
  `created` datetime NOT NULL default '0',             
  `login` datetime NOT NULL default '0',               
  `status` tinyint(4) NOT NULL default '0',           
  `timezone` varchar(8) default NULL,                 
  `language` varchar(12) NOT NULL default '',         
  `picture` varchar(255) NOT NULL default '',         
  `description` text,                                    
  PRIMARY KEY  (`uid`),                               
  UNIQUE KEY `name` (`name`),                                                  
  KEY `mail` (`mail`)                                 
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
       
- role table
CREATE TABLE `role` (                                 
  `rid` int(10) unsigned NOT NULL auto_increment,     
  `name` varchar(64) NOT NULL default '',             
  PRIMARY KEY  (`rid`),                               
  UNIQUE KEY `name` (`name`)                          
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 
       
- users_roles table
CREATE TABLE `users_roles` (      
   `id` int(10) unsigned NOT NULL auto_increment,        
   `uid` int(10) unsigned NOT NULL default '0', 
   `rid` int(10) unsigned NOT NULL default '0', 
   PRIMARY KEY  (`id`),                  
   KEY `uid` (`uid`)
   KEY `rid` (`rid`)                            
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8

- permission table (reserved for future usage)
CREATE TABLE `permission` (                           
  `pid` int(11) NOT NULL auto_increment,              
  `rid` int(10) unsigned NOT NULL default '0',        
  `perm` text,                                           
  PRIMARY KEY  (`pid`),                               
  KEY `rid` (`rid`)                                   
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8