optimized log to oc2
This commit is contained in:
parent
bd33e67c90
commit
2cb201b5f0
@ -9,7 +9,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
require_once($opt['rootpath'] . 'lib2/logic/rowEditor.class.php');
|
||||
require_once($opt['rootpath'] . 'lib/logtypes.inc.php'); // lib1 ???
|
||||
require_once($opt['rootpath'] . 'lib2/logic/logtypes.inc.php');
|
||||
|
||||
class cache
|
||||
{
|
||||
@ -575,6 +575,9 @@ class cache
|
||||
}
|
||||
|
||||
|
||||
// $userLogType:
|
||||
// Logtype selected by the user, or null if not applicable
|
||||
|
||||
function getUserLogTypes($userLogType, $oldLogType = 0)
|
||||
{
|
||||
global $translate, $login;
|
||||
@ -582,7 +585,7 @@ class cache
|
||||
$logTypes = array();
|
||||
|
||||
$logtypeNames = get_logtype_names();
|
||||
$allowedLogtypes = get_cache_log_types($this->getCacheId(), 0);
|
||||
$allowedLogtypes = get_cache_log_types($this->getCacheId(), $oldLogType);
|
||||
$defaultLogType = $userLogType;
|
||||
if (!logtype_ok($this->getCacheId(), $defaultLogType, $oldLogType))
|
||||
$defaultLogType = $allowedLogtypes[0];
|
||||
|
@ -49,8 +49,8 @@
|
||||
// get cache object
|
||||
$cache = new cache($cacheId);
|
||||
|
||||
// check log allowed (owner, admin, already published, not disabled)
|
||||
$validate['logAllowed'] = ($cache->allowLog() || $useradmin || ($cache->getStatus() != 5 && $cache->getStatus() != 6 && $cache->getStatus() != 7));
|
||||
// check log allowed, depending on cache state and logged in user
|
||||
$validate['logAllowed'] = $cache->allowLog();
|
||||
|
||||
// get user object
|
||||
$user = new user($login->userid);
|
||||
@ -141,16 +141,8 @@
|
||||
if (isset($_POST['submitform']) && $cache->requireLogPW())
|
||||
$validate['logPw'] = $cache->validateLogPW($logType, $_POST['log_pw']);
|
||||
|
||||
// check error
|
||||
$loggable = true;
|
||||
foreach ($validate as $test)
|
||||
{
|
||||
$loggable &= $test;
|
||||
|
||||
// break on error
|
||||
if ($loggable === false)
|
||||
break;
|
||||
}
|
||||
// check for errors
|
||||
$loggable = array_product($validate);
|
||||
|
||||
// prepare duplicate log error
|
||||
$validate['duplicateLog'] = true;
|
||||
@ -186,8 +178,8 @@
|
||||
$cacheLog->setType($logType);
|
||||
$cacheLog->setDate($logDate);
|
||||
$cacheLog->setText($logText);
|
||||
$cacheLog->setTextHtml((($descMode != 1) ? 1 : 0));
|
||||
$cacheLog->setTextHtmlEdit((($descMode == 3) ? 1 : 0));
|
||||
$cacheLog->setTextHtml(($descMode != 1) ? 1 : 0);
|
||||
$cacheLog->setTextHtmlEdit(($descMode == 3) ? 1 : 0);
|
||||
|
||||
// save log values
|
||||
$cacheLog->save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user