$my_name
$my_pass
$my_cookie
"; require "bb_cl.php"; require "../xtpl.p"; include "../lang.php"; $bb=new bb; $xtpl_bb= new XTemplate ("../master.xtpl"); $bb->do_navig(); //set var fo a cookie // if ($my_cookie) { $md5_cookie=md5($my_cookie); //where md5(aid)='690ead72a91c068870e19f3881e372df'; //$my_author=$bb->fetch("aid","authors","pwd=\"$my_cookie\" "); $my_author=$bb->fetch("aid, pwd","authors","pwd=\"$my_cookie\" and md5(aid)='$my_cookie2' "); } //should login form be showen //if he loged out we set the cookie, that why we have to // know if it is the admin cookie ( !$my_author). if (!$my_cookie || !$my_author) { $xtpl_bb->assign(NAW,""._NAW.""); $xtpl_bb->assign(WISEHY_TEPERR,""._WISEHY_TEPERR.""); $xtpl_bb->parse("main.login"); //print $my_author; } //check in the login stuff if ($my_author) { $admin=1; //$redirect=""; //$xtpl->assign("redirect","$redirect"); include ("bb.php"); //$xtpl->assign("admin",$my_author); //$xtpl->parse("main.loggedin"); // header('Location: http://pdki.mine.nu/bb/bb.php'); exit; }else{ $admin=0; if($bb->check_admin($my_name,$my_pass) ==1) { $admin=1; $cookie_build=md5($my_pass); $cookie_build2=md5($my_name); //$c_pass=md5($my_pass); setcookie("bb","$cookie_build",time()+2592000,"/","",""); setcookie("bb2","$cookie_build2",time()+2592000,"/","",""); //the only way to let the cookie some time // I tried sleep but it dose'nt help. header('Location: brb.php'); // this //$redirect=""; //$xtpl->assign("redirect","$redirect"); include ("bb.php"); //$xtpl->parse("main.loggedin"); //header('Location: http://pdki.mine.nu/bb/bb.php'); exit; } } $xtpl_bb->parse("main"); $xtpl_bb->out("main"); ?>