From c92213ecaa3c0b7dce8dd5369f09c42c77122f62 Mon Sep 17 00:00:00 2001 From: FraGoTe Date: Mon, 23 Sep 2013 02:56:01 -0500 Subject: [PATCH] Open Meetings Integration Plugin --- .../om_integration/lib/om_integration.lib.php | 196 ++++++++++-------- ...dGenerateRoomHashByURLAndRecFlag.class.php | 15 ++ plugin/om_integration/start.php | 5 +- 3 files changed, 131 insertions(+), 85 deletions(-) create mode 100644 plugin/om_integration/lib/services/setUserObjectAndGenerateRoomHashByURLAndRecFlag/setUserObjectAndGenerateRoomHashByURLAndRecFlag.class.php diff --git a/plugin/om_integration/lib/om_integration.lib.php b/plugin/om_integration/lib/om_integration.lib.php index 45b2b1c293..decfbb31d2 100644 --- a/plugin/om_integration/lib/om_integration.lib.php +++ b/plugin/om_integration/lib/om_integration.lib.php @@ -3,6 +3,7 @@ include_once 'services/getSession/getSession.class.php'; include_once 'services/loginUser/loginUser.class.php'; include_once 'services/addRoomWithModerationAndExternalType/addRoomWithModerationAndExternalType.class.php'; include_once 'services/getRoomWithCurrentUsersById/getRoomWithCurrentUsersById.class.php'; +include_once 'services/setUserObjectAndGenerateRoomHashByURLAndRecFlag/setUserObjectAndGenerateRoomHashByURLAndRecFlag.class.php'; /** * Open Meetings-Chamilo connector class */ @@ -110,7 +111,7 @@ class om_integration { $objAddRoom->isDemoRoom = false; $objAddRoom->demoTime = false; $objAddRoom->isModeratedRoom = $isModerated; - $objAddRoom->externalRoomType = 'Chamilo'; + $objAddRoom->externalRoomType = 'chamilo'; $omServices = new SoapClient( $urlWsdl ); $adFun = $omServices->addRoomWithModerationAndExternalType( $objAddRoom ); @@ -146,6 +147,7 @@ class om_integration { * @assert ('abcdefghijklmnopqrstuvwxyzabcdefghijklmno') === false */ function join_meeting($meetingid) { + if (empty($meetingid)) { return false; } $pass = $this->get_user_meeting_password(); $meeting_data = Database::select('*', $this->table, array('where' => array('id = ? AND status = 1 ' => $meetingid)), 'first'); @@ -153,35 +155,23 @@ class om_integration { if ($this->debug) error_log("meeting does not exist: $meetingid "); return false; } + + $params = array( 'room_id' => $meetingid ); + $returnVal = $this->setUserObjectAndGenerateRoomHashByURLAndRecFlag( $params ); + $urlWithoutProtocol = str_replace("http://", CONFIG_OMSERVER_BASE_URL); + $imgWithoutProtocol = str_replace("http://", $_SESSION['_user']['avatar'] ); - $meeting_is_running_info = $this->api->isMeetingRunningWithXmlResponseArray($meeting_data['id']); - $meeting_is_running = $meeting_is_running_info['running'] == 'true' ? true : false; - - if ($this->debug) error_log("meeting is running: ".$meeting_is_running); - - $params = array( - 'meetingId' => $meeting_data['id'], // -- REQUIRED - The unique id for the meeting - 'password' => $this->get_mod_meeting_password() // -- REQUIRED - The moderator password for the meeting - ); - - $meeting_info_exists = $this->get_meeting_info($params); + $iframe = CONFIG_OMSERVER_BASE_URL . "/?" . + "secureHash=" . $returnVal . + "&scopeRoomId=" . $meeting_data['id'] . + "&language=" . "" . + "&picture=" . $imgWithoutProtocol . + "&user_id=". $_SESSION['_user']['user_id'] . + "&chamiloRoom=1" . + "&wwwroot=" . $urlWithoutProtocol; + + printf("