Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Users tables in Joomla 2.5
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ofer Cohen  
View profile  
 More options Feb 25 2012, 7:49 am
From: Ofer Cohen <oferc...@gmail.com>
Date: Sat, 25 Feb 2012 14:49:05 +0200
Local: Sat, Feb 25 2012 7:49 am
Subject: Re: [jcms] Users tables in Joomla 2.5

Hey

It would be better if you could document all of this info in the wiki.

Thanks.


On 02/25/2012 06:11 AM, fornandakishore wrote:

Hi Pierre,

Yesterday only I have inserted users in to Joomla v2.5.1. As of my knowledge I found two tables (jos_users, jos_user_usergroup_map) are required to insert data.

jos_usergroups - Contains the User groups, you can create more groups from admin area such as Registered, Author, Super Users (etc..)

jos_users - Contains main user information such as name, username, email, password, block etc..

jos_user_usergroup_map - contains mapping to user_id (from jos_users) and group_id (jos_usergrops)

Below is the code written by me to insert data in to these tables using the save function in the custom component model..

                $data = JRequest::get('post');
$userTable = JTable::getInstance('User', 'JTable', $config = array());
$CustomerTable = $this -> getTable();
$userData = array();
$params = JComponentHelper::getParams('com_users');
$useractivation = $params -> get('useractivation');

jimport('joomla.user.helper');
$salt = JUserHelper::genRandomPassword(32);
$pswrd = $data['password'];
$cryptpswrd = JUserHelper::getCryptedPassword($pswrd, $salt);
$dbpassword = $cryptpswrd . ':' . $salt;
$date = date('Y-m-d H:i:s');

if ($data['id'] && $data['customer_id']) {
$userData['id'] = $data['customer_id'];
}
$userData['name'] = $data['first_name'] . ' ' . $data['last_name'];
$userData['username'] = $userData['email'] = $data['email_address'];
if (!empty($data['password'])) {
$userData['password'] = $dbpassword;
}
$userData['block'] = 0;
$userData['registerDate'] = $date;

if (empty($data['id']) && empty($data['customer_id'])) {
// Check if the user needs to activate their account.
if (($useractivation == 1) || ($useractivation == 2)) {
$userData['activation'] = JApplication::getHash(JUserHelper::genRandomPassword());
$userData['block'] = 1;
}
}
//echo "<pre>"; print_r($data); print_r($userData); exit ;

// Inserting Data into Users Table
if (!$userTable -> bind($userData)) {
$this -> setError($userTable -> getError());
return false;
}
// Check the data.
if (!$userTable -> check()) {
$this -> setError($userTable -> getError());
return false;
}
// Store the data.
if (!$userTable -> store()) {
$this -> setError($userTable -> getError());
return false;
}
if (empty($data['id']) && empty($data['customer_id'])) {
$userid = $userTable -> get('id');
} else {
$userid = $data['customer_id'];
}
// Inserting Data into Users Group Table
if (empty($data['id'])) {

$sql = "INSERT INTO `#__user_usergroup_map` (`user_id`, `group_id`) VALUES('" . $userid . "','2')";
$this -> _db -> setQuery($sql);
if (!$this -> _db -> query()) {
JError::raiseError(500, $this -> _db -> getErrorMsg());
}
}
// some other code to ..

I guess this may help you.. :)

 
---------------------

Nanda Kishore. M

PHP Developer

http://php-desk.blogspot.com

Ph: + 91 98499 71144 (Cell)




On Sat, Feb 25, 2012 at 01:31, pierre dechery <pierre.dechery@gmail.com> wrote:
Hi everyone,

I need to migrate the users from a 1.0 to a 2.5 Joomla site. Not any content, just the users.

Since my original 1.0 jos_users table is very modificated, with many customized fields, I wish to do the migration manually in phpMyAdmin, but I'd like to confirm exactly what tables in Joomla 2.5 need to be updated.

For what I've learned so far, they are:

 
Anyone can help by saying it's ok, and maybe the exact function of each table? I haven't found this information yet, and any help will be much appreciated.

Regards,

Pierre
--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-cms/-/3W_qpjDDDCUJ.
To post to this group, send an email to joomla-dev-cms@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cms+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To post to this group, send an email to joomla-dev-cms@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cms+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.