I have a question regarding the user/auth mechanism. I am transitioning a site from vanilla php to Yii, and first off I am converting the members section. Everything works well but there is one thing I cannot figure out how to do. Basically, once a member signs in, the "Login" link should change to "Logout (username)" throughout the site. The problem I am having is that I cannot see a way to access the user's status and login details (set via Yii login) through plain php.
The way it is setup currently is something like this:
<?php if (isset($_SESSION['loggedIn'] && $_SESSION['loggedIn'] === '1') { echo '<a href="/logout.php">Logout ('.getCurrentUsername().')</a>'; else { echo '<a href="/login.php">Login</a>'; } ?>
Is there a way to include some core Yii files to be able to access the CWebUser object? This would enable me to transition the frontend to Yii page-by-page.
Thanks in advance.
Chris