[geeklog-cvs] Geeklog-1.x/plugins/calendar functions.inc, 1.83, 1.84
Dirk Haun
dhaun at qs1489.pair.com
Sat Apr 19 11:04:07 EDT 2008
Update of /cvsroot/geeklog/Geeklog-1.x/plugins/calendar
In directory qs1489.pair.com:/tmp/cvs-serv35507/plugins/calendar
Modified Files:
functions.inc
Log Message:
Bring group and default permission handling for 'calendar.submit' in sync with the Links plugin
Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/calendar/functions.inc,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** functions.inc 17 Apr 2008 18:33:27 -0000 1.83
--- functions.inc 19 Apr 2008 15:04:05 -0000 1.84
***************
*** 549,553 ****
if (($_CA_CONF['eventsubmission'] == 1) &&
! !SEC_hasRights ('calendar.submit')) {
DB_save ($_TABLES['eventsubmission'],
'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description',
--- 549,554 ----
if (($_CA_CONF['eventsubmission'] == 1) &&
! !SEC_hasRights('calendar.submit')) {
!
DB_save ($_TABLES['eventsubmission'],
'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description',
***************
*** 559,584 ****
}
! $retval = COM_refresh ($_CONF['site_url'] . '/calendar/index.php?msg=4');
} else {
! if (isset ($_USER['uid']) && ($_USER['uid'] > 1)) {
$owner_id = $_USER['uid'];
} else {
! $owner_id = 1; // anonymous user
}
DB_save ($_TABLES['events'],
! 'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description,owner_id',
! "{$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']}',$owner_id");
! if (isset ($_CA_CONF['notification']) &&
($_CA_CONF['notification'] == 1)) {
! CALENDAR_sendNotification ($_TABLES['events'], $A);
}
! COM_rdfUpToDateCheck ();
! $retval = COM_refresh ($_CONF['site_url'] . '/calendar/index.php');
}
} else if ($_CA_CONF['personalcalendars'] == 1) { // add to personal calendar
! if (isset ($_USER['uid']) && ($_USER['uid'] > 1)) {
DB_save ($_TABLES['personal_events'],
'uid,eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description',
--- 560,601 ----
}
! $retval = COM_refresh($_CONF['site_url']
! . '/calendar/index.php?msg=4');
} else {
! if (COM_isAnonUser()) {
! $owner_id = 1; // anonymous user
! } else {
$owner_id = $_USER['uid'];
+ }
+
+ if (SEC_hasRights('calendar.submit')) {
+ $A['group_id'] = SEC_getFeatureGroup('calendar.submit');
} else {
! $A['group_id'] = DB_getItem($_TABLES['groups'], 'grp_id',
! "grp_name = 'All Users'");
}
+ SEC_setDefaultPermissions($A, $_CA_CONF['default_permissions']);
DB_save ($_TABLES['events'],
! 'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon',
! "{$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']}',$owner_id,{$A['group_id']},{$A['perm_owner']},{$A['perm_group']},{$A['perm_members']},{$A['perm_anon']}");
!
! if (isset($_CA_CONF['notification']) &&
($_CA_CONF['notification'] == 1)) {
! CALENDAR_sendNotification($_TABLES['events'], $A);
}
! COM_rdfUpToDateCheck('calendar', $A['event_type'], $A['eid']);
! $retval = COM_refresh($_CONF['site_url']
! . '/calendar/index.php?msg=17');
}
} else if ($_CA_CONF['personalcalendars'] == 1) { // add to personal calendar
! if (COM_isAnonUser()) {
! // anonymous users don't have personal calendars - bail
! COM_accessLog("Attempt to write to the personal calendar of user '{$A['uid']}'.");
!
! $retval = COM_refresh($_CONF['site_url'] . '/calendar/index.php');
! } else {
DB_save ($_TABLES['personal_events'],
'uid,eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description',
***************
*** 586,594 ****
$retval = COM_refresh ($_CONF['site_url']
. '/calendar/index.php?mode=personal&msg=17');
- } else {
- // anonymous users don't have personal calendars - bail
- COM_accessLog ("Attempt to write to the personal calendar of user '{$A['uid']}'.");
-
- $retval = COM_refresh ($_CONF['site_url'] . '/calendar/index.php');
}
--- 603,606 ----
More information about the geeklog-cvs
mailing list