Revision: 247
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=247&view=rev
Author: trollinger
Date: 2008-02-19 14:21:27 -0800 (Tue, 19 Feb 2008)
Log Message:
-----------
Remove a couple of notice/warning error
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/php/common/XmlArchive.php
branches/team/Thomas/integrations_common/php/common/XmlRoom.php
branches/team/Thomas/integrations_common/php/lc/LCAction.php
branches/team/Thomas/integrations_common/php/lc/LCRoom.php
branches/team/Thomas/integrations_common/php/lc/lcapi.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -42,13 +42,18 @@
array("value" => "status_appear", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "enabled_breakoutrooms", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "archiveEnabled", "type" => PARAM_BOOL, "default_value" => "0"),
+ array("value" => "enabled_student_eboard", "type" => PARAM_BOOL, "default_value" => "0"),
+ array("value" => "enabled_students_breakoutrooms", "type" => PARAM_BOOL, "default_value" => "0"),
+ array("value" => "enabled_students_mainrooms", "type" => PARAM_BOOL, "default_value" => "0"),
+ array("value" => "enabled_status", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "appshareEnabled", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "pptEnabled", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "chatEnabled", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "privateChatEnabled", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "accessAvailable", "type" => PARAM_BOOL, "default_value" => "0"),
array("value" => "privateChatEnabled", "type" => PARAM_BOOL, "default_value" => "0"),
- array("value" => "userlimit", "type" => PARAM_INT, "default_value" => -1)
+ array("value" => "userlimit", "type" => PARAM_BOOL, "default_value" => "0"),
+ array("value" => "userlimitValue", "type" => PARAM_INT, "default_value" => -1)
) ;
}
@@ -400,10 +405,14 @@
WIMBA_ERROR => 4
);
global $CFG;
-
+
$log_product = $product."_log_level";
+
+ if(!isset($CFG->$log_product)){
+ $CFG->$log_product=2;//default to Info
+ }
//Write on the logs only if the configured level allows it.
- if ($product=="general" ||$level_values[$level] >= $CFG->$log_product){
+ if ($product=="general" || $level_values[$level] >= $CFG->$log_product){
// Gets the site shortname
$site = get_record('course','id',SITEID);
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -36,11 +36,13 @@
/**
* Configure different parmaters used to generate the xml according to the current product
* @param product : the product which will be display (liveclassroom or voicetools)
- * @param object : contains the informations get from the server
- * @param objectInformations : contains the informations get from the database
+ * @param $serverInformations : contains the informations get from the server
+ * @param $databaseInformations : contains the informations get from the database
*/
- function setCurrentProduct($product, $serverInformations = NULL, $databaseInformations = NULL)
+ function setCurrentProduct($product, $serverInformations = NULL, $databaseInformations= NULL)
{
+
+
$this->product = $product;
$this->currentObject = $serverInformations;
@@ -52,15 +54,17 @@
if ($product == "liveclassroom")
{
+ if(isset($this->currentObject))
$roomId=$this->currentObject->getRoomId();
+
if ($this->currentObject != null && $this->currentObject->isArchive())
{
$this->isArchive = "true";
}
-
- $roomId=$this->currentObject->getRoomId();
+
$courseId=$this->session->getCourseId() . "_S";
$isStudentAdmin= $this->api->isStudentAdmin($roomId, $courseId);
+
if ($this->currentObject == null
|| $this->currentObject != null && $isStudentAdmin == "false")
{
@@ -372,6 +376,7 @@
/********
SESSION
*********/
+
$this->xml->CreateInformationElement(
$this->session->timeOfLoad,
$this->session->hparams["firstname"],
@@ -385,7 +390,7 @@
HEADER
*********/
$this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
-
+
if($update=="update")
{
$this->xml->addContextBarElement(
@@ -630,7 +635,10 @@
$parameters["disabled"] = "true";
}
- $roomId=$this->currentObject->getRoomId();
+ $roomId="";
+ if(isset($this->currentObject))
+ $roomId=$this->currentObject->getRoomId();
+
$courseId=$this->session->getCourseId() . "_S";
$isStudentAdmin= $this->api->isStudentAdmin($roomId, $courseId);
if ($this->currentObject == null || $isStudentAdmin == "false") {
@@ -1258,7 +1266,7 @@
}
else
{
- if ($this->isLectureRoom == false || $this->currentObject->isArchive())
+ if ($this->isLectureRoom == false || isset( $this->currentObject ) && $this->currentObject->isArchive())
{
$this->xml->createPanelSettings(
get_string("tab_title_chat", 'liveclassroom'),
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -55,11 +55,11 @@
if($this->error==NULL)
{
-
- $root->append_child($this->Informations);
+ if(isset($this->Informations))
+ $root->append_child($this->Informations);
+
foreach ($this->part as $key => $value)
{
-
$windows->append_child($this->addWindowsElement($key, $value));
}
}
Modified: branches/team/Thomas/integrations_common/php/common/XmlArchive.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/XmlArchive.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/common/XmlArchive.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -11,6 +11,7 @@
var $nameDisplay;
var $preview;
var $url;
+ var $param;
var $url_params;
var $tooltipAvailability;
var $tooltipDial;
Modified: branches/team/Thomas/integrations_common/php/common/XmlRoom.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/XmlRoom.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/common/XmlRoom.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -4,13 +4,14 @@
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
- */
+ */
class XmlRoom{
var $id;
var $nameDisplay;
var $preview;
+ var $param;
var $launchUrl;
var $url_params;
var $tooltipAvailability;
@@ -78,7 +79,7 @@
$preview->append_child($xml->create_text_node($this->preview));
$launchUrl = $xml->create_element("url");
- $launchUrl->append_child($xml->create_text_node($this->launchUrl);
+ $launchUrl->append_child($xml->create_text_node($this->launchUrl));
$param = $xml->create_element("param");
$param->append_child($xml->create_text_node($this->param));
@@ -143,8 +144,7 @@
function setArchive($archives) {
$this->archives=$archives;
}
-
-
+
}
Modified: branches/team/Thomas/integrations_common/php/lc/LCAction.php
===================================================================
--- branches/team/Thomas/integrations_common/php/lc/LCAction.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/lc/LCAction.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -51,6 +51,7 @@
*/
function createFirstTime()
{
+
if ($this->api->lcapi_get_users($this->getStudentUserid()) == false)
{
// create the two users
@@ -272,7 +273,7 @@
}
return false;
}
- function getPhoneNumbers($room_id, $user_id)
+ function getPhoneNumbers()
{
return $this->api->lcapi_get_simulcast();
}
Modified: branches/team/Thomas/integrations_common/php/lc/LCRoom.php
===================================================================
--- branches/team/Thomas/integrations_common/php/lc/LCRoom.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/lc/LCRoom.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -8,7 +8,7 @@
require_once("PrefixUtil.php");
// Constants
-define(" ATTRIB_ROOM_DESCRIPTION", "description");
+define("ATTRIB_ROOM_DESCRIPTION", "description");
define("ATTRIB_ROOM_LONG_NAME", "longname");
define("ATTRIB_ROOM_IS_ARCHIVE", "archive");
define("ATTRIB_ROOM_ID", "class_id");
@@ -139,57 +139,58 @@
function setByRecord($currentRecord, $prefix)
{
+
// room attributes
- $rid = trimPrefix($currentRecord[ATTRIB_ROOM_ID], $prefix);
+ $rid = trimPrefix($this->getKeyValue($currentRecord,ATTRIB_ROOM_ID), $prefix);
$this->setRoomId($rid);
- $this->setDescription($currentRecord[ATTRIB_ROOM_DESCRIPTION]);
- $this->setLongname($currentRecord[ATTRIB_ROOM_LONG_NAME]);
- $this->setContactEmail($currentRecord[ATTRIB_ROOM_CONTACT_EMAIL]);
- $this->setArchive($currentRecord[ATTRIB_ROOM_ARCHIVE]);
- $this->setPreview($currentRecord[ATTRIB_ROOM_PREVIEW]);
- $this->setBORAutoMoveInstructors($currentRecord[ATTRIB_BOR_AUTO_MOVE_INSTRUCTORS]);
- $this->setBORAutoMoveSelf($currentRecord[ATTRIB_BOR_AUTO_MOVE_SELF]);
- $this->setBORCarouselsPublic($currentRecord[ATTRIB_BOR_CAROUSELS_PUBLIC]);
- $this->setBOREnabled($currentRecord[ATTRIB_BOR_ENABLED]);
- $this->setBORInitialNumber($currentRecord[ATTRIB_BOR_INITIAL_NUMBER]);
- $this->setBORShowRoomCarousels($currentRecord[ATTRIB_BOR_SHOW_ROOM_CAROUSELS]);
- $this->setUserstatusEnabled($currentRecord[ATTRIB_ROOM_USERSTATUS_ENABLED]);
- $this->setSendUserstatusUpdates($currentRecord[ATTRIB_ROOM_SEND_USERSTATUS_UPDATES]);
+ $this->setDescription($this->getKeyValue($currentRecord,ATTRIB_ROOM_DESCRIPTION));
+ $this->setLongname($this->getKeyValue($currentRecord,ATTRIB_ROOM_LONG_NAME));
+ $this->setContactEmail($this->getKeyValue($currentRecord,ATTRIB_ROOM_CONTACT_EMAIL));
+ $this->setArchive($this->getKeyValue($currentRecord,ATTRIB_ROOM_ARCHIVE));
+ $this->setPreview($this->getKeyValue($currentRecord,ATTRIB_ROOM_PREVIEW));
+ $this->setBORAutoMoveInstructors($this->getKeyValue($currentRecord,ATTRIB_BOR_AUTO_MOVE_INSTRUCTORS));
+ $this->setBORAutoMoveSelf($this->getKeyValue($currentRecord,ATTRIB_BOR_AUTO_MOVE_SELF));
+ $this->setBORCarouselsPublic($this->getKeyValue($currentRecord,ATTRIB_BOR_CAROUSELS_PUBLIC));
+ $this->setBOREnabled($this->getKeyValue($currentRecord,ATTRIB_BOR_ENABLED));
+ $this->setBORInitialNumber($this->getKeyValue($currentRecord,ATTRIB_BOR_INITIAL_NUMBER));
+ $this->setBORShowRoomCarousels($this->getKeyValue($currentRecord,ATTRIB_BOR_SHOW_ROOM_CAROUSELS));
+ $this->setUserstatusEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_USERSTATUS_ENABLED));
+ $this->setSendUserstatusUpdates($this->getKeyValue($currentRecord,ATTRIB_ROOM_SEND_USERSTATUS_UPDATES));
// Media Settings
// Compatible with LC 5.X
- $this->setHmsSimulcast($currentRecord[ATTRIB_ROOM_HMS_SIMULCAST]);
- $this->setHmsSimulcastRestricted($currentRecord[ATTRIB_ROOM_HMS_SIMULCAST_RESTRICTED]);
- $this->setHmsTwoWayEnabled($currentRecord[ATTRIB_ROOM_HMS_TWO_WAY_ENABLED]);
- $this->setMediaFormat($currentRecord[ATTRIB_ROOM_MEDIA_FORMAT]);
- $this->setMediaType($currentRecord[ATTRIB_ROOM_MEDIA_TYPE]);
- $this->setVideoFrameWidth($currentRecord[ATTRIB_ROOM_VF_WIDTH]);
- $this->setVideoFrameHeight($currentRecord[ATTRIB_ROOM_VF_HEIGHT]);
- $this->setVideoFrameLocation($currentRecord[ATTRIB_ROOM_VF_LOCATION]);
- $this->setVideoFrameSet($currentRecord[ATTRIB_ROOM_VIDEOFRAMESET]);
- $this->setStudentVideoOnStartupEnabled($currentRecord[ATTRIB_ROOM_ENABLE_STUDENT_VIDEO_ON_STARTUP]);
- // setVideoWindowSizeOnStartup((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_WINDOW_SIZE_ON_STARTUP]);
- // setVideoWindowEncodingSize((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_WINDOW_ENCODING_SIZE]);
- // setVideoDefaultBitRate((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_DEFAULT_BIT_RATE]);
- // setVideoBitRateCeiling((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_BIT_RATE_CEILING]);
- $this->setVideoBandwidth($currentRecord[ATTRIB_ROOM_HMS_VIDEO_BANDWIDTH]);
+ $this->setHmsSimulcast($this->getKeyValue($currentRecord,ATTRIB_ROOM_HMS_SIMULCAST));
+ $this->setHmsSimulcastRestricted($this->getKeyValue($currentRecord,ATTRIB_ROOM_HMS_SIMULCAST_RESTRICTED));
+ $this->setHmsTwoWayEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_HMS_TWO_WAY_ENABLED));
+ $this->setMediaFormat($this->getKeyValue($currentRecord,ATTRIB_ROOM_MEDIA_FORMAT));
+ $this->setMediaType($this->getKeyValue($currentRecord,ATTRIB_ROOM_MEDIA_TYPE));
+ $this->setVideoFrameWidth($this->getKeyValue($currentRecord,ATTRIB_ROOM_VF_WIDTH));
+ $this->setVideoFrameHeight($this->getKeyValue($currentRecord,ATTRIB_ROOM_VF_HEIGHT));
+ $this->setVideoFrameLocation($this->getKeyValue($currentRecord,ATTRIB_ROOM_VF_LOCATION));
+ $this->setVideoFrameSet($this->getKeyValue($currentRecord,ATTRIB_ROOM_VIDEOFRAMESET));
+ $this->setStudentVideoOnStartupEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_ENABLE_STUDENT_VIDEO_ON_STARTUP));
+ // setVideoWindowSizeOnStartup((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_WINDOW_SIZE_ON_STARTUP));
+ // setVideoWindowEncodingSize((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_WINDOW_ENCODING_SIZE));
+ // setVideoDefaultBitRate((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_DEFAULT_BIT_RATE));
+ // setVideoBitRateCeiling((String)currentRecord[ATTRIB_ROOM_HMS_VIDEO_BIT_RATE_CEILING));
+ $this->setVideoBandwidth($this->getKeyValue($currentRecord,ATTRIB_ROOM_HMS_VIDEO_BANDWIDTH));
// Advanced settings
- $this->setArchiveEnabled($currentRecord[ATTRIB_ROOM_CAN_ARCHIVE]);
- $this->setEboardEnabled($currentRecord[ATTRIB_ROOM_CAN_EBOARD]);
- $this->setLiveShareEnabled($currentRecord[ATTRIB_ROOM_CAN_LIVESHARE]);
- $this->setLogChatEnabled($currentRecord[ATTRIB_ROOM_CAN_LOGCHAT]);
- $this->setMoveStudentEnabled($currentRecord[ATTRIB_ROOM_CAN_MOVE_STUDENT]);
- $this->setPptImportEnabled($currentRecord[ATTRIB_ROOM_CAN_PPT_IMPORT]);
- $this->setShowWebEnabled($currentRecord[ATTRIB_ROOM_CAN_SHOW_WEB]);
- $this->setChatEnabled($currentRecord[ATTRIB_ROOM_CHATENABLE]);
- $this->setPrivateChatEnabled($currentRecord[ATTRIB_ROOM_PRIVATECHATENABLE]);
- $this->setStudentWhiteboardEnabled($currentRecord[ATTRIB_ROOM_STUDENT_WB_ENABLED]);
- $this->setStudentLiveAppEnabled($currentRecord[ATTRIB_ROOM_STUDENT_WB_LIVEAPP]);
+ $this->setArchiveEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_ARCHIVE));
+ $this->setEboardEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_EBOARD));
+ $this->setLiveShareEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_LIVESHARE));
+ $this->setLogChatEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_LOGCHAT));
+ $this->setMoveStudentEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_MOVE_STUDENT));
+ $this->setPptImportEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_PPT_IMPORT));
+ $this->setShowWebEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CAN_SHOW_WEB));
+ $this->setChatEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_CHATENABLE));
+ $this->setPrivateChatEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_PRIVATECHATENABLE));
+ $this->setStudentWhiteboardEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_STUDENT_WB_ENABLED));
+ $this->setStudentLiveAppEnabled($this->getKeyValue($currentRecord,ATTRIB_ROOM_STUDENT_WB_LIVEAPP));
// Access
- $this->setUserLimit($currentRecord[ATTRIB_ROOM_USERLIMIT]);
+ $this->setUserLimit($this->getKeyValue($currentRecord,ATTRIB_ROOM_USERLIMIT));
// PINs are compatible with LC 4.3.0+
- $this->setParticipantPin($currentRecord[ATTRIB_ROOM_PARTICIPANT_PIN]);
- $this->setPresenterPin($currentRecord[ATTRIB_ROOM_PRESENTER_PIN]);
+ $this->setParticipantPin($this->getKeyValue($currentRecord,ATTRIB_ROOM_PARTICIPANT_PIN));
+ $this->setPresenterPin($this->getKeyValue($currentRecord,ATTRIB_ROOM_PRESENTER_PIN));
}
/**
@@ -338,7 +339,7 @@
*/
function isValidRoomId($id)
{
- if (id != null && ereg(ACCEPTABLE_ROOM_ID_REGEX, $id) > 0) {
+ if ($id != null && ereg(ACCEPTABLE_ROOM_ID_REGEX, $id) > 0) {
return true;
} else {
return true;
@@ -725,6 +726,13 @@
{
return $this->attributes;
}
+
+ function getKeyValue($tab,$key){
+ if(array_key_exists($key,$tab)){
+ return $tab[$key];
+ }
+ return "";
+ }
}
?>
Modified: branches/team/Thomas/integrations_common/php/lc/lcapi.php
===================================================================
--- branches/team/Thomas/integrations_common/php/lc/lcapi.php 2008-02-18 19:22:56 UTC (rev 246)
+++ branches/team/Thomas/integrations_common/php/lc/lcapi.php 2008-02-19 22:21:27 UTC (rev 247)
@@ -102,7 +102,9 @@
define("LCAPI_DELAY", 1800); // validity time of an auth request in seconds
class LCApi {
+
var $_lcapi_config;
+ var $cookie_tstamp=null;
var $cookie_file = null;
var $valid = null;
// Command
@@ -175,7 +177,7 @@
if (!isset ($this->_lcapi_config))
{
// $this->lcapi_error(self::LCAPI_ENOCONF);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": LCAPI not configured in " . print_r(debug_backtrace(), true));
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": LCAPI not configured in " . print_r(debug_backtrace(), true));
return false;
}
$url = $this->_lcapi_config->server . LCAPI_COMMAND . LCAPI_FUNCTION_NOOP . "&AuthType=AuthCookieHandler" . "&AuthName=Horizon" . "&credential_0=" . $this->_lcapi_config->login . "&credential_1=" . $this->_lcapi_config->password;
@@ -191,20 +193,20 @@
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": executing request: " . $url);
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": executing request: " . $url);
$data = curl_exec($ch);
if (curl_errno($ch))
{
$this->lcapi_error(LCAPI_EADDR);
- wimba_add_error(WIMBA_ERROR,WC,"HTTP Request failed: " . curl_error($ch));
+ wimba_add_log(WIMBA_ERROR,WC,"HTTP Request failed: " . curl_error($ch));
return false;
}
preg_match("(\d*)", $data, $matches);
$resp_code = $matches[0];
if ($resp_code == 204) {
$this->lcapi_error(LCAPI_EAUTH);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Authentication failed (204)");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Authentication failed (204)");
return false;
}
else
@@ -212,13 +214,13 @@
if ($resp_code != 100 && $resp_code != 301)
{
$this->lcapi_error(LCAPI_EAUTH);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Authentication Failed: $resp_code");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Authentication Failed: $resp_code");
return false;
}
}
curl_close($ch);
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": Authentication successful");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": Authentication successful");
return $ch;
}
@@ -237,25 +239,26 @@
if (!isset ($this->_lcapi_config))
{
// $this->lcapi_error(self::LCAPI_ENOCONF);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": LCAPI not configured in " . print_r(debug_backtrace(), true));
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": LCAPI not configured in " . print_r(debug_backtrace(), true));
return false;
}
// $this->cookie_tstamp = $this->_lcapi_config->tmppath.self::LCAPI_COOKIE_TSTAMP; //Open the temp file to check the last modification date
$this->cookie_file = $this->_lcapi_config->tmppath . LCAPI_COOKIE_FILE; // Cookie File path
- // echo $this->cookie_file;
- // echo "eee".file_exists($this->cookie_tstamp);
- // /if (file_exists($this->cookie_tstamp)) {
- // $this->tstamp = time();
- // echo $tstamp;
- // }
-
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": cookie timestamp:" . $this->tstamp);
+ $this->cookie_tstamp = $this->_lcapi_config->tmppath.LCAPI_COOKIE_TSTAMP; //Open the temp file to check the last modification date
+
+
+ if(file_exists($this->cookie_tstamp)) {
+ $this->tstamp = file_get_contents($this->cookie_tstamp);
+ }
+
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": cookie timestamp:" . $this->tstamp);
+
$this->valid = $this->tstamp + LCAPI_DELAY;
// 1800 seconds = 30 minutes
if ((!file_exists($this->cookie_file)) || time() > $this->valid)
{
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": Timestamp too old (tstamp: $tstamp, valid: $valid), re-auth necessary.");
-
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": Timestamp too old (tstamp: $this->tstamp, valid: $this->valid), re-auth necessary.");
+
if (!$ch = $this->lcapi_authenticate())
{
return false;
@@ -264,7 +267,6 @@
}
$url = $this->_lcapi_config->server . LCAPI_COMMAND . $function . $params;
-
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -273,17 +275,17 @@
curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookie_file);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": executing request: " . $url);
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": executing request: " . $url);
$response = curl_exec($ch);
if (curl_errno($ch))
{
$this->lcapi_error(LCAPI_ECURL);
- wimba_add_error(WIMBA_ERROR,WC,"Curl error: " . curl_error($ch));
+ wimba_add_log(WIMBA_ERROR,WC,"Curl error: " . curl_error($ch));
return false;
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": Request Returned: " . $response);
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": Request Returned: " . $response);
return $response;
}
/**
@@ -294,7 +296,7 @@
* @param $lastname string - LC User last name.
* @return bool - true if the user is successfuly created or already exist, false otherwise
*/
- function lcapi_create_user($userid, $firstname, $lastname)
+ function lcapi_create_user($userid, $firstname="", $lastname="")
{
$params = "&target=" . $this->prefix . $userid . "&first_name=$firstname&last_name=$lastname";
$enc_params = str_replace(" ", "+", $params);
@@ -304,18 +306,17 @@
if ($lc_respcode == 301)
{
$this->lcapi_error(LCAPI_EEXIST);
-
- wimba_add_error(WIMBA_DEBUG,WC,"User ($this->prefix.$userid, $firstname, $lastname) already exist, not created.");
+ wimba_add_log(WIMBA_DEBUG,WC,"User ($this->prefix.$userid, $firstname, $lastname) already exist, not created.");
return false;
}
if ($lc_respcode != 100)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": User Creation Failed for ($this->prefix.$userid, $firstname, $lastname) with $lc_respcode");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": User Creation Failed for ($this->prefix.$userid, $firstname, $lastname) with $lc_respcode");
return false;
}
- wimba_add_error(WIMBA_DEBUG,WC,"User ($this->prefix.$userid, $firstname, $lastname) created.");
+ wimba_add_log(WIMBA_DEBUG,WC,"User ($this->prefix.$userid, $firstname, $lastname) created.");
return true;
}
@@ -339,7 +340,7 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_ENOSESN);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Create Session ($respcode).");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Create Session ($respcode).");
return false;
}
$currentline = strtok($response, "\n");
@@ -350,18 +351,18 @@
if (empty ($currentline))
{
$this->lcapi_error(LCAPI_ENOSESN);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Session was returned with good code, but session not available ($enc_params => $response)");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Session was returned with good code, but session not available ($enc_params => $response)");
return false;
}
$authtoken = substr($currentline, 10);
if (empty ($authtoken)) {
$this->lcapi_error(LCAPI_ENOSESN);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Token empty, response: $response");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Token empty, response: $response");
return false;
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": Auth OK (hzA=$authtoken)");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": Auth OK (hzA=$authtoken)");
return $authtoken;
}
/**
@@ -405,17 +406,17 @@
if ($respcode == 301)
{
$this->lcapi_error(LCAPI_EEXIST);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Class ($roomid, $roomname) already exist, not created");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Class ($roomid, $roomname) already exist, not created");
return false;
}
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Create Class with id : $roomid, and name : $roomname.");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Create Class with id : $roomid, and name : $roomname.");
return false;
}
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Class ($roomid, $roomname) created with success.");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Class ($roomid, $roomname) created with success.");
return true;
}
/**
@@ -437,11 +438,11 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Add Role $role to userid $userid in Class with id:$roomid");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Add Role $role to userid $userid in Class with id:$roomid");
return false;
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": Role $role added for $userid in Class $roomid");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": Role $role added for $userid in Class $roomid");
return true;
}
/**
@@ -464,11 +465,11 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Removed Role $role from userid $this->prefix.$userid in Class with id:" . $roomid);
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot Removed Role $role from userid $this->prefix.$userid in Class with id:" . $roomid);
return false;
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": Role $role removed from $userid in Class $roomid");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": Role $role removed from $userid in Class $roomid");
return true;
}
/**
@@ -485,7 +486,7 @@
if ($respcode == 302)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": $roomid suppression failed");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": $roomid suppression failed");
return false;
}
else
@@ -493,12 +494,12 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": $roomid suppression failed for an unknown reason (response: $response)");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": $roomid suppression failed for an unknown reason (response: $response)");
return false;
}
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": $roomid deleted successfully.");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": $roomid deleted successfully.");
return true;
}
/**
@@ -526,11 +527,11 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_CRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Room modification failed ($roomid): $response");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Room modification failed ($roomid): $response");
return false;
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . "$roomid has been modified with success");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . "$roomid has been modified with success");
return true;
}
/**
@@ -544,7 +545,7 @@
function lcapi_get_archives($userid, $roomid = '')
{
$result = $this->lcapi_get_rooms($this->prefix . $userid, $this->prefix . $roomid, 1);
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning archives for '$this->prefix.$userid' and '$this->prefix.$roomid': " . print_r($result, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning archives for '$this->prefix.$userid' and '$this->prefix.$roomid': " . print_r($result, true));
return $result;
}
/**
@@ -568,7 +569,7 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_ECRUD);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": List of room query failed");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": List of room query failed");
return false;
}
list (, $body) = explode("\n", $response, 2);
@@ -579,13 +580,15 @@
$lines = explode("\n", $records[$i]);
$record = null;
foreach ($lines as $line)
- {
- list ($key, $value) = explode('=', $line);
-
- if (!empty ($key) && $key != "")
- {
- $record[$key] = $value;
- }
+ {
+ if(!empty($line)){
+ list ($key, $value) = explode('=', $line);
+
+ if (!empty ($key) && $key != "")
+ {
+ $record[$key] = $value;
+ }
+ }
}
if ((empty ($roomid) && !empty ($record)) || // orphaned archive or room
@@ -597,7 +600,7 @@
}
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": retrieved Rooms for $userid and roomid '$roomid': " . print_r($rooms, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": retrieved Rooms for $userid and roomid '$roomid': " . print_r($rooms, true));
return $rooms;
}
/**
@@ -631,16 +634,15 @@
}
$request = str_replace(" ", "+", $request);
$response = $this->lcapi_send_query(LCAPI_FUNCTION_LIST_USER, $request);
- if (LCAPI_DEBUG)
- {
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": request '$request', response: $response");
- }
+
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": request '$request', response: $response");
+
preg_match("(\d*)", $response, $matches);
$respcode = $matches[0];
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Unable to query the server. request: '$request', response: '$response'");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Unable to query the server. request: '$request', response: '$response'");
return false;
}
list (, $body) = explode("\n", $response, 2);
@@ -655,13 +657,15 @@
$lines = explode("\n", $record);
$empty = true;
foreach ($lines as $line) {
-
- list ($key, $value) = explode('=', $line);
- if (!empty ($key))
- {
- $answer[$key] = $value;
- $empty = false;
- }
+ if(!empty($line)){
+ list ($key, $value) = explode('=', $line);
+
+ if (!empty ($key))
+ {
+ $answer[$key] = $value;
+ $empty = false;
+ }
+ }
}
if (!$empty)
{
@@ -669,7 +673,7 @@
}
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning answers: " . print_r($answers, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning answers: " . print_r($answers, true));
return $answer;
}
@@ -696,16 +700,16 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": request '$params', response: $reponse");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": request '$params', response: $reponse");
return false;
}
// Some dichotomy to retreive the role name
list (, $body) = explode("\n", $response, 2);
- $records = explode(LCAPI_RECORD_SEPERATOR, $body);
+ $records = explode(LCAPI_RECORD_SEPARATOR, $body);
$result = explode(LCAPI_ATTR_ROLEID . "=", $records[0]);
$result = explode("\n", $result[1]);
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning answer: " . $result[0]);
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning answer: " . $result[0]);
return $result[0];
}
@@ -724,7 +728,7 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot perform query: $params, reponse: $response");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot perform query: $params, reponse: $response");
return false;
}
list (, $body) = explode("\n", $response, 2);
@@ -747,7 +751,7 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": cannot retrieve the room name");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": cannot retrieve the room name");
return false;
}
list (, $body) = explode("\n", $response, 2);
@@ -755,15 +759,17 @@
$lines = explode("\n", $records[0]);
foreach ($lines as $line)
{
- list ($key, $value) = explode("=", $line);
- if ($key == LCAPI_ATTR_LONGNAME)
- {
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": $this->prefix.$roomid's room name is $value");
- return $value;
- }
+ if(!empty($line)){
+ list ($key, $value) = explode("=", $line);
+ if ($key == LCAPI_ATTR_LONGNAME)
+ {
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": $this->prefix.$roomid's room name is $value");
+ return $value;
+ }
+ }
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": did not find name of room: $roomid");
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": did not find name of room: $roomid");
return false;
}
@@ -782,7 +788,7 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot query the media type of $roomid");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Cannot query the media type of $roomid");
return false;
}
list (, $body) = explode("\n", $response, 2);
@@ -790,15 +796,17 @@
$lines = explode("\n", $records[0]);
foreach ($lines as $line)
{
- list ($key, $value) = explode("=", $line);
- if ($key == LCAPI_ATTR_MEDIATYPE)
- {
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": $roomid's media type is $value");
- return $value;
- }
-
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": did not find media type for $roomid");
- return false;
+ if(!empty($line)){
+ list ($key, $value) = explode("=", $line);
+ if ($key == LCAPI_ATTR_MEDIATYPE)
+ {
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": $roomid's media type is $value");
+ return $value;
+ }
+
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": did not find media type for $roomid");
+ return false;
+ }
}
}
/**
@@ -810,6 +818,7 @@
*/
function lcapi_get_room_info($roomid)
{
+ $roominfo=array();
$params = "&filter00=" . LCAPI_ATTR_CLASSID . "&filter00value=" . $this->prefix . $roomid . "&attribute=" . LCAPI_ATTR_ARCHIVE . "&attribute=" . LCAPI_ATTR_CANARCH . "&attribute=" . LCAPI_ATTR_CANEBRD . "&attribute=" . LCAPI_ATTR_CANAPPSHR . "&attribute=" . LCAPI_ATTR_CANPPTIMPRT . "&attribute=" . LCAPI_ATTR_CHTNBL . "&attribute=" . LCAPI_ATTR_PRVTCHTNBL . "&attribute=" . LCAPI_ATTR_DESCR . "&attribute=" . LCAPI_ATTR_HMSSIMCAST . "&attribute=" . LCAPI_ATTR_HMSSIMCAST_RSTRD . "&attribute=" . LCAPI_ATTR_HMS_2WYENBLD . "&attribute=" . LCAPI_ATTR_MEDIATYPE . "&attribute=" . LCAPI_ATTR_PREVIEW . "&attribute=" . LCAPI_ATTR_STDNT_WBENBLD . "&attribute=" . LCAPI_ATTR_STDNT_WBLVAPP . "&attribute=" . LCAPI_ATTR_USRLIMT . "&attribute=" . LCAPI_ATTR_LONGNAME . "&attribute=" . LCAPI_ATTR_VIDEO_BANDWIDTH . "&attribute=" . LCAPI_ATTR_ENABLE_STUDENT_VIDEO_ON_STARTUP . "&attribute=" . LCAPI_ATTR_USERSTATUS_ENABLED . "&attribute=" . LCAPI_ATTR_SEND_USERSTATUS_UPDATES . "&attribute=" . LCAPI_ATTR_ENABLED . "&attribute=" . LCAPI_ATTR_CAROUSELS_PUBLIC . "&attribute=" . LCAPI_ATTR_SHOW_ROOM_CAROUSELS . "&attribute=" . LCAPI_ATTR_PARTICIPANT_PIN . "&attribute=" . LCAPI_ATTR_PRESENTER_PIN;
$response = $this->lcapi_send_query(LCAPI_FUNCTION_GET_ROOM_LIST, $params);
@@ -818,25 +827,28 @@
if ($respcode != 100)
{
// $this->lcapi_error(self::LCAPIEQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": cannot query room info for $roomid");
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": cannot query room info for $roomid");
return false;
}
+
list (, $body) = explode("\n", $response, 2);
$records = explode(LCAPI_RECORD_SEPARATOR, $body);
$lines = explode("\n", $records[0]);
foreach ($lines as $line)
{
- list ($key, $value) = explode("=", $line);
- if (!empty ($key))
- {
- $roominfo[$key] = $value;
+ if(!empty($line)){
+ list ($key, $value) = explode("=", $line);
+ if (!empty ($key))
+ {
+ $roominfo[$key] = $value;
+ }
}
}
$room = new LCRoom();
- $room->setByRecord($roominfo, $this->prefix);.
+ $room->setByRecord($roominfo, $this->prefix);
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning room info for $roomid: " . print_r($roominfo, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning room info for $roomid: " . print_r($roominfo, true));
return $room;
}
@@ -853,7 +865,7 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Query failed: " . $response);
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Query failed: " . $response);
return false;
}
list (, $body) = explode("\n", $response, 2);
@@ -861,11 +873,13 @@
$lines = explode("\n", $records[0]);
foreach ($lines as $line)
{
- list ($key, $value) = explode("=", $line);
- $answer[trim($key)] = trim($value);
+ if(!empty($line)){
+ list ($key, $value) = explode("=", $line);
+ $answer[trim($key)] = trim($value);
+ }
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning server status: " . print_r($answer, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning server status: " . print_r($answer, true));
return $answer;
}
@@ -882,20 +896,22 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Query failed: " . $response);
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Query failed: " . $response);
return false;
}
list (, $body) = explode("\n", $response, 2);
$records = explode(LCAPI_RECORD_SEPARATOR, $body);
foreach ($records as $record)
{
- $lines = explode("\n", $record);
- list (, $key) = explode("=", $lines[0], 2);
- list (, $value) = explode("=", $lines[1], 2);
- $answers[trim($key)] = trim($value);
+ if(!empty($record)){
+ $lines = explode("\n", $record);
+ list (, $key) = explode("=", $lines[0], 2);
+ list (, $value) = explode("=", $lines[1], 2);
+ $answers[trim($key)] = trim($value);
+ }
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning server config: " . print_r($answers, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning server config: " . print_r($answers, true));
return $answers;
}
@@ -907,20 +923,22 @@
if ($respcode != 100)
{
$this->lcapi_error(LCAPI_EQRY);
- wimba_add_error(WIMBA_ERROR,WC,__FUNCTION__ . ": Query failed: " . $response);
+ wimba_add_log(WIMBA_ERROR,WC,__FUNCTION__ . ": Query failed: " . $response);
return false;
}
list (, $body) = explode("\n", $response, 2);
$records = explode(LCAPI_RECORD_SEPARATOR, $body);
foreach ($records as $record)
{
- $lines = explode("\n", $record);
- list (, $key) = explode("=", $lines[0], 2);
- list (, $value) = explode("=", $lines[1], 2);
- $answers[trim($key)] = trim($value);
+ if(!empty($record)){
+ $lines = explode("\n", $record);
+ list (, $key) = explode("=", $lines[0], 2);
+ list (, $value) = explode("=", $lines[1], 2);
+ $answers[trim($key)] = trim($value);
+ }
}
- wimba_add_error(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning server config: " . print_r($answers, true));
+ wimba_add_log(WIMBA_DEBUG,WC,__FUNCTION__ . ": returning server config: " . print_r($answers, true));
return $answers;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|