aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorAndré Noack <noack@data-quest.de>2024-09-04 08:01:19 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2024-09-04 08:01:19 +0000
commit207406981b8a86f3db95ba7d155e49c5ffcce246 (patch)
tree6a95b344ce34711832405067c2fa473726886a2c /public
parent612bb1c13763e07bd8201b9642af1506f18826ce (diff)
Resolve "Ausbau der Elearning Schnittstelle"
Closes #4109 Merge request studip/studip!3351
Diffstat (limited to 'public')
-rw-r--r--public/admin_elearning_interface.php196
-rw-r--r--public/ilias3_referrer.php78
2 files changed, 0 insertions, 274 deletions
diff --git a/public/admin_elearning_interface.php b/public/admin_elearning_interface.php
deleted file mode 100644
index 24eb47c..0000000
--- a/public/admin_elearning_interface.php
+++ /dev/null
@@ -1,196 +0,0 @@
-<?
-# Lifter002: TODO
-# Lifter007: TODO
-# Lifter003: TODO
-# Lifter010: TODO
-// +---------------------------------------------------------------------------+
-// This file is part of Stud.IP
-// admin_elearning_interface.php
-//
-// Copyright (c) 2005 Arne Schroeder <schroeder@data-quest.de>
-// Suchi & Berg GmbH <info@data-quest.de>
-// +---------------------------------------------------------------------------+
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or any later version.
-// +---------------------------------------------------------------------------+
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// +---------------------------------------------------------------------------+
-
-use Studip\Button, Studip\LinkButton;
-
-require '../lib/bootstrap.php';
-
-page_open(["sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", 'user' => "Seminar_User"]);
-$GLOBALS['perm']->check("root");
-
-include 'lib/seminar_open.php'; // initialise Stud.IP-Session
-// -- here you have to put initialisations for the current page
-
-PageLayout::setHelpKeyword("Basis.Ilias");
-PageLayout::setTitle(_("Verwaltung der Lernmodul-Schnittstelle"));
-Navigation::activateItem('/admin/config/elearning');
-
-ob_start();
-
-$cms_select = Request::get('cms_select');
-
-if (Config::get()->ELEARNING_INTERFACE_ENABLE)
-{
- $connection_status = [];
- $connected_cms = [];
- if ($cms_select != "" && isset($ELEARNING_INTERFACE_MODULES[$cms_select]))
- {
- $connected_cms[$cms_select] = new ConnectedCMS();
- $connection_status = $connected_cms[$cms_select]->getConnectionStatus($cms_select);
- if (Request::submitted('activate'))
- {
- ELearningUtils::setConfigValue("ACTIVE", "1", $cms_select);
- }
- if (Request::submitted('deactivate'))
- {
- ELearningUtils::setConfigValue("ACTIVE", "0", $cms_select);
- }
- if (!count(array_column($connection_status, 'error')))
- {
- require_once ("lib/elearning/" . $ELEARNING_INTERFACE_MODULES[$cms_select]["CLASS_PREFIX"] . "ConnectedCMS.php");
- $classname = $ELEARNING_INTERFACE_MODULES[$cms_select]["CLASS_PREFIX"] . "ConnectedCMS";
- $connected_cms[$cms_select] = new $classname($cms_select);
- $connected_cms[$cms_select]->initSubclasses();
- }
- } else {
- unset($cms_select);
- }
-
- if (!empty($messages["error"])) {
- PageLayout::postError($messages["error"]);
- }
- if (!empty($messages["info"])) {
- PageLayout::postInfo($messages["info"]);
- }
-
- echo ELearningUtils::getCMSSelectbox(_("Bitte wählen Sie ein angebundenes System für die Schnittstelle: "), false) . "\n\n<br><br>";
-
- if (!empty($cms_select)) {
- echo "<table>";
- $error_count = 0;
- foreach ($connection_status as $type => $msg)
- {
- if ($msg["error"] != "")
- {
- echo "<tr><td valign=\"middle\">" . Icon::create('decline', Icon::ROLE_ATTENTION)->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . $msg["error"] . "</td></tr>";
- $error_count++;
- }
- else
- echo "<tr><td valign=\"middle\">" . Icon::create('accept', Icon::ROLE_ACCEPT)->asImg(['class' => 'text-top', 'title' => _('OK')]) . $msg["info"] . "</td></tr>";
- }
- echo "<tr><td><br></td></tr>";
- if ($error_count > 0)
- {
- $status_info = "error";
- echo "<tr><td valign=\"middle\">" . Icon::create('decline', Icon::ROLE_ATTENTION)->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . "<b>";
- echo _("Beim Laden der Schnittstelle sind Fehler aufgetreten. ");
- if (ELearningUtils::isCMSActive($cms_select))
- {
- ELearningUtils::setConfigValue("ACTIVE", "0", $cms_select);
- echo _("Die Schnittstelle wurde automatisch deaktiviert!");
- }
- echo "</b></td></tr>";
- }
- else
- echo "<tr><td valign=\"middle\">" . Icon::create('accept', Icon::ROLE_ACCEPT, ['title' => _('OK')])->asImg(['class' => 'text-top']) . "<b>" .sprintf( _("Die Schnittstelle zum %s-System ist korrekt konfiguriert."), $connected_cms[$cms_select]->getName()) . "</b></td></tr>";
- echo "</table>";
- echo "<br>\n";
- echo htmlReady(ELearningUtils::getCMSHeader(isset($connected_cms[$cms_select]) ? $connected_cms[$cms_select]->getName() : ''));
- echo "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\" class=\"default\">\n";
- echo CSRFProtection::tokenTag();
- echo '<fieldset>';
- if (ELearningUtils::isCMSActive($cms_select))
- {
- $status_info = "active";
- echo ELearningUtils::getHeader(_("Status"));
- echo "<br>\n";
- echo _("Die Schnittstelle ist <b>aktiv</b>.");
- echo "<br><br>\n";
- echo _("Hier können Sie die Schnittstelle deaktivieren.");
- echo "<br><br>\n";
- echo Button::create(_('Deaktivieren'), 'deactivate');
- }
- else
- {
- echo ELearningUtils::getHeader(_("Status"));
- echo "<br>\n";
- echo _("Die Schnittstelle ist nicht aktiv.");
- echo "<br><br>\n";
- if ($error_count == 0)
- {
- $status_info = "not active";
- echo _("Hier können Sie die Schnittstelle aktivieren.");
- echo "<br><br>\n";
- echo Button::create(_('Aktivieren'), 'activate');
- }
- }
- echo '</fieldset>';
- echo "<input type=\"HIDDEN\" name=\"cms_select\" value=\"" . $cms_select . "\">\n";
- echo "</form>";
- echo "<br>\n";
-
- echo "<form method=\"POST\" action=\"" . URLHelper::getURL() . "\" class=\"default\">\n";
- echo CSRFProtection::tokenTag();
- echo '<fieldset>';
- if ($error_count == 0)
- {
- echo ELearningUtils::getHeader(_("Einstellungen"));
- echo "<br>\n";
- $connected_cms[$cms_select]->getPreferences();
- }
- echo '</fieldset>';
- echo "<input type=\"hidden\" name=\"cms_select\" value=\"" . $cms_select . "\">\n";
- echo "</form>";
-
- echo ELearningUtils::getCMSFooter($connected_cms[$cms_select]->getLogo());
- }
-
- Helpbar::Get()->addPlainText(_('Information'), _('Hier können Sie angebundene Systeme verwalten.'), Icon::create('info'));
- Helpbar::Get()->addPlainText(_('Aktionen'), _('Nachdem Sie ein angebundenes System ausgewählt haben wird die Verbindung zum System geprüft.'), Icon::create('info'));
- // Anzeige, wenn noch keine Account-Zuordnung besteht
-
- switch ($status_info ?? null) {
- case "active":
- PageLayout::postSuccess(sprintf(_("Die Verbindung zum System \"%s\" ist <b>aktiv</b>. Sie können die Einbindung des Systems in Stud.IP jederzeit deaktivieren."), htmlReady($connected_cms[$cms_select]->getName())));
- break;
- case "not active":
- PageLayout::postWarning(sprintf(_("Die Verbindung zum System \"%s\" steht, das System ist jedoch nicht aktiviert. Sie können die Einbindung des Systems in Stud.IP jederzeit aktivieren. Solange die Verbindung nicht aktiviert wurde, werden die Module des Systems \"%s\" in Stud.IP nicht angezeigt."), htmlReady($connected_cms[$cms_select]->getName()), htmlReady($connected_cms[$cms_select]->getName())));
- break;
- case "error":
- PageLayout::postError(sprintf(_("Bei der Prüfung der Verbindung sind Fehler aufgetreten. Sie müssen zunächst die Einträge in der Konfigurationsdatei korrigieren, bevor das System angebunden werden kann."), $connected_cms[$cms_select]->getName()));
- break;
- }
-
-// terminate objects
- if (!empty($connected_cms))
- foreach($connected_cms as $system)
- $system->terminate();
-
-}
-else
-{
- PageLayout::postError(_("Die Schnittstelle für die Integration von Lernmodulen ist nicht aktiviert.
- Damit Lernmodule verwendet werden können, muss die Verbindung zu einem LCM-System in der Konfigurationsdatei von Stud.IP hergestellt werden.
- Wenden Sie sich bitte an den/die AdministratorIn."), [_("E-Learning-Schnittstelle nicht eingebunden")]);
-
-}
-
-
-$template = $GLOBALS['template_factory']->open('layouts/base.php');
-$template->content_for_layout = ob_get_clean();
-echo $template->render();
-
-page_close();
diff --git a/public/ilias3_referrer.php b/public/ilias3_referrer.php
deleted file mode 100644
index 82d9031..0000000
--- a/public/ilias3_referrer.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?
-# Lifter002: TODO
-# Lifter007: TODO
-# Lifter003: TODO
-# Lifter010: TODO
-// +---------------------------------------------------------------------------+
-// This file is part of Stud.IP
-// ilias3_referrer.php
-//
-// Copyright (c) 2005 Arne Schroeder <schroeder@data-quest.de>
-// Suchi & Berg GmbH <info@data-quest.de>
-// +---------------------------------------------------------------------------+
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or any later version.
-// +---------------------------------------------------------------------------+
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// +---------------------------------------------------------------------------+
-
-require '../lib/bootstrap.php';
-
-ob_start();
-page_open(["sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", 'user' => "Seminar_User"]);
-$perm->check("autor");
-include 'lib/seminar_open.php'; // initialise Stud.IP-Session
-
-if (Config::get()->ELEARNING_INTERFACE_ENABLE) {
- ELearningUtils::bench("start");
-
- $cms_select = Request::quoted('cms_select');
- if (isset($ELEARNING_INTERFACE_MODULES[$cms_select]["name"])) {
- ELearningUtils::loadClass($cms_select);
- // init session now
- $sess_id = $connected_cms[$cms_select]->user->getSessionId();
- $connected_cms[$cms_select]->terminate();
- ob_end_clean();
- if (!$sess_id){
- $message = _("Login nicht möglich");
- $details = [];
- $details[] = sprintf(_("Automatischer Login für das System <b>%s</b> (Nutzername:%s) fehlgeschlagen."),
- htmlReady($connected_cms[$cms_select]->getName()),
- $connected_cms[$cms_select]->user->getUsername());
- $details[] = _("Dieser Fehler kann dadurch hervorgerufen werden, dass Sie Ihr Passwort geändert haben. In diesem Fall versuchen Sie bitte Ihren Account erneut zu verknüpfen.");
- $details[] = sprintf(_("%sZurück%s zu Meine Lernmodule"), '<a href="'.URLHelper::getLink("dispatch.php/elearning/my_accounts").'"><b>', '</b></a>');
-
- PageLayout::postError($message, $details);
- $template = $GLOBALS['template_factory']->open('layouts/base.php');
- $template->content_for_layout = ob_get_clean();
- $template->infobox = $infobox ? ['content' => $infobox] : null;
- echo $template->render();
- page_close();
- die;
- }
- $parameters = "?sess_id=$sess_id";
- $client_id = Request::get('client_id');
- if (!empty($client_id))
- $parameters .= "&client_id=$client_id";
- if (Request::get('target'))
- $parameters .= "&target=".Request::option('target');
- if (Request::get('ref_id'))
- $parameters .= "&ref_id=".Request::option('ref_id');
- if (Request::get('type'))
- $parameters .= "&type=".Request::option('type');
-
- // refer to studip_referrer.php
- header("Location: ".$ELEARNING_INTERFACE_MODULES[$cms_select]["ABSOLUTE_PATH_ELEARNINGMODULES"] . $ELEARNING_INTERFACE_MODULES[$cms_select]["target_file"] . $parameters);
- page_close();
- die;
- }
-}
-?>