You can check by this little snippet if the actual user visiting your website is logged in or not. This snippet can be used anywhere (modules, themes, blocks..)
1 2 3 4 5 6 7 8 9 |
<?php global $user; if ($user->uid) { // User is logged in. Do something. } else { // User in anonymous. Do something. } ?> |