Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.54 KB | None | 0 0
  1. <?php
  2. if (!defined('AXE'))
  3.     exit;
  4. //if session set, then we shoudlnt be here
  5. if (isset($_SESSION['user']))
  6. {
  7.     print "You are already logged in."; $tpl_footer = new Template("styles/".$style."/footer.php");
  8.     $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  9.     print $tpl_footer->toString();
  10.     exit;
  11. }
  12. //common include
  13. $box_simple_wide = new Template("styles/".$style."/box_simple_wide.php");
  14. $box_wide = new Template("styles/".$style."/box_wide.php");
  15. $box_wide->setVar("imagepath", 'styles/'.$style.'/images/');
  16. $box_simple_wide->setVar("imagepath", 'styles/'.$style.'/images/');
  17. //end common include
  18. if (isset($_POST['action']))
  19. {
  20.     if (pun_htmlspecialchars($_POST['username'])=='')
  21.         {
  22.             $cont2= "Your user name needs to be filled in. <meta http-equiv='refresh' content='2;url=./quest.php?name=login'/>";
  23.         }
  24.         elseif (pun_htmlspecialchars($_POST['username'])=='')
  25.         {
  26.             $cont2= "Your password needs to be filled in. <meta http-equiv='refresh' content='2;url=./quest.php?name=login'/>";
  27.         }
  28.     //lets select acc db
  29.     mysql_select_db($acc_db);
  30.     special_core_exec_onlogin(pun_htmlspecialchars($_POST['username']));
  31.    
  32.     $a  = mysql_query("SELECT ".$db_translation['encrypted_password']." FROM ".$db_translation['accounts']." WHERE ".$db_translation['login']." = '".$db->escape(pun_htmlspecialchars($_POST['username']))."'") or die (mysql_error());
  33.     $a2 = mysql_fetch_array($a);
  34.     if ($a2[0]==sha1(strtoupper(pun_htmlspecialchars($_POST['username'])).':'.strtoupper(pun_htmlspecialchars($_POST['password']))))
  35.     {
  36.         if (pun_htmlspecialchars($_POST['username'])=='')
  37.         {
  38.             $cont2= "Your user name needs to be filled in. <meta http-equiv='refresh' content='0;url=./quest.php?name=login'/>";
  39.         }
  40.         elseif (pun_htmlspecialchars($_POST['password'])=='')
  41.         {
  42.             $cont2= "Your password needs to be filled in. <meta http-equiv='refresh' content='0;url=./quest.php?name=login'/>";
  43.         }
  44.         else
  45.         {
  46.             $_SESSION['user']=pun_htmlspecialchars($_POST['username']);
  47.             $cont2= "You are now logged in! <meta http-equiv='refresh' content='0;url=./'/>";
  48.         }
  49.         $box_wide->setVar("content_title", "Login");   
  50.         $box_wide->setVar("content", $cont2);                  
  51.         print $box_wide->toString();
  52.         $tpl_footer = new Template("styles/".$style."/footer.php");
  53.         $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
  54.         print $tpl_footer->toString();
  55.         exit;
  56.         }
  57.         else
  58.         {
  59.         $warn = "<font color='red'>(!)</font>";
  60.         $warn2 = "<strong>Incorrect username or password!</strong>";
  61.     }
  62. }
  63.  
  64.  
  65. $cont2='
  66.         <center>
  67.         <div class="sub-box1" align="left">
  68.          <form action="" method="post">
  69.          &nbsp;Username:<br/>
  70.          <input type="text" id="username" maxlength="20" name="username" /><br/> '. $warn.'                            
  71.          &nbsp;Password:  <br/>                                        
  72.          <input type="password" id="password" maxlength="20" name="password" /><br/> '. $warn .'   
  73. '. $warn2.'
  74.          &nbsp;*Use your in-game account details*<br/>
  75.          <div class="line2"></div>
  76.          <table cellpadding="0" cellspacing="0"><tr>
  77.          <td valign="top">
  78.          <div id="log-b2"><input type="submit" name="action" value="Login" class="button doit" /></div>
  79.          </td>
  80.          <td valign="top" style="padding: 3px 0px 0px 5px;">
  81.          <a href="./quest.php?name=gimmepass">Forgot password?</a> <br/>
  82.          <a href="quest.php?name=register">Create a new Account</a>
  83.          </td>
  84.          </tr></table>
  85.          
  86.          </form>
  87.          </div>
  88.         </center>
  89. ';
  90.          
  91. $box_wide->setVar("content_title", "Login");   
  92. $box_wide->setVar("content", $cont2);                  
  93. print $box_wide->toString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement