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

somebodysysop’s picture

We still need to provide a message to the user if he *is* logged in, so what about:

 if ($user->uid) {
    $message = t('If you have received a registration code for access to a group, process it here.');
  } else {
$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);
kobnim’s picture

Hi,
I'd like to suggest a small tweak to the wording:

Instead of:

$message = t('If you have received a registration code for access to a group, process it here.');

how about:

$message = t('If you were given a registration code to join a particular group, please enter it below. Otherwise, for a list of groups you may be able to join without a registration code, please click l("here", "og/".');

How does that sound?

- Mindy

somebodysysop’s picture

Sounds fine to me. Have you tried this code?

kobnim’s picture

Yes, the code is working for me.

sun’s picture

Status: Active » Closed (won't fix)

After 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.

somebodysysop’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

The 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.