INFORMATICS

The Best

Joomla 3.6 - 3.7 - white page in backend - Fatal error login.php

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Joomla 3.6 - 3.7 - white page in backend - Fatal error login.php

I have an error on backend in Joomla website. When I insert user and password I can see this errors:

Notice: Undefined offset: 0 in /www/site/libraries/vendor/joomla/input/src/Input.php on line 313, referer: http://webpage/administrator

Fatal error: Call to a member function get() on null in /www/administrator/components/com_login/models/login.php on line 33 referer: http://webpage/administrator

 

Error - login.php - size 4525 B

/**
* @package Joomla.Administrator
* @subpackage com_login
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights r
eserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

/**
* Login Model
*
* @since 1.5
*/
class LoginModelLogin extends JModelLegacy
{
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState()
{
$input = JFactory::getApplication()->input->getInputForRequestMethod();

$credentials = array(
'username' => $input->get('username', '', 'USERNAME'),
'password' => $input->get('passwd', '', 'RAW'),
'secretkey' => $input->get('secretkey', '', 'RAW'),
);

$this->setState('credentials', $credentials);

// Check for return URL from the request first.
if ($return = $input->get('return', '', 'BASE64'))
{
$return = base64_decode($return);

if (!JUri::isInternal($return))
{
$return = '';
}
}

// Set the return URL if empty.
if (empty($return))
{
$return = 'index.php';

 correct login.php - size - 4579 B

/**
* @package Joomla.Administrator
* @subpackage com_login
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

/**
* Login Model
*
* @since 1.5
*/
class LoginModelLogin extends JModelLegacy
{
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState()
{
$app = JFactory::getApplication();

$input = $app->input;
$method = $input->getMethod();

$credentials = array(
'username' => $input->$method->get('username', '', 'USERNAME'),
'password' => $input->$method->get('passwd', '', 'RAW'),
'secretkey' => $input->$method->get('secretkey', '', 'RAW'),
);
$this->setState('credentials', $credentials);

// Check for return URL from the request first.
if ($return = $input->$method->get('return', '', 'BASE64'))
{
$return = base64_decode($return);

if (!JUri::isInternal($return))
{
$return = '';
}
}

// Set the return URL if empty.
if (empty($return))
{
$return = 'index.php';

 problem solving - changing the login.php file

Search