new rector conf and checked files
Dieser Commit ist enthalten in:
Ursprung
c9eaa03cd0
Commit
01255ad980
103
conlib/local.php
103
conlib/local.php
|
@ -59,13 +59,13 @@ class DB_ConLite extends DB_Sql {
|
||||||
* - $options['enableProfiling'] (bool) Optional, flag to enable profiling
|
* - $options['enableProfiling'] (bool) Optional, flag to enable profiling
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(array $options = array()) {
|
public function __construct(array $options = []) {
|
||||||
global $cachemeta;
|
global $cachemeta;
|
||||||
|
|
||||||
parent::__construct($options);
|
parent::__construct($options);
|
||||||
|
|
||||||
if (!is_array($cachemeta)) {
|
if (!is_array($cachemeta)) {
|
||||||
$cachemeta = array();
|
$cachemeta = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO check this out
|
// TODO check this out
|
||||||
|
@ -109,7 +109,7 @@ class DB_ConLite extends DB_Sql {
|
||||||
*/
|
*/
|
||||||
public function copyResultToArray($sTable = '') {
|
public function copyResultToArray($sTable = '') {
|
||||||
|
|
||||||
$aValues = array();
|
$aValues = [];
|
||||||
|
|
||||||
|
|
||||||
$aMetadata = $this->metadata($sTable);
|
$aMetadata = $this->metadata($sTable);
|
||||||
|
@ -132,17 +132,8 @@ class DB_ConLite extends DB_Sql {
|
||||||
*
|
*
|
||||||
* @deprecated since version 2.0.0, use DB_ConLite instead
|
* @deprecated since version 2.0.0, use DB_ConLite instead
|
||||||
*/
|
*/
|
||||||
class DB_Contenido extends DB_ConLite {
|
class DB_Contenido extends DB_ConLite
|
||||||
|
{
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @deprecated since version 2.0.0
|
|
||||||
* @param array $options
|
|
||||||
*/
|
|
||||||
public function __construct(array $options = array()) {
|
|
||||||
parent::__construct($options);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Contenido_CT_Sql extends CT_Sql {
|
class Contenido_CT_Sql extends CT_Sql {
|
||||||
|
@ -176,17 +167,12 @@ class Contenido_CT_Sql extends CT_Sql {
|
||||||
* @param string $id The session id (hash)
|
* @param string $id The session id (hash)
|
||||||
* @param string $name Name of the session
|
* @param string $name Name of the session
|
||||||
* @param string $str The value to store
|
* @param string $str The value to store
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
public function ac_store($id, $name, $str) {
|
public function ac_store($id, $name, $str): bool {
|
||||||
switch ($this->encoding_mode) {
|
$str = match ($this->encoding_mode) {
|
||||||
case 'slashes':
|
'slashes' => addslashes($name . ':' . $str),
|
||||||
$str = addslashes($name . ':' . $str);
|
default => base64_encode($name . ':' . $str),
|
||||||
break;
|
};
|
||||||
case 'base64':
|
|
||||||
default:
|
|
||||||
$str = base64_encode($name . ':' . $str);
|
|
||||||
}
|
|
||||||
|
|
||||||
$name = addslashes($name);
|
$name = addslashes($name);
|
||||||
$now = date('YmdHis', time());
|
$now = date('YmdHis', time());
|
||||||
|
@ -195,7 +181,7 @@ class Contenido_CT_Sql extends CT_Sql {
|
||||||
"REPLACE INTO %s (sid, name, val, changed) VALUES ('%s', '%s', '%s', '%s')", $this->database_table, $id, $name, $str, $now
|
"REPLACE INTO %s (sid, name, val, changed) VALUES ('%s', '%s', '%s', '%s')", $this->database_table, $id, $name, $str, $now
|
||||||
);
|
);
|
||||||
|
|
||||||
return ($this->db->query($iquery)) ? true : false;
|
return (bool) $this->db->query($iquery);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -280,14 +266,12 @@ class Contenido_CT_Shm extends CT_Shm {
|
||||||
class Contenido_CT_Session extends CT_Session {
|
class Contenido_CT_Session extends CT_Session {
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->ac_start(array(
|
$this->ac_start([
|
||||||
'namespace' => 'contenido_ct_session_ns',
|
'namespace' => 'contenido_ct_session_ns',
|
||||||
'session.hash_function' => '1', // use sha-1 function
|
'session.hash_function' => '1',
|
||||||
'session.hash_bits_per_character' => '5', // and set 5 character to achieve 32 chars
|
// use sha-1 function
|
||||||
# 'session.save_path' => 'your path',
|
'session.hash_bits_per_character' => '5',
|
||||||
# 'session.name' => 'your session name',
|
]);
|
||||||
# 'session.gc_maxlifetime' => 'your lifetime in seconds',
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -321,8 +305,8 @@ class Contenido_Session extends Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete() {
|
public function delete() {
|
||||||
$oCol = new InUseCollection();
|
$inUseCollection = new InUseCollection();
|
||||||
$oCol->removeSessionMarks($this->id);
|
$inUseCollection->removeSessionMarks($this->id);
|
||||||
parent::delete();
|
parent::delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,6 +420,8 @@ class Contenido_Challenge_Auth extends Auth {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auth_validatelogin() {
|
public function auth_validatelogin() {
|
||||||
|
$pass = null;
|
||||||
|
$uid = null;
|
||||||
global $username, $password, $challenge, $response, $timestamp;
|
global $username, $password, $challenge, $response, $timestamp;
|
||||||
|
|
||||||
if ($password == '') {
|
if ($password == '') {
|
||||||
|
@ -523,7 +509,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
public function auth_loglogin($uid) {
|
public function auth_loglogin($uid) {
|
||||||
global $cfg, $client, $lang, $auth, $sess, $saveLoginTime;
|
global $cfg, $client, $lang, $auth, $sess, $saveLoginTime;
|
||||||
|
|
||||||
$perm = new Contenido_Perm();
|
$contenidoPerm = new Contenido_Perm();
|
||||||
$timestamp = date('Y-m-d H:i:s');
|
$timestamp = date('Y-m-d H:i:s');
|
||||||
$idcatart = '0';
|
$idcatart = '0';
|
||||||
|
|
||||||
|
@ -540,7 +526,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
$iTmpClient = $this->db->f('idclient');
|
$iTmpClient = $this->db->f('idclient');
|
||||||
$iTmpLang = $this->db->f('idlang');
|
$iTmpLang = $this->db->f('idlang');
|
||||||
|
|
||||||
if ($perm->have_perm_client_lang($iTmpClient, $iTmpLang)) {
|
if ($contenidoPerm->have_perm_client_lang($iTmpClient, $iTmpLang)) {
|
||||||
$client = $iTmpClient;
|
$client = $iTmpClient;
|
||||||
$lang = $iTmpLang;
|
$lang = $iTmpLang;
|
||||||
$bFound = true;
|
$bFound = true;
|
||||||
|
@ -565,7 +551,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$idaction = $perm->getIDForAction('login');
|
$idaction = $contenidoPerm->getIDForAction('login');
|
||||||
$lastentry = $this->db->nextid($cfg['tab']['actionlog']);
|
$lastentry = $this->db->nextid($cfg['tab']['actionlog']);
|
||||||
|
|
||||||
$sql = "INSERT INTO
|
$sql = "INSERT INTO
|
||||||
|
@ -585,9 +571,12 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auth_validatelogin() {
|
public function auth_validatelogin() {
|
||||||
|
$uid = null;
|
||||||
|
$perm = null;
|
||||||
|
$pass = null;
|
||||||
global $username, $password, $challenge, $response, $formtimestamp, $auth_handlers;
|
global $username, $password, $challenge, $response, $formtimestamp, $auth_handlers;
|
||||||
|
|
||||||
$gperm = array();
|
$gperm = [];
|
||||||
|
|
||||||
if ($password == '') {
|
if ($password == '') {
|
||||||
return false;
|
return false;
|
||||||
|
@ -622,12 +611,10 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
|
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
|
||||||
|
|
||||||
$bInMaintenance = false;
|
$bInMaintenance = false;
|
||||||
if ($sMaintenanceMode == 'enabled') {
|
|
||||||
#sysadmins are allowed to login every time
|
#sysadmins are allowed to login every time
|
||||||
if (!preg_match('/sysadmin/', $perm)) {
|
if ($sMaintenanceMode == 'enabled' && !preg_match('/sysadmin/', $perm)) {
|
||||||
$bInMaintenance = true;
|
$bInMaintenance = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($bInMaintenance) {
|
if ($bInMaintenance) {
|
||||||
unset($uid);
|
unset($uid);
|
||||||
|
@ -635,17 +622,14 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
unset($pass);
|
unset($pass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($auth_handlers) && !$bInMaintenance) {
|
if (is_array($auth_handlers) && !$bInMaintenance && array_key_exists($pass, $auth_handlers)) {
|
||||||
if (array_key_exists($pass, $auth_handlers)) {
|
|
||||||
$success = call_user_func($auth_handlers[$pass], $username, $password);
|
$success = call_user_func($auth_handlers[$pass], $username, $password);
|
||||||
|
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$uid = md5($username);
|
$uid = md5($username);
|
||||||
$pass = md5($password);
|
$pass = md5($password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($uid == false) {
|
if ($uid == false) {
|
||||||
## No user found, sleep and exit
|
## No user found, sleep and exit
|
||||||
|
@ -664,9 +648,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
|
||||||
$gperm[] = $this->db->f('perms');
|
$gperm[] = $this->db->f('perms');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($gperm)) {
|
|
||||||
$perm = implode(',', $gperm);
|
$perm = implode(',', $gperm);
|
||||||
}
|
|
||||||
|
|
||||||
if ($response == '') { ## True when JS is disabled
|
if ($response == '') { ## True when JS is disabled
|
||||||
if (md5($password) != $pass) { ## md5 hash for non-JavaScript browsers
|
if (md5($password) != $pass) { ## md5 hash for non-JavaScript browsers
|
||||||
|
@ -718,8 +700,6 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
|
||||||
global $password;
|
global $password;
|
||||||
|
|
||||||
if ($password == '') {
|
if ($password == '') {
|
||||||
/* Stay as nobody when an empty password is passed */
|
|
||||||
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,13 +716,18 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auth_validatelogin() {
|
public function auth_validatelogin() {
|
||||||
|
$perm = null;
|
||||||
|
$gperm = [];
|
||||||
|
$pass = null;
|
||||||
global $username, $password, $challenge, $response, $auth_handlers, $client;
|
global $username, $password, $challenge, $response, $auth_handlers, $client;
|
||||||
|
|
||||||
$client = (int) $client;
|
$client = (int) $client;
|
||||||
|
|
||||||
if (isset($username)) {
|
if (isset($username)) {
|
||||||
$this->auth['uname'] = $username; ## This provides access for 'loginform.ihtml'
|
$this->auth['uname'] = $username;
|
||||||
} else if ($this->nobody) { ## provides for 'default login cancel'
|
## This provides access for 'loginform.ihtml'
|
||||||
|
} elseif ($this->nobody) {
|
||||||
|
## provides for 'default login cancel'
|
||||||
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
|
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
|
||||||
return $uid;
|
return $uid;
|
||||||
}
|
}
|
||||||
|
@ -768,8 +753,7 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
|
||||||
$perm = $this->db->f('perms');
|
$perm = $this->db->f('perms');
|
||||||
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
|
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
|
||||||
|
|
||||||
if (is_array($auth_handlers)) {
|
if (is_array($auth_handlers) && array_key_exists($pass, $auth_handlers)) {
|
||||||
if (array_key_exists($pass, $auth_handlers)) {
|
|
||||||
$success = call_user_func($auth_handlers[$pass], $username, $password);
|
$success = call_user_func($auth_handlers[$pass], $username, $password);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$uid = md5($username);
|
$uid = md5($username);
|
||||||
|
@ -777,7 +761,6 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($uid !== false) {
|
if ($uid !== false) {
|
||||||
$this->db->query(sprintf("SELECT a.group_id AS group_id, a.perms AS perms " .
|
$this->db->query(sprintf("SELECT a.group_id AS group_id, a.perms AS perms " .
|
||||||
|
@ -796,11 +779,9 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
|
||||||
$gperm[] = $this->db->f('perms');
|
$gperm[] = $this->db->f('perms');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($gperm)) {
|
|
||||||
$perm = implode(',', $gperm);
|
$perm = implode(',', $gperm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($uid == false) {
|
if ($uid == false) {
|
||||||
## User not found, sleep and exit
|
## User not found, sleep and exit
|
||||||
|
@ -837,16 +818,16 @@ function register_auth_handler($aHandlers) {
|
||||||
global $auth_handlers;
|
global $auth_handlers;
|
||||||
|
|
||||||
if (!is_array($auth_handlers)) {
|
if (!is_array($auth_handlers)) {
|
||||||
$auth_handlers = array();
|
$auth_handlers = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($aHandlers)) {
|
if (!is_array($aHandlers)) {
|
||||||
$aHandlers = Array($aHandlers);
|
$aHandlers = [$aHandlers];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($aHandlers as $sHandler) {
|
foreach ($aHandlers as $aHandler) {
|
||||||
if (!in_array($sHandler, $auth_handlers)) {
|
if (!in_array($aHandler, $auth_handlers)) {
|
||||||
$auth_handlers[md5($sHandler)] = $sHandler;
|
$auth_handlers[md5($aHandler)] = $aHandler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,8 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
|
|
||||||
$_PHPLIB = array();
|
$_PHPLIB = [];
|
||||||
$_PHPLIB['libdir'] = str_replace ('\\', '/', dirname(__FILE__) . '/');
|
$_PHPLIB['libdir'] = str_replace ('\\', '/', __DIR__ . '/');
|
||||||
|
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
|
||||||
|
|
11
rector.php
11
rector.php
|
@ -1,12 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Rector\Config\RectorConfig;
|
use Rector\Config\RectorConfig;
|
||||||
use Rector\Set\ValueObject\LevelSetList;
|
use Rector\Set\ValueObject\LevelSetList;
|
||||||
|
use Rector\Set\ValueObject\SetList;
|
||||||
|
|
||||||
return static function (RectorConfig $rectorConfig): void {
|
return static function (RectorConfig $rectorConfig): void {
|
||||||
$rectorConfig->parallel();
|
$rectorConfig->parallel();
|
||||||
$rectorConfig->paths([
|
$rectorConfig->paths([
|
||||||
__DIR__,
|
__DIR__.'/conlite',
|
||||||
]);
|
]);
|
||||||
$rectorConfig->skip([
|
$rectorConfig->skip([
|
||||||
__DIR__ . DIRECTORY_SEPARATOR . 'node_modules',
|
__DIR__ . DIRECTORY_SEPARATOR . 'node_modules',
|
||||||
|
@ -14,5 +16,10 @@ return static function (RectorConfig $rectorConfig): void {
|
||||||
__DIR__ . DIRECTORY_SEPARATOR . 'vendor',
|
__DIR__ . DIRECTORY_SEPARATOR . 'vendor',
|
||||||
]);
|
]);
|
||||||
$rectorConfig->importNames();
|
$rectorConfig->importNames();
|
||||||
$rectorConfig->import(LevelSetList::UP_TO_PHP_80);
|
$rectorConfig->sets([
|
||||||
|
LevelSetList::UP_TO_PHP_80,
|
||||||
|
SetList::CODE_QUALITY,
|
||||||
|
SetList::DEAD_CODE,
|
||||||
|
SetList::NAMING,
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
|
Laden…
In neuem Issue referenzieren