diff -Naur connect_class_dom.php connect_class_dom.php --- connect_class_dom.php 2011-03-01 11:47:52.183000000 -0500 +++ connect_class_dom.php 2011-03-01 10:43:59.124986313 -0500 @@ -4,8 +4,10 @@ class connect_class_dom extends connect_class { - public function __construct($serverurl = '', $serverport = '', $username = '', $password = '', $cookie = '') { - parent::__construct($serverurl, $serverport, $username, $password, $cookie); + public function __construct($serverurl = '', $serverport = '', + $username = '', $password = '', + $cookie = '', $https) { + parent::__construct($serverurl, $serverport, $username, $password, $cookie, $https); } public function create_request($params = array(), $sentrequest = true) { diff -Naur connect_class.php connect_class.php --- connect_class.php 2011-03-01 11:47:52.198000000 -0500 +++ connect_class.php 2011-03-01 11:29:07.004986314 -0500 @@ -17,13 +17,17 @@ var $_xmlresponse; var $_apicall; var $_connection; + var $_https; - public function __construct($serverurl = '', $serverport = 80, $username = '', $password = '', $cookie = '') { + public function __construct($serverurl = '', $serverport = 80, + $username = '', $password = '', + $cookie = '', $https = false) { $this->_serverurl = $serverurl; $this->_serverport = $serverport; $this->_username = $username; $this->_password = $password; $this->_cookie = $cookie; + $this->_https = $https; } /** @@ -57,6 +61,10 @@ $this->_connection = $connection; } + public function set_https($https = false) { + $this->_https = $https; + } + public function get_serverurl() { return $this->_serverurl; } @@ -81,11 +89,34 @@ return $this->_serverport; } + public function get_https() { + return $this->_https; + } + private function get_deafult_header() { return array('Content-Type: text/xml'); } /** + * Adds or replaces http:// with https:// for secured connections + * @return string - server URL with the HTTPS protocol + */ + private function make_https() { + + $serverurl = $this->_serverurl; + $httpsexists = strpos($this->_serverurl, 'https://'); + $httpexists = strpos($this->_serverurl, 'http://'); + + if (false === $httpsexists and false !== $httpexists) { + $serverurl = str_replace('http://', 'https://', $this->_serverurl); + } elseif (false === $httpsexists) { + $serverurl = 'https://' . $this->_serverurl; + } + + return $serverurl; + } + + /** * Posts XML to the Adobe Connect server and returns the results * @param int $return_header 1 to include the response header, 0 to not * @param array $add_header an array of headers to add to the request @@ -93,13 +124,23 @@ public function send_request($return_header = 0, $add_header = array(), $stop = false) { $ch = curl_init(); + $serverurl = $this->_serverurl; + + if ($this->_https) { + + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + + $serverurl = $this->make_https(); + } + if ($stop) { // echo $this->_serverurl . '?session='. $this->_cookie; die(); // https://example.com/api/xml?action=principal=list - curl_setopt($ch, CURLOPT_URL, $this->_serverurl/* . '?action=login&external-auth=use'*/); + curl_setopt($ch, CURLOPT_URL, $serverurl/* . '?action=login&external-auth=use'*/); } else { $querystring = (!empty($this->_cookie)) ? '?session='. $this->_cookie : ''; - curl_setopt($ch, CURLOPT_URL, $this->_serverurl . $querystring); + curl_setopt($ch, CURLOPT_URL, $serverurl . $querystring); } diff -Naur conntest.php conntest.php --- conntest.php 2011-03-01 11:47:52.192000000 -0500 +++ conntest.php 2011-03-01 11:39:34.536986313 -0500 @@ -19,6 +19,13 @@ $password = required_param('authPassword', PARAM_NOTAGS); $httpheader = required_param('authHTTPheader', PARAM_NOTAGS); $emaillogin = required_param('authEmaillogin', PARAM_INT); + $https = optional_param('authHTTPS', 'false', PARAM_ALPHA); + + if (false === strpos($https, 'false')) { + $https = true; + } else { + $https = false; + } $strtitle = get_string('connectiontesttitle', 'adobeconnect'); @@ -28,7 +35,7 @@ print_string('conntestintro', 'adobeconnect'); - adobe_connection_test($serverhost, $port, $username, $password, $httpheader, $emaillogin); + adobe_connection_test($serverhost, $port, $username, $password, $httpheader, $emaillogin, $https); echo '
'. "\n"; echo ''; diff -Naur join.php join.php --- join.php 2011-03-01 11:47:52.255000000 -0500 +++ join.php 2011-03-01 11:18:13.484986314 -0500 @@ -176,9 +176,18 @@ notice(get_string('notparticipant', 'adobeconnect')); } else { + $protocol = 'http://'; + $https = false; $login = $usrobj->username; - $aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port); + if (isset($CFG->adobeconnect_https) and (!empty($CFG->adobeconnect_https))) { + + $protocol = 'https://'; + $https = true; + } + + $aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port, + '', '', '', $https); $aconnect->request_http_header_login(1, $login); // Include the port number only if it is a port other than 80 @@ -188,7 +197,8 @@ $port = ':' . $CFG->adobeconnect_port; } - redirect('http://' . $CFG->adobeconnect_meethost . $port + + redirect($protocol . $CFG->adobeconnect_meethost . $port . $meeting->url . '?session=' . $aconnect->get_cookie()); } diff -Naur lang/en_utf8/adobeconnect.php lang/en_utf8/adobeconnect.php --- lang/en_utf8/adobeconnect.php 2010-09-08 12:09:09.000000000 -0400 +++ lang/en_utf8/adobeconnect.php 2011-03-01 09:56:25.764986312 -0500 @@ -83,6 +83,8 @@ $string['adobeconnect:meetinghost'] = 'Meeting Host'; $string['public'] = 'Public'; $string['private'] = 'Private'; +$string['https'] = 'HTTPS Connection'; +$string['https_desc'] = 'Connect to the Connect server via HTTPS'; // Error codes $string['emptyxml'] = 'Unable to connect to the Adobe Connect Pro server at this time. Please inform your Moodle administrator.'; diff -Naur locallib.php locallib.php --- locallib.php 2011-03-01 11:47:52.115000000 -0500 +++ locallib.php 2011-03-01 11:39:42.476986313 -0500 @@ -21,7 +21,9 @@ define('ADOBE_TMZ_LENGTH', 6); -function adobe_connection_test($host = '', $port = 80, $username = '', $password = '', $httpheader = '', $emaillogin) { +function adobe_connection_test($host = '', $port = 80, $username = '', + $password = '', $httpheader = '', + $emaillogin, $https = false) { if (empty($host) or empty($port) or (0 == $port) or @@ -41,7 +43,9 @@ $aconnectDOM = new connect_class_dom($host, $port, $username, - $password); + $password, + '', + $https); $params = array( 'action' => 'common-info' @@ -320,10 +324,16 @@ $port = 80; } + if (isset($CFG->adobeconnect_https) and (!empty($CFG->adobeconnect_https))) { + $https = true; + } + $aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port, $CFG->adobeconnect_admin_login, - $CFG->adobeconnect_admin_password); + $CFG->adobeconnect_admin_password, + '', + $https); $params = array( 'action' => 'common-info' diff -Naur settings.php settings.php --- settings.php 2011-03-01 11:47:52.186000000 -0500 +++ settings.php 2011-03-01 09:55:05.876986313 -0500 @@ -23,6 +23,9 @@ $settings->add(new admin_setting_configcheckbox('adobeconnect_email_login', get_string('email_login', 'adobeconnect'), get_string('email_login_desc', 'adobeconnect'), '0')); +$settings->add(new admin_setting_configcheckbox('adobeconnect_https', get_string('https', 'adobeconnect'), + get_string('https_desc', 'adobeconnect'), '0')); + //$settings->add(new admin_setting_configcheckbox('adobeconnect_record_force', get_string('record_force', 'adobeconnect'), // get_string('record_force_desc', 'adobeconnect'), '0')); diff -Naur testserverconnection.js testserverconnection.js --- testserverconnection.js 2011-03-01 11:47:52.206000000 -0500 +++ testserverconnection.js 2011-03-01 11:35:43.744986314 -0500 @@ -13,6 +13,7 @@ queryString += "&authUsername=" + escape(obj.id_s__adobeconnect_admin_login.value); queryString += "&authPassword=" + escape(obj.id_s__adobeconnect_admin_password.value); queryString += "&authHTTPheader=" + escape(obj.id_s__adobeconnect_admin_httpauth.value); + queryString += "&authHTTPS=" + escape(obj.id_s__adobeconnect_https.checked); if (obj.id_s__adobeconnect_email_login.checked) { queryString += "&authEmaillogin=1"; diff -Naur view.php view.php --- view.php 2011-03-01 11:47:52.214000000 -0500 +++ view.php 2011-03-01 11:27:09.532986313 -0500 @@ -226,8 +226,15 @@ // Log in the current user $login = $usrobj->username; $password = $usrobj->username; +$https = false; -$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port); +if (isset($CFG->adobeconnect_https) and (!empty($CFG->adobeconnect_https))) { + $https = true; +} + + +$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port, + '', '', '', $https); $aconnect->request_http_header_login(1, $login); $adobesession = $aconnect->get_cookie();