-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Travis van der F edited this page Aug 7, 2019
·
3 revisions
Welcome to the SU-Auth wiki!
- Registration
- Login (validation)
- Change Password (manual) / Reset Password (automatic)
- Profile
$user = new SUAuth; // new user session
$user->login(123); // force log in user with ID 123
if ($user->isLoggedIn()) // SUAuth::isLoggedIn()
{
$user = SUAuth::id($user->getUserId());
echo sprintf('User %s is logged', $user->getUsername());
}
else
{
$user = new SUAuth;
$user->handle = '[email protected]';
$user->password = 'TEST123'; // such a BAD password
if ($user->saveLogin()) // force login with set parameters
{
# Get log in session ID
echo $user->Session::id();
}
}
$user->logout(); // Bye!