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