Bug #15675
closedBackend Login Problem
0%
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 matrix.psz@web.de
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)