Do all users, backend and front end reside in the same tables?
Yes.
The website is going to have different tiered users that get access to different things, any advice on how to best use Modx login on this.
The login process just logs you in. The access control is done with the Security Permissions system. I'm afraid it's not very intuitive, but if all you need is to limit users in particular User Groups to particular groups of resources (front-end pages), it's not quite as bad. There's some information on a bunch of different pages here:
http://bobsguides.com/revolution-permissions.html.
There is also
this 50-minute video of me explaining how it works.
If you want to limit access to files, you use Media Sources.
As far as the password could I set a password then have them change it when they log into the account? Sending them an email stating the username and password, but require change at login? Something to that effect.
Yes, as long as all the usernames are unique that could work. Actually forcing them to create a new password would be a little tricky and would take some custom code, but it's definitely doable if you have the PHP skills.
There is salt and passwords are not in plain text.
As I mentioned, if you can find the login code at the old site, you could put it in a MODX plugin at the new site and use it to both log the user in, and update their password and salt to MODX-style without the user even being aware of it. That way they could continue to use their old username and password.
I've done this for a client, so it definitely works. There's description of what the plugin looks like in the Blog article I linked to above.
Thanks for buying my book. There's some information in there about how user information is stored, but not much that speaks to your specific problem.
There's a field list for the user object here:
http://bobsguides.com/modx-object-quick-reference.html#modUser.
And one for the User Profile here:
http://bobsguides.com/modx-object-quick-reference.html#modUserProfile.
*************
The basic process I used for importing the users is to create translation arrays, one for the user object and one for the profile object. The key is the name of the field at the old site and the value is the name of the field at the new site.
The user import snippet code looks something like this (untested and off the top of my head):
$output = '';
$userFields = array(
'oldField1' => 'newField1',
'oldField2' => 'newField2',
// etc.
}
$profileFields = array(
'oldField1' => 'newField1',
'oldField2' => 'newField2',
// etc.
}
while (line from CSV is read) {
$userData = array of oldFieldname/value pairs holding data for one user created from CSV line
$output = '<br />Processing user: ' . $userData['username'];
foreach ($userData as $fieldName => $value) {
$user = $modx->newObject('modUser');
$userProfile = $this->modx->newObject('modUserProfile');
$user->addOne($userProfile, 'Profile');
if (in_array($fieldName, $userFields)) {
/* Password and salt fields need special handling, otherwise, MODX will
hash the hash and create a new salt */
if ($field == 'password') {
$user->_setRaw($userFields[$fieldName], $value);
} elseif ($field == 'salt') {
$user->_setRaw($userFields[$fieldName], $value);
} else {
$user->set($userFields[$fieldName], $value);
$output .= '</br> --- Set new field ' . $userFields[$fieldName] . 'to . $value;
}
} elseif (in_array($fieldName, $profileFields)) {
$profile->set($profileFields[$fieldName], $value);
$output .= '</br> --- Set new field ' . $profileFields[$fieldName] . 'to . $value;
} else {
$output .= '</br> --- Unused field (old) ' . $fieldName . ' -- value = ' . $value;
}
}
/* Uncomment these after the output looks correct */
// $user->save();
// $userProfile->save();
}
return $output;