[geeklog-cvs] Geeklog-1.x/plugins/calendar functions.inc, 1.81, 1.82

Dirk Haun dhaun at qs1489.pair.com
Sat Apr 12 16:34:20 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/calendar
In directory qs1489.pair.com:/tmp/cvs-serv51101/plugins/calendar

Modified Files:
	functions.inc 
Log Message:
Fixed deleting events submissions from the Events editor


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/calendar/functions.inc,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** functions.inc	17 Mar 2008 21:12:54 -0000	1.81
--- functions.inc	12 Apr 2008 20:34:18 -0000	1.82
***************
*** 303,308 ****
  *
  */
! function plugin_ismoderator_calendar() {
!     return SEC_hasRights ('calendar.moderate');
  }
  
--- 303,309 ----
  *
  */
! function plugin_ismoderator_calendar()
! {
!     return SEC_hasRights('calendar.moderate');
  }
  
***************
*** 770,794 ****
  *
  * @param    string  $eid    id of event to delete
  * @param    string          HTML redirect
  */
! function CALENDAR_deleteEvent ($eid)
  {
      global $_CONF, $_TABLES, $_USER;
  
!     $result = DB_query ("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon "
!                        ."FROM {$_TABLES['events']} WHERE eid = '$eid'");
!     $A = DB_fetchArray ($result);
!     $access = SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'],
!             $A['perm_group'], $A['perm_members'], $A['perm_anon']);
!     if ($access < 3) {
!         COM_accessLog ("User {$_USER['username']} tried to illegally delete event $eid.");
!         return COM_refresh ($_CONF['site_admin_url'] . '/plugins/calendar/index.php');
!     }
  
!     DB_delete ($_TABLES['events'], 'eid', $eid);
!     DB_delete ($_TABLES['personal_events'], 'eid', $eid);
!     COM_rdfUpToDateCheck ('geeklog', 'calendar', $eid);
  
!     return COM_refresh ($_CONF['site_admin_url'] . '/plugins/calendar/index.php?msg=18');
  }
  
--- 771,810 ----
  *
  * @param    string  $eid    id of event to delete
+ * @param    string  $type   'submission' when attempting to delete a submission
  * @param    string          HTML redirect
  */
! function CALENDAR_deleteEvent($eid, $type = '')
  {
      global $_CONF, $_TABLES, $_USER;
  
!     if (empty($type)) { // delete regular event
!         $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['events']} WHERE eid = '$eid'");
!         $A = DB_fetchArray($result);
!         $access = SEC_hasAccess($A['owner_id'], $A['group_id'],
!                     $A['perm_owner'], $A['perm_group'], $A['perm_members'],
!                     $A['perm_anon']);
!         if ($access < 3) {
!             COM_accessLog("User {$_USER['username']} tried to illegally delete event $eid.");
!             return COM_refresh($_CONF['site_admin_url']
!                                . '/plugins/calendar/index.php');
!         }
  
!         DB_delete($_TABLES['events'], 'eid', $eid);
!         DB_delete($_TABLES['personal_events'], 'eid', $eid);
!         COM_rdfUpToDateCheck('geeklog', 'calendar', $eid);
  
!         return COM_refresh($_CONF['site_admin_url'] . '/plugins/calendar/index.php?msg=18');
!     } elseif ($type == 'submission') {
!         if (plugin_ismoderator_calendar()) {
!             DB_delete($_TABLES['eventsubmission'], 'eid', $eid);
!         } else {
!             COM_accessLog("User {$_USER['username']} tried to illegally delete event submission $eid.");
!         }
!     } else {
!         COM_accessLog("User {$_USER['username']} tried to illegally delete event $eid of type $type.");
!     }
! 
!     return COM_refresh($_CONF['site_admin_url']
!                        . '/plugins/calendar/index.php');
  }
  




More information about the geeklog-cvs mailing list