/**
  * @return ilSwitchAaiXMLAPI|ilAdobeConnectXMLAPI|ilAdobeConnectDfnXMLAPI
  */
 public static function getApiByAuthMode()
 {
     if (self::$classname === NULL) {
         if (ilAdobeConnectServer::getSetting('auth_mode') == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) {
             self::$classname = 'ilSwitchAaiXMLAPI';
         } else {
             if (ilAdobeConnectServer::getSetting('auth_mode') == ilAdobeConnectServer::AUTH_MODE_DFN) {
                 self::$classname = 'ilAdobeConnectDfnXMLAPI';
             } else {
                 self::$classname = 'ilAdobeConnectXMLAPI';
             }
         }
     }
     include_once dirname(__FILE__) . '/class.' . self::$classname . '.php';
     $objXMLApi = new self::$classname();
     return $objXMLApi;
 }
コード例 #2
0
 public static function getScosByFolderId($folder_id)
 {
     $instance = ilAdobeConnectServer::_getInstance();
     $adminLogin = $instance->getLogin();
     $adminPass = $instance->getPasswd();
     $xmlApi = ilXMLApiFactory::getApiByAuthMode();
     $session = $xmlApi->getBreezeSession();
     if ($session != NULL && $xmlApi->login($adminLogin, $adminPass, $session)) {
         $scos = $xmlApi->getScosByFolderId($folder_id, $session);
     }
     return $scos;
 }
 public function requestAdobeConnectContent()
 {
     /**
      * @var $ilSetting ilSetting
      */
     global $ilSetting;
     if (!isset($_GET['record_url']) || !strlen($_GET['record_url'])) {
         $this->showContent();
         return;
     }
     $url = ilUtil::stripSlashes($_GET['record_url']);
     $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php');
     $this->pluginObj->includeClass('class.ilAdobeConnectQuota.php');
     $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId());
     $ilAdobeConnectUser->ensureAccountExistance();
     $xmlAPI = ilXMLApiFactory::getApiByAuthMode();
     $xmlAPI->logout($_SESSION['xavc_last_sso_sessid']);
     $session = $ilAdobeConnectUser->loginUser();
     $_SESSION['xavc_last_sso_sessid'] = $session;
     $url = ilUtil::appendUrlParameterString($url, 'session=' . $session);
     $presentation_url = ilAdobeConnectServer::getPresentationUrl(true);
     $logout_url = $presentation_url . '/api/xml?action=logout';
     if ($ilSetting->get('short_inst_name') != "") {
         $title_prefix = $ilSetting->get('short_inst_name');
     } else {
         $title_prefix = 'ILIAS';
     }
     $sso_tpl = new ilTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.perform_sso.html", true, true);
     $sso_tpl->setVariable('SPINNER_SRC', $this->pluginObj->getDirectory() . '/templates/js/spin.js');
     $sso_tpl->setVariable('TITLE_PREFIX', $title_prefix);
     $sso_tpl->setVariable('LOGOUT_URL', $logout_url);
     $sso_tpl->setVariable('URL', $url);
     $sso_tpl->setVariable('INFO_TXT', $this->pluginObj->txt('redirect_in_progress'));
     $sso_tpl->setVariable('OBJECT_TITLE', $this->object->getTitle());
     $sso_tpl->show();
     exit;
 }
 /**
  *  Log out user on the Adobe Connect server
  *
  * @param String $session
  */
 public function logoutUser($session)
 {
     $xmlAPI = ilXMLApiFactory::getApiByAuthMode();
     $xmlAPI->logout($session);
 }
 /**
  * Called in case the user clicked the save button
  * 
  * @access	public
  */
 public function saveAdobeSettings()
 {
     /**
      * @var $ilCtrl ilCtrl
      * @var $lng 	$lng
      * @var $tpl	$tpl
      */
     global $lng, $ilCtrl, $tpl;
     $this->initAdobeSettingsForm();
     if ($this->form->checkInput()) {
         $url = parse_url($this->form->getInput('server'));
         $url_2 = parse_url($this->form->getInput('presentation_server'));
         if ((ilUtil::isIPv4($url['host']) || ilUtil::isDN($url['host'])) && (ilUtil::isIPv4($url_2['host']) || ilUtil::isDN($url_2['host']))) {
             $params = array('server' => null, 'port' => null, 'login' => null, 'password' => null, 'cave' => null, 'user_assignment_mode' => null, 'schedule_lead_time' => null, 'presentation_server' => null, 'presentation_port' => null);
             $params['auth_mode'] = $this->form->getInput('auth_mode');
             if ($this->form->getInput('auth_mode') == 'auth_mode_header') {
                 $params['x_user_id'] = $this->form->getInput('x_user_id');
             }
             // Get current values from database
             foreach ($params as $key => $val) {
                 $params[$key] = ilAdobeConnectServer::getSetting($key);
             }
             // Set values from form into database
             foreach ($params as $key => $v) {
                 $value = $this->form->getInput($key);
                 if (in_array($key, array('server', 'presentation_server')) && '/' == substr($value, -1)) {
                     $value = substr($value, 0, -1);
                 }
                 ilAdobeConnectServer::setSetting($key, $value);
             }
             ilAdobeConnectServer::setSetting('auth_mode_switchaai_account_type', serialize($this->form->getInput('auth_mode_switchaai_account_type')));
             ilAdobeConnectServer::_getInstance()->commitSettings();
             try {
                 //check connection;
                 //do not check the connection in case of switchAAI. It's not possible because of the redirection to the cave-server
                 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($this->form->getInput('login'), $this->form->getInput('password'), $session)) {
                         throw new ilException('err_authentication_failed');
                     }
                 }
                 if (ilAdobeConnectServer::getSetting('user_assignment_mode') == ilAdobeConnectServer::ASSIGN_USER_DFN_EMAIL) {
                     ilAdobeConnectServer::setSetting('use_user_folders', 0);
                 }
                 ilUtil::sendSuccess($lng->txt('settings_saved'), true);
                 $ilCtrl->redirect($this, 'editAdobeSettings');
             } catch (ilException $e) {
                 // rollback
                 foreach ($params as $key => $val) {
                     ilAdobeConnectServer::setSetting($key, $val);
                 }
                 ilAdobeConnectServer::_getInstance()->commitSettings();
                 $this->form->getItemByPostVar('server')->setAlert($this->getPluginObject()->txt($e->getMessage()));
             }
         } else {
             if (!ilUtil::isIPv4($url['host']) && !ilUtil::isDN($url['host'])) {
                 $this->form->getItemByPostVar('server')->setAlert($this->getPluginObject()->txt('err_invalid_server'));
             }
             if (!ilUtil::isIPv4($url_2['host']) && !ilUtil::isDN($url_2['host'])) {
                 $this->form->getItemByPostVar('presentation_server')->setAlert($this->getPluginObject()->txt('err_invalid_server'));
             }
         }
     }
     ilUtil::sendFailure($this->getPluginObject()->txt('check_input'));
     $this->form->setValuesByPost();
     return $tpl->setContent($this->form->getHTML());
 }
コード例 #6
0
if (!$ilDB->tableColumnExists('rep_robj_xavc_data', 'folder_id')) {
    $ilDB->addTableColumn('rep_robj_xavc_data', 'folder_id', array('type' => 'integer', 'length' => 8, 'notnull' => false, 'default' => 0));
}
?>
	
<#33>	
<?php 
// migration step
$res = $ilDB->query('SELECT * FROM rep_robj_xavc_settings');
$settings = array();
while ($row = $ilDB->fetchAssoc($res)) {
    $settings[$row['keyword']] = $row['value'];
}
if ($settings['login'] && $settings['password']) {
    //check connection
    $xmlAPI = ilXMLApiFactory::getApiByAuthMode();
    $session = $xmlAPI->getBreezeSession();
    if ($session && $xmlAPI->login($settings['login'], $settings['password'], $session)) {
        $folder_id = $xmlAPI->getShortcuts("my-meetings", $session);
        $ilDB->update('rep_robj_xavc_data', array('folder_id' => array('integer', (int) $folder_id)), array('folder_id' => array('integer', 0)));
    }
}
?>
<#34>
<?php 
if (!$ilDB->tableColumnExists('rep_robj_xavc_data', 'url_path')) {
    $ilDB->addTableColumn('rep_robj_xavc_data', 'url_path', array('type' => 'text', 'length' => 80, 'notnull' => false, 'default' => null));
}
?>
<#35>
<?php 
 private function fetchCurrentMeetings()
 {
     $api = ilXMLApiFactory::getApiByAuthMode();
     $session = $api->getAdminSession();
     return $api->getActiveScos($session);
 }