From b8e251041130fe0c26c9a7f0357b7317fae0bde4 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Fri, 7 Sep 2012 11:41:57 +0200 Subject: do not create conferences with negative durations --- models/model.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'models') diff --git a/models/model.php b/models/model.php index 6680409db..05378217e 100644 --- a/models/model.php +++ b/models/model.php @@ -2381,14 +2381,18 @@ function event_calendar_create_bbb_conf($event) { // fix duration bug # $duration = (int)(($event->real_end_time-$event->start_date)/60)+$day_in_minutes; $duration = (int)(($event->real_end_time-$now)/60)+$day_in_minutes; - $title = urlencode($event->title); - $output = event_calendar_bbb_api('create',array('meetingID'=>$event->guid,'name'=>$title,'duration'=>$duration)); - if ($output) { - $xml = new SimpleXMLElement($output); - if ($xml->returncode == 'SUCCESS') { - $event->bbb_attendee_password = (string) $xml->attendeePW; - $event->bbb_moderator_password = (string) $xml->moderatorPW; - return TRUE; + if ($duration > 0) { + $title = urlencode($event->title); + $output = event_calendar_bbb_api('create',array('meetingID'=>$event->guid,'name'=>$title,'duration'=>$duration)); + if ($output) { + $xml = new SimpleXMLElement($output); + if ($xml->returncode == 'SUCCESS') { + $event->bbb_attendee_password = (string) $xml->attendeePW; + $event->bbb_moderator_password = (string) $xml->moderatorPW; + return TRUE; + } else { + return FALSE; + } } else { return FALSE; } -- cgit v1.2.3