/** * get preferences * * shows additional settings. * @access public */ function getPreferences() { global $connected_cms; $role_template_name = Request::get('role_template_name'); $cat_name = Request::get('cat_name'); $style_setting = Request::option('style_setting'); $encrypt_passwords = Request::option('encrypt_passwords'); $this->soap_client->setCachingStatus(false); if ($cat_name != "") { $cat = $this->soap_client->getReferenceByTitle(trim($cat_name), "cat"); if ($cat == false) { $messages["error"] .= sprintf(_("Das Objekt mit dem Namen \"%s\" wurde im System %s nicht gefunden."), htmlReady($cat_name), htmlReady($this->getName())) . "<br>\n"; } if ($cat != "") { ELearningUtils::setConfigValue("category_id", $cat, $this->cms_type); $this->main_category_node_id = $cat; } } if ($role_template_name != "") { $role_template = $this->soap_client->getObjectByTitle(trim($role_template_name), "rolt"); if ($role_template == false) { $messages["error"] .= sprintf(_("Das Rollen-Template mit dem Namen \"%s\" wurde im System %s nicht gefunden."), htmlReady($role_template_name), htmlReady($this->getName())) . "<br>\n"; } if (is_array($role_template)) { ELearningUtils::setConfigValue("user_role_template_id", $role_template["obj_id"], $this->cms_type); ELearningUtils::setConfigValue("user_role_template_name", $role_template["title"], $this->cms_type); $this->user_role_template_id = $role_template["obj_id"]; } } if (Request::submitted('submit')) { ELearningUtils::setConfigValue("user_style", $style_setting, $this->cms_type); ELearningUtils::setConfigValue("user_skin", $style_setting, $this->cms_type); ELearningUtils::setConfigValue("encrypt_passwords", $encrypt_passwords, $this->cms_type); } else { if (ELearningUtils::getConfigValue("user_style", $this->cms_type) != "") { $style_setting = ELearningUtils::getConfigValue("user_style", $this->cms_type); } if (ELearningUtils::getConfigValue("encrypt_passwords", $this->cms_type) != "") { $encrypt_passwords = ELearningUtils::getConfigValue("encrypt_passwords", $this->cms_type); } } if ($messages["error"] != "") { echo "<b>" . Icon::create('decline', 'attention')->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . " " . $messages["error"] . "</b><br><br>"; } echo "<table>"; echo "<tr valign=\"top\"><td width=30% align=\"left\"><font size=\"-1\">"; echo "<b>" . _("SOAP-Verbindung: ") . "</b>"; echo "</td><td><font size=\"-1\">"; $error = $this->soap_client->getError(); if ($error != false) { echo sprintf(_("Beim Herstellen der SOAP-Verbindung trat folgender Fehler auf:")) . "<br><br>" . $error; } else { echo sprintf(_("Die SOAP-Verbindung zum Klienten \"%s\" wurde hergestellt, der Name des Administrator-Accounts ist \"%s\"."), htmlReady($this->soap_data["client"]), htmlReady($this->soap_data["username"])); } echo "<br>\n"; echo "<br>\n"; echo "</td></tr><tr><td width=30% align=\"left\"><font size=\"-1\">"; $cat = $this->soap_client->getObjectByReference($this->main_category_node_id); echo "<b>" . _("Kategorie: ") . "</b>"; echo "</td><td>"; echo "<input type=\"text\" size=\"20\" border=0 value=\"" . $cat["title"] . "\" name=\"cat_name\"> "; echo Icon::create('info-circle', 'inactive', ['title' => _('Geben Sie hier den Namen einer bestehenden ILIAS 3 - Kategorie ein, in der die Lernmodule und User-Kategorien abgelegt werden sollen.')])->asImg(); echo "</td></tr><tr><td></td><td><font size=\"-1\">"; echo " (ID " . $this->main_category_node_id; if ($cat["description"] != "") { echo ", " . _("Beschreibung: ") . htmlReady($cat["description"]); } echo ")"; echo "<br>\n"; echo "<br>\n"; echo "</td></tr><tr><td width=30% align=\"left\"><font size=\"-1\">"; echo "<b>" . _("Rollen-Template für die persönliche Kategorie: ") . "</b>"; echo "</td><td>"; echo "<input type=\"text\" size=\"20\" border=0 value=\"" . ELearningUtils::getConfigValue("user_role_template_name", $this->cms_type) . "\" name=\"role_template_name\"> "; echo Icon::create('info-circle', 'inactive', ['title' => _('Geben Sie den Namen des Rollen-Templates ein, das für die persönliche Kategorie von Lehrenden verwendet werden soll (z.B. \\"Author\\").')])->asImg(); echo "</td></tr><tr><td></td><td><font size=\"-1\">"; echo " (ID " . $this->user_role_template_id; echo ")"; echo "<br>\n"; echo "<br>\n"; echo "</td></tr><tr><td width=30% align=\"left\"><font size=\"-1\">"; echo "<b>" . _("Passwörter: ") . "</b>"; echo "</td><td><font size=\"-1\">"; echo "<input type=\"checkbox\" border=0 value=\"md5\" name=\"encrypt_passwords\""; if ($encrypt_passwords == "md5") { echo " checked"; } echo "> " . _("ILIAS-Passwörter verschlüsselt speichern."); echo Icon::create('info-circle', 'inactive', ['title' => _('Wählen Sie diese Option, wenn die ILIAS-Passwörter der zugeordneten Accounts verschlüsselt in der Stud.IP-Datenbank abgelegt werden sollen.')])->asImg(); echo "</td></tr><tr><td></td><td><font size=\"-1\">"; echo "<br>\n"; echo "<br>\n"; echo "</td></tr><tr><td width=30% align=\"left\"><font size=\"-1\">"; echo "<b>" . _("Style / Skin: ") . "</b>"; echo "</td><td><font size=\"-1\">"; echo "<input type=\"checkbox\" border=0 value=\"studip\" name=\"style_setting\""; if ($style_setting == "studip") { echo " checked"; } echo "> " . _("Stud.IP-Style für neue Nutzer-Accounts voreinstellen."); echo Icon::create('info-circle', 'inactive', ['title' => _('Wählen Sie diese Option, wenn für alle von Stud.IP angelegten ILIAS-Accounts das Stud.IP-Layout als System-Style eingetragen werden soll. ILIAS-seitig angelegte Accounts erhalten weiterhin den Standard-Style.')])->asImg(); echo "</td></tr><tr><td></td><td><font size=\"-1\">"; echo "<br>\n"; echo "<br>\n"; echo "</td></tr>"; echo "</table>"; echo "<center>" . Button::create(_('übernehmen'), 'submit') . "</center><br>"; echo "<br>\n"; parent::getPreferences(); echo "<br>\n"; }
/** * get preferences * * shows additional settings. * @access public */ function getPreferences() { global $connected_cms; $role_template_name = Request::get('role_template_name'); $cat_name = Request::get('cat_name'); $this->soap_client->setCachingStatus(false); if ($cat_name != "") { $cat = $this->soap_client->getReferenceByTitle(trim($cat_name), "cat"); if ($cat == false) { $messages["error"] .= sprintf(_("Das Objekt mit dem Namen \"%s\" wurde im System %s nicht gefunden."), htmlReady($cat_name), htmlReady($this->getName())) . "<br>\n"; } elseif ($cat != "") { ELearningUtils::setConfigValue("category_id", $cat, $this->cms_type); $this->main_category_node_id = $cat; } } if ($this->main_category_node_id != false and ELearningUtils::getConfigValue("user_category_id", $this->cms_type) == "") { $object_data["title"] = sprintf(_("User-Daten")); $object_data["description"] = _("Hier befinden sich die persönlichen Ordner der Stud.IP-User."); $object_data["type"] = "cat"; $object_data["owner"] = $this->user->getId(); $user_cat = $connected_cms[$this->cms_type]->soap_client->addObject($object_data, $connected_cms[$this->cms_type]->main_category_node_id); if ($user_cat != false) { $this->user_category_node_id = $user_cat; ELearningUtils::setConfigValue("user_category_id", $user_cat, $this->cms_type); } else { $messages["error"] .= _("Die Kategorie für User-Daten konnte nicht angelegt werden.") . "<br>\n"; } } if ($role_template_name != "") { $role_template = $this->soap_client->getObjectByTitle(trim($role_template_name), "rolt"); if ($role_template == false) { $messages["error"] .= sprintf(_("Das Rollen-Template mit dem Namen \"%s\" wurde im System %s nicht gefunden."), htmlReady($role_template_name), htmlReady($this->getName())) . "<br>\n"; } if (is_array($role_template)) { ELearningUtils::setConfigValue("user_role_template_id", $role_template["obj_id"], $this->cms_type); ELearningUtils::setConfigValue("user_role_template_name", $role_template["title"], $this->cms_type); $this->user_role_template_id = $role_template["obj_id"]; } } if (Request::submitted('submit')) { ELearningUtils::setConfigValue("encrypt_passwords", Request::option("encrypt_passwords"), $this->cms_type); $encrypt_passwords = Request::option("encrypt_passwords"); ELearningUtils::setConfigValue("ldap_enable", Request::option("ldap_enable"), $this->cms_type); $this->ldap_enable = Request::option("ldap_enable"); } else { if (ELearningUtils::getConfigValue("encrypt_passwords", $this->cms_type) != "") { $encrypt_passwords = ELearningUtils::getConfigValue("encrypt_passwords", $this->cms_type); } } $cat = $this->soap_client->getObjectByReference($this->main_category_node_id); $user_cat = $this->soap_client->getObjectByReference($this->user_category_node_id); $title = $this->link->getModuleLink($user_cat["title"], $this->user_category_node_id, "cat"); $ldap_options = array(); foreach (StudipAuthAbstract::GetInstance() as $plugin) { if ($plugin instanceof StudipAuthLdap) { $ldap_options[] = '<option ' . ($plugin->plugin_name == $this->ldap_enable ? 'selected' : '') . '>' . $plugin->plugin_name . '</option>'; } } ob_start(); ConnectedCMS::getPreferences(); $module_types = ob_get_clean(); $template = $GLOBALS['template_factory']->open('elearning/ilias4_connected_cms_preferences.php'); $template->set_attribute('messages', $messages); $template->set_attribute('soap_error', $this->soap_client->getError()); $template->set_attribute('soap_data', $this->soap_data); $template->set_attribute('main_category_node_id', $this->main_category_node_id); $template->set_attribute('main_category_node_id_title', $cat['title']); $template->set_attribute('user_category_node_id', $this->user_category_node_id); $template->set_attribute('user_category_node_id_title', $title); $template->set_attribute('user_role_template_name', ELearningUtils::getConfigValue("user_role_template_name", $this->cms_type)); $template->set_attribute('user_role_template_id', $this->user_role_template_id); $template->set_attribute('encrypt_passwords', $encrypt_passwords); $template->set_attribute('ldap_options', count($ldap_options) ? join("\n", array_merge(array('<option></option>'), $ldap_options)) : ''); $template->set_attribute('module_types', $module_types); echo $template->render(); }