Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Login a user with TFS 0.3 compatibility
- function user_login_03($username, $password) {
- if (config('salt') === true) {
- $username = sanitize($username);
- $data = mysql_select_single("SELECT `salt`, `id`, `password`, `name` FROM `accounts` WHERE `name`='$username';");
- $salt = $data['salt'];
- if (!empty($salt)) $password = sha1($salt.$password);
- else $password = sha1($password);
- return ($data !== false && $data['name'] == $username && $data['password'] == $password) ? $data['id'] : false;
- } else return user_login($username, $password);
- }
- // Verify that user is logged in
- function user_logged_in() {
- return (getSession('user_id') !== false) ? true : false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement