Browse Source

API: tripal_set_message now only shown to uid 1

Lacey Sanderson 11 years ago
parent
commit
aa0f4f7a28
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tripal_core/api/tripal_core.tripal.api.inc

+ 7 - 0
tripal_core/api/tripal_core.tripal.api.inc

@@ -128,6 +128,13 @@ function tripal_report_error($type, $severity, $message, $variables = array(), $
  *         The default is FALSE.
  */
 function tripal_set_message($message, $importance = TRIPAL_INFO, $options = array()) {
+  global $user;
+
+  // Only show the message to the administrator user (uid=1)
+  // thus if the current user is not the administrator then return nothing
+  if ($user->uid > 1) {
+    return '';
+  }
 
   // set defaults
   $options['return_html'] = (isset($options['return_html'])) ? $options['return_html'] : FALSE;