aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-09-07 11:41:57 +0200
committerKevin Jardine <kevinjardine@yahoo.com>2012-09-07 11:41:57 +0200
commitb8e251041130fe0c26c9a7f0357b7317fae0bde4 (patch)
tree1e40923be8ceb48f5e95dfde4c560d5cbf98536e
parente2410ff02068bd012174ff31b143c11f65f0f485 (diff)
downloadelgg-b8e251041130fe0c26c9a7f0357b7317fae0bde4.tar.gz
elgg-b8e251041130fe0c26c9a7f0357b7317fae0bde4.tar.bz2
do not create conferences with negative durations
-rw-r--r--models/model.php20
1 files changed, 12 insertions, 8 deletions
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;
}