title: page getting rendered after restrict drupal
body: <p>I am using a custom module to restrict a role to a url in drupal 7 the code is as follows:</p>
  
  <pre><code> &lt;?php
  
   // Implements hook_init() 
   function restrict_access_init() {
     $restrictions = restrict_access_restrictions();
     global $user;
     foreach ($restrictions as $path =&gt; $roles) {
       // See if the current path matches any of the patterns provided.
       if (drupal_match_path($_GET['q'], $path)) {
         // It matches, check the current user has any of the required roles
         $valid = FALSE;
         foreach ($roles as $role) {
               print implode("','",$user -&gt;roles);
           if (in_array($role, $user-&gt;roles)) {
             $valid = TRUE;
             break;
           }
         }
  
         if (!$valid) {
           drupal_access_denied();
         }
       }
     }
   }
  
   function restrict_access_restrictions() {
     // This array will be keyed by path and contain an array of allowed roles for that path
     return array(
       'path/path' =&gt; array('admin'),
     );
   }
  
   ?&gt;
  </code></pre>
  
  <p>This does restrict access just fine but it then renders the page un-styled after the footer.</p>
  
  <p>Any ideas why this may be happening?
  I'm at a lost end with this now.</p>