condition inside template.php (if logged_in/logged_out and else) Is it possible to perform condition inside template.php (if logged_in, do these...else do that/ do nothing)?

I am a front-end developer, and as a front-end developer, i like my code clean. So i'm cleaning up my drupal html source code output.

I found some modules out there, that help a lot, and one of then is HTML5 Tools and Metatag (thank you for the team developers). But even with those great tools, i still having the "Drupal.settings" in my html output. 

Ocasionally, i found that i can remove the "Drupal.settings" from the html with the hook_js_alter :


  function MYTHEME_js_alter (&amp;$js) {   unset($js['settings']); }


But the problem is: my logged in users still needing this "Drupal.settings" because some modules use it. So that's why i'm asking if there is a way to perform condition inside template.php to logged_in/logged_out users.

THank you in advance
This should help you out. Drupal user login - How to tell if a Drupal user is logged in (authenticated)

You can also use the utility variable $logged_in: Returns TRUE if the user is registered and signed in.

Updated answer.

In template.php, you can use global $user; to check and see if someone is logged in.

global $user;    
if (isset($user-&gt;roles[1])) {
  //Put code here.
}


Checking against Devel, you can see that $user-&gt;roles[1] means it's an anonymous user.