Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */

require_once dirname(__FILE__) . '/libs/composer/vendor/autoload.php';
15 changes: 8 additions & 7 deletions classes/class.ilAdobeConnectConfigGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ private function initAdobeSettingsForm()
$form_lead_time->setInfo($this->getPluginObject()->txt('schedule_lead_time_info'));
$this->form->addItem($form_lead_time);

$form_security_mode = new ilCheckboxInputGUI($this->getPluginObject()->txt('enhanced_security_mode'), 'enhanced_security_mode');
$form_security_mode->setInfo($this->pluginObj->txt('enhanced_security_mode_info'));
$this->form->addItem($form_security_mode);

$head_line = new ilFormSectionHeaderGUI();
$head_line->setTitle($this->getPluginObject()->txt('presentation_server_settings'));
$this->form->addItem($head_line);
Expand Down Expand Up @@ -219,6 +223,7 @@ private function getAdobeSettingsValues()

$values['x_user_id'] = ilAdobeConnectServer::getSetting('x_user_id')? ilAdobeConnectServer::getSetting('x_user_id') : 'x_user_id';

$values['enhanced_security_mode'] = ilAdobeConnectServer::getSetting('enhanced_security_mode', 0);
$this->form->setValuesByArray($values);
}

Expand Down Expand Up @@ -297,6 +302,8 @@ public function saveAdobeSettings()
}
ilAdobeConnectServer::setSetting($key, trim($value));
}
ilAdobeConnectServer::setSetting('enhanced_security_mode', (int)$this->form->getInput('enhanced_security_mode'));

ilAdobeConnectServer::setSetting('auth_mode_switchaai_account_type',serialize($this->form->getInput('auth_mode_switchaai_account_type')));
ilAdobeConnectServer::_getInstance()->commitSettings();

Expand All @@ -307,14 +314,8 @@ public function saveAdobeSettings()
if(ilAdobeConnectServer::getSetting('user_assignment_mode') != ilAdobeConnectServer::ASSIGN_USER_SWITCH)
{
$xmlAPI = ilXMLApiFactory::getApiByAuthMode();
$session = $xmlAPI->getBreezeSession();

if(!$session)
{
throw new ilException('err_invalid_server');
}

if(!$xmlAPI->login(trim($this->form->getInput('login')), trim($this->form->getInput('password')), $session))
if(!$xmlAPI->login(trim($this->form->getInput('login')), trim($this->form->getInput('password')), null))
{
throw new ilException('err_authentication_failed');
}
Expand Down
163 changes: 74 additions & 89 deletions classes/class.ilAdobeConnectDfnXMLAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ protected function getApiUrl($params)
* @param string $session
* @return bool
*/
public function addUser($login, $email, $pass, $first_name, $last_name, $session)
public function addUser($login, $email, $pass, $first_name, $last_name, $session = null)
{
global $DIC;
$ilLog = $DIC->logger()->root();

$url = $this->getApiUrl(array(
'action' => 'lms-user-create',
'action' => 'lms-user-create',
'login' => $login,
'first-name' => $first_name,
'last-name' => $last_name,
'session' => $session
'first-name' => $first_name,
'last-name' => $last_name,
'session' => $session
));

$ilLog->write("addUser URL: ". $url);

$xml = simplexml_load_file($url);
$xml = $this->sendRequest($url);

if($xml->status['code'] == 'ok')
{
Expand All @@ -79,25 +79,26 @@ public function addUser($login, $email, $pass, $first_name, $last_name, $session
* @param string $session
* @return bool|string
*/
public function searchUser($login, $session)
public function searchUser($login, $session = NULL)
{
global $DIC;
$ilLog = $DIC->logger()->root();

$url = $this->getApiUrl(array(
'login' => $login,
'action' => 'lms-user-exists',
'session' => $session
'session' => $session
));
$xml = simplexml_load_file($url);

if($xml->status['code'] == 'ok')
$xml = $this->sendRequest($url);
if($xml instanceof \SimpleXMLElement)
{
$list = $xml->{'principal-list'};

$id = (string)$list->principal['principal-id'];
if($xml->status['code'] == 'ok')
{
$list = $xml->{'principal-list'};
$id = (string)$list->principal['principal-id'];

return $id;
return $id;
}
}
else
{
Expand Down Expand Up @@ -126,18 +127,10 @@ public function externalLogin($user = null, $pass = null, $session = null )
$url = $this->getApiUrl(array(
'action' => 'lms-user-login',
'login' => $user,
'session' => $session
'session' => $session
));

$context = array(
'http' => array('timeout' => 4),
'https' => array('timeout' => 4)
);

$ctx = $this->proxy($context);
$xml_string = file_get_contents($url, false, $ctx);
$xml = simplexml_load_string($xml_string);

$xml = $this->sendRequest($url);
if($xml->status['code'] == 'ok')
{
return (string)$xml->cookie;
Expand All @@ -149,76 +142,68 @@ public function externalLogin($user = null, $pass = null, $session = null )
return false;
}

/**
* @param string $user
* @param string $pass
* @param string $session
* @return bool
*/
public function login($user, $pass, $session)
{
global $DIC;
$ilLog = $DIC->logger()->root();
$lng = $DIC->language();

if(isset(self::$loginsession_cache[$session]))
{
return true;
}

$url = $this->getApiUrl(array(
'action' => 'login',
'login' => $user,
'password' => $pass,
'session' => $session
));

$context = array(
'http' => array(
'timeout' => 4
),
'https' => array(
'timeout' => 4
)
);

$ctx = $this->proxy($context);
$xml_string = file_get_contents($url, false, $ctx);
$xml = simplexml_load_string($xml_string);

if($xml->status['code'] == 'ok')
{
self::$loginsession_cache[$session] = true;
return true;
}
else
{
unset(self::$loginsession_cache[$session]);
$ilLog->write('AdobeConnect login Request: '.$url);
if($xml)
{
$ilLog->write('AdobeConnect login Response: ' . $xml->asXML());
}
$ilLog->write('AdobeConnect login failed: '.$user);
ilUtil::sendFailure($lng->txt('login_failed'));
return false;
}
}

/**
* @param String $session
* @return bool|void
*/
public function logout($session)
{
}
// /**
// * @param string $user
// * @param string $pass
// * @param string $session
// * @return bool
// */
// public function login($user, $pass, $session)
// {
// global $DIC;
// $ilLog = $DIC->logger()->root();
// $lng = $DIC->language();
//
// if(isset(self::$loginsession_cache[$session]))
// {
// return true;
// }
//
// $url = $this->getApiUrl(array(
// 'action' => 'login',
// 'login' => $user,
// 'password' => $pass,
// 'session' => $session
// ));
//
// $context = array(
// 'http' => array(
// 'timeout' => 4
// ),
// 'https' => array(
// 'timeout' => 4
// )
// );
//
// $ctx = $this->proxy($context);
// $xml_string = file_get_contents($url, false, $ctx);
// $xml = simplexml_load_string($xml_string);
//
// if($xml->status['code'] == 'ok')
// {
// self::$loginsession_cache[$session] = true;
// return true;
// }
// else
// {
// unset(self::$loginsession_cache[$session]);
// $ilLog->write('AdobeConnect login Request: '.$url);
// if($xml)
// {
// $ilLog->write('AdobeConnect login Response: ' . $xml->asXML());
// }
// $ilLog->write('AdobeConnect login failed: '.$user);
// ilUtil::sendFailure($lng->txt('login_failed'));
// return false;
// }
// }

/**
* @param String $login
* @param String $session
* @return null|String
*/
public function getPrincipalId($login, $session)
public function getPrincipalId($login, $session = null)
{
return $this->searchUser($login, $session);
}
Expand Down
18 changes: 18 additions & 0 deletions classes/class.ilAdobeConnectPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ public function getPluginName()
return "AdobeConnect";
}

/**
* @inheritdoc
*/
protected function init()
{
parent::init();

$this->registerAutoloader();
}

/**
* Registers the plugin autoloader
*/
private function registerAutoloader()
{
require_once dirname(__FILE__) . '/../autoload.php';
}

/**
* @param $string a_type
* @param $string $a_size
Expand Down
3 changes: 1 addition & 2 deletions classes/class.ilAdobeConnectQuota.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public function __construct()
private function fetchCurrentMeetings()
{
$api = ilXMLApiFactory::getApiByAuthMode();
$session = $api->getAdminSession();
return $api->getActiveScos($session);
return $api->getActiveScos();
}

private function buildCurrentMeetings(array $data)
Expand Down
Loading