Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

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


Reply


2 Posts   676 Views

Avatar
martin_w

Community Member, 28 Posts

29 November 2012 at 9:27am

Edited: 29/11/2012 9:51am

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

Source

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;
36
37    // Default login (see Security::setDefaultAdmin())
38    if(Security::check_default_admin($RAW_data['Email'], $RAW_data['Password'])) {
39       $member = Security::findAnAdministrator();

Trace

MemberAuthenticator::authenticate(Array,MemberLoginForm)
call_user_func_array(Array,Array)
Line 208 of MemberLoginForm.php
MemberLoginForm->performLogin(Array)
Line 125 of MemberLoginForm.php
MemberLoginForm->dologin(Array,MemberLoginForm,SS_HTTPRequest)
Line 332 of Form.php
Form->httpSubmission(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 161 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 125 of Director.php
Director::direct(/Security/LoginForm/)
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!

Avatar
martin_w

Community Member, 28 Posts

30 November 2012 at 2:45am

Solved..

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.