|
[geeklog-cvs] geeklog: Clean up $_USER['uid'] handling: msg#00035geeklog-cvs
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/a88b92761fb9 changeset: 7196:a88b92761fb9 user: Dirk Haun <dirk@xxxxxxxxxxxxxx> date: Wed Jul 29 11:13:39 2009 +0200 description: Clean up $_USER['uid'] handling diffstat: system/classes/story.class.php | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-) diffs (81 lines): diff -r 80dd75e48446 -r a88b92761fb9 system/classes/story.class.php --- a/system/classes/story.class.php Wed Jul 29 10:58:19 2009 +0200 +++ b/system/classes/story.class.php Wed Jul 29 11:13:39 2009 +0200 @@ -449,7 +449,11 @@ $this->_show_topic_icon = 1; } - $this->_uid = $_USER['uid']; + if (COM_isAnonUser()) { + $this->_uid = 1; + } else { + $this->_uid = $_USER['uid']; + } $this->_date = time(); $this->_expire = time(); $this->_commentcode = $_CONF['comment_code']; @@ -479,7 +483,11 @@ $this->_statuscode = 0; $this->_featured = 0; - $this->_owner_id = $_USER['uid']; + if (COM_isAnonUser()) { + $this->_owner_id = 1; + } else { + $this->_owner_id = $_USER['uid']; + } if (isset($_GROUPS['Story Admin'])) { $this->_group_id = $_GROUPS['Story Admin']; @@ -792,10 +800,10 @@ { global $_USER, $_CONF, $_TABLES; - if (isset($_USER['uid']) && ($_USER['uid'] > 1)) { + if (COM_isAnonUser()) { + $this->_uid = 1; + } else { $this->_uid = $_USER['uid']; - } else { - $this->_uid = 1; } $this->_postmode = $_CONF['postmode']; @@ -845,6 +853,9 @@ $this->_postmode = COM_applyFilter($array['postmode']); $this->_sid = COM_applyFilter($array['sid']); $this->_uid = COM_applyFilter($array['uid'], true); + if ($this->_uid < 1) { + $this->_uid = 1; + } $this->_unixdate = COM_applyFilter($array['date'], true); if (!isset($array['bodytext'])) { @@ -895,10 +906,10 @@ global $_USER, $_CONF, $_TABLES; $this->_sid = COM_makeSid(); - if (isset($_USER['uid']) && ($_USER['uid'] > 1)) { + if (COM_isAnonUser()) { + $this->_uid = 1; + } else { $this->_uid = $_USER['uid']; - } else { - $this->_uid = 1; } $tmptid = addslashes(COM_sanitizeID($this->_tid)); @@ -949,10 +960,10 @@ $this->_trackbackcode = $_CONF['trackback_code']; $this->_statuscode = 0; $this->_show_topic_icon = $_CONF['show_topic_icon']; - if (isset($_USER['uid'])) { + if (COM_isAnonUser()) { + $this->_owner_id = 1; + } else { $this->_owner_id = $_USER['uid']; - } else { - $this->_owner_id = 1; } $this->_group_id = $T['group_id']; $this->_perm_owner = $T['perm_owner']; _______________________________________________ geeklog-cvs mailing list geeklog-cvs@xxxxxxxxxxxxxxxxx http://eight.pairlist.net/mailman/listinfo/geeklog-cvs
|
|
||||||||||||||||||||||||||
|
|
|
| News | Mail Home | sitemap | FAQ | advertise |