In order to bypass the login for the admin you just need to pass the restriction rules that are applied to the page. The main rule is for 'Administrator' and is setup like this:
session variable:
$_SESSION['AdminLogin']
This session variable must hold the password for the Admin user.
You can check the username or id after you login and if it is the admin username or id then you can store the password in this session variable.