Example #1
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $command = new SignIn();
     if (!empty($this->params)) {
         $requestUrl = "/";
         foreach ($this->params as $param) {
             $requestUrl .= $param . "/";
         }
         $command->setRequest($requestUrl);
     }
     return $command->frameResponse($frameResponseObject);
 }
Example #2
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/Source/SignInDB.php';
// File with DB functions class
if (!$_SESSION) {
    session_start();
}
// Start the session
$SignIn = new SignIn();
//instantiating class with DB functions
$action = $_REQUEST["action"];
//variable from GET string - shows what action to take
header("Content-type:text/xml");
//setting the content type of the response document to XML
echo '<?xml version="1.0"?><data>';
//setting the root xml tag in the response document
switch ($action) {
    case "CheckPassword":
        $status = $SignIn->CheckPassword($_REQUEST['Name'], $_REQUEST['Password']);
        //
        echo '<status><![CDATA[' . $status[0] . ']]></status>';
        //output login status
        echo '<Name><![CDATA[' . $status[1] . ']]></Name>';
        //output login status
        break;
}
echo "</data>";
//finish xml
Example #3
0
loadClass('RESTResponse');
loadClass('REST_Errors');
if ($application->getCurrentProtocol() !== "https") {
    $e = new REST_Errors();
    $e->IncorrectRestProtocol();
    $e->send();
    exit;
}
if (!isset($_GET['alogin']) || !isset($_GET['apassword'])) {
    $e = new REST_Errors();
    $e->UndefinedLoginPassword();
    $e->send();
    exit;
}
loadActionClass('SignIn');
$signin = new SignIn();
$acountInfo = null;
if ($signin->isValidAcount($_GET['alogin'], md5($_GET['apassword']), $acountInfo)) {
    modApiFunc("Users", "setCurrentUserID", $acountInfo['id']);
} else {
    $e = new REST_Errors();
    $e->IncorrectLoginPassword();
    $e->send();
    exit;
}
if ($usr->isUserSignedIn() == FALSE) {
}
$_GET['asc_action'] = 'REST_Request_Action';
CProfiler::start('processAction');
$application->processAction();
CProfiler::stop('processAction');
 public function login()
 {
     $object_login = SignIn::get_instance();
     $return = $object_login->User_login('teacher', 'Mail', 'password', 'inputmail', 'password', 'Teacher');
     return $return;
 }
 public function login()
 {
     $object_login = SignIn::get_instance();
     $return = $object_login->User_login('admin', 'mail', 'password', 'inputmail', 'password', 'Administrator');
     return $return;
 }
Example #6
0
 public function login()
 {
     $object_login = SignIn::get_instance();
     $return = $object_login->User_login('students', 'stu_id', 'password', 'inputid', 'password', 'Student');
     return $return;
 }
Example #7
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;
 }