Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login()
- {
- if(isset($_POST['login']))
- {
- $user = $_POST['username'];
- $pass = sha1(strtoupper($_POST['username'].':'.$_POST['password']));
- $q = $this->db->select('*','account',"username = '$user' AND sha_pass_hash = '$pass'");
- if(mysql_num_rows($q) > 0)
- {
- $row = mysql_fetch_assoc($q);
- foreach($row as $c => $v)
- {
- $_SESSION[$c] = $v;
- }
- //Encrypt the posted code field and then compare with the stored key
- $captchaaccept = $_SESSION['keya'];
- if(md5($_POST['captcha']) != $captchaaccept)
- {
- $this->mmsg('error','Invalid Captcha');
- }
- $gm = $this->db->select('*','account_access',"id = '$_SESSION[id]'");
- $row = mysql_fetch_assoc($gm);
- if($row['gmlevel'] >= 4)
- {
- $_SESSION['gm'] = 1;
- }
- }
- else
- {
- return $this->mmsg('error','Invalid Login');
- }
- header("Location: ./?account");
- exit;
- }
- }
Add Comment
Please, Sign In to add comment