public function Login($Name, $Pass)
 {
     global $objSession;
     $tmpUser = new Nepama_User($Name);
     if ($tmpUser == false) {
         return false;
     }
     $tmpPass = $tmpUser->GetProperty("password");
     if ($tmpPass == md5($Pass)) {
         $objSession->Login(array("name" => $Name, "password" => $tmpPass));
         return true;
     }
     return false;
 }
Beispiel #2
0
function Main_Checklogin(&$objUser)
{
    global $objSession;
    // Check for Login. If a session exists verify the password. If wrong -> Logout
    if ($objSession->CheckLogin()) {
        if ($objSession->GetData("name") == "Gast") {
            $objSession->Logout();
        }
        $objUser = new Nepama_User($objSession->GetData("name"));
        if ($objUser->GetProperty("password") != $objSession->GetData("password")) {
            $objSession->Logout();
        }
    }
    // Check Login again, if no session exists create a Guestuser-object.
    if (!$objSession->CheckLogin()) {
        // create guest-user and log in
        $objUser = new Nepama_User("Gast");
        //$objSession->Login(array("name" => "Gast", "password" => md5("gast")));
        return false;
    }
    return true;
}