diff options
author | Sashi20 | 2019-07-26 11:34:06 +0530 |
---|---|---|
committer | Sashi20 | 2019-07-26 11:34:06 +0530 |
commit | ce69ac900621fe10eb9d7660171cf4c25f72dfcb (patch) | |
tree | 6f228e8129c218644f8e3bafd92aa1f79491d312 | |
parent | 91e35563ff4d7f0170005505e7b5537fe074042a (diff) | |
download | esim_workshop_form-ce69ac900621fe10eb9d7660171cf4c25f72dfcb.tar.gz esim_workshop_form-ce69ac900621fe10eb9d7660171cf4c25f72dfcb.tar.bz2 esim_workshop_form-ce69ac900621fe10eb9d7660171cf4c25f72dfcb.zip |
Modify error message displayed when user accesses the form without logging in
-rw-r--r-- | esim_workshop_form_2019.inc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/esim_workshop_form_2019.inc b/esim_workshop_form_2019.inc index 58e6d44..af24adf 100644 --- a/esim_workshop_form_2019.inc +++ b/esim_workshop_form_2019.inc @@ -6,9 +6,11 @@ function esim_workshop_form_page() { global $user; $data = ''; - if (!$user) + if ($user->uid == 0) { - $data .= "Please login to give feedback"; + $msg = drupal_set_message(t('It is mandatory to ' . l('login', 'user') . ' on this website to access the workshop form. If you are new user please create a new account first.'), 'error'); + drupal_goto('user'); + return $msg; } //!$user /************* Check if user has already submitted a proposal **************/ $query = db_select('esim_workshop_2019_form_step1_feedback'); @@ -59,6 +61,13 @@ function esim_workshop_step1_form($form, &$form_state, $no_js_use = FALSE) { global $user; global $base_url; + if ($user->uid == 0) + { + $msg = drupal_set_message(t('It is mandatory to ' . l('login', 'user') . ' on this website to access the flowsheet proposal form. If you are new user please create a new account first.'), 'error'); + //drupal_goto('om-flowsheet-project'); + drupal_goto('user'); + return $msg; + } // All the real form fields. $query = db_select('esim_workshop_2019_form_step1_feedback'); $query->fields('esim_workshop_2019_form_step1_feedback'); |