This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
montpellier/drupal/mon_agglo_comptecitoyen/mon_agglo_comptecitoyen.module

51 lines
1.1 KiB
Plaintext

<?php
function _edit_user_callback() {
unset($_REQUEST['destination']);
return drupal_goto("https://connexion.montpellier-agglo.com/accounts");
}
function _create_user_callback() {
unset($_REQUEST['destination']);
return drupal_goto("https://connexion.montpellier-agglo.com/accounts/register");
}
/* user_login hook) */
function mon_agglo_comptecitoyen_user_login(&$edit, $account) {
$edit['redirect'] = '';
}
/**
* Show /manual_login page
*/
function mon_agglo_comptecitoyen_login_page() {
return drupal_get_form('user_login');
}
/**
* Implements hook_menu_alter().
*/
function mon_agglo_comptecitoyen_menu_alter(&$items) {
$items['user']['page callback'] = '_edit_user_callback';
$items['user/%user_uid_optional']['page callback'] = '_edit_user_callback';
$items['admin/people/create']['page callback'] = '_create_user_callback';
}
/**
* Implements hook_menu().
*/
function mon_agglo_comptecitoyen_menu() {
$items = array();
$items['manual_login'] = array(
'title' => 'User account',
'page callback' => 'mon_agglo_comptecitoyen_login_page',
'access callback' => TRUE,
);
return $items;
}