mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-05 20:18:42 +00:00
Bug fixes
This commit is contained in:
parent
2f37afb7d6
commit
448f623b4d
|
|
@ -70,17 +70,17 @@ class Auth
|
||||||
/**
|
/**
|
||||||
* Authenticates user.
|
* Authenticates user.
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return int
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function authenticate()
|
public function authenticate() : int
|
||||||
{
|
{
|
||||||
$uid = $this->session->get('UID');
|
$uid = $this->session->get('UID');
|
||||||
|
|
||||||
if ($uid === null) {
|
if (empty($uid)) {
|
||||||
$uid = false;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $uid;
|
return $uid;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class L11nManager
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function __construct(LoggerInterface $logger)
|
public function __construct(LoggerInterface $logger = null)
|
||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|
@ -179,9 +179,11 @@ class L11nManager
|
||||||
$this->loadLanguage($code, $module, $class::getLocalization($code, $theme));
|
$this->loadLanguage($code, $module, $class::getLocalization($code, $theme));
|
||||||
|
|
||||||
if (!isset($this->language[$code][$module][$translation])) {
|
if (!isset($this->language[$code][$module][$translation])) {
|
||||||
$this->logger->warning(FileLogger::MSG_FULL, [
|
if(isset($this->logger)) {
|
||||||
'message' => 'Undefined translation for \'' . $code . '/' . $module . '/' . $translation . '\'.',
|
$this->logger->warning(FileLogger::MSG_FULL, [
|
||||||
]);
|
'message' => 'Undefined translation for \'' . $code . '/' . $module . '/' . $translation . '\'.',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
return 'ERROR';
|
return 'ERROR';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ class FileLogger implements LoggerInterface
|
||||||
private function write(string $message) /* : void */
|
private function write(string $message) /* : void */
|
||||||
{
|
{
|
||||||
$this->createFile();
|
$this->createFile();
|
||||||
if(!is_readable($this->path)) {
|
if(!is_writable($this->path)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -350,7 +350,7 @@ class File extends FileAbstract implements FileInterface
|
||||||
Directory::create(dirname($path), 0644, true);
|
Directory::create(dirname($path), 0644, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable($path)) {
|
if(!is_writable(dirname($path))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class LZW implements CompressionInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$w = chr($compressed[0]);
|
$w = chr($compressed[0]);
|
||||||
$result = $w;
|
$result = $dictionary[$compressed[0]];
|
||||||
$count = count($compressed);
|
$count = count($compressed);
|
||||||
|
|
||||||
for ($i = 1; $i < $count; $i++) {
|
for ($i = 1; $i < $count; $i++) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user