Fixed handling of owner_id for anonymous event submissions HEAD
authorDirk Haun <dirk@haun-online.de>
Sat Oct 03 15:08:13 2009 +0200 (5 months ago)
branchHEAD
changeset 7346c1c6258c8b23
parent 73451185208e854a
child 7347752c977d9aa0
Fixed handling of owner_id for anonymous event submissions
plugins/calendar/functions.inc
     1.1 --- a/plugins/calendar/functions.inc	Sat Oct 03 14:50:24 2009 +0200
     1.2 +++ b/plugins/calendar/functions.inc	Sat Oct 03 15:08:13 2009 +0200
     1.3 @@ -578,9 +578,15 @@
     1.4          if (($_CA_CONF['eventsubmission'] == 1) &&
     1.5                  !SEC_hasRights('calendar.submit')) {
     1.6  
     1.7 +            if (COM_isAnonUser()) {
     1.8 +                $uid = 1;
     1.9 +            } else {
    1.10 +                $uid = $_USER['uid'];
    1.11 +            }
    1.12 +
    1.13              DB_save ($_TABLES['eventsubmission'],
    1.14                       'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description,owner_id',
    1.15 -                     "{$A['eid']},'{$A['title']}','{$A['event_type']}','{$A['url']}','{$A['datestart']}','{$A['timestart']}','{$A['dateend']}','{$A['timeend']}',{$A['allday']},'{$A['location']}','{$A['address1']}','{$A['address2']}','{$A['city']}','{$A['state']}','{$A['zipcode']}','{$A['description']}',{$_USER['uid']}");
    1.16 +                     "{$A['eid']},'{$A['title']}','{$A['event_type']}','{$A['url']}','{$A['datestart']}','{$A['timestart']}','{$A['dateend']}','{$A['timeend']}',{$A['allday']},'{$A['location']}','{$A['address1']}','{$A['address2']}','{$A['city']}','{$A['state']}','{$A['zipcode']}','{$A['description']}',{$uid}");
    1.17  
    1.18              if (isset ($_CA_CONF['notification']) &&
    1.19                      ($_CA_CONF['notification'] == 1)) {