public function __construct() { $this->adcInfo = ilAdobeConnectServer::_getInstance(); $this->server = $this->adcInfo->getServer(); $this->port = $this->adcInfo->getPort(); $this->x_user_id = $this->adcInfo->getXUserId(); $this->auth_mode = $this->adcInfo->getAuthMode(); }
private function addMultiCommands() { global $ilUser, $lng, $rbacsystem, $tree; $this->parent_obj->pluginObj->includeClass('class.ilXAVCPermissions.php'); $isadmin = $rbacsystem->checkAccessOfUser($ilUser->getId(), 'write', $this->parent_obj->ref_id); $this->parent_obj->pluginObj->includeClass('class.ilAdobeConnectServer.php'); $settings = ilAdobeConnectServer::_getInstance(); if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->parent_obj->ref_id, AdobeConnectPermissions::PERM_CHANGE_ROLE) || $isadmin && $settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) { $this->addMultiCommand('updateParticipants', $lng->txt('update')); $this->addMultiCommand('makeHosts', $this->pluginObj->txt('make_hosts')); $this->addMultiCommand('makeModerators', $this->pluginObj->txt('make_moderators')); $this->addMultiCommand('makeParticipants', $this->pluginObj->txt('make_participants')); $this->addMultiCommand('makeBlocked', $this->pluginObj->txt('make_blocked')); } $this->parent_obj->pluginObj->includeClass('class.ilAdobeConnectServer.php'); $settings = ilAdobeConnectServer::_getInstance(); if ((ilXAVCPermissions::hasAccess($ilUser->getId(), $this->parent_obj->ref_id, AdobeConnectPermissions::PERM_ADD_PARTICIPANTS) || $isadmin && $settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) && !$settings->getSetting('allow_crs_grp_trigger')) { $this->addMultiCommand('detachMember', $lng->txt('delete')); } }
/** * Logs in user on the Adobe Connect server. * * With SWITCHaai we use this login only to log in the technical user! * * @return string $technical_user_session */ public function login() { global $lng, $ilLog; if (null !== self::$technical_user_session) { return self::$technical_user_session; } $instance = ilAdobeConnectServer::_getInstance(); $params['action'] = 'login'; $params['login'] = $instance->getLogin(); $params['password'] = $instance->getPasswd(); $api_url = self::getApiUrl($params); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, TRUE); $output = curl_exec($ch); $curlHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); //Get the Header part from the output $ResponseHeader = mb_substr($output, 0, $curlHeaderSize); //get the breezeSession preg_match_all('|BREEZESESSION=(.*);|U', $ResponseHeader, $content); self::$technical_user_session = implode(';', $content[1]); return self::$technical_user_session; }
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 showContent() { /* * var $ilUser ilUser */ global $ilUser, $tpl, $ilAccess; $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php'); $this->pluginObj->includeClass('class.ilAdobeConnectServer.php'); $has_write_permission = $ilAccess->checkAccess("write", "", $this->object->getRefId()); $settings = ilAdobeConnectServer::_getInstance(); if ($settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI and ilAdobeConnectServer::useSwitchaaiAuthMode($ilUser->getAuthMode(true))) { //Login User - this creates a user if he not exists. $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->loginUser(); //Add the user as Participant @adobe switch $status = ilXAVCMembers::_lookupStatus($ilUser->getId(), $this->object->getRefId()); $this->object->addSwitchParticipant($ilUser->getEmail(), $status); } $this->tabs->setTabActive('contents'); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->removeFormAction(); $this->pluginObj->includeClass('class.ilAdobeConnectQuota.php'); $this->pluginObj->includeClass("class.ilObjAdobeConnectAccess.php"); $is_member = ilObjAdobeConnectAccess::_hasMemberRole($ilUser->getId(), $this->object->getRefId()); $is_admin = ilObjAdobeConnectAccess::_hasAdminRole($ilUser->getId(), $this->object->getRefId()); //SWITCHAAI: If the user has no SWITCHaai-Account, we show the room link without connecting to the adobe-connect server. This is used for guest logins. $show_only_roomlink = false; if ($settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI and !ilAdobeConnectServer::useSwitchaaiAuthMode($ilUser->getAuthMode(true))) { $show_only_roomlink = true; $presentation_url = $settings->getPresentationUrl(); $button_txt = $this->pluginObj->txt('enter_vc'); $button_target = $presentation_url . $this->object->getURL(); $button_tpl = new ilTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.bigbutton.html", true, true); $button_tpl->setVariable('BUTTON_TARGET', $button_target); $button_tpl->setVariable('BUTTON_TEXT', $button_txt); $big_button = $button_tpl->get(); $info->addSection(''); $info->addProperty('', $big_button . "<br />"); } if (($this->access->checkAccess("write", "", $this->object->getRefId()) || $is_member || $is_admin) && !$show_only_roomlink) { $presentation_url = $settings->getPresentationUrl(); $form = new ilPropertyFormGUI(); $form->setTitle($this->pluginObj->txt('access_meeting_title')); $this->object->doRead(); if ($this->object->getStartDate() != NULL) { $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->ensureAccountExistance(); $xavc_login = $ilAdobeConnectUser->getXAVCLogin(); $quota = new ilAdobeConnectQuota(); // show button if (($this->object->getPermanentRoom() == 1 || $this->doProvideAccessLink()) && $this->object->isParticipant($xavc_login)) { if (!$quota->mayStartScheduledMeeting($this->object->getScoId())) { $href = $this->txt("meeting_not_available_no_slots"); $button_disabled = true; } else { $href = '<a href="' . $this->ctrl->getLinkTarget($this, 'performSso') . '" target="_blank" >' . $presentation_url . $this->object->getURL() . '</a>'; $button_disabled = false; } } else { $href = $this->txt("meeting_not_available"); $button_disabled = true; } if ($button_disabled == true) { $button_txt = $href; } else { $button_txt = $this->pluginObj->txt('enter_vc'); } $button_target = ILIAS_HTTP_PATH . "/" . $this->ctrl->getLinkTarget($this, 'performSso', '', false, false); $button_tpl = new ilTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.bigbutton.html", true, true); $button_tpl->setVariable('BUTTON_TARGET', $button_target); $button_tpl->setVariable('BUTTON_TEXT', $button_txt); $big_button = $button_tpl->get(); $info->addSection(''); if ($button_disabled == true) { $info->addProperty('', $href); } else { $info->addProperty('', $big_button . "<br />"); } // show instructions if (strlen($this->object->getInstructions()) > 1) { $info->addSection($this->lng->txt('exc_instruction')); $info->addProperty('', nl2br($this->object->getInstructions())); } // show contact info if (strlen($this->object->getContactInfo()) > 1) { $info->addSection($this->pluginObj->txt('contact_information')); $info->addProperty('', nl2br($this->object->getContactInfo())); } //show contents if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->object->getRefId(), AdobeConnectPermissions::PERM_READ_CONTENTS) && $this->object->getReadContents('content')) { $info->addSection($this->pluginObj->txt('file_uploads')); $info->setFormAction($this->ctrl->getFormAction($this, 'showContent')); $has_access = false; if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->ref_id, AdobeConnectPermissions::PERM_UPLOAD_CONTENT) || $has_write_permission) { $has_access = true; $tpl_sub_button = new ilTemplate("Services/InfoScreen/templates/default/tpl.submitbuttons.html", true, true); $tpl_sub_button->setVariable('BTN_NAME', $this->txt("add_new_content")); $tpl_sub_button->setVariable('BTN_COMMAND', 'showAddContent'); $info->addProperty('', $tpl_sub_button->get()); } $info->addProperty('', $this->viewContents($has_access)); } // show records if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->object->getRefId(), AdobeConnectPermissions::PERM_READ_RECORDS) && $this->object->getReadRecords()) { $has_access = false; if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->ref_id, AdobeConnectPermissions::PERM_EDIT_RECORDS) || $has_write_permission) { $has_access = true; } $info->addSection($this->pluginObj->txt('records')); $info->addProperty('', $this->viewRecords($has_access, 'record')); } } else { ilUtil::sendFailure($this->txt('error_connect_ac_server')); } } $info->hideFurtherSections(); $tpl->setContent($info->getHTML() . $this->getPerformTriggerHtml()); $tpl->setPermanentLink('xavc', $this->object->getRefId()); $tpl->addILIASFooter(); }
/** * Returns a session variable, needed to avoid login at open on SwitchAAI-Installations * @return string with session id, false if SwitchAAI and no session and NULL if non * SwitchAAI and error creating session. */ private function getSession($forceAdmin = false, $forceUser = false) { $this->pluginObj->includeClass('class.ilAdobeConnectServer.php'); $settings = ilAdobeConnectServer::_getInstance(); $session = 'false'; if ($forceUser == true || $settings->getAuthMode() != ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) { $session = $this->xmlApi->getBreezeSession(); } else { if (!forceAdmin) { $session = $this->xmlApi->checkBreezeSession(); } } if ($session == 'false' && $settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) { $session = $this->xmlApi->login($this->adminLogin, $this->adminPass); } return $session; }
public function searchUser($a_xavc_login = '') { if ($a_xavc_login) { $xavc_login = $a_xavc_login; } else { $xavc_login = $this->getXAVCLogin(); } $xmlAPI = ilXMLApiFactory::getApiByAuthMode(); $session = $xmlAPI->getBreezeSession(); $instance = ilAdobeConnectServer::_getInstance(); $login = $instance->getLogin(); $pass = $instance->getPasswd(); if ($session != NULL && $xmlAPI->login($login, $pass, $session)) { $search = $xmlAPI->searchUser($xavc_login, $session); $xmlAPI->logout($session); return $search; } }
/** * 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()); }
public function checkConcurrentMeetingDates(ilDateTime $endDate, ilDateTime $startDate = null, $ignoreId = null) { /** * @var $ilDB ilDB */ global $ilDB; if ($startDate == null) { $startDate = new ilDateTime(time(), IL_CAL_UNIX); } $sim = array(); $srv = ilAdobeConnectServer::_getInstance(); $new_start_date = $startDate->getUnixTime() - $srv->getBufferBefore(); $new_end_date = $endDate->getUnixTime() + $srv->getBufferAfter(); $query = array('SELECT * FROM rep_robj_xavc_data', 'WHERE (', '(%s > start_date AND %s < end_date) OR', '(%s > start_date AND %s < end_date) OR', '(%s < start_date AND %s > end_date)', ')'); $types = array('integer', 'integer', 'integer', 'integer', 'integer', 'integer'); $values = array($new_start_date, $new_start_date, $new_end_date, $new_end_date, $new_start_date, $new_end_date); if ($ignoreId !== null) { $query[] = 'AND id <> %s'; $types[] = 'integer'; $values[] = $ignoreId; } $res = $ilDB->queryF(join(' ', $query), $types, $values); while ($row = $ilDB->fetchObject($res)) { if (ilObject::_hasUntrashedReference($row->id)) { $sim[] = $row; } } return $sim; }
public function showContent() { /* * var $ilUser ilUser */ global $ilUser, $tpl, $ilCtrl, $ilAccess; $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php'); $this->pluginObj->includeClass('class.ilAdobeConnectServer.php'); $has_write_permission = $ilAccess->checkAccess("write", "", $this->object->getRefId()); $settings = ilAdobeConnectServer::_getInstance(); $this->tabs->setTabActive('contents'); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->removeFormAction(); $this->pluginObj->includeClass('class.ilAdobeConnectQuota.php'); $this->pluginObj->includeClass("class.ilObjAdobeConnectAccess.php"); $is_member = ilObjAdobeConnectAccess::_hasMemberRole($ilUser->getId(), $this->object->getRefId()); $is_admin = ilObjAdobeConnectAccess::_hasAdminRole($ilUser->getId(), $this->object->getRefId()); if ($this->access->checkAccess("write", "", $this->object->getRefId()) || $is_member || $is_admin) { $presentation_url = $settings->getPresentationUrl(); $form = new ilPropertyFormGUI(); $form->setTitle($this->pluginObj->txt('access_meeting_title')); $this->object->doRead(); if ($this->object->getStartDate() != NULL) { $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->ensureAccountExistance(); $xavc_login = $ilAdobeConnectUser->getXAVCLogin(); $quota = new ilAdobeConnectQuota(); // show button if (($this->object->getPermanentRoom() == 1 || $this->doProvideAccessLink()) && $this->object->isParticipant($xavc_login)) { $this->pluginObj->includeClass('class.ilAdobeConnectRoles.php'); $xavcRoles = new ilAdobeConnectRoles($this->object->getRefId()); if (!$quota->mayStartScheduledMeeting($this->object->getScoId())) { $href = $this->txt("meeting_not_available_no_slots"); $button_disabled = true; } else { if (!$xavcRoles->isAdministrator($this->user->getId()) && count($current_pax = $this->object->getCurrentPax()) > $this->object->getMaxPax() && !in_array($this->object->getPrincipalId($xavc_login), $current_pax)) { $href = $this->txt("meeting_full"); $button_disabled = true; } else { $href = '<a href="' . $this->ctrl->getLinkTarget($this, 'performSso') . '" target="_blank" >' . $presentation_url . $this->object->getURL() . '</a>'; $button_disabled = false; } } } else { $href = $this->txt("meeting_not_available"); $button_disabled = true; } if ($button_disabled == true) { $button_txt = $href; } else { $button_txt = $this->pluginObj->txt('enter_vc'); } $button_target = ILIAS_HTTP_PATH . "/" . $this->ctrl->getLinkTarget($this, 'performSso', '', false, false); $button_tpl = new ilTemplate($this->pluginObj->getDirectory() . "/templates/default/tpl.bigbutton.html", true, true); $button_tpl->setVariable('BUTTON_TARGET', $button_target); $button_tpl->setVariable('BUTTON_TEXT', $button_txt); $big_button = $button_tpl->get(); $info->addSection(''); if ($button_disabled == true) { $info->addProperty('', $href); } else { $info->addProperty('', $big_button . "<br />"); } // show instructions if (strlen($this->object->getInstructions()) > 1) { $info->addSection($this->lng->txt('exc_instruction')); $info->addProperty('', nl2br($this->object->getInstructions())); } // show contact info if (strlen($this->object->getContactInfo()) > 1) { $info->addSection($this->pluginObj->txt('contact_information')); $info->addProperty('', nl2br($this->object->getContactInfo())); } //show contents if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->object->getRefId(), AdobeConnectPermissions::PERM_READ_CONTENTS) && $this->object->getReadContents('content') || ilXAVCPermissions::hasAccess($ilUser->getId(), $this->ref_id, AdobeConnectPermissions::PERM_UPLOAD_CONTENT) || $has_write_permission) { $admins_only = ''; if (!$this->object->getReadContents('content')) { $admins_only = $this->pluginObj->txt('admins_only'); } $info->addSection($this->pluginObj->txt('file_uploads') . ' ' . $admins_only); $info->setFormAction($this->ctrl->getFormAction($this, 'showContent')); $has_access = false; if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->ref_id, AdobeConnectPermissions::PERM_UPLOAD_CONTENT) || $has_write_permission) { $has_access = true; $tpl_sub_button = new ilTemplate("Services/InfoScreen/templates/default/tpl.submitbuttons.html", true, true); $tpl_sub_button->setVariable('BTN_NAME', $this->txt("add_new_content")); $tpl_sub_button->setVariable('BTN_COMMAND', 'showAddContent'); $info->addProperty('', $tpl_sub_button->get()); } $info->addProperty('', $this->viewContents($has_access)); } // show records if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->object->getRefId(), AdobeConnectPermissions::PERM_READ_RECORDS) && $this->object->getReadRecords() || ilXAVCPermissions::hasAccess($ilUser->getId(), $this->ref_id, AdobeConnectPermissions::PERM_EDIT_RECORDS) || $has_write_permission) { $has_access = false; $admins_only = ''; if (ilXAVCPermissions::hasAccess($ilUser->getId(), $this->ref_id, AdobeConnectPermissions::PERM_EDIT_RECORDS) || $has_write_permission) { $has_access = true; if (!$this->object->getReadRecords()) { $admins_only = $this->pluginObj->txt('admins_only'); } } $info->addSection($this->pluginObj->txt('records') . ' ' . $admins_only); $info->addProperty('', $this->viewRecords($has_access, 'record')); } } else { ilUtil::sendFailure($this->txt('error_connect_ac_server')); } } $info->hideFurtherSections('', true); $tpl->setContent($info->getHTML() . $this->getPerformTriggerHtml()); $tpl->setPermanentLink('xavc', $this->object->getRefId()); $tpl->addILIASFooter(); }