From ab51102cd051b726ec4d8cef916f784543377fed Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Wed, 30 Oct 2013 20:20:06 +0100 Subject: [PATCH] improve message after registration --- materio_user.pages.inc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/materio_user.pages.inc b/materio_user.pages.inc index 40741b6c..0505c9bb 100644 --- a/materio_user.pages.inc +++ b/materio_user.pages.inc @@ -21,12 +21,19 @@ function materio_user_register_submit(){ $form_state = array( "values"=>$_POST); drupal_form_submit($_POST['form_id'], $form_state); - $return['form_state'] = $form_state; + // $return['form_state'] = $form_state; $return['errors'] = form_get_errors(); - if($return['errors']) + if($return['errors']){ unset ($_SESSION['messages']['error']); - + }else{ + $messages = drupal_get_messages('status'); + // $return['messages'] = $messages; + drupal_set_message(t("Congratulation, you juste created your free materiO' account, welcome !"), 'status'); + foreach ($messages['status'] as $msg) { + drupal_set_message($msg, 'status'); + } + } // after registration user is automaticly logged in, thank's to login tobogan module drupal_json_output($return);