fev. 10, 2009 session_start(); $user = "Email:"; $pass = "CPF:"; $left = "-41px"; $value = "Entrar"; $button = ""; $link = "Painel Administrativo [ Logout ]"; if ($_SESSION['membersarea']=="Active") { $disabled = "disabled"; $button = " "; $value = ""; } if ($_REQUEST['closed']=="yes") { setcookie('ergousermail'); session_destroy(); echo ""; } if (isset($_SESSION['b_link'])) { $disabled = "disabled"; $loguser = "Active"; $user = " "; $button = " "; $left = "-5px"; $value = ""; $link = "Pagina de Status [ sair ]"; } if ($_COOKIE['ergousermail']!="") { //$link = "".$_COOKIE['ergousermail']." [ Logout ]"; $user = " "; $pass = "Senha:"; } include_once ("config/config.php"); require ("ins_include.php"); if (isset($_REQUEST['loginok'])) { if ($_SESSION['membersarea']=="Active") { echo ""; } else { $cpf=formatcpf($_REQUEST['password']); $authDetails = mysql_query("SELECT * FROM authors WHERE email='".$_REQUEST['email']."' AND cpf='".$cpf."'"); $total = mysql_num_rows($authDetails); if ($total>0) { $userDetails = mysql_fetch_array($authDetails); $userId = $userDetails['id']; $userName = $userDetails['nome']; $userCpf = $userDetails['cpf']; $userEmail = $userDetails['email']; $page = "1a254h"; $case = 1; $ling = "pt"; $b_link = array(); $b_link[] = $userId; $b_link[] = $userName; $b_link[] = $userCpf; $b_link[] = $userEmail; $b_link[] = $page; $b_link[] = $case; $b_link[] = $ling; $_SESSION['b_link'] = $b_link; echo ""; } else if ($total==0) { $userDetails = mysql_query("SELECT * FROM admins WHERE email='".$_REQUEST['email']."'"); $userDetails = mysql_fetch_array($userDetails); if (substr($userDetails['password'],0,10)==substr(md5($_REQUEST['password']),0,10)&&$_REQUEST['password']!=""&&$_REQUEST['email']!="") { if ($userDetails['active']==1) { $_SESSION['membersarea']="Active"; $_SESSION['memberid']=$userDetails['id']; $_SESSION['membername']=$userDetails['name']; $_SESSION['membermail']=$userDetails['email']; $_SESSION['memberlevel']=$userDetails['level']; $_SESSION['lastlogin']=TRUE; echo ""; } } } } echo ""; } ?>
"; if ($value=="Entrar") { echo ""; } echo "
".$user." "; if ($_COOKIE['ergousermail']!=""||$loguser=="Active") { echo "
".$link."
"; } else { echo ""; } echo "
".$pass."
 
".$button."
"; ?>