daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Login a user with TFS 0.3 compatibility
  2. function user_login_03($username, $password) {
  3.     if (config('salt') === true) {
  4.         $username = sanitize($username);
  5.         $data = mysql_select_single("SELECT `salt`, `id`, `password`, `name` FROM `accounts` WHERE `name`='$username';");
  6.         $salt = $data['salt'];
  7.         if (!empty($salt)) $password = sha1($salt.$password);
  8.         else $password = sha1($password);
  9.         return ($data !== false && $data['name'] == $username && $data['password'] == $password) ? $data['id'] : false;
  10.     } else return user_login($username, $password);
  11. }
  12.  
  13. // Verify that user is logged in
  14. function user_logged_in() {
  15.     return (getSession('user_id') !== false) ? true : false;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top