ajax_logintoboggan.module in Ajax 6
File
plugins/loggintoboggan/ajax_logintoboggan.module
View source
<?php
function ajax_logintoboggan_ajax_types(&$types) {
$types['logintoboggan_user_register'] = t('Loggin Toboggan User Register');
return TRUE;
}
function ajax_logintoboggan_ajax_alter(&$form, &$form_state, $form_id) {
global $logintoboggan_denied;
if (isset($logintoboggan_denied) && $logintoboggan_denied) {
$q = ajax_path_info($form['#action']);
if (!array_key_exists('destination', $q['query'])) {
$p = ajax_drupal_path($form['#action']);
$q['query']['destination'] = $p;
$form['#action'] = url($p, array(
'query' => $q['query'],
'fragment' => $q['fragment'],
'absolute' => FALSE,
));
}
}
else {
return FALSE;
}
}