[geeklog-cvs] geeklog: Fixed error if user is anonymous when viewing What's Ne...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Thu Mar 25 14:16:58 EDT 2010
changeset 7829:bc496accc8d4
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/bc496accc8d4
user: Tom <websitemaster at cogeco.net>
date: Thu Mar 25 13:41:25 2010 -0400
description:
Fixed error if user is anonymous when viewing What's New Block.
diffstat:
plugins/polls/functions.inc | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (27 lines):
diff -r a6a301bada92 -r bc496accc8d4 plugins/polls/functions.inc
--- a/plugins/polls/functions.inc Sat Mar 20 15:56:56 2010 -0400
+++ b/plugins/polls/functions.inc Thu Mar 25 13:41:25 2010 -0400
@@ -1318,8 +1318,13 @@
. '/polls/index.php?pid=' . $pid
. '&aid=-1';
} else {
+ if (COM_isAnonUser()) {
+ $userid = 1;
+ } else {
+ $userid = $_USER['uid'];
+ }
// Users who have already voted but cannot see the results cannot view link
- if ($_USER['uid'] == 2 || ($_USER['uid'] != 2 && !($A['hideresults'] == 1 && (isset($_COOKIE['poll-' . $A['pid']]) || POLLS_ipAlreadyVoted($A['pid']))))) {
+ if ($userid == 2 || ($userid != 2 && !($A['hideresults'] == 1 && (isset($_COOKIE['poll-' . $A['pid']]) || POLLS_ipAlreadyVoted($A['pid']))))) {
$props['url'] = $_CONF['site_url']
. '/polls/index.php?pid=' . $A['pid'];
// . '&aid=-1';
@@ -1587,6 +1592,8 @@
{
global $_CONF, $_TABLES;
+ $stwhere = '';
+
if ($uid > 0) {
$stwhere = " AND ({$_TABLES['comments']}.uid = $uid)";
}
More information about the geeklog-cvs
mailing list