[geeklog-cvs] geeklog: Use COM_isAnonUser

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Jun 1 10:19:18 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/513cf4019e90
changeset: 7076:513cf4019e90
user:      Dirk Haun <dirk at haun-online.de>
date:      Mon Jun 01 15:14:41 2009 +0200
description:
Use COM_isAnonUser

diffstat:

 plugins/calendar/functions.inc |  8 ++++----
 plugins/polls/functions.inc    |  6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r 7f638764a464 -r 513cf4019e90 plugins/calendar/functions.inc
--- a/plugins/calendar/functions.inc	Mon Jun 01 12:30:40 2009 +0200
+++ b/plugins/calendar/functions.inc	Mon Jun 01 15:14:41 2009 +0200
@@ -68,13 +68,13 @@
 * NOTE: this MUST return the url/value pairs in the following format
 * $<arrayname>[<label>] = <url>
 *
+* @return   mixed   menu entry, or boolean false if disabled / hidden
 */
-function plugin_getmenuitems_calendar ()
+function plugin_getmenuitems_calendar()
 {
-    global $_CONF, $_USER, $_CA_CONF, $LANG_CAL_1;
+    global $_CONF, $_CA_CONF, $LANG_CAL_1;
 
-    $anon = (empty ($_USER['uid']) || ($_USER['uid'] <= 1)) ? true : false;
-    if (($_CA_CONF['hidecalendarmenu'] == 1) || ($anon &&
+    if (($_CA_CONF['hidecalendarmenu'] == 1) || (COM_isAnonUser() &&
             ($_CONF['loginrequired'] || $_CA_CONF['calendarloginrequired']))) {
         return false;
     }
diff -r 7f638764a464 -r 513cf4019e90 plugins/polls/functions.inc
--- a/plugins/polls/functions.inc	Mon Jun 01 12:30:40 2009 +0200
+++ b/plugins/polls/functions.inc	Mon Jun 01 15:14:41 2009 +0200
@@ -77,13 +77,13 @@
 * NOTE: this MUST return the url/value pairs in the following format
 * $<arrayname>[<label>] = <url>
 *
+* @return   mixed   menu entry, or boolean false if disabled / hidden
 */
 function plugin_getmenuitems_polls ()
 {
-    global $_CONF, $_USER, $_PO_CONF, $LANG_POLLS;
+    global $_CONF, $_PO_CONF, $LANG_POLLS;
 
-    $anon = (empty ($_USER['uid']) || ($_USER['uid'] <= 1)) ? true : false;
-    if (($_PO_CONF['hidepollsmenu'] == 1) || ($anon &&
+    if (($_PO_CONF['hidepollsmenu'] == 1) || (COM_isAnonUser() &&
                 ($_CONF['loginrequired'] || $_PO_CONF['pollsloginrequired']))) {
         return false;
     }



More information about the geeklog-cvs mailing list