Commit e8f5c37e authored by Carsten  Rose's avatar Carsten Rose
Browse files

Constants: timeout for session specified to 86400 secs.

Database: rename 'row' to 'record'.
QuickFormQuery: implemented timeout of 86400 for session lifetime.
parent c7827d37
......@@ -13,6 +13,8 @@ const API_DIR = 'typo3conf/ext/qfq/qfq/api/';
const QFQ_LOG = 'qfq.log';
const SESSION_LIFETIME_SECONDS = 86400;
const FORM_LOAD = 'form_load';
const FORM_SAVE = 'form_save';
const FORM_PERMISSION_SIP = 'sip';
......
......@@ -234,13 +234,13 @@ class Database {
if ($count === 0)
$result = array();
else
throw new DbException($specificMessage . "Expected no row, got $count rows: $sql", ERROR_DB_TOO_MANY_ROWS);
throw new DbException($specificMessage . "Expected no record, got $count rows: $sql", ERROR_DB_TOO_MANY_ROWS);
break;
case ROW_EXPECT_1:
if ($count === 1)
$result = $this->fetchAll($mode)[0];
else
throw new DbException($specificMessage . "Expected one row, got $count: $sql", ERROR_DB_COUNT_DO_NOT_MATCH);
throw new DbException($specificMessage . "Expected one record, got $count: $sql", ERROR_DB_COUNT_DO_NOT_MATCH);
break;
case ROW_EXPECT_0_1:
if ($count === 1)
......@@ -248,13 +248,13 @@ class Database {
elseif ($count === 0)
$result = array();
else
throw new DbException($specificMessage . "Expected no row, got $count rows: $sql", ERROR_DB_TOO_MANY_ROWS);
throw new DbException($specificMessage . "Expected no record, got $count rows: $sql", ERROR_DB_TOO_MANY_ROWS);
break;
case ROW_EXPECT_GE_1:
if ($count > 0)
$result = $this->fetchAll($mode);
else
throw new DbException($specificMessage . "Expected at least one row, got nothing: $sql", ERROR_DB_TOO_FEW_ROWS);
throw new DbException($specificMessage . "Expected at least one record, got nothing: $sql", ERROR_DB_TOO_FEW_ROWS);
break;
default:
......
......@@ -104,6 +104,11 @@ class QuickFormQuery {
mb_internal_encoding("UTF-8");
ini_set('session.gc-maxlifetime', SESSION_LIFETIME_SECONDS);
ini_set('session.cookie_lifetime', SESSION_LIFETIME_SECONDS);
// Refresh the session even if no new data saved.
$_SESSION['LAST_ACTIVITY'] = time();
set_error_handler("\\qfq\\ErrorHandler::exception_error_handler");
if (!isset($t3data['bodytext']))
......@@ -211,7 +216,7 @@ class QuickFormQuery {
private function loadFormSpecification($mode) {
// formName
if (false === $formName = $this->getFormName()) {
if (false === ($formName = $this->getFormName())) {
return false;
}
$this->store->setVar(SYSTEM_FORM, $formName, STORE_SYSTEM);
......@@ -263,6 +268,10 @@ class QuickFormQuery {
private function getFormName() {
$formName = $this->store->getVar(SIP_FORM, STORE_TYPO3 . STORE_SIP . STORE_CLIENT);
//TODO: das sollte mit Evaluate geparst werden
// if($formName === '{{form}}')
// $formName = $this->store->getVar(SIP_FORM, STORE_SIP . STORE_CLIENT);
return $formName;
}
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment