how to render login page drupal 7 in template.php?

by perbatek   Last Updated July 18, 2017 09:07 AM

I have some custom theme from drupal 6 then I upgare to drupal 7 , but the login page doesn't show up I mean when user not yet login then show login page here my old code for render login page which is not render

function _phptemplate_variables($hook, $variables = array()) {
  switch ($hook) {
    case 'page':
      global $user;
      if (arg(0) == 'user'){
        if (!$user->uid) { //check to see if the user is logged in. If not display the special login page layout
          $variables['template_file'] = 'page-login';
        }
        elseif (arg(1) == 'login' || arg(1) == 'register' || arg(1) == 'password' ) {
          $variables['template_file'] = 'page-login';
        }
      }
      break;
  }

  return $variables;
}

how do I render the login page if user not yet login ?

Tags : 7 6


Related Questions