示例#1
0
 public function get_user_status_html($user_name)
 {
     $html = null;
     $user = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $user_name);
     if (!$user->get_attribute("LLMS_NETWORKING_PROFILE") instanceof steam_object) {
         $html = "<i>noch nie angemeldet</i>";
     }
     $sTeamServerDataAccess = new sTeamServerDataAccess();
     if ($sTeamServerDataAccess->isLocked($user->get_id())) {
         if ($html == null) {
             $html = "<i>Benutzer gesperrt</i>";
         } else {
             $html .= " und <i>Benutzer gesperrt</i>";
         }
     }
     if ($sTeamServerDataAccess->isTrashed($user->get_id())) {
         if ($html == null) {
             $html = "<i>Benutzer gelöscht</i>";
         } else {
             $html .= " und <i>Benutzer gelöscht</i>";
         }
     }
     return $html;
 }
示例#2
0
 public function get_icon_bar_html($is_logged_in)
 {
     if ($is_logged_in) {
         $user = lms_steam::get_current_user();
         $koala_html_menu = new koala_html_menu();
         if (USERMANAGEMENT) {
             $dataAccess = new sTeamServerDataAccess();
             if (lms_steam::is_koala_admin($user) || $dataAccess->isCustomerAdmin($user->get_id())) {
                 $koala_html_menu->add_menu_entry(array("name" => "<img title=\"Benutzerverwaltung\" src=\"/styles/standard/images/usermanagement.gif\" />", "link" => PATH_URL . "usermanagement/admin"));
             }
         }
         // SERVER
         if (SERVERMENU && lms_steam::is_koala_admin($user)) {
             $configImageUrl = PATH_URL . "styles/standard/images/config_16.gif";
             $koala_html_menu->add_menu_entry(array("name" => "<img title=\"Server\" src=\"{$configImageUrl}\" />", "menu" => array(array("name" => gettext("Server information"), "link" => PATH_URL . "admin_server.php"), array("name" => gettext("koaLA extensions information"), "link" => PATH_URL . "extensions_index.php"), array("name" => gettext("Semester administration"), "link" => PATH_URL . "admin_semester_statistics.php"), IMPORT_COURSE_FROM_PAUL ? array("name" => gettext("PAUL Synchronisation"), "link" => PATH_URL . "admin_paul.php") : "", USERMANAGEMENT ? array("name" => gettext("Usermanagement"), "link" => PATH_URL . "usermanagement/index.php") : "", SERVERMONITOR ? array("name" => gettext("Server Monitor"), "link" => PATH_URL . "serverstats.php") : "", KOALAADMINTOOLS ? array("name" => gettext("koaLA Admintools"), "link" => PATH_URL . "admin/") : "")));
         }
         $extensions = ExtensionMaster::getInstance()->getExtensionByType("IIconBarExtension");
         foreach ($extensions as $extension) {
             $entries = $extension->getIconBarEntries();
             if (isset($entries) && is_array($entries)) {
                 foreach ($entries as $entry) {
                     $koala_html_menu->add_menu_entry($entry);
                 }
             }
         }
         return $koala_html_menu->get_html();
     }
     return "";
 }
示例#3
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $portal = \lms_portal::get_instance();
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $problem = "";
         $hint = "";
         $values = $_POST["values"];
         if (empty($values["login"])) {
             $problem = gettext("The login name is missing.") . "&nbsp;";
             $hint = gettext("Please enter your login name.") . "&nbsp;";
         }
         if (empty($values["password"])) {
             $problem .= gettext("Your password is missing.");
             $hint .= gettext("Please enter your password.");
         }
         if ($values["login"] == "guest") {
             $problem = gettext("Invalid username or wrong password.");
             $hint = gettext("Please verify your credentials and try again.");
         }
         // Check if user is locked by usermanagement
         if (defined("USERMANAGEMENT") && USERMANAGEMENT) {
             $dataAccess = new sTeamServerDataAccess();
             $userID = $dataAccess->login2ID($values["login"]);
             if ($userID != "-1" && $dataAccess->isLocked($userID)) {
                 $problem .= "Dieser Benutzer wurde gesperrt und kann sich vorl&auml;ufig nicht am System anmelden";
                 $hint .= "";
             } else {
                 if ($userID != "-1" && $dataAccess->isTrashed($userID)) {
                     $problem .= "Dieser Benutzer wurde gelöscht und kann sich nicht mehr am System anmelden";
                     $hint .= "";
                 }
             }
         }
         if (empty($problem)) {
             if (CHECK_LDAP_ACCESS) {
                 $client = new \SoapClient(NULL, array("location" => LDAP_SERVICE_LOCATION, "uri" => LDAP_SERVICE_URL, "local_cert" => LDAP_SERVICE_CERT));
                 $parameter = array(new \SoapParam(trim($values["login"]), "uid"));
                 try {
                     $result = $client->__soapCall("getState", $parameter);
                 } catch (\Exception $e) {
                     // $problem = "SOAP-SERVICE NICHT ERREICHBAR!";
                     $hint = "";
                 }
                 if (empty($problem)) {
                     $ldap_client = new \lms_ldap();
                     $dn = "uid=" . utf8_encode(trim($values["login"])) . ", " . LDAP_OU . ", " . LDAP_O . ", " . LDAP_C;
                     if (!$ldap_client->bind($dn, utf8_encode($values["password"]))) {
                         $problem = gettext("Invalid username or wrong password.");
                         $hint = gettext("Please verify your credentials and try again.");
                     } else {
                         $_SESSION["LDAP_PASSWORD_ENCR"] = encrypt($values["password"], ENCRYPTION_KEY);
                         $_SESSION["LDAP_LOGIN"] = utf8_encode(trim($values["login"]));
                         ob_end_clean();
                         header("Location: " . PATH_URL . "disclaimer.php");
                         exit;
                     }
                 }
             }
         }
         if (empty($problem) && !$portal->login(trim($values["login"]), $values["password"], isset($values["req"]) ? $values["req"] : NULL)) {
             $problem = gettext("Invalid username or wrong password.");
             $hint = gettext("Please verify your credentials and try again.");
         }
     }
     if (!empty($problem)) {
         $portal->set_problem_description($problem, $hint);
     }
     $content = \SignIn::getInstance()->loadTemplate("signin.template.html");
     $content->setVariable("REQUEST_URI", isset($_GET["req"]) ? $_GET["req"] : "");
     $content->setVariable("LOGIN_INFO", gettext("Use your IMT credentials to log in into koaLA knowledge network. Here, you can get and discuss course materials online, extend your personal and academic network, and cooperate with fellow students and colleagues.") . "<br>(" . gettext("Hinweis: Bitte beachten Sie, dass Sie in Ihren Browsereinstellungen dieser Seite das Speichern von Cookies erlauben. Das ist für die Anmeldung notwendig.") . ")");
     $content->setVariable("LOGIN_NAME_TEXT", gettext("Login"));
     $content->setVariable("PASSWORD_NAME_TEXT", gettext("Password"));
     $content->setVariable("SIGNIN_BUTTON_TEXT", gettext("Sign in"));
     $content->setVariable("RETURN_TEXT", gettext("return to the home page"));
     $content->setVariable("REQUEST_URI", isset($this->request) ? $this->request : "");
     if (isset($values) && is_array($values)) {
         $content->setVariable("VALUE_LOGIN", trim($values["login"]));
     }
     if (isset($values["login"]) && !empty($values["login"])) {
         $portal->add_javascript_onload("SignIn", "document.getElementById('second_field').focus();");
     } else {
         $portal->add_javascript_onload("SignIn", "document.getElementById('first_field').focus();");
     }
     $frameResponseObject->setTitle(gettext("Sign in"));
     $frameResponseObject->setHeadline("Anmeldung");
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($content->get());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }