Jump to:

23482 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » [Solved] [Notice] Undefined index: Email / can't log in to backend

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 572 Views
  • martin_w
    Community Member
    28 Posts

    [Solved] [Notice] Undefined index: Email / can't log in to backend Link to this post

    Hi guys,

    I suddenly got this issue that I can't log in to the admin area/backend.
    When I enter my login data on Security/Login it shows me the same page without any error message.
    So I set the page to "dev"-mode and then I get this notice:

    [Notice] Undefined index: Email
    GET /Security/LoginForm/

    Line 33 in /.../.../MemberAuthenticator.php


    24 * @param array $RAW_data Raw data to authenticate the user
    25 * @param Form $form Optional: If passed, better error messages can be
    26 * produced by using
    27 * {@link Form::sessionMessage()}
    28 * @return bool|Member Returns FALSE if authentication fails, otherwise
    29 * the member object
    30 * @see Security::setDefaultAdmin()
    31 */
    32 public static function authenticate($RAW_data, Form $form = null) {
    33 $SQL_user = Convert::raw2sql($RAW_data['Email']);
    34    $isLockedOut = false;
    35    $result = null;
    37    // Default login (see Security::setDefaultAdmin())
    38    if(Security::check_default_admin($RAW_data['Email'], $RAW_data['Password'])) {
    39       $member = Security::findAnAdministrator();


    Line 208 of MemberLoginForm.php
    Line 125 of MemberLoginForm.php
    Line 332 of Form.php
    Line 143 of RequestHandler.php
    Line 161 of RequestHandler.php
    Line 147 of Controller.php
    Line 282 of Director.php
    Line 125 of Director.php
    Line 127 of main.php

    I know what this notice means, but I have no idea how to solve this on Silverstripe and why it didn't show up before. (There have been no changes to the code these past few days.)
    I checked two other posts, but they didn't help to solve my problem.

    I hope you have some ideas.
    Thanks in advance!

  • martin_w
    Community Member
    28 Posts

    Re: [Solved] [Notice] Undefined index: Email / can't log in to backend Link to this post


    The problem was caused by a htaccess function which redirected to the same url with a forward slash at the end.
    And that's why the post data was always empty because Silverstripe has no forward slash at the end of the url.

    Well as I said "There have been no changes to the code these past few days.".
    Apparently there were some changes to the htaccess.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.