Minor - Adding PHP comments, formatting code, updating credits.

1.9.x
Julio Montoya 12 years ago
parent 5e848bf21f
commit 6b7c1f5c7e
  1. 1
      plugin/openmeetings/config.php
  2. 7
      plugin/openmeetings/lib/openmeetings.class.php
  3. 4
      plugin/openmeetings/lib/openmeetings_api.php
  4. 70
      plugin/openmeetings/lib/openmeetings_gateway.php
  5. 17
      plugin/openmeetings/lib/openmeetings_plugin.class.php
  6. 2
      plugin/openmeetings/lib/session.class.php
  7. 1
      plugin/openmeetings/lib/user.class.php
  8. 1
      plugin/openmeetings/readme.txt

@ -10,4 +10,3 @@ require_once 'lib/openmeetings.class.php';
require_once 'lib/openmeetings_plugin.class.php'; require_once 'lib/openmeetings_plugin.class.php';
require_once 'lib/openmeetings_gateway.php'; require_once 'lib/openmeetings_gateway.php';
require_once 'lib/openmeetings_rest_service.php'; require_once 'lib/openmeetings_rest_service.php';

@ -231,7 +231,9 @@ class OpenMeetings
); );
if (empty($meetingData)) { if (empty($meetingData)) {
if ($this->debug) error_log("meeting does not exist: $meetingId "); if ($this->debug) {
error_log("meeting does not exist: $meetingId ");
}
return false; return false;
} }
$params = array('room_id' => $meetingData['room_id']); $params = array('room_id' => $meetingData['room_id']);
@ -609,6 +611,7 @@ class OpenMeetings
/** /**
* @param int $id * @param int $id
* @return int
*/ */
public function deleteMeeting($id) public function deleteMeeting($id)
{ {
@ -623,7 +626,7 @@ class OpenMeetings
), ),
array('id = ? ' => $id) array('id = ? ' => $id)
); );
return $id;
//error_log(__FILE__.'+'.__LINE__.' Finished closing'); //error_log(__FILE__.'+'.__LINE__.' Finished closing');
} catch (SoapFault $e) { } catch (SoapFault $e) {
error_log(__FILE__.'+'.__LINE__.' Warning: We have detected some problems: Fault: '.$e->faultstring); error_log(__FILE__.'+'.__LINE__.' Warning: We have detected some problems: Fault: '.$e->faultstring);

@ -15,12 +15,10 @@ class OpenMeetingsAPI
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
$this->_user = CONFIG_OPENMEETINGS_USER; $this->_user = CONFIG_OPENMEETINGS_USER;
$this->_pass = CONFIG_OPENMEETINGS_PASS; $this->_pass = CONFIG_OPENMEETINGS_PASS;
$this->_serverBaseUrl = CONFIG_OPENMEETINGS_SERVER_URL; $this->_serverBaseUrl = CONFIG_OPENMEETINGS_SERVER_URL;
} }
} }

@ -36,7 +36,7 @@ class OpenMeetingsGateway
private $_pass; private $_pass;
private $_url; private $_url;
function __construct($host, $user, $pass) public function __construct($host, $user, $pass)
{ {
$this->_user = urlencode($user); $this->_user = urlencode($user);
$this->_pass = urlencode($pass); $this->_pass = urlencode($pass);
@ -53,17 +53,28 @@ class OpenMeetingsGateway
} }
} }
function getRestUrl($name) /**
* @param string $name
* @return string
*/
public function getRestUrl($name)
{ {
return $this->getUrl() . "/services/" . $name . "/"; return $this->getUrl() . "/services/" . $name . "/";
} }
function getUrl() /**
* @return string
*/
public function getUrl()
{ {
return $this->_url; return $this->_url;
} }
function var_to_str($in) /**
* @param bool $in
* @return string
*/
public function var_to_str($in)
{ {
if (is_bool($in)) { if (is_bool($in)) {
return $in ? "true" : "false"; return $in ? "true" : "false";
@ -75,7 +86,7 @@ class OpenMeetingsGateway
/** /**
* TODO: Get Error Service and show detailed Error Message * TODO: Get Error Service and show detailed Error Message
*/ */
function loginUser() public function loginUser()
{ {
$returnValue = 0; $returnValue = 0;
$response = $this->rest->call($this->getRestUrl("UserService") . "getSession", "session_id"); $response = $this->rest->call($this->getRestUrl("UserService") . "getSession", "session_id");
@ -116,7 +127,11 @@ class OpenMeetingsGateway
} }
} }
function updateRoomWithModeration($room) /**
* @param Room $room
* @return array|bool|int|null
*/
public function updateRoomWithModeration($room)
{ {
$err = $this->rest->getError(); $err = $this->rest->getError();
if ($err) { if ($err) {
@ -160,10 +175,16 @@ class OpenMeetingsGateway
return - 1; return - 1;
} }
/* /**
* public String setUserObjectAndGenerateRecordingHashByURL(String SID, String username, String firstname, String lastname, Long externalUserId, String externalUserType, Long recording_id) * @param $username
* @param $firstname
* @param $lastname
* @param $userId
* @param $systemType
* @param $recording_id
* @return array|bool|int|null
*/ */
function setUserObjectAndGenerateRecordingHashByURL($username, $firstname, $lastname, $userId, $systemType, $recording_id) public function setUserObjectAndGenerateRecordingHashByURL($username, $firstname, $lastname, $userId, $systemType, $recording_id)
{ {
$result = $this->rest->call($this->getRestUrl("UserService") $result = $this->rest->call($this->getRestUrl("UserService")
. 'setUserObjectAndGenerateRecordingHashByURL?' . 'setUserObjectAndGenerateRecordingHashByURL?'
@ -188,7 +209,20 @@ class OpenMeetingsGateway
return - 1; return - 1;
} }
function setUserObjectAndGenerateRoomHashByURLAndRecFlag($username, $firstname, $lastname, $profilePictureUrl, $email, $userId, $systemType, $room_id, $becomeModerator, $allowRecording) /**
* @param $username
* @param $firstname
* @param $lastname
* @param $profilePictureUrl
* @param $email
* @param $userId
* @param $systemType
* @param $room_id
* @param $becomeModerator
* @param $allowRecording
* @return array|bool|int|null
*/
public function setUserObjectAndGenerateRoomHashByURLAndRecFlag($username, $firstname, $lastname, $profilePictureUrl, $email, $userId, $systemType, $room_id, $becomeModerator, $allowRecording)
{ {
$err = $this->rest->getError(); $err = $this->rest->getError();
if ($err) { if ($err) {
@ -230,7 +264,7 @@ class OpenMeetingsGateway
* @param Room $openmeetings * @param Room $openmeetings
* @return array|bool|int|null * @return array|bool|int|null
*/ */
function deleteRoom($openmeetings) public function deleteRoom($openmeetings)
{ {
$err = $this->rest->getError(); $err = $this->rest->getError();
if ($err) { if ($err) {
@ -259,7 +293,7 @@ class OpenMeetingsGateway
/** /**
* Generate a new room hash for entering a conference room * Generate a new room hash for entering a conference room
*/ */
function setUserObjectAndGenerateRoomHash($username, $firstname, $lastname, $profilePictureUrl, $email, $externalUserId, $externalUserType, $room_id, $becomeModeratorAsInt, $showAudioVideoTestAsInt) public function setUserObjectAndGenerateRoomHash($username, $firstname, $lastname, $profilePictureUrl, $email, $externalUserId, $externalUserType, $room_id, $becomeModeratorAsInt, $showAudioVideoTestAsInt)
{ {
$result = $this->rest->call($this->getRestUrl("UserService") $result = $this->rest->call($this->getRestUrl("UserService")
. "setUserObjectAndGenerateRoomHash?" . "setUserObjectAndGenerateRoomHash?"
@ -291,10 +325,10 @@ class OpenMeetingsGateway
/** /**
* Create a new conference room * Create a new conference room
* @param The room object * @param Room The room object
* @return The REST call's result * @return The REST call's result
*/ */
function createRoomWithModAndType($room) public function createRoomWithModAndType($room)
{ {
$service = 'addRoomWithModerationAndExternalType'; $service = 'addRoomWithModerationAndExternalType';
if ($room->allowRecording) { if ($room->allowRecording) {
@ -342,6 +376,7 @@ class OpenMeetingsGateway
/** /**
* Gets the list of open rooms of type "Chamilo" * Gets the list of open rooms of type "Chamilo"
* @param string $type The type of external system connecting to OpenMeetings * @param string $type The type of external system connecting to OpenMeetings
* @return bool
*/ */
public function getRoomsWithCurrentUsersByType($type = 'chamilolms') public function getRoomsWithCurrentUsersByType($type = 'chamilolms')
{ {
@ -393,7 +428,7 @@ class OpenMeetingsGateway
/** /**
* Get list of available recordings made by this instance * Get list of available recordings made by this instance
*/ */
function getRecordingsByExternalRooms() public function getRecordingsByExternalRooms()
{ {
$url = $this->getRestUrl("RoomService") $url = $this->getRestUrl("RoomService")
. "getFlvRecordingByExternalRoomType?" . "getFlvRecordingByExternalRoomType?"
@ -404,12 +439,13 @@ class OpenMeetingsGateway
return $result; return $result;
} }
/** /**
* Get list of available recordings made for the given room * Get list of available recordings made for the given room
* @param int $id Room ID * @param int $id Room ID
* @return array * @return array
*/ */
function getFlvRecordingsByRoomId($id) public function getFlvRecordingsByRoomId($id)
{ {
$url = $this->getRestUrl("RoomService") $url = $this->getRestUrl("RoomService")
. "getFlvRecordingByRoomId?" . "getFlvRecordingByRoomId?"
@ -424,7 +460,7 @@ class OpenMeetingsGateway
/** /**
* Get list of available recordings made by user * Get list of available recordings made by user
*/ */
function getRecordingsByExternalUser($id) public function getRecordingsByExternalUser($id)
{ {
$url = $this->getRestUrl("RoomService") $url = $this->getRestUrl("RoomService")
. "getFlvRecordingByExternalUserId?" . "getFlvRecordingByExternalUserId?"

@ -1,14 +1,19 @@
<?php <?php
/**
* Class OpenMeetingsPlugin
*/
class OpenMeetingsPlugin extends Plugin class OpenMeetingsPlugin extends Plugin
{ {
public $is_course_plugin = true; public $is_course_plugin = true;
//When creating a new course this settings are added to the course //When creating a new course this settings are added to the course
public $course_settings = array( public $course_settings = array(array(
array('name' => 'openmeetings_record_and_store', 'type' => 'checkbox') 'name' => 'openmeetings_record_and_store',
); 'type' => 'checkbox'
));
static function create() public static function create()
{ {
static $result = null; static $result = null;
return $result ? $result : $result = new self(); return $result ? $result : $result = new self();
@ -19,7 +24,7 @@ class OpenMeetingsPlugin extends Plugin
parent::__construct('2.0', 'Francis Gonzales', array('tool_enable' => 'boolean', 'host' =>'text', 'user' => 'text', 'pass' => 'text')); parent::__construct('2.0', 'Francis Gonzales', array('tool_enable' => 'boolean', 'host' =>'text', 'user' => 'text', 'pass' => 'text'));
} }
function install() public function install()
{ {
$table = Database::get_main_table('plugin_openmeetings'); $table = Database::get_main_table('plugin_openmeetings');
// id is the internal unique ID (keeps track of historical sessions // id is the internal unique ID (keeps track of historical sessions
@ -46,7 +51,7 @@ class OpenMeetingsPlugin extends Plugin
$this->install_course_fields_in_all_courses(); $this->install_course_fields_in_all_courses();
} }
function uninstall() public function uninstall()
{ {
$t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); $t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS); $t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);

@ -4,6 +4,7 @@
* @package chamilo.plugin.openmeetings * @package chamilo.plugin.openmeetings
*/ */
namespace Chamilo\Plugin\OpenMeetings; namespace Chamilo\Plugin\OpenMeetings;
/** /**
* Class session * Class session
*/ */
@ -11,6 +12,5 @@ class Session
{ {
public function __construct() public function __construct()
{ {
} }
} }

@ -4,6 +4,7 @@
* @package chamilo.plugin.openmeetings * @package chamilo.plugin.openmeetings
*/ */
namespace Chamilo\Plugin\OpenMeetings; namespace Chamilo\Plugin\OpenMeetings;
/** /**
* Class User * Class User
*/ */

@ -13,3 +13,4 @@ People involved:
* First draft developed by Francis Gonzales Tello - Independent (at the time) * First draft developed by Francis Gonzales Tello - Independent (at the time)
* First stable version published by Yannick Warnier - BeezNest/Chamilo team * First stable version published by Yannick Warnier - BeezNest/Chamilo team
* Maxim Solodovnik - OpenMeetings team - many thanks to him! * Maxim Solodovnik - OpenMeetings team - many thanks to him!
* Julio Montoya - Corrections and adding features.

Loading…
Cancel
Save