Project

General

Profile

Actions

Bug #15675

closed

Backend Login Problem

Added by old_sapperlot almost 19 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-02-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.1
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

This is a comment to Bug ID 0002059:

There is a login problem to the backend of the quickstart package (probably also in other packages) due to a missing Defalt value of a NOT NULL field in the database.
Here are my findings to this issue:
In the sql script to create the db (database.sql in typo3conf) the following table creation statement is made:

CREATE TABLE `be_sessions` (
`ses_id` varchar(32) NOT NULL default '',
`ses_name` varchar(32) NOT NULL default '',
`ses_userid` int(11) unsigned NOT NULL default '0',
`ses_tstamp` int(11) unsigned NOT NULL default '0',
`ses_data` mediumblob NOT NULL,
`ses_iplock` varchar(39) NOT NULL default '',
`ses_hashlock` int(11) NOT NULL default '0',
PRIMARY KEY (`ses_id`,`ses_name`)
) TYPE=MyISAM;

Thereby the ses_data field is declared NOT NULL but no default value is given.

In class.t3lib_userauth.php an INSERT call to be_sessions table is made:

/**
 * Creates a user session record.
 *
 * @param    array        user data array
 * @return    void
*/
function createUserSession ($tempuser) {
if ($this->writeDevLog)     t3lib_div::devLog('Create session ses_id = '.$this->id, 't3lib_userAuth');
// delete session entry first
$GLOBALS['TYPO3_DB']->exec_DELETEquery(
$this->session_table,
'ses_id = '.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->id, $this->session_table).'
AND ses_name = '.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->name, $this->session_table)
);
// re-create session entry
$insertFields = array(
'ses_id' => $this->id,
'ses_name' => $this->name,
'ses_iplock' => $tempuser['disableIPlock'] ? '[DISABLED]' : $this->ipLockClause_remoteIPNumber($this->lockIP),
'ses_hashlock' => $this->hashLockClause_getHashInt(),
'ses_userid' => $tempuser[$this->userid_column],
'ses_tstamp' => $GLOBALS['EXEC_TIME']
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery($this->session_table, $insertFields);

However no value for the ses_data field is givn. Thus the Insert statement fails and also the whole login procedure.

My workareound is to allow the ses_data field to be NULL. However as newbie I have no idea what this field is for and if there is a routine which will fail because of a NULL value in the ses_data.

Please let me know if my workaround will lead to problems in other routines of typo3. Sens an email to

PS: This bug almost kept me from further evaluating typo3 and should be removed very fast from the starter package, because probably a lot of people will not look any further into the problem if they can't login into an evaluation installation.

PPS: How can I write a follow up note to a bug ?
(issue imported from #M2634)


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #15295: Unable to login into BE when using MySQL 5+ClosedKarsten Dambekalns2005-12-19

Actions
Related to TYPO3 Core - Bug #16809: FIX FOR Typo3 basic tables definition not compliant with MySQL 5.0 strict mode enabled by defaultClosedDmitry Dulepov2006-12-22

Actions
Actions #1

Updated by old_sapperlot almost 19 years ago

Additional Note: Please check chapter 11.1.4 in the MySQL 5.0 Manual for the differences between MySQL Versions < 5.0.3 and > 5.0.3 about DEFAULT values.

Since no DEFAULT value can be specified for a BLOB field either allow NULL values or specify a value at each insert statement.

Actions #2

Updated by Karsten Dambekalns over 18 years ago

This should be fixed in 4.0beta3, as we disregard NOT NULL definitions completely now. Please confirm... Thanks!

Actions #3

Updated by Karsten Dambekalns over 18 years ago

I just checked with current code, the field is still defined that way, but I have no problems logging in with MySQL 5.0.22. If you still experience this bug, please reopen.

Actions

Also available in: Atom PDF