Subversion-Projekte lars-tiefland.em_wm

Revision

Revision 3 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 3 Revision 114
Zeile 1... Zeile 1...
1
<?
1
<?
2
	function authenticiate()
2
    function authenticiate()
3
	{
3
    {
4
		global $smarty, $meld;
4
        global $smarty, $meld;
5
		$pw=" ";
5
        $pw = " ";
6
		header('HTTP/1.0 401 Unauthorized');
6
        header( 'HTTP/1.0 401 Unauthorized' );
7
		header('WWW-authenticate: basic realm="Pflanzendatenbank"');
7
        header( 'WWW-authenticate: basic realm="Pflanzendatenbank"' );
-
 
8
        $meld = ( !isset($meld) ) ?
8
		$meld=(!isset($meld))?"Ungültige Login-Informationen ==> Zuguriff verweigert!":$meld;
9
            "Ungültige Login-Informationen ==> Zuguriff verweigert!" : $meld;
9
		$smarty->assign("h1","Fehler bei Authentifizierung!");
10
        $smarty->assign( "h1", "Fehler bei Authentifizierung!" );
10
		$smarty->assign("meld",$meld);
11
        $smarty->assign( "meld", $meld );
11
		$smarty->assign("error",true);
12
        $smarty->assign( "error", true );
12
		$smarty->display("meld.tpl");
13
        $smarty->display( "meld.tpl" );
13
		exit;
14
        exit;
14
	}
15
    }
Zeile 15... Zeile 16...
15
 
16
 
16
	if (!isset($_SERVER["PHP_AUTH_USER"]))
17
    if ( !isset($_SERVER["PHP_AUTH_USER"]) )
17
	{
18
    {
18
		authenticiate();
19
        authenticiate();
19
	}
20
    }
20
	else
21
    else
21
	{
22
    {
22
		$u_name=$_SERVER["PHP_AUTH_USER"];
23
        $u_name = $_SERVER["PHP_AUTH_USER"];
23
		if(strtolower($u_name)=="guest")
24
        if ( strtolower($u_name) == "guest" )
24
		{
25
        {
25
			require("email.php");
26
            require ( "email.php" );
26
			$pw="";
27
            $pw = "";
27
		}
28
        }
28
		else
29
        else
29
		{
30
        {
30
			$pw=$_SERVER["PHP_AUTH_PW"];
31
            $pw = $_SERVER["PHP_AUTH_PW"];
31
		}
32
        }
32
		$user=new User($u_name, $pw);
33
        $user = new User( $u_name, $pw );
33
		if(is_null($user->u_id))
34
        if ( is_null($user->u_id) )
34
		{
35
        {
35
			authenticiate();
36
            authenticiate();
36
		}
37
        }
37
	}
38
    }