示例#1
0
?>
            <? if (count($cms_data['modules'])) : ?>
                <? foreach ($cms_data['modules'] as $module_html) : ?>
                    <?php 
echo $module_html;
?>
                <? endforeach ?>
            <? else : ?>
                <table border="0" cellspacing="0" cellpadding="6">
                    <tr>
                        <td>
                            <?php 
echo sprintf(_("Sie haben im System %s keine eigenen Lernmodule."), htmlReady($cms_data['name']));
?>
<br>
                            <br>
                        </td>
                    </tr>
                </table>
            <? endif ?>
            <br>
            <br>
            <?php 
echo $cms_data['new_module_form'];
?>
        <? endif ?>
        <?php 
echo ELearningUtils::getCMSFooter($cms_data['logo']);
?>
        <br>
    <? endforeach ?>
示例#2
0
 /**
  * Displays accounts and elearning modules for active user
  */
 public function my_accounts_action()
 {
     global $connected_cms, $current_module, $messages;
     Navigation::activateItem('/tools/my_elearning');
     PageLayout::setTitle(_("Meine Lernmodule und Benutzer-Accounts"));
     if ($this->new_account_cms != "") {
         $this->new_account_form = ELearningUtils::getNewAccountForm($this->new_account_cms);
     }
     foreach ($GLOBALS['ELEARNING_INTERFACE_MODULES'] as $cms => $cms_preferences) {
         if (ELearningUtils::isCMSActive($cms)) {
             ELearningUtils::loadClass($cms);
             if ($cms_preferences["auth_necessary"] == true) {
                 $this->new_module_form[$cms] = ELearningUtils::getNewModuleForm($cms);
             }
             $connection_status = $connected_cms[$cms]->getConnectionStatus($cms);
             foreach ($connection_status as $type => $msg) {
                 if ($msg["error"] != "") {
                     PageLayout::postMessage(MessageBox::error(_("Es traten Probleme bei der Anbindung einzelner Lermodule auf. Bitte wenden Sie sich an Ihren Systemadministrator."), array($cms . ': ' . $msg["error"])));
                     $GLOBALS["ELEARNING_INTERFACE_" . $cms . "_ACTIVE"] = false;
                 }
             }
         }
     }
     $connected_cms = array();
     // prepare cms list
     foreach ($GLOBALS['ELEARNING_INTERFACE_MODULES'] as $cms => $cms_preferences) {
         if (ELearningUtils::isCMSActive($cms) and $cms_preferences["auth_necessary"]) {
             ELearningUtils::loadClass($cms);
             $this->cms_list[$cms] = $cms_preferences;
             $this->cms_list[$cms]['name'] = $connected_cms[$cms]->getName();
             $this->cms_list[$cms]['logo'] = $connected_cms[$cms]->getLogo();
             $this->cms_list[$cms]['modules'] = array();
             if ($this->new_account_cms != $cms) {
                 $this->cms_list[$cms]['show_account_form'] = $cms_preferences;
             }
             if ($GLOBALS["module_type_" . $cms] != "") {
                 $this->cms_list[$cms]['cms_anker_target'] = true;
             }
             if ($connected_cms[$cms]->user->isConnected()) {
                 $this->cms_list[$cms]['start_link'] = $connected_cms[$cms]->link->getStartpageLink();
             }
             if ($this->new_account_cms != $cms) {
                 if ($connected_cms[$cms]->user->isConnected()) {
                     $this->cms_list[$cms]['user'] = $connected_cms[$cms]->user->getUsername();
                     $connected_cms[$cms]->soap_client->setCachingStatus(false);
                     $this->user_content_modules = $connected_cms[$cms]->getUserContentModules();
                     $connected_cms[$cms]->soap_client->setCachingStatus(true);
                     if (!($this->user_content_modules == false)) {
                         foreach ($this->user_content_modules as $key => $connection) {
                             $connected_cms[$cms]->setContentModule($connection, false);
                             $this->cms_list[$cms]['modules'][] = $connected_cms[$cms]->content_module[$current_module]->view->show();
                         }
                     }
                     $this->cms_list[$cms]['new_module_form'] = $this->new_module_form[$cms];
                 }
             } else {
                 $this->cms_list[$cms]['account_form'] = $this->new_account_form;
             }
         }
     }
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/learnmodule-sidebar.png');
     $widget = new ActionsWidget();
     if ($GLOBALS['perm']->have_perm('autor') and count($this->cms_list)) {
         foreach ($this->cms_list as $cms_key => $cms_data) {
             if ($connected_cms[$cms_key]->user->isConnected()) {
                 $widget->addLink(sprintf(_('Zur %s Startseite'), $cms_data['name']), URLHelper::getScriptLink($cms_data['start_link']), Icon::create('link-extern', 'clickable'), array('target' => '_blank'));
                 $link_count++;
             }
         }
     }
     if ($link_count) {
         $sidebar->addWidget($widget);
     }
     // terminate objects
     if (is_array($connected_cms)) {
         foreach ($connected_cms as $system) {
             $system->terminate();
         }
     }
     if (is_array($messages)) {
         foreach ($messages as $mtype => $mtext) {
             PageLayout::postMessage(MessageBox::$mtype($mtext));
         }
     }
 }
示例#3
0
 function moduleElearning_interfaceDeactivate($range_id)
 {
     global $connected_cms;
     foreach (ObjectConnections::GetConnectedSystems($range_id) as $system) {
         ELearningUtils::loadClass($system);
         $connected_cms[$system]->deleteConnectedModules($range_id);
     }
 }
示例#4
0
 /**
  * Displays a page.
  */
 public function edit_action($id = null)
 {
     global $connected_cms, $current_module;
     if (!$this->rechte) {
         throw new AccessDeniedException(_('Keine Berechtigung zum Bearbeiten der Lernmodul-Verknüpfungen.'));
     }
     Navigation::activateItem('/course/elearning/edit');
     $GLOBALS['view'] = 'edit';
     // ggf. neuen Ilias4-Kurs anlegen
     if (Request::submitted('create_course') and $this->rechte) {
         ELearningUtils::loadClass($this->cms_select);
         if (method_exists($connected_cms[$this->cms_select], "createCourse")) {
             if ($connected_cms[$this->cms_select]->createCourse($this->seminar_id)) {
                 PageLayout::postMessage(MessageBox::info(_('Kurs wurde angelegt.')));
             }
         }
     }
     // ggf. bestehenden Ilias4-Kurs zuordnen
     if (Request::submitted('connect_course')) {
         if (ObjectConnections::getConnectionModuleId(Request::option("connect_course_sem_id"), "crs", $this->cms_select) and $GLOBALS['perm']->have_studip_perm("dozent", Request::option("connect_course_sem_id"))) {
             ObjectConnections::setConnection($this->seminar_id, ObjectConnections::getConnectionModuleId(Request::option("connect_course_sem_id"), "crs", $this->cms_select), "crs", $this->cms_select);
             PageLayout::postMessage(MessageBox::info(_('Zuordnung wurde gespeichert.')));
             ELearningUtils::loadClass($this->cms_select);
             if (method_exists($connected_cms[$this->cms_select], "updateConnections")) {
                 $connected_cms[$this->cms_select]->updateConnections(ObjectConnections::getConnectionModuleId(Request::option("connect_course_sem_id"), "crs", $this->cms_select));
             }
         }
     }
     // Zugeordnete Ilias-Kurse ermitteln und ggf. aktualisieren
     $this->course_output = ELearningUtils::getIliasCourses($this->seminar_id);
     if ($this->new_account_cms == "") {
         if ($this->module_system_type != "") {
             $user_crs_role = $connected_cms[$this->module_system_type]->crs_roles[$GLOBALS['auth']->auth["perm"]];
             ELearningUtils::loadClass($this->module_system_type);
         }
         if (Request::submitted('remove')) {
             $connected_cms[$this->module_system_type]->newContentModule($this->module_id, $this->module_type, true);
             if ($connected_cms[$this->module_system_type]->content_module[$this->module_id]->unsetConnection($this->seminar_id, $this->module_id, $this->module_type, $this->module_system_type)) {
                 PageLayout::postMessage(MessageBox::info(_('Die Zuordnung wurde entfernt.')));
             }
             unset($connected_cms[$this->module_system_type]->content_module[$this->module_id]);
         } elseif (Request::submitted('add')) {
             $connected_cms[$this->module_system_type]->newContentModule($this->module_id, $this->module_type, true);
             if ($connected_cms[$this->module_system_type]->content_module[$this->module_id]->setConnection($this->seminar_id)) {
                 PageLayout::postMessage(MessageBox::info(_('Die Zuordnung wurde gespeichert.')));
             }
             unset($connected_cms[$this->module_system_type]->content_module[$this->module_id]);
         }
         if ($this->search_key != "") {
             ELearningUtils::loadClass($this->cms_select);
             if (strlen(trim($this->search_key)) > 2) {
                 $searchresult_content_modules = $connected_cms[$this->cms_select]->searchContentModules($this->search_key);
             } else {
                 PageLayout::postMessage(MessageBox::error(_('Jeder Suchbegriff muss mindestens 3 Zeichen lang sein!')));
             }
         }
     }
     //Instanz mit den Zuordnungen von Content-Modulen zur Veranstaltung
     $object_connections = new ObjectConnections($this->seminar_id);
     $connected_modules = $object_connections->getConnections();
     $this->module_count = 0;
     $content_modules_list = array();
     $user_modules_list = array();
     $search_modules_list = array();
     if ($object_connections->isConnected()) {
         $caching_active = true;
         foreach ($connected_modules as $key => $connection) {
             if (ELearningUtils::isCMSActive($connection["cms"])) {
                 ELearningUtils::loadClass($connection["cms"]);
                 $connected_cms[$connection["cms"]]->newContentModule($connection["id"], $connection["type"], true);
                 $connected_modules[$key]['title'] = $connected_cms[$connection["cms"]]->content_module[$connection["id"]]->getTitle();
                 $title_tmp[$key] = str_replace(array('ä', 'ö', 'ü', 'ß'), array('ae', 'oe', 'ue', 'ss'), strtolower($connected_modules[$key]['title']));
                 $type_tmp[$key] = array_search($connection['type'], array_keys($GLOBALS['ELEARNING_INTERFACE_MODULES'][$connection["cms"]]['types']));
                 $class_tmp[$key] = $GLOBALS['ELEARNING_INTERFACE_MODULES'][$connection["cms"]]["CLASS_PREFIX"];
             }
         }
         array_multisort($class_tmp, SORT_ASC, $type_tmp, SORT_ASC, $title_tmp, SORT_ASC, $connected_modules);
         foreach ($connected_modules as $index => $connection) {
             $current_module = $connection["id"];
             if ($this->module_count == 0) {
                 $content_modules_list[$index]['show_header'] = true;
             }
             $this->module_count++;
             $this->module_system_count[$connection["cms"]]++;
             if ($this->open_all != "") {
                 $_SESSION['elearning_open_close'][$connected_cms[$connection["cms"]]->content_module[$connection["id"]]->getReferenceString()] = true;
             } elseif ($this->close_all != "") {
                 $_SESSION['elearning_open_close'][$connected_cms[$connection["cms"]]->content_module[$connection["id"]]->getReferenceString()] = false;
             }
             $content_modules_list[$index]['module'] = $connected_cms[$connection["cms"]]->content_module[$connection["id"]]->view->showAdmin();
         }
     }
     if ($this->module_count == 0 and $this->new_account_cms == "") {
         if ($_SESSION['SessSemName']['class'] == 'inst') {
             PageLayout::postMessage(MessageBox::info(_('Momentan sind dieser Einrichtung keine Lernmodule zugeordnet.')));
         } else {
             PageLayout::postMessage(MessageBox::info(_('Momentan sind dieser Veranstaltung keine Lernmodule zugeordnet.')));
         }
     }
     $this->caching_active = false;
     if (isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_select]["name"])) {
         ELearningUtils::loadClass($this->cms_select);
         $user_content_modules = $connected_cms[$this->cms_select]->getUserContentModules();
         if (!($user_content_modules == false)) {
             foreach ($user_content_modules as $key => $connection) {
                 // show only those modules which are not already connected to the seminar
                 if (is_object($connected_cms[$this->cms_select]->content_module[$connection["ref_id"]])) {
                     continue;
                 }
                 $connected_cms[$this->cms_select]->setContentModule($connection, false);
                 $connected_cms[$this->cms_select]->content_module[$current_module]->view->showAdmin();
                 $user_modules_list[$key]['module'] = $connected_cms[$this->cms_select]->content_module[$current_module]->view->showAdmin();
             }
         }
         if (!$connected_cms[$this->cms_select]->isAuthNecessary() || $connected_cms[$this->cms_select]->user->isConnected()) {
             $this->show_search = true;
         }
         if (!($searchresult_content_modules == false)) {
             foreach ($searchresult_content_modules as $key => $connection) {
                 // show only those modules which are not already connected to the seminar
                 if (is_object($connected_cms[$this->cms_select]->content_module[$connection["ref_id"]])) {
                     continue;
                 }
                 $connected_cms[$this->cms_select]->setContentModule($connection, false);
                 $search_modules_list[$key]['module'] = $connected_cms[$this->cms_select]->content_module[$current_module]->view->showAdmin();
             }
         }
         // ILIAS 4: Leeren Kurs anlegen oder Kurse von anderen Veranstaltungen zuordnen
         if (method_exists($connected_cms[$this->cms_select], "updateConnections") and !$this->module_system_count[$this->cms_select] and !ObjectConnections::getConnectionModuleId($this->seminar_id, "crs", $this->cms_select)) {
             $show_ilias_empty_course = true;
             if ($GLOBALS['perm']->have_perm('root')) {
                 $query = "SELECT DISTINCT object_id, module_id, Name\n                                  FROM object_contentmodules\n                                  LEFT JOIN seminare ON (object_id = Seminar_id)\n                                  WHERE module_type = 'crs' AND system_type = ?";
             } else {
                 $query = "SELECT DISTINCT object_id, module_id, Name\n                                  FROM object_contentmodules\n                                  LEFT JOIN seminare ON (object_id = Seminar_id)\n                                  LEFT JOIN seminar_user USING (Seminar_id)\n                                  WHERE module_type = 'crs' AND system_type = ? AND seminar_user.status = 'dozent'";
             }
             $statement = DBManager::get()->prepare($query);
             $statement->execute(array($this->cms_select));
             while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
                 if ($GLOBALS['perm']->have_studip_perm('dozent', $row['object_id'])) {
                     $existing_courses[$row['object_id']] = my_substr($row['Name'], 0, 60) . " " . sprintf(_("(Kurs-ID %s)"), $row['module_id']);
                 }
             }
         } elseif (method_exists($connected_cms[$this->cms_select], "updateConnections") and count($connected_cms[$this->cms_select]->types['webr'])) {
             $this->show_ilias_link_info = true;
             $crs_data = ObjectConnections::getConnectionModuleId($this->seminar_id, "crs", $this->cms_select);
         }
     }
     // Cachen der SOAP-Daten
     if (is_array($connected_cms)) {
         foreach ($connected_cms as $system) {
             $system->terminate();
         }
     }
     $widget = new ActionsWidget();
     if (count($this->course_output['courses'])) {
         $widget->addLink(_('Zuordnungen aktualisieren'), URLHelper::getURL('?view=edit&cms_select=' . $this->cms_select . '&update=1'), Icon::create('refresh', 'clickable'));
     }
     $this->sidebar->addWidget($widget);
     $this->new_account = $this->new_account_cms;
     $this->is_inst = $_SESSION['SessSemName']['class'] == 'inst';
     if ($this->cms_select) {
         $this->cms_name = $connected_cms[$this->cms_select]->getName();
         $this->cms_logo = $connected_cms[$this->cms_select]->getLogo();
         $this->user_modules = $user_modules_list;
         $this->search_modules = $search_modules_list;
         $this->existing_courses = $existing_courses;
         $this->show_ilias_empty_course = $show_ilias_empty_course;
     }
     $this->content_modules = $content_modules_list;
 }
示例#5
0
 /**
  * check db-integrity
  *
  * checks if there are broken links in the database
  * @access public
  * @return boolean successful
  */
 function checkIntegrity()
 {
     global $ELEARNING_INTERFACE_MODULES, $messages;
     $db = DBManager::get();
     foreach ($ELEARNING_INTERFACE_MODULES as $cms_type => $data) {
         $cmsystems[$cms_type] = array();
     }
     $config = Config::get();
     foreach ($config->getFields('global', null, 'ELEARNING_INTERFACE_') as $key) {
         $parts = explode("_", $key);
         $cmsystems[$parts[2]]["config"]++;
     }
     $rs = $db->query("SELECT external_user_system_type, COUNT(*) as c FROM auth_extern GROUP BY external_user_system_type");
     while ($row = $rs->fetch()) {
         $cmsystems[$row["external_user_system_type"]]["accounts"] = $row['c'];
     }
     $rs = $db->query("SELECT system_type, COUNT(*) FROM object_contentmodules GROUP BY system_type");
     while ($row = $rs->fetch()) {
         $cmsystems[$row["system_type"]]["modules"] = $row['c'];
     }
     if (Request::submitted('delete')) {
         $messages["info"] .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\">";
         $messages["info"] .= CSRFProtection::tokenTag();
         $messages["info"] .= "<table>";
         $messages["info"] .= "<tr><td>&nbsp;</td></tr>";
         $messages["info"] .= "<tr><td>" . sprintf(_("Durch das Löschen der Daten zum System mit dem Index \"%s\" werden %s Konfigurationseinträge und Verknüpfungen von Stud.IP-Veranstaltungen und -User-Accounts unwiederbringlich aus der Stud.IP-Datenbank entfernt. Wollen Sie diese Daten jetzt löschen?"), Request::quoted('delete_cms'), $cmsystems[Request::quoted('delete_cms')]["accounts"] + $cmsystems[Request::quoted('delete_cms')]["modules"] + $cmsystems[Request::quoted('delete_cms')]["config"]) . "</td></tr>";
         $messages["info"] .= "<tr><td align=\"center\"><input type=\"hidden\" name=\"delete_cms\" value=\"" . Request::quoted('delete_cms') . "\">";
         $messages["info"] .= '<div class="button-group">' . Button::create(_('Alle löschen'), 'confirm_delete') . Button::createCancel(_('Abbrechen'), 'abbruch') . '<div></td></tr>';
         $messages["info"] .= "<tr><td align=\"center\"></td></tr>";
         $messages["info"] .= "</table>";
         $messages["info"] .= "</form>";
     }
     if (Request::submitted('confirm_delete')) {
         unset($cmsystems[Request::quoted('delete_cms')]);
         //          deleteCMSData(Request::quoted('delete_cms'));
         $messages["info"] .= _("Daten wurden gelöscht.");
     }
     foreach ($cmsystems as $cms_type => $data) {
         if ($ELEARNING_INTERFACE_MODULES[$cms_type]) {
             $output .= ELearningUtils::getCMSHeader($ELEARNING_INTERFACE_MODULES[$cms_type]["name"]);
             $output .= "<table>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             if (ELearningUtils::getConfigValue("ACTIVE", $cms_type)) {
                 $output .= "<tr><td>" . Icon::create('checkbox-checked', 'clickable')->asImg(['class' => 'text-top']) . "</td><td><b>" . sprintf(_("Die Schnittstelle zum System %s ist aktiv."), $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</b></td></tr>";
                 $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             } elseif ($data["config"] < 1) {
                 $output .= "<tr><td>" . Icon::create('checkbox-unchecked', 'clickable')->asImg(['class' => 'text-top']) . "</td><td><i>" . sprintf(_("Die Schnittstelle für das System %s wurde noch nicht eingerichtet."), $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</i></td></tr>";
             } elseif ($data["config"] < 1) {
                 $output .= "<tr><td>" . Icon::create('checkbox-unchecked', 'clickable')->asImg(['class' => 'text-top']) . "</td><td><i>" . sprintf(_("Die Schnittstelle wurde noch nicht aktiviert."), $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</i></td></tr>";
             }
             if ($data["accounts"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Stud.IP-User-Accounts sind mit Accounts im System %s verknüpft."), $data["accounts"], $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</td></tr>";
             }
             if ($data["modules"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Objekte sind Stud.IP-Veranstaltungen oder -Einrichtungen zugeordnet."), $data["modules"]) . "</td></tr>";
             }
             if ($data["config"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Einträge in der config-Tabelle der Stud.IP-Datenbank."), $data["config"]) . "</td></tr>";
             }
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "</table>";
             $output .= ELearningUtils::getCMSFooter($ELEARNING_INTERFACE_MODULES[$cms_type]["logo_file"] ? "<img src=\"" . $ELEARNING_INTERFACE_MODULES[$cms_type]["logo_file"] . "\" border=\"0\">" : $cms_type);
         } else {
             $output .= ELearningUtils::getCMSHeader("<font color=FF0000> Unbekanntes System: " . $cms_type . "</font>");
             $output .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\">";
             $output .= CSRFProtection::tokenTag();
             $output .= "<table>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "<tr><td>" . Icon::create('decline', 'attention')->asImg(['class' => 'text-top']) . "</td><td><i>" . sprintf(_("Für das System mit dem Index \"%s\" existieren keine Voreinstellungen in den Konfigurationsdateien mehr."), $cms_type) . "</i></td></tr>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "<tr><td colspan=\"2\"><b>" . _("In der Stud.IP-Datenbank sind noch folgende Informationen zu diesem System gespeichert:") . "</b></td></tr>";
             if ($data["accounts"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Stud.IP-User-Accounts sind mit externen Accounts mit dem Index \"%s\" verknüpft."), $data["accounts"], $cms_type) . "</td></tr>";
             }
             if ($data["modules"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Objekte sind Stud.IP-Veranstaltungen oder -Einrichtungen zugeordnet."), $data["modules"]) . "</td></tr>";
             }
             if ($data["config"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Einträge in der config-Tabelle der Stud.IP-Datenbank."), $data["config"]) . "</td></tr>";
             }
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "<tr><td align=\"center\" colspan=\"2\"><input type=\"hidden\" name=\"delete_cms\" value=\"" . $cms_type . "\">" . Button::create(_('Löschen'), 'delete') . "</td></tr>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "</table>";
             $output .= "</form>";
             $output .= ELearningUtils::getCMSFooter('');
         }
         $output .= "<br>";
     }
     return $output;
 }
示例#6
0
                <? foreach ($course_output['courses'] as $course) : ?>        
                    <a href="<?php 
echo $course['url'];
?>
"><?php 
echo sprintf(_('Kurs in %s'), $course['cms_name']);
?>
</a>
                    <br>
                <? endforeach ?>
            </div>
        <? elseif (count($content_modules)) : ?>
            <?foreach ($content_modules as $module) : ?>        
                <? if ($module['show_header']) : ?>
                    <?php 
echo ELearningUtils::getModuleHeader(_("Angebundene Lernmodule"));
?>
                <? endif ?>
                <?php 
echo $module['module'];
?>
                <br>
            <? endforeach ?>
            <br>
            <? if (count($course_output['courses'])) : ?>
                <?php 
echo $course_output['text'];
?>
<br>
                <? foreach ($course_output['courses'] as $course) : ?>        
                    <a href="<?php 
示例#7
0
            <br>
            </div>
            </form>
            <br>
        <? endif ?>
        <? if ($show_ilias_link_info) : ?>
            <br>
            <?php 
echo ELearningUtils::getHeader(_("Links zu anderen ILIAS-Objekten"));
?>
            <div align="center">
            <br>
            <?php 
echo _('Sie können beliebige weitere Objekte hinzufügen, indem Sie im verknüpften Kurs in ILIAS einen ' . 'internen Link zu den entsprechenden Objekten anlegen. ' . 'Wechseln Sie dazu in den Kurs, wählen Sie unter "Neues Objekt hinzufügen" die Option Weblink und legen ' . 'einen Link innerhalb von ILIAS an. Kehren Sie anschließend auf diese Seite zurück und klicken Sie in der Infobox ' . 'auf "Aktualisieren". Für die auf diese Weise verlinkten Objekte müssen Sie selbst sicherstellen, dass die Teilnehmenden ' . 'des Kurses Zugriff darauf haben.');
?>
            <br>
            <br>
            </div>
        <? endif ?>
        <?php 
echo ELearningUtils::getCMSFooter($cms_logo);
?>
        <br>
        <? if ($anker_target == "choose") : ?>
            <a name='anker'></a>
        <? endif ?>
    <? endif ?>
    <?php 
echo ELearningUtils::getCMSSelectbox(_("Um Lernmodule hinzuzufügen, wählen Sie ein angebundenes System aus:"));
?>
<? endif?>
示例#8
0
 /**
  * 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\">&nbsp;";
     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\">&nbsp;";
     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 ">&nbsp;" . _("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 ">&nbsp;" . _("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";
 }
示例#9
0
    /**
     *  Deletes the current seminar
     *
     * @return void       returns success-message if seminar could be deleted
     *                    otherwise an  error-message
     */

    public function delete()
    {
        $s_id = $this->id;

        // Delete that Seminar.

        // Alle Benutzer aus dem Seminar rauswerfen.
        $query = "DELETE FROM seminar_user WHERE Seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Teilnehmende und Lehrende archiviert."), $db_ar));
        }

        // Alle Benutzer aus Wartelisten rauswerfen
        $query = "DELETE FROM admission_seminar_user WHERE seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        // Alle beteiligten Institute rauswerfen
        $query = "DELETE FROM seminar_inst WHERE Seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Zuordnungen zu Einrichtungen archiviert."), $db_ar));
        }

        // user aus den Statusgruppen rauswerfen
        $count = DeleteAllStatusgruppen($s_id);
        if ($count > 0) {
            $this->createMessage(_("Einträge aus Funktionen / Gruppen gelöscht."));
        }

        // Alle Eintraege aus dem Vorlesungsverzeichnis rauswerfen
        $db_ar = StudipSemTree::DeleteSemEntries(null, $s_id);
        if ($db_ar > 0) {
            $this->createMessage(sprintf(_("%s Zuordnungen zu Bereichen archiviert."), $db_ar));
        }

        // Alle Termine mit allem was dranhaengt zu diesem Seminar loeschen.
        if (($db_ar = SingleDateDB::deleteAllDates($s_id)) > 0) {
            $this->createMessage(sprintf(_("%s Veranstaltungstermine archiviert."), $db_ar));
        }

        //Themen
        IssueDB::deleteAllIssues($s_id);

        //Cycles
        SeminarCycleDate::deleteBySQL('seminar_id = ' . DBManager::get()->quote($s_id));

        // Alle weiteren Postings zu diesem Seminar in den Forums-Modulen löschen
        foreach (PluginEngine::getPlugins('ForumModule') as $plugin) {
            $plugin->deleteContents($s_id);  // delete content irrespective of plugin-activation in the seminar

            if ($plugin->isActivated($s_id)) {   // only show a message, if the plugin is activated, to not confuse the user
                $this->createMessage(sprintf(_('Einträge in %s archiviert.'), $plugin->getPluginName()));
            }
        }


        // Alle Dokumente zu diesem Seminar loeschen.
        if (($db_ar = delete_all_documents($s_id)) > 0) {
            $this->createMessage(sprintf(_("%s Dokumente und Ordner archiviert."), $db_ar));
        }

        // Freie Seite zu diesem Seminar löschen
        $query = "DELETE FROM scm WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(_("Freie Seite der Veranstaltung archiviert."));
        }

        // delete literatur
        $del_lit = StudipLitList::DeleteListsByRange($s_id);
        if ($del_lit) {
            $this->createMessage(sprintf(_("%s Literaturlisten archiviert."),$del_lit['list']));
        }

        // Alle News-Verweise auf dieses Seminar löschen
        if ( ($db_ar = StudipNews::DeleteNewsRanges($s_id)) ) {
            $this->createMessage(sprintf(_("%s Ankündigungen gelöscht."), $db_ar));
        }
        //delete entry in news_rss_range
        StudipNews::UnsetRssId($s_id);

        //kill the datafields
        DataFieldEntry::removeAll($s_id);

        //kill all wiki-pages
        $query = "DELETE FROM wiki WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_wiki = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Wiki-Seiten archiviert."), $db_wiki));
        }

        $query = "DELETE FROM wiki_links WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        $query = "DELETE FROM wiki_locks WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        // kill all the ressources that are assigned to the Veranstaltung (and all the linked or subordinated stuff!)
        if (Config::get()->RESOURCES_ENABLE) {
            $killAssign = new DeleteResourcesUser($s_id);
            $killAssign->delete();
            if ($rr = RoomRequest::existsByCourse($s_id)) {
                RoomRequest::find($rr)->delete();
            }
        }

        // kill virtual seminar-entries in calendar
        $query = "DELETE FROM schedule_seminare WHERE seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        if(get_config('ELEARNING_INTERFACE_ENABLE')){
            global $connected_cms;
            $del_cms = 0;
            $cms_types = ObjectConnections::GetConnectedSystems($s_id);
            if(count($cms_types)){
                foreach($cms_types as $system){
                    ELearningUtils::loadClass($system);
                    $del_cms += $connected_cms[$system]->deleteConnectedModules($s_id);
                }
                $this->createMessage(sprintf(_("%s Verknüpfungen zu externen Systemen gelöscht."), $del_cms ));
            }
        }

        //kill the object_user_vists for this seminar
        object_kill_visits(null, $s_id);

        // Logging...
        $query = "SELECT CONCAT(seminare.VeranstaltungsNummer, ' ', seminare.name, '(', semester_data.name, ')')
                  FROM seminare
                  LEFT JOIN semester_data ON (seminare.start_time = semester_data.beginn)
                  WHERE seminare.Seminar_id='$s_id'";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        $semlogname = $statement->fetchColumn() ?: sprintf('unknown sem_id: %s', $s_id);

        StudipLog::log("SEM_ARCHIVE",$s_id,NULL,$semlogname);
        // ...logged

        // delete deputies if necessary
        deleteAllDeputies($s_id);

        UserDomain::removeUserDomainsForSeminar($s_id);

        AutoInsert::deleteSeminar($s_id);

        //Anmeldeset Zordnung entfernen
        $cs = $this->getCourseSet();
        if ($cs) {
            CourseSet::removeCourseFromSet($cs->getId(), $this->getId());
            $cs->load();
            if (!count($cs->getCourses())
                && $cs->isGlobal()
                && $cs->getUserid() != '') {
                $cs->delete();
            }
        }
        AdmissionPriority::unsetAllPrioritiesForCourse($this->getId());
        // und das Seminar loeschen.
        $this->course->delete();
        $this->restore();
        return true;
    }
示例#10
0
 /**
  * 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();
 }
示例#11
0
文件: browse.php 项目: ratbird/hope
                {
                    $connected_cms[$cms_select]->setContentModule($connection, false);
                    $connected_cms[$cms_select]->content_module[$current_module]->view->show("searchresult");
                }
                echo "<br>\n";
            }
            if ( ( strlen( trim($search_key) ) > 2 ) AND ($searchresult_content_modules == false))
            echo MessageBox::info(sprintf( _("Es gibt im System %s zu diesem Suchbegriff keine Content-Module."),  $connected_cms[$cms_select]->getName()));
            echo ELearningUtils::getCMSFooter($connected_cms[$cms_select]->getLogo());
        }

        echo "<br>\n";
        if ($cms_select == "")
            echo ELearningUtils::getCMSSelectbox("<b>" . _("Wählen Sie ein angebundenes System für die Suche:") . "</b>");
        else
            echo ELearningUtils::getCMSSelectbox(_("Wählen Sie ein angebundenes System für die Suche:"));
    }

// Cachen der SOAP-Daten
    if (is_array($connected_cms))
        foreach($connected_cms as $system)
            $system->terminate();


    ?>
    </td></tr></table>

        </td>
        <td width="270" class="blank" align="right" valign="top">
        <? print_infobox($infobox, "sidebar/learnmodule-sidebar.png"); ?>
        </td>
示例#12
0
 /**
  * Delete an existing user from the database and tidy up
  *
  * @access   public
  * @param    bool delete all documents belonging to the user
  * @return   bool Removal successful?
  */
 function deleteUser($delete_documents = true)
 {
     global $perm;
     // Do we have permission to do so?
     if (!$perm->have_perm("admin")) {
         $this->msg .= "error§" . _("Sie haben keine Berechtigung Accounts zu löschen.") . "§";
         return FALSE;
     }
     if (!$perm->have_perm("root")) {
         if ($this->user_data['auth_user_md5.perms'] == "root") {
             $this->msg .= "error§" . _("Sie haben keine Berechtigung <em>Root-Accounts</em> zu löschen.") . "§";
             return FALSE;
         }
         if ($this->user_data['auth_user_md5.perms'] == "admin" && !$this->adminOK()) {
             $this->msg .= "error§" . _("Sie haben keine Berechtigung diesen Admin-Account zu löschen.") . "§";
             return FALSE;
         }
     }
     $status = studygroup_sem_types();
     // active dozent?
     if (empty($status)) {
         $active_count = 0;
     } else {
         $query = "SELECT SUM(c) AS count FROM (\n                          SELECT COUNT(*) AS c\n                          FROM seminar_user AS su1\n                          INNER JOIN seminar_user AS su2 ON (su1.seminar_id = su2.seminar_id AND su2.status = 'dozent')\n                          INNER JOIN seminare ON (su1.seminar_id = seminare.seminar_id AND seminare.status NOT IN (?))\n                          WHERE su1.user_id = ? AND su1.status = 'dozent'\n                          GROUP BY su1.seminar_id\n                          HAVING c = 1\n                          ORDER BY NULL\n                      ) AS sub";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array(studygroup_sem_types(), $this->user_data['auth_user_md5.user_id']));
         $active_count = $statement->fetchColumn();
     }
     if ($active_count) {
         $this->msg .= sprintf("error§" . _("<em>%s</em> ist Lehrkraft in %s aktiven Veranstaltungen und kann daher nicht gelöscht werden.") . "§", $this->user_data['auth_user_md5.username'], $active_count);
         return FALSE;
         //founder of studygroup?
     } elseif (get_config('STUDYGROUPS_ENABLE')) {
         $status = studygroup_sem_types();
         if (empty($status)) {
             $group_ids = array();
         } else {
             $query = "SELECT Seminar_id\n                          FROM seminare AS s\n                          LEFT JOIN seminar_user AS su USING (Seminar_id)\n                          WHERE su.status = 'dozent' AND su.user_id = ? AND s.status IN (?)";
             $statement = DBManager::get()->prepare($query);
             $statement->execute(array($this->user_data['auth_user_md5.user_id'], studygroup_sem_types()));
             $group_ids = $statement->fetchAll(PDO::FETCH_COLUMN);
         }
         foreach ($group_ids as $group_id) {
             $sem = Seminar::GetInstance($group_id);
             if (StudygroupModel::countMembers($group_id) > 1) {
                 // check whether there are tutors or even autors that can be promoted
                 $tutors = $sem->getMembers('tutor');
                 $autors = $sem->getMembers('autor');
                 if (count($tutors) > 0) {
                     $new_founder = current($tutors);
                     StudygroupModel::promote_user($new_founder['username'], $sem->getId(), 'dozent');
                     continue;
                 } elseif (count($autors) > 0) {
                     $new_founder = current($autors);
                     StudygroupModel::promote_user($new_founder['username'], $sem->getId(), 'dozent');
                     continue;
                 }
                 // since no suitable successor was found, we are allowed to remove the studygroup
             } else {
                 $sem->delete();
             }
             unset($sem);
         }
     }
     // store user preferred language for sending mail
     $user_language = getUserLanguagePath($this->user_data['auth_user_md5.user_id']);
     // delete documents of this user
     if ($delete_documents) {
         // Remove private file space of this user
         if (Config::get()->PERSONALDOCUMENT_ENABLE) {
             $root_dir = new RootDirectory($this->user_data['auth_user_md5.user_id']);
             $root_dir->delete();
         }
         // Remove other files
         $temp_count = 0;
         $query = "SELECT dokument_id FROM dokumente WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($this->user_data['auth_user_md5.user_id']));
         while ($document_id = $statement->fetchColumn()) {
             if (delete_document($document_id)) {
                 $temp_count++;
             }
         }
         if ($temp_count) {
             $this->msg .= "info§" . sprintf(_("%s Dokumente gelöscht."), $temp_count) . "§";
         }
         // delete empty folders of this user
         $temp_count = 0;
         $query = "SELECT COUNT(*) FROM folder WHERE range_id = ?";
         $count_content = DBManager::get()->prepare($query);
         $query = "DELETE FROM folder WHERE folder_id = ?";
         $delete_folder = DBManager::get()->prepare($query);
         $query = "SELECT folder_id FROM folder WHERE user_id = ? ORDER BY mkdate DESC";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($this->user_data['auth_user_md5.user_id']));
         while ($folder_id = $statement->fetchColumn()) {
             $count_content->execute(array($folder_id));
             $count = $count_content->fetchColumn();
             $count_content->closeCursor();
             if (!$count && !doc_count($folder_id)) {
                 $delete_folder->execute(array($folder_id));
                 $temp_count += $delete_folder->rowCount();
             }
         }
         if ($temp_count) {
             $this->msg .= "info§" . sprintf(_("%s leere Ordner gelöscht."), $temp_count) . "§";
         }
         // folder left?
         $query = "SELECT COUNT(*) FROM folder WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($this->user_data['auth_user_md5.user_id']));
         $count = $statement->fetchColumn();
         if ($count) {
             $this->msg .= sprintf("info§" . _("%s Ordner konnten nicht gelöscht werden, da sie noch Dokumente anderer BenutzerInnen enthalten.") . "§", $count);
         }
     }
     // kill all the ressources that are assigned to the user (and all the linked or subordinated stuff!)
     if (Config::get()->RESOURCES_ENABLE) {
         $killAssign = new DeleteResourcesUser($this->user_data['auth_user_md5.user_id']);
         $killAssign->delete();
     }
     $this->re_sort_position_in_seminar_user();
     // delete user from seminars (postings will be preserved)
     $query = "DELETE FROM seminar_user WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (($db_ar = $statement->rowCount()) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus Veranstaltungen gelöscht."), $db_ar) . "§";
     }
     // delete user from waiting lists
     $query = "SELECT seminar_id FROM admission_seminar_user WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     $seminar_ids = $statement->fetchAll(PDO::FETCH_COLUMN);
     $query = "DELETE FROM admission_seminar_user WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (($db_ar = $statement->rowCount()) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus Wartelisten gelöscht."), $db_ar) . "§";
         array_map('update_admission', $seminar_ids);
     }
     // delete user from instituts
     $this->logInstUserDel($this->user_data['auth_user_md5.user_id']);
     $query = "DELETE FROM user_inst WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (($db_ar = $statement->rowCount()) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus MitarbeiterInnenlisten gelöscht."), $db_ar) . "§";
     }
     // delete user from Statusgruppen
     if ($db_ar = RemovePersonFromAllStatusgruppen(get_username($this->user_data['auth_user_md5.user_id'])) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus Funktionen / Gruppen gelöscht."), $db_ar) . "§";
     }
     // delete user from archiv
     $query = "DELETE FROM archiv_user WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (($db_ar = $statement->rowCount()) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus den Zugriffsberechtigungen für das Archiv gelöscht."), $db_ar) . "§";
     }
     // delete all personal news from this user
     if ($db_ar = StudipNews::DeleteNewsByAuthor($this->user_data['auth_user_md5.user_id'])) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus den Ankündigungen gelöscht."), $db_ar) . "§";
     }
     if ($db_ar = StudipNews::DeleteNewsRanges($this->user_data['auth_user_md5.user_id'])) {
         $this->msg .= "info§" . sprintf(_("%s Verweise auf Ankündigungen gelöscht."), $db_ar) . "§";
     }
     //delete entry in news_rss_range
     StudipNews::UnsetRssId($this->user_data['auth_user_md5.user_id']);
     // delete 'Studiengaenge'
     $query = "DELETE FROM user_studiengang WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (($db_ar = $statement->rowCount()) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Zuordnungen zu Studiengängen gelöscht."), $db_ar) . "§";
     }
     // delete all private appointments of this user
     if (get_config('CALENDAR_ENABLE')) {
         $appkills = CalendarEvent::deleteBySQL('range_id = ?', array($this->user_data['auth_user_md5.user_id']));
         if ($appkills) {
             $this->msg .= "info§" . sprintf(_("%s Einträge aus den Terminen gelöscht."), $appkills) . "§";
         }
         // delete membership in group calendars
         if (get_config('CALENDAR_GROUP_ENABLE')) {
             $membershipkills = CalendarUser::deleteBySQL('owner_id = :user_id OR user_id = :user_id', array(':user_id' => $this->user_data['auth_user_md5.user_id']));
             if ($membershipkills) {
                 $this->msg .= 'info§' . sprintf(_('%s Verknüpfungen mit Gruppenterminkalendern gelöscht.'));
             }
         }
     }
     // delete all messages send or received by this user
     $messaging = new messaging();
     $messaging->delete_all_messages($this->user_data['auth_user_md5.user_id']);
     // delete user from all foreign adressbooks and empty own adressbook
     $buddykills = Contact::deleteBySQL('user_id = ?', array($this->user_data['auth_user_md5.user_id']));
     if ($buddykills > 0) {
         $this->msg .= "info§" . sprintf(_("%s Einträge aus Adressbüchern gelöscht."), $buddykills) . "§";
     }
     $contactkills = Contact::deleteBySQL('owner_id = ?', array($this->user_data['auth_user_md5.user_id']));
     if ($contactkills) {
         $this->msg .= sprintf(_('Adressbuch mit %d Einträgen gelöscht.'), $contactkills);
     }
     // delete users groups
     Statusgruppen::deleteBySQL('range_id = ?', array($this->user_data['auth_user_md5.user_id']));
     // remove user from any groups
     StatusgruppeUser::deleteBySQL('user_id = ?', array($this->user_data['auth_user_md5.user_id']));
     // delete all blubber entrys
     $query = "DELETE FROM blubber WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (($db_ar = $statement->rowCount()) > 0) {
         $this->msg .= "info§" . sprintf(_("%s Blubber gelöscht."), $db_ar) . "§";
     }
     // delete the datafields
     $localEntries = DataFieldEntry::removeAll($this->user_data['auth_user_md5.user_id']);
     UserConfigEntry::deleteByUser($this->user_data['auth_user_md5.user_id']);
     // delete all remaining user data
     $queries = array("DELETE FROM kategorien WHERE range_id = ?", "DELETE FROM user_info WHERE user_id = ?", "DELETE FROM user_visibility WHERE user_id = ?", "DELETE FROM user_online WHERE user_id = ?", "DELETE FROM auto_insert_user WHERE user_id = ?", "DELETE FROM roles_user WHERE userid = ?", "DELETE FROM schedule WHERE user_id = ?", "DELETE FROM schedule_seminare WHERE user_id = ?", "DELETE FROM termin_related_persons WHERE user_id = ?", "DELETE FROM user_userdomains WHERE user_id = ?");
     foreach ($queries as $query) {
         DBManager::get()->prepare($query)->execute(array($this->user_data['auth_user_md5.user_id']));
     }
     object_kill_visits($this->user_data['auth_user_md5.user_id']);
     object_kill_views($this->user_data['auth_user_md5.user_id']);
     // delete picture
     $avatar = Avatar::getAvatar($this->user_data["auth_user_md5.user_id"]);
     if ($avatar->is_customized()) {
         $avatar->reset();
         $this->msg .= "info§" . _("Bild gelöscht.") . "§";
     }
     // delete visibility settings
     Visibility::removeUserPrivacySettings($this->user_data['auth_user_md5.user_id']);
     //delete connected users
     if (get_config('ELEARNING_INTERFACE_ENABLE')) {
         if (ELearningUtils::initElearningInterfaces()) {
             foreach ($GLOBALS['connected_cms'] as $cms) {
                 if ($cms->auth_necessary && $cms->user instanceof ConnectedUser) {
                     $user_auto_create = $cms->USER_AUTO_CREATE;
                     $cms->USER_AUTO_CREATE = false;
                     $userclass = strtolower(get_class($cms->user));
                     $connected_user = new $userclass($cms->cms_type, $this->user_data['auth_user_md5.user_id']);
                     if ($ok = $connected_user->deleteUser()) {
                         if ($connected_user->is_connected) {
                             $this->msg .= "info§" . sprintf(_("Der verknüpfte Nutzer %s wurde im System %s gelöscht."), $connected_user->login, $connected_user->cms_type) . "§";
                         }
                     }
                     $cms->USER_AUTO_CREATE = $user_auto_create;
                 }
             }
         }
     }
     // delete deputy entries if necessary
     $query = "DELETE FROM deputies WHERE ? IN (user_id, range_id)";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     $deputyEntries = $statement->rowCount();
     if ($deputyEntries) {
         $this->msg .= "info§" . sprintf(_("%s Einträge in den Vertretungseinstellungen gelöscht."), $deputyEntries) . "§";
     }
     // delete Stud.IP account
     $query = "DELETE FROM auth_user_md5 WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($this->user_data['auth_user_md5.user_id']));
     if (!$statement->rowCount()) {
         $this->msg .= "error§<em>" . _("Fehler:") . "</em> " . $query . "§";
         return FALSE;
     } else {
         $this->msg .= "msg§" . sprintf(_("Benutzer \"%s\" gelöscht."), $this->user_data['auth_user_md5.username']) . "§";
     }
     log_event("USER_DEL", $this->user_data['auth_user_md5.user_id'], NULL, sprintf("%s %s (%s)", $this->user_data['auth_user_md5.Vorname'], $this->user_data['auth_user_md5.Nachname'], $this->user_data['auth_user_md5.username']));
     //log with Vorname Nachname (username) as info string
     // Can we reach the email?
     if ($this->checkMail($this->user_data['auth_user_md5.Email'])) {
         // include language-specific subject and mailbody
         $Zeit = date("H:i:s, d.m.Y", time());
         include "locale/{$user_language}/LC_MAILS/delete_mail.inc.php";
         // send mail
         StudipMail::sendMessage($this->user_data['auth_user_md5.Email'], $subject, $mailbody);
     }
     unset($this->user_data);
     return TRUE;
 }
示例#13
0
echo CSRFProtection::tokenTag();
echo ELearningUtils::getHeader(_("Neues Lernmodul erstellen"));
?>
<? foreach($cms_types as $name => $value) : ?>
    <input type="HIDDEN" name="<?php 
echo $name;
?>
" value="<?php 
echo htmlReady($value);
?>
">
<? endforeach ?>
<table border="0" cellspacing=0 cellpadding=6 width = "100%">
<tr><td>
    <font size="-1">
    <?php 
echo sprintf(_("Typ für neues Lernmodul: %s"), ELearningUtils::getTypeSelectbox($cms));
?>
    </font>
</td>
<td align="right" valign="middle">
    <? if (count($types) > 1) : ?>
        <?php 
echo Button::create(_('Auswählen'), 'choose');
?>
    <? endif ?>
    <?php 
echo $link;
?>
</td></tr></table>
</form>
示例#14
0
<?php

use Studip\Button, Studip\LinkButton;
?>
<form method="POST" action="<?php 
echo URLHelper::getLink();
?>
#anker">
<?php 
echo CSRFProtection::tokenTag();
?>
<table border="0" cellspacing=0 cellpadding=0 width = "99%">
<tr><td class="table_row_even" align="center" valign="middle" ><font size="-1">
<?php 
echo ELearningUtils::getHeader(_("Angebundenes System"));
?>
<br>
<?php 
echo htmlReady($message);
?>
<br>
<br>
<input type="HIDDEN" name="anker_target" value="choose">
<input type="HIDDEN" name="view" value="<?php 
echo htmlReady($view);
?>
">
<input type="HIDDEN" name="search_key" value="<?php 
echo htmlReady($search_key);
?>
">