In the function og_user_roles_register(), anonymous users click a link to login:
function og_user_roles_register() {
global $user;
if ($user->uid) {
drupal_set_message(t('If you have received a registration code for access to a group, process it here.'));
} else {
drupal_set_message(l('You must register/login use registration codes.', 'user/login'));
...
}
After logging in or registering, the user is redirected to their user profile page.
My small feature request is that the user instead be redirected back to this form.
I have created some custom code to accomplish this using drupal_get_destination():
if (!$user->uid){
$message = "You must "
. l('register','user/register', array('query' => drupal_get_destination()))
. "or "
. l('login','user/login', array('query' => drupal_get_destination()))
. "to use registration codes";
drupal_set_message($message);
}
- Mindy
Comments
Comment #1
somebodysysop commentedWe still need to provide a message to the user if he *is* logged in, so what about:
Comment #2
kobnim commentedHi,
I'd like to suggest a small tweak to the wording:
Instead of:
how about:
How does that sound?
- Mindy
Comment #3
somebodysysop commentedSounds fine to me. Have you tried this code?
Comment #4
kobnim commentedYes, the code is working for me.
Comment #5
sunAfter the rise of the rewritten OGUR 4.x for Drupal 6, in which many unrelated features of OGUR were removed, and nearing a release of Drupal 7, I'm closing down old issues.
Comment #6
somebodysysop commentedThe person who changed the status of these issues to "won't fix" was not authorized to do so: http://drupal.org/node/352139#comment-2352234
OGUR 6.x-1.x will continue to be maintained by me.