devplanete/php-login-advanced — pull request #10 by devplanete (2014-04-23 20:04:15+00:00)
Title: Cleaning and simplification of code

- Delete `private $user_id, $user_name` and `$user_email` : these variables are only set but never used. And we can use easily $_SESSION['user_id'], $_SESSION['user_name '] and $_SESSION['user_email '] instead of them.

- Delete `loginWithSessionData()` because finally nothing to do here, we are already connected when $_SESSION[ * ] variable are defined ;)

- Add function `getPasswordHash($password)`: for code reusability it make sense to have a function for that.

- Remove `function getUsername()`: use $_SESSION['user_name '] instead