I wonder if Ghia's idea could be improved?
One extra benefit or adding users in profile/admin over sytem/admin is that you can choose whether to add the user as 'active' or 'inactive'.
I can imagine it could be useful to add many users at the same time but leave them 'inactive' - which is the default on the screen anyway. Sending out the welcome message to inactive users would seem wrong, it would be better when the user was activated later.
If a user had been active in the past and for some reason a site admin had de-activated them, then when the user was re-activated it would be helpful to re-send the welcome message, particularly if it includes the disclaimers etc.
So how about changing (around line 107 in ../profile/admin/user.php)
if ( isset($_POST['level']) && $user->getVar('level') != intval($_POST['level']) ) {
$user->setVar('level', intval($_POST['level']) );
}
to
if ( isset($_POST['level']) && $user->getVar('level') != intval($_POST['level']) ) {
$userLevelChange = true;
$user->setVar('level', intval($_POST['level']) );
}
and later changing
if ( $user->isNew() ) {
redirect_header('user.php', 2, _PROFILE_AM_USERCREATED, false);
} else {
redirect_header('user.php', 2, _US_PROFUPDATED, false);
}
to
if ( $user->isNew() ) {
if ($user->getVar('level')) {
XoopsUserUtility::sendWelcome($user);
}
redirect_header('user.php', 2, _PROFILE_AM_USERCREATED, false);
} else {
if ($userLevelChange && $user->getVar('level')) {
XoopsUserUtility::sendWelcome($user);
}
redirect_header('user.php', 2, _US_PROFUPDATED, false);
}