I have a problem using Drupal 7 admin login in my custom theme. After creating a custom theme when I try to submit the login form, I receive the following error:
"Access denied You are not authorized to access this page."
When I revert back to a default theme (eg. Bartik), everything works fine again.
After reading a lot of solutions, I can't seem to find the right one for me. Any ideas?
EDIT: The problem seems to be the "drupal_render(drupal_get_form('search_block_form'))" in my page.tpl.php. For my theme i need a form markup without any container, so i used this function to render the form. The solution for me was to change it like:
$form_array= drupal_get_form("user_login");
$form = drupal_render($form_array);
echo $form;
First take a look at this: your-drupal-parh/user -if this link takes to the login form, then you just need to customize the login form.
If it doesn't help, try create a login.
Update templete.php
themename
is the name of your theme.path
points to the path where the user-login.tpl.php file exists in your theme directory[heredrupal_get_path('theme', 'themename') . '/templates'
means that the user-login.tpl.php file is in the theme's template directory].Code for user-login.tpl.php:
Clear cache and see what happens.