registration fixes

This commit is contained in:
Dennis Eichhorn 2023-03-24 16:20:20 +01:00
parent 68e98a308a
commit 3b3203e242
159 changed files with 984 additions and 508 deletions

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\Application\ApplicationAbstract;
* Media class.
*
* @package Modules\Admin\Admin\Install
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
@ -43,44 +43,35 @@ class Media
{
$media = \Modules\Media\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Media.install.json']);
SettingMapper::create()->execute(
new Setting(
0,
SettingsEnum::DEFAULT_LIST_EXPORTS,
(string) $media['collection'][4]['id'],
'\\d+',
module: 'Admin'
)
);
SettingMapper::create()->execute(
new Setting(
0,
SettingsEnum::DEFAULT_LETTERS,
(string) $media['collection'][5]['id'],
'\\d+',
module: 'Admin'
)
);
SettingMapper::create()->execute(
new Setting(
0,
SettingsEnum::DEFAULT_ASSETS,
(string) $media['upload'][0]['id'],
'\\d+',
module: 'Admin'
)
);
SettingMapper::create()->execute(
new Setting(
0,
SettingsEnum::DEFAULT_TEMPLATES,
(string) $media['upload'][1]['id'],
'\\d+',
module: 'Admin'
)
\Modules\Admin\Admin\Installer::installExternal($app,
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LIST_EXPORTS,
'content' => (string) $media['collection'][4]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LETTERS,
'content' => (string) $media['collection'][5]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_ASSETS,
'content' => (string) $media['upload'][0]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_TEMPLATES,
'content' => (string) $media['upload'][1]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
]
);
}
}

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -1,15 +1,94 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Media
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
/**
* Default PDF class.
*
* @package Modules\Media
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class DefaultPdf extends TCPDF
{
/**
* Font
*
* @var string
* @since 1.0.0
*/
public string $fontName = '';
/**
* Font size
*
* @var int
* @since 1.0.0
*/
public int $fontSize = 8;
/**
* Side margins
*
* @var int
* @since 1.0.0
*/
public int $sideMargin = 15;
//Page header
public function Header() {
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct()
{
parent::__construct('P', 'mm', 'A4', true, 'UTF-8', false);
$this->SetCreator("Jingga");
// set default header data
$this->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'Jingga', 'Business solutions made simple.');
// set header and footer fonts
$this->SetHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
$this->SetFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
// set default monospaced font
$this->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$this->SetMargins(15, 30, 15);
// set auto page breaks
$this->SetAutoPageBreak(true, 25);
// set image scale factor
$this->SetImageScale(PDF_IMAGE_SCALE_RATIO);
// add a page
$this->AddPage();
}
/**
* Create header
*
* @return void
*
* @since 1.0.0
*/
public function Header() : void
{
if ($this->header_xobjid === false) {
$this->header_xobjid = $this->startTemplate($this->w, 0);
@ -50,8 +129,15 @@ class DefaultPdf extends TCPDF
}
}
// Page footer
public function Footer() {
/**
* Create footer
*
* @return void
*
* @since 1.0.0
*/
public function Footer() : void
{
$this->SetY(-25);
$this->SetFont('helvetica', 'I', 7);
@ -76,35 +162,6 @@ class DefaultPdf extends TCPDF
$this->SetXY(25 + 45 + 35 + 15 + 40, -15, true);
$this->MultiCell(35, 0, "www.jingga.app\ninfo@jingga.app\n+49 0152 ???????", 0, 'L', false, 1, null, null, true, 0, false, true, 0, 'B');
}
public function __construct()
{
parent::__construct('P', 'mm', 'A4', true, 'UTF-8', false);
$this->SetCreator("Jingga");
// set default header data
$this->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'Jingga', 'Business solutions made simple.');
// set header and footer fonts
$this->SetHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);
$this->SetFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);
// set default monospaced font
$this->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$this->SetMargins(15, 30, 15);
// set auto page breaks
$this->SetAutoPageBreak(true, 25);
// set image scale factor
$this->SetImageScale(PDF_IMAGE_SCALE_RATIO);
// add a page
$this->AddPage();
}
}
/*

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -15,6 +15,7 @@ declare(strict_types=1);
require_once __DIR__ . '/../phpOMS/Autoloader.php';
use phpOMS\Autoloader;
Autoloader::addPath(__DIR__ . '/../Resources');
$media = $this->getData('media');
@ -22,7 +23,7 @@ $data = $this->getData('data') ?? [];
include $media->getSourceByName('template.php')->getAbsolutePath();
$word = new DefaultWord();
$word = new DefaultWord();
$section = $word->createFirstPage();
$file = \tempnam(\sys_get_temp_dir(), 'oms_');
@ -30,4 +31,4 @@ $writer->save($file);
echo \file_get_contents($file);
\unlink($file);
\unlink($file);

View File

@ -0,0 +1,38 @@
[
{
"type": "email_template",
"from": "",
"to": "",
"cc": "",
"bcc": "",
"subject": "Registration confirmation",
"ishtml": true,
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Registration Confirmation</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Registration Confirmation</h1><p style=\"margin-bottom: 20px;\">Dear {user_name},</p><p style=\"margin-bottom: 20px;\">Thank you for registering for our service. Your account has been successfully created.</p><p style=\"margin-bottom: 20px;\">Your username is: {user_name}</p><p style=\"margin-bottom: 40px;\">To get started, please click on the following confirmation link:</p><a href=\"{confirmation_link}\" style=\"display: inline-block; padding: 10px 20px; background-color: #0070c0; color: #ffffff; text-decoration: none;\">Confirm</a></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Dear {user_name},\n\nThank you for registering for our service. Your account has been successfully created.\n\nYour username is: {user_name}\n\nTo get started, please click on the following confirmation link: {confirmation_link}.\n\nThank you,\n\n[Your Company]",
"send": false
},
{
"type": "email_template",
"from": "",
"to": "",
"cc": "",
"bcc": "",
"subject": "Account recovery",
"ishtml": true,
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Registration Confirmation</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Registration Confirmation</h1><p style=\"margin-bottom: 20px;\">Dear [Name],</p><p style=\"margin-bottom: 20px;\">Thank you for registering for our service. Your account has been successfully created.</p><p style=\"margin-bottom: 20px;\">Your username is: [Username]</p><p style=\"margin-bottom: 40px;\">To get started, please click on the following confirmation link:</p><a href=\"[Login Link]\" style=\"display: inline-block; padding: 10px 20px; background-color: #0070c0; color: #ffffff; text-decoration: none;\">Confirm</a></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Dear [Name],\n\nThank you for registering for our service. Your account has been successfully created.\n\nYour username is: [Username]\n\nTo get started, please click on the following confirmation link: [Login Link].\n\nThank you,\n\n[Your Company]",
"send": false
},
{
"type": "email_template",
"from": "",
"to": "",
"cc": "",
"bcc": "",
"subject": "Failed login",
"ishtml": true,
"body": "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Registration Confirmation</title></head><body style=\"font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"600\" style=\"margin: 0 auto; background-color: #ffffff;\"><tr><td style=\"padding: 40px 0; text-align: center;\"><h1 style=\"margin-top: 0; color: #000000; font-size: 24px;\">Registration Confirmation</h1><p style=\"margin-bottom: 20px;\">Dear [Name],</p><p style=\"margin-bottom: 20px;\">Thank you for registering for our service. Your account has been successfully created.</p><p style=\"margin-bottom: 20px;\">Your username is: [Username]</p><p style=\"margin-bottom: 40px;\">To get started, please click on the following confirmation link:</p><a href=\"[Login Link]\" style=\"display: inline-block; padding: 10px 20px; background-color: #0070c0; color: #ffffff; text-decoration: none;\">Confirm</a></td></tr></table></td></tr></table></body></html>",
"bodyalt": "Dear [Name],\n\nThank you for registering for our service. Your account has been successfully created.\n\nYour username is: [Username]\n\nTo get started, please click on the following confirmation link: [Login Link].\n\nThank you,\n\n[Your Company]",
"send": false
}
]

View File

@ -0,0 +1,81 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Admin\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Admin\Admin\Install;
use Model\Setting;
use Model\SettingMapper;
use Modules\Admin\Models\SettingsEnum;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Uri\HttpUri;
/**
* Media class.
*
* @package Modules\Admin\Admin\Install
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class Messages
{
/**
* Install media providing
*
* @param ApplicationAbstract $app Application
* @param string $path Module path
*
* @return void
*
* @since 1.0.0
*/
public static function install(ApplicationAbstract $app, string $path) : void
{
$messages = \Modules\Messages\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Messages.install.json']);
/** @var \Modules\Admin\Controller\ApiController $module */
$module = $app->moduleManager->get('Admin');
$settings = [
[
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE,
'content' => (string) $messages['email_template'][0]['id'],
'module' => 'Admin',
],
[
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_FORGOT_PASSWORD_TEMPLATE,
'content' => (string) $messages['email_template'][1]['id'],
'module' => 'Admin',
],
[
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_FAILED_TEMPLATE,
'content' => (string) $messages['email_template'][2]['id'],
'module' => 'Admin',
],
];
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request->header->account = 1;
$request->setData('settings', \json_encode($settings));
$module->apiSettingsSet($request, $response);
}
}

View File

@ -19,7 +19,7 @@
"type": 2,
"subtype": 1,
"name": "Groups",
"uri": "{/lang}/{/app}/admin/group/list",
"uri": "{/base}/admin/group/list",
"target": "self",
"icon": null,
"order": 2,
@ -33,7 +33,7 @@
"type": 3,
"subtype": 1,
"name": "List",
"uri": "{/lang}/{/app}/admin/group/list",
"uri": "{/base}/admin/group/list",
"target": "self",
"icon": null,
"order": 1,
@ -48,7 +48,7 @@
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "{/lang}/{/app}/admin/group/create?{?}",
"uri": "{/base}/admin/group/create?{?}",
"target": "self",
"icon": null,
"order": 5,
@ -65,7 +65,7 @@
"type": 2,
"subtype": 1,
"name": "Accounts",
"uri": "{/lang}/{/app}/admin/account/list",
"uri": "{/base}/admin/account/list",
"target": "self",
"icon": null,
"order": 4,
@ -79,7 +79,7 @@
"type": 3,
"subtype": 1,
"name": "List",
"uri": "{/lang}/{/app}/admin/account/list",
"uri": "{/base}/admin/account/list",
"target": "self",
"icon": null,
"order": 1,
@ -94,7 +94,7 @@
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "{/lang}/{/app}/admin/account/create?{?}",
"uri": "{/base}/admin/account/create?{?}",
"target": "self",
"icon": null,
"order": 5,
@ -111,7 +111,7 @@
"type": 2,
"subtype": 1,
"name": "Modules",
"uri": "{/lang}/{/app}/admin/module/list",
"uri": "{/base}/admin/module/list",
"target": "self",
"icon": null,
"order": 6,
@ -125,7 +125,7 @@
"type": 3,
"subtype": 1,
"name": "Info",
"uri": "{/lang}/{/app}/admin/module/info?{?}",
"uri": "{/base}/admin/module/info?{?}",
"target": "self",
"icon": null,
"order": 1,
@ -140,7 +140,7 @@
"type": 3,
"subtype": 1,
"name": "Settings",
"uri": "{/lang}/{/app}/admin/module/settings?{?}",
"uri": "{/base}/admin/module/settings?{?}",
"target": "self",
"icon": null,
"order": 5,
@ -155,7 +155,7 @@
"type": 3,
"subtype": 1,
"name": "Routes",
"uri": "{/lang}/{/app}/admin/module/route/list?{?}",
"uri": "{/base}/admin/module/route/list?{?}",
"target": "self",
"icon": null,
"order": 15,
@ -170,7 +170,7 @@
"type": 3,
"subtype": 1,
"name": "Hooks",
"uri": "{/lang}/{/app}/admin/module/hook/list?{?}",
"uri": "{/base}/admin/module/hook/list?{?}",
"target": "self",
"icon": null,
"order": 15,
@ -185,7 +185,7 @@
"type": 3,
"subtype": 1,
"name": "Log",
"uri": "{/lang}/{/app}/admin/module/log?{?}",
"uri": "{/base}/admin/module/log?{?}",
"target": "self",
"icon": null,
"order": 20,

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Application\ApplicationAbstract;
* Navigation class.
*
* @package Modules\Admin\Admin\Install
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

170
Admin/Install/settings.php Normal file
View File

@ -0,0 +1,170 @@
<?php
declare(strict_types=1);
use Modules\Admin\Models\SettingsEnum;
use phpOMS\Message\Mail\SubmitType;
return [
[
'type' => 'setting',
'name' => SettingsEnum::PASSWORD_PATTERN,
'content' => '/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[.,\/\(\)\{\}\[\]#?!@$%^&*+=\':"-]).{8,}$/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGIN_TRIES,
'content' => '3',
'pattern' => '/\\d+/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::PASSWORD_INTERVAL,
'content' => '90',
'pattern' => '/\\d+/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::PASSWORD_HISTORY,
'content' => '3',
'pattern' => '/\\d+/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGGING_STATUS,
'content' => '1',
'pattern' => '/[0-3]/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGGING_PATH,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_UNIT,
'content' => '1',
'pattern' => '/\\d+/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGIN_STATUS,
'content' => '1',
'pattern' => '/[0-3]/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE,
'content' => '',
'pattern' => '/\\d*/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGIN_MAIL_FORGOT_PASSWORD_TEMPLATE,
'content' => '',
'pattern' => '/\\d*/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::LOGIN_MAIL_FAILED_TEMPLATE,
'content' => '',
'pattern' => '/\\d*/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LOCALIZATION,
'content' => '1',
'pattern' => '/\\d+/',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_OUT,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_PORT_OUT,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_IN,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_PORT_IN,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_ADDR,
'content' => '',
'pattern' => "/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/",
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_TYPE,
'content' => SubmitType::MAIL,
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_USER,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_PASS,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_CERT,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_KEY,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_KEYPASS,
'content' => '',
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_TLS,
'content' => (string) false,
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_APP,
'content' => (string) true,
'module' => 'Admin',
],
];

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum;
* Install type enum.
*
* @package Modules\Admin\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -24,18 +24,20 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\Localization\Localization;
use phpOMS\Message\Mail\SubmitType;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
use phpOMS\System\File\PathException;
use phpOMS\System\OperatingSystem;
use phpOMS\System\SystemType;
use phpOMS\Uri\HttpUri;
/**
* Installer class.
*
* @package Modules\Admin\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
@ -67,6 +69,11 @@ final class Installer extends InstallerAbstract
self::installDefaultSettings();
$sqlite->close();
$settings = include __DIR__ . '/Install/settings.php';
foreach ($settings as $setting) {
self::createSettings($app, $setting);
}
}
/**
@ -78,38 +85,6 @@ final class Installer extends InstallerAbstract
**/
private static function installDefaultSettings() : void
{
SettingMapper::create()->execute(new Setting(0, SettingsEnum::PASSWORD_PATTERN, '/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGIN_TRIES, '3', pattern: '/\\d+/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGIN_TIMEOUT, '3', pattern: '/\\d+/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::PASSWORD_INTERVAL, '90', pattern: '/\\d+/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::PASSWORD_HISTORY, '3', pattern: '/\\d+/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGGING_STATUS, '1', pattern: '/[0-3]/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGGING_PATH, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::DEFAULT_UNIT, '1', pattern: '/\\d+/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGIN_STATUS, '1', pattern: '/[0-3]', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE, '', pattern: '/\\d*/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGIN_MAIL_FORGOT_PASSWORD_TEMPLATE, '', pattern: '/\\d*/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::LOGIN_MAIL_FAILED_TEMPLATE, '', pattern: '/\\d*/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::DEFAULT_LOCALIZATION, '1', pattern: '/\\d+/', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_OUT, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_PORT_OUT, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_IN, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_PORT_IN, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_ADDR, '', pattern: "/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/", module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_TYPE, SubmitType::MAIL, module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_USER, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_PASS, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_CERT, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_KEY, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_KEYPASS, '', module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::MAIL_SERVER_TLS, (string) false, module: 'Admin'));
SettingMapper::create()->execute(new Setting(0, SettingsEnum::GROUP_GENERATE_AUTOMATICALLY_APP, (string) true, module: 'Admin'));
$cmdResult = \shell_exec(
(OperatingSystem::getSystem() === SystemType::WIN
? 'php.exe'
@ -157,9 +132,9 @@ final class Installer extends InstallerAbstract
foreach ($countries as $country) {
$query->values(
$country['country_name'] === null ? null : \trim($country['country_name']),
$country['country_code2'] === null ? null : \trim($country['country_code2']),
$country['country_code3'] === null ? null : \trim($country['country_code3']),
$country['country_name'] === null ? null : \trim((string) $country['country_name']),
$country['country_code2'] === null ? null : \trim((string) $country['country_code2']),
$country['country_code3'] === null ? null : \trim((string) $country['country_code3']),
$country['country_numeric'],
$country['country_region'],
(int) $country['country_developed']
@ -196,12 +171,12 @@ final class Installer extends InstallerAbstract
foreach ($languages as $language) {
$query->values(
$language['language_name'] === null ? null : \trim($language['language_name']),
$language['language_native'] === null ? null : \trim($language['language_native']),
$language['language_639_1'] === null ? null : \trim($language['language_639_1']),
$language['language_639_2T'] === null ? null : \trim($language['language_639_2T']),
$language['language_639_2B'] === null ? null : \trim($language['language_639_2B']),
$language['language_639_3'] === null ? null : \trim($language['language_639_3'])
$language['language_name'] === null ? null : \trim((string) $language['language_name']),
$language['language_native'] === null ? null : \trim((string) $language['language_native']),
$language['language_639_1'] === null ? null : \trim((string) $language['language_639_1']),
$language['language_639_2T'] === null ? null : \trim((string) $language['language_639_2T']),
$language['language_639_2B'] === null ? null : \trim((string) $language['language_639_2B']),
$language['language_639_3'] === null ? null : \trim((string) $language['language_639_3'])
);
}
@ -236,13 +211,13 @@ final class Installer extends InstallerAbstract
foreach ($currencies as $currency) {
$query->values(
$currency['currency_id'],
$currency['currency_name'] === null ? null : \trim($currency['currency_name']),
$currency['currency_code'] === null ? null : \trim($currency['currency_code']),
$currency['currency_number'] === null ? null : \trim($currency['currency_number']),
$currency['currency_symbol'] === null ? null : \trim($currency['currency_symbol']),
$currency['currency_name'] === null ? null : \trim((string) $currency['currency_name']),
$currency['currency_code'] === null ? null : \trim((string) $currency['currency_code']),
$currency['currency_number'] === null ? null : \trim((string) $currency['currency_number']),
$currency['currency_symbol'] === null ? null : \trim((string) $currency['currency_symbol']),
$currency['currency_subunits'],
$currency['currency_decimal'] === null ? null : \trim($currency['currency_decimal']),
$currency['currency_countries'] === null ? null : \trim($currency['currency_countries'])
$currency['currency_decimal'] === null ? null : \trim((string) $currency['currency_decimal']),
$currency['currency_countries'] === null ? null : \trim((string) $currency['currency_countries'])
);
}
@ -297,18 +272,41 @@ final class Installer extends InstallerAbstract
/**
* Create settings.
*
* @param ApplicationAbstract $app Database instance
* @param array $setting Media info
* @param ApplicationAbstract $app Database instance
* @param array $data Setting data
*
* @return array
*
* @since 1.0.0
*/
private static function createSettings(ApplicationAbstract $app, array $setting) : array
private static function createSettings(ApplicationAbstract $app, array $data) : array
{
unset($setting['type']);
$app->appSettings->create($setting);
/** @var \Modules\Admin\Controller\ApiController $module */
$module = $app->moduleManager->get('Admin');
return $setting;
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request->header->account = 1;
$request->setData('id', $data['id'] ?? 0);
$request->setData('name', $data['name'] ?? '');
$request->setData('content', $data['content'] ?? '');
$request->setData('pattern', $data['pattern'] ?? '');
$request->setData('unit', $data['unit'] ?? null);
$request->setData('app', $data['app'] ?? null);
$request->setData('module', $data['module'] ?? null);
$request->setData('group', $data['group'] ?? null);
$request->setData('account', $data['account'] ?? null);
$module->apiSettingsCreate($request, $response);
$responseData = $response->get('');
if (!\is_array($responseData)) {
return [];
}
return !\is_array($responseData['response'])
? $responseData['response']->toArray()
: $responseData['response'];
}
}

View File

@ -6,7 +6,7 @@
*
* @package Modules
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -103,7 +103,7 @@ echo $this->getData('nav')->render();
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordRegex'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iPassword" name="settings_1000000001" type="text" value="<?= $this->printHtml($generalSettings['1000000001:::Admin']->content); ?>" placeholder="&#xf023; ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
<input id="iPassword" name="settings_1000000001" type="text" value="<?= $this->printHtml($generalSettings['1000000001']->content); ?>" placeholder="&#xf023; ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
</div>
<div class="form-group">
@ -112,7 +112,7 @@ echo $this->getData('nav')->render();
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:LoginRetries'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iLoginRetries" name="settings_1000000005" type="number" value="<?= $this->printHtml($generalSettings['1000000005:::Admin']->content); ?>" min="-1">
<input id="iLoginRetries" name="settings_1000000005" type="number" value="<?= $this->printHtml($generalSettings['1000000005']->content); ?>" min="-1">
</div>
<div class="form-group">
@ -121,7 +121,7 @@ echo $this->getData('nav')->render();
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:TimeoutPeriod'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iTimeoutPeriod" name="settings_1000000002" type="number" value="<?= $this->printHtml($generalSettings['1000000002:::Admin']->content); ?>">
<input id="iTimeoutPeriod" name="settings_1000000002" type="number" value="<?= $this->printHtml($generalSettings['1000000002']->content); ?>">
</div>
<div class="form-group">
@ -130,7 +130,7 @@ echo $this->getData('nav')->render();
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordChangeInterval'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iPasswordChangeInterval" name="settings_1000000003" type="number" value="<?= $this->printHtml($generalSettings['1000000003:::Admin']->content); ?>">
<input id="iPasswordChangeInterval" name="settings_1000000003" type="number" value="<?= $this->printHtml($generalSettings['1000000003']->content); ?>">
</div>
<div class="form-group">
@ -139,7 +139,7 @@ echo $this->getData('nav')->render();
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordHistory'); ?>"><i class="fa fa-info-circle"></i></i>
</label>
<input id="iPasswordHistory" name="settings_1000000004" type="number" value="<?= $this->printHtml($generalSettings['1000000004:::Admin']->content); ?>">
<input id="iPasswordHistory" name="settings_1000000004" type="number" value="<?= $this->printHtml($generalSettings['1000000004']->content); ?>">
</div>
</div>
@ -167,7 +167,7 @@ echo $this->getData('nav')->render();
<div class="form-group">
<label for="iLogPath"><?= $this->getHtml('LogPath'); ?></label>
<input id="iLogPath" name="settings_1000000007" type="text" value="<?= $this->printHtml($generalSettings['1000000007:::Admin']->content); ?>" placeholder="&#xf040; /Logs">
<input id="iLogPath" name="settings_1000000007" type="text" value="<?= $this->printHtml($generalSettings['1000000007']->content); ?>" placeholder="&#xf040; /Logs">
</div>
</div>
<div class="portlet-foot">

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Module\StatusAbstract;
* Activate class.
*
* @package Modules\Admin\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Module\UninstallerAbstract;
* Uninstall class.
*
* @package Modules\Admin\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\System\File\Local\Directory;
* Update class.
*
* @package Modules\Admin\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -42,6 +42,7 @@ use Modules\Admin\Models\SettingsEnum;
use Modules\Media\Models\Collection;
use Modules\Media\Models\CollectionMapper;
use Modules\Media\Models\UploadFile;
use Modules\Messages\Models\EmailMapper;
use phpOMS\Account\AccountStatus;
use phpOMS\Account\AccountType;
use phpOMS\Account\GroupStatus;
@ -93,7 +94,7 @@ use phpOMS\Version\Version;
* This class is responsible for the basic admin activities such as managing accounts, groups, permissions and modules.
*
* @package Modules\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
@ -117,8 +118,8 @@ final class ApiController extends Controller
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
$login = AccountMapper::login(
(string) ($request->getData('user') ?? ''),
(string) ($request->getData('pass') ?? '')
$request->getDataString('user') ?? '',
$request->getDataString('pass') ?? ''
);
if ($login >= LoginReturnType::OK) {
@ -191,27 +192,42 @@ final class ApiController extends Controller
SettingsEnum::MAIL_SERVER_PASS,
SettingsEnum::MAIL_SERVER_TLS,
],
unit: $this->app->unitId,
module: 'Admin'
);
$handler = new MailHandler();
$handler->setMailer($emailSettings[SettingsEnum::MAIL_SERVER_TYPE . ':::Admin']->content ?? SubmitType::MAIL);
$handler->useAutoTLS = (bool) ($emailSettings[SettingsEnum::MAIL_SERVER_TLS . ':::Admin']->content ?? false);
if (($emailSettings[SettingsEnum::MAIL_SERVER_TYPE . ':::Admin']->content ?? SubmitType::MAIL) === SubmitType::SMTP) {
$smtp = new Smtp();
$handler->smtp = $smtp;
$handler->useSMTPAuth = true;
if (empty($emailSettings)) {
/** @var \Model\Setting[] $emailSettings */
$emailSettings = $this->app->appSettings->get(
names: [
SettingsEnum::MAIL_SERVER_OUT,
SettingsEnum::MAIL_SERVER_PORT_OUT,
SettingsEnum::MAIL_SERVER_TYPE,
SettingsEnum::MAIL_SERVER_USER,
SettingsEnum::MAIL_SERVER_PASS,
SettingsEnum::MAIL_SERVER_TLS,
],
module: 'Admin'
);
}
if (!empty($port = $emailSettings[SettingsEnum::MAIL_SERVER_PORT_OUT . ':::Admin']->content)) {
$handler = new MailHandler();
$handler->setMailer($emailSettings[SettingsEnum::MAIL_SERVER_TYPE]->content ?? SubmitType::MAIL);
$handler->useAutoTLS = (bool) ($emailSettings[SettingsEnum::MAIL_SERVER_TLS]->content ?? false);
if (($emailSettings[SettingsEnum::MAIL_SERVER_TYPE]->content ?? SubmitType::MAIL) === SubmitType::SMTP) {
$smtp = new Smtp();
$handler->smtp = $smtp;
}
if (!empty($port = $emailSettings[SettingsEnum::MAIL_SERVER_PORT_OUT]->content)) {
$handler->port = (int) $port;
}
$handler->host = $emailSettings[SettingsEnum::MAIL_SERVER_OUT . ':::Admin']->content ?? 'localhost';
$handler->hostname = $emailSettings[SettingsEnum::MAIL_SERVER_OUT . ':::Admin']->content ?? '';
$handler->username = $emailSettings[SettingsEnum::MAIL_SERVER_USER . ':::Admin']->content ?? '';
$handler->password = $emailSettings[SettingsEnum::MAIL_SERVER_PASS . ':::Admin']->content ?? '';
$handler->host = $emailSettings[SettingsEnum::MAIL_SERVER_OUT]->content ?? 'localhost';
$handler->hostname = $emailSettings[SettingsEnum::MAIL_SERVER_OUT]->content ?? '';
$handler->username = $emailSettings[SettingsEnum::MAIL_SERVER_USER]->content ?? '';
$handler->password = $emailSettings[SettingsEnum::MAIL_SERVER_PASS]->content ?? '';
return $handler;
}
@ -232,27 +248,20 @@ final class ApiController extends Controller
public function apiForgot(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{
/** @var \Modules\Admin\Models\Account $account */
$account = !empty($request->getData('login'))
? AccountMapper::get()->where('login', (string) $request->getData('login'))->execute()
$account = !empty($request->getData('user'))
? AccountMapper::get()->where('login', (string) $request->getData('user'))->execute()
: AccountMapper::get()->where('email', (string) $request->getData('email'))->execute();
/** @var \Model\Setting[] $forgotten */
$forgotten = $this->app->appSettings->get(
names: [SettingsEnum::LOGIN_FORGOTTEN_DATE, SettingsEnum::LOGIN_FORGOTTEN_COUNT],
module: self::NAME,
module: 'Admin',
account: $account->getId()
);
/** @var \Model\Setting[] $emailSettings */
$emailSettings = $this->app->appSettings->get(
names: [
SettingsEnum::MAIL_SERVER_ADDR,
SettingsEnum::MAIL_SERVER_CERT,
SettingsEnum::MAIL_SERVER_KEY,
SettingsEnum::MAIL_SERVER_KEYPASS,
SettingsEnum::MAIL_SERVER_TLS,
],
module: self::NAME
names: SettingsEnum::MAIL_SERVER_ADDR,
module: 'Admin'
);
if ((int) $forgotten[SettingsEnum::LOGIN_FORGOTTEN_COUNT]->content > 3) {
@ -267,10 +276,10 @@ final class ApiController extends Controller
$token = (string) \random_bytes(64);
$handler = $this->setUpServerMailHandler();
$resetLink = UriFactory::build('{/lang}/{/app}/reset?user=' . $account->getId() . '&token=' . $token);
$resetLink = UriFactory::build('{/base}/reset?user=' . $account->getId() . '&token=' . $token);
$mail = new Email();
$mail->setFrom($emailSettings[SettingsEnum::MAIL_SERVER_ADDR]->content, 'Jingga');
$mail->setFrom($emailSettings->content);
$mail->addTo($account->getEmail(), \trim($account->name1 . ' ' . $account->name2 . ' ' . $account->name3));
$mail->subject = 'Jingga: Forgot Password';
$mail->body = '';
@ -297,6 +306,7 @@ final class ApiController extends Controller
],
], true);
/*
if (!empty($emailSettings[SettingsEnum::MAIL_SERVER_CERT]->content)
&& !empty($emailSettings[SettingsEnum::MAIL_SERVER_KEY]->content)
) {
@ -306,6 +316,7 @@ final class ApiController extends Controller
$emailSettings[SettingsEnum::MAIL_SERVER_KEYPASS]->content
);
}
*/
$handler->send($mail);
@ -378,7 +389,7 @@ final class ApiController extends Controller
);
$handler = $this->setUpServerMailHandler();
$loginLink = UriFactory::build('{/lang}/{/app}/{/backend}');
$loginLink = UriFactory::build('{/base}/{/backend}');
$mail = new Email();
$mail->setFrom($emailSettings[SettingsEnum::MAIL_SERVER_ADDR]->content, 'Jingga');
@ -444,13 +455,13 @@ final class ApiController extends Controller
$request->uri->__toString(),
[
'response' => $this->app->appSettings->get(
$request->getData('id', 'int'),
$request->getDataInt('id'),
$request->getData('name'),
$request->getData('unit', 'int'),
$request->getData('app', 'int'),
$request->getDataInt('unit'),
$request->getDataInt('app'),
$request->getData('module'),
$request->getData('group', 'int'),
$request->getData('account', 'int')
$request->getDataInt('group'),
$request->getDataInt('account')
),
]
);
@ -509,7 +520,7 @@ final class ApiController extends Controller
$dataSettings = $request->getDataJson('settings');
foreach ($dataSettings as $data) {
$id = isset($data['id']) ? (int) $data['id'] : null;
$id = isset($data['id']) && !empty($data['id']) ? (int) $data['id'] : null;
$name = $data['name'] ?? null;
$content = $data['content'] ?? null;
$unit = $data['unit'] ?? null;
@ -556,6 +567,86 @@ final class ApiController extends Controller
);
}
/**
* Api method for modifying settings
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return void
*
* @api
*
* @since 1.0.0
*/
public function apiSettingsCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{
if (!empty($val = $this->validateSettingsCreate($request))) {
$response->set('setting_create', new FormValidation($val));
$response->header->status = RequestStatusCode::R_400;
return;
}
$setting = $this->createSettingFromRequest($request);
$this->createModel($request->header->account, $setting, SettingMapper::class, 'setting', $request->getOrigin());
$this->fillJsonResponse(
$request,
$response,
NotificationLevel::OK,
'',
$this->app->l11nManager->getText($response->getLanguage(), '0', '0', 'SuccessfulCreate'),
$setting
);
}
/**
* Validate password update request
*
* @param RequestAbstract $request Request
*
* @return array<string, bool>
*
* @since 1.0.0
*/
private function validateSettingsCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['name'] = empty($request->getData('name')))) {
return $val;
}
return [];
}
/**
* Method to create group from request.
*
* @param RequestAbstract $request Request
*
* @return Setting
*
* @since 1.0.0
*/
private function createSettingFromRequest(RequestAbstract $request) : Setting
{
$setting = new Setting(
id: $request->getDataInt('id') ?? 0,
name: $request->getDataString('name') ?? '',
content: $request->getDataString('content') ?? '',
pattern: $request->getDataString('pattern') ?? '',
unit: $request->getDataInt('unit'),
app: $request->getDataInt('app'),
module: $request->getDataString('module'),
group: $request->getDataInt('group'),
account: $request->getDataInt('account')
);
return $setting;
}
/**
* Api method for modifying account password
*
@ -945,8 +1036,8 @@ final class ApiController extends Controller
private function createApplicationFromRequest(RequestAbstract $request) : App
{
$app = new App();
$app->name = (string) ($request->getData('name') ?? '');
$app->type = (int) ($request->getData('type') ?? ApplicationType::WEB);
$app->name = $request->getDataString('name') ?? '';
$app->type = $request->getDataInt('type') ?? ApplicationType::WEB;
return $app;
}
@ -968,7 +1059,7 @@ final class ApiController extends Controller
{
$appManager = new ApplicationManager($this->app);
$app = \rtrim($request->getData('appSrc') ?? '', '/\\ ');
$app = \rtrim($request->getDataString('appSrc') ?? '', '/\\ ');
if (!\is_dir(__DIR__ . '/../../../' . $app)) {
$response->header->status = RequestStatusCode::R_400;
return;
@ -990,8 +1081,8 @@ final class ApiController extends Controller
// handle app installation
$result = $appManager->install(
__DIR__ . '/../../../' . $app,
__DIR__ . '/../../../' . ($request->getData('appDest') ?? ''),
$request->getData('theme') ?? 'Default'
__DIR__ . '/../../../' . ($request->getDataString('appDest') ?? ''),
$request->getDataString('theme') ?? 'Default'
);
// handle providing
@ -1087,7 +1178,7 @@ final class ApiController extends Controller
private function updateGroupFromRequest(RequestAbstract $request, Group $group) : Group
{
$group->name = (string) ($request->getData('name') ?? $group->name);
$group->setStatus((int) ($request->getData('status') ?? $group->getStatus()));
$group->setStatus($request->getDataInt('status') ?? $group->getStatus());
$group->description = Markdown::parse((string) ($request->getData('description') ?? $group->descriptionRaw));
$group->descriptionRaw = (string) ($request->getData('description') ?? $group->descriptionRaw);
@ -1163,10 +1254,10 @@ final class ApiController extends Controller
{
$group = new Group();
$group->createdBy = new NullAccount($request->header->account);
$group->name = (string) ($request->getData('name') ?? '');
$group->setStatus((int) ($request->getData('status') ?? GroupStatus::INACTIVE));
$group->description = Markdown::parse((string) ($request->getData('description') ?? ''));
$group->descriptionRaw = (string) ($request->getData('description') ?? '');
$group->name = $request->getDataString('name') ?? '';
$group->setStatus($request->getDataInt('status') ?? GroupStatus::INACTIVE);
$group->description = Markdown::parse($request->getDataString('description') ?? '');
$group->descriptionRaw = $request->getDataString('description') ?? '';
return $group;
}
@ -1233,7 +1324,7 @@ final class ApiController extends Controller
$response->set(
$request->uri->__toString(),
\array_values(
GroupMapper::getAll()->where('name', '%' . ($request->getData('search') ?? '') . '%', 'LIKE')->execute()
GroupMapper::getAll()->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')->execute()
)
);
}
@ -1286,11 +1377,11 @@ final class ApiController extends Controller
$request->uri->__toString(),
\array_values(
AccountMapper::getAll()
->where('login', '%' . ($request->getData('search') ?? '') . '%', 'LIKE')
->where('email', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('name1', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('name2', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('name3', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('login', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
->where('email', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->where('name1', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->where('name2', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->where('name3', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->execute()
)
);
@ -1314,16 +1405,16 @@ final class ApiController extends Controller
/** @var Account[] $accounts */
$accounts = \array_values(
AccountMapper::getAll()
->where('login', '%' . ($request->getData('search') ?? '') . '%', 'LIKE')
->where('email', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('name1', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('name2', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('name3', '%' . ($request->getData('search') ?? '') . '%', 'LIKE', 'OR')
->where('login', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
->where('email', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->where('name1', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->where('name2', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->where('name3', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
->execute()
);
/** @var Group[] $groups */
$groups = \array_values(GroupMapper::getAll()->where('name', '%' . ($request->getData('search') ?? '') . '%', 'LIKE')->execute());
$groups = \array_values(GroupMapper::getAll()->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')->execute());
$data = [];
foreach ($accounts as $account) {
@ -1447,7 +1538,7 @@ final class ApiController extends Controller
$this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'AccountCreateTitle'),
\str_replace(
'{url}',
UriFactory::build('{/lang}/{/app}/admin/account/settings?{?}&id=' . $account->getId()),
UriFactory::build('{/base}/admin/account/settings?{?}&id=' . $account->getId()),
$this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'AccountCreateMsg'
)),
$account
@ -1480,6 +1571,7 @@ final class ApiController extends Controller
return;
}
/** @var \Modules\Admin\Models\App */
$app = AppMapper::get()
->where('id', (int) $request->getData('app'))
->execute();
@ -1530,7 +1622,7 @@ final class ApiController extends Controller
$emailAccount = AccountMapper::get()->where('email', (string) $request->getData('email'))->execute();
/** @var Account $loginAccount */
$loginAccount = AccountMapper::get()->where('login', (string) ($request->getData('login') ?? $request->getData('email')))->execute();
$loginAccount = AccountMapper::get()->where('login', (string) ($request->getData('user') ?? $request->getData('email')))->execute();
/** @var null|Account $account */
$account = null;
@ -1653,15 +1745,24 @@ final class ApiController extends Controller
$this->createModelRelation($account->getId(), $account->getId(), $defaultGroupIds, AccountMapper::class, 'groups', 'registration', $request->getOrigin());
} else {
// New account
$request->setData('status', AccountStatus::INACTIVE);
$request->setData('type', AccountType::USER);
$request->setData('status', AccountStatus::INACTIVE, true);
$request->setData('type', AccountType::USER, true);
$request->setData('name1', !$request->hasData('name1')
? \explode('@', $request->getData('email'))[0]
: $request->getData('name1')
);
$request->setData('login', $request->getData('login') ?? $request->getData('email'));
? (!$request->hasData('user')
? \explode('@', $request->getDataString('email'))[0]
: $request->getDataString('user')
)
: $request->getDataString('name1')
, true);
$request->setData('user', !$request->hasData('user')
? $request->getDataString('email')
: $request->getDataString('user')
, true);
$this->apiAccountCreate($request, $response, $data);
/** @var Account $account */
$account = $response->get($request->uri->__toString())['response'];
// Create confirmation pending entry
@ -1684,17 +1785,18 @@ final class ApiController extends Controller
// Create client
if ($request->hasData('client')) {
$internalRequest = new HttpRequest();
$internalRequest = new HttpRequest();
$internalResponse = new HttpResponse();
$internalRequest->header->account = $account->getId();
$internalRequest->setData('account', $account->getId());
$internalRequest->setData('number', 100000 + $account->getId());
$internalRequest->setData('address', $request->getData('address') ?? '');
$internalRequest->setData('postal', $request->getData('postal') ?? '');
$internalRequest->setData('city', $request->getData('city') ?? '');
$internalRequest->setData('country', $request->getData('country') ?? '');
$internalRequest->setData('state', $request->getData('state') ?? '');
$internalRequest->setData('address', $request->getDataString('address') ?? '');
$internalRequest->setData('postal', $request->getDataString('postal') ?? '');
$internalRequest->setData('city', $request->getDataString('city') ?? '');
$internalRequest->setData('country', $request->getDataString('country') ?? '');
$internalRequest->setData('state', $request->getDataString('state') ?? '');
$internalRequest->setData('vat_id', $request->getDataString('vat_id') ?? '');
$this->app->moduleManager->get('ClientManagement')->apiClientCreate($internalRequest, $internalResponse);
}
@ -1709,16 +1811,46 @@ final class ApiController extends Controller
$handler = $this->setUpServerMailHandler();
$emailSettings = $this->app->appSettings->get(
names: SettingsEnum::MAIL_SERVER_ADDR,
names: [SettingsEnum::MAIL_SERVER_ADDR, SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE],
module: 'Admin'
);
$mail = new Email();
$mail->setFrom($emailSettings->content);
$mail = EmailMapper::get()
->where('id', (int) $emailSettings[SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE])
->execute();
$mail->setFrom($emailSettings[SettingsEnum::MAIL_SERVER_ADDR]->content);
$mail->addTo((string) $request->getData('email'));
$mail->subject = 'Registration';
$mail->body = "Hello,\nThank you very much for using our services at Jingga. Please click the following link to confirm your registration:\n\n" . UriFactory::build('{/base}/{/lang}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash()) . "\n\nBest regards,\nJingga";
$mail->bodyAlt = $mail->body;
// @todo: improve, the /tld link could be api.myurl.com which of course is not the url of the respective app.
// Maybe store the uri in the $app model? or store all urls in the config file
$mail->body = \str_replace(
[
'{confirmation_link}',
'{user_name}',
],
[
UriFactory::hasQuery('/' . \strtolower($app->name))
? UriFactory::build('{/' . \strtolower($app->name) . '}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash())
: UriFactory::build('{/tld}/{/lang}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash()),
$account->login
],
$mail->body
);
$mail->bodyAlt = \str_replace(
[
'{confirmation_link}',
'{user_name}',
],
[
UriFactory::hasQuery('/' . \strtolower($app->name))
? UriFactory::build('{/' . \strtolower($app->name) . '}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash())
: UriFactory::build('{/tld}/{/lang}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash()),
$account->login
],
$mail->bodyAlt
);
$handler->send($mail);
@ -1858,8 +1990,8 @@ final class ApiController extends Controller
*/
private function createProfileForAccount(Account $account, RequestAbstract $request) : void
{
if (((string) ($request->getData('password') ?? '')) === ''
|| ((string) ($request->getData('login') ?? '')) === ''
if (($request->getDataString('password') ?? '') === ''
|| ($request->getDataString('user') ?? '') === ''
) {
return;
}
@ -1882,16 +2014,16 @@ final class ApiController extends Controller
private function createAccountFromRequest(RequestAbstract $request) : Account
{
$account = new Account();
$account->login = (string) ($request->getData('login') ?? '');
$account->name1 = (string) ($request->getData('name1') ?? '');
$account->name2 = (string) ($request->getData('name2') ?? '');
$account->name3 = (string) ($request->getData('name3') ?? '');
$account->setStatus((int) ($request->getData('status') ?? AccountStatus::INACTIVE));
$account->setType((int) ($request->getData('type') ?? AccountType::USER));
$account->setEmail((string) ($request->getData('email') ?? ''));
$account->generatePassword((string) ($request->getData('password') ?? ''));
$account->login = $request->getDataString('user') ?? '';
$account->name1 = $request->getDataString('name1') ?? '';
$account->name2 = $request->getDataString('name2') ?? '';
$account->name3 = $request->getDataString('name3') ?? '';
$account->setStatus($request->getDataInt('status') ?? AccountStatus::INACTIVE);
$account->setType($request->getDataInt('type') ?? AccountType::USER);
$account->setEmail($request->getDataString('email') ?? '');
$account->generatePassword($request->getDataString('password') ?? '');
if ($request->getData('locale') === null) {
if (!$request->hasData('locale')) {
$account->l11n = Localization::fromJson(
$this->app->l11nServer === null ? $request->header->l11n->jsonSerialize() : $this->app->l11nServer->jsonSerialize()
);
@ -1991,13 +2123,13 @@ final class ApiController extends Controller
*/
private function updateAccountFromRequest(RequestAbstract $request, Account $account, bool $allowPassword = false) : Account
{
$account->login = (string) ($request->getData('login') ?? $account->login);
$account->login = (string) ($request->getData('user') ?? $account->login);
$account->name1 = (string) ($request->getData('name1') ?? $account->name1);
$account->name2 = (string) ($request->getData('name2') ?? $account->name2);
$account->name3 = (string) ($request->getData('name3') ?? $account->name3);
$account->setEmail((string) ($request->getData('email') ?? $account->getEmail()));
$account->setStatus((int) ($request->getData('status') ?? $account->getStatus()));
$account->setType((int) ($request->getData('type') ?? $account->getType()));
$account->setEmail($request->getDataString('email') ?? $account->getEmail());
$account->setStatus($request->getDataInt('status') ?? $account->getStatus());
$account->setType($request->getDataInt('type') ?? $account->getType());
if ($allowPassword && !empty($request->getData('password'))) {
$account->generatePassword((string) $request->getData('password'));
@ -2021,7 +2153,7 @@ final class ApiController extends Controller
*/
public function apiModuleStatusUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{
$module = (string) ($request->getData('module') ?? '');
$module = $request->getDataString('module') ?? '';
$status = (int) $request->getData('status');
if (empty($module) || empty($status)) {
@ -2492,11 +2624,11 @@ final class ApiController extends Controller
$permission->setElement(empty($request->getData('permissionelement')) ? null : (int) $request->getData('permissionelement'));
$permission->setComponent(empty($request->getData('permissioncomponent')) ? null : (int) $request->getData('permissioncomponent'));
$permission->setPermission(
(int) ($request->getData('permissioncreate') ?? 0)
| (int) ($request->getData('permissionread') ?? 0)
| (int) ($request->getData('permissionupdate') ?? 0)
| (int) ($request->getData('permissiondelete') ?? 0)
| (int) ($request->getData('permissionpermission') ?? 0)
($request->getDataInt('permissioncreate') ?? 0)
| ($request->getDataInt('permissionread') ?? 0)
| ($request->getDataInt('permissionupdate') ?? 0)
| ($request->getDataInt('permissiondelete') ?? 0)
| ($request->getDataInt('permissionpermission') ?? 0)
);
return $permission;
@ -2600,11 +2732,11 @@ final class ApiController extends Controller
$permission->setCategory(empty($request->getData('permissioncategory')) ? $permission->getCategory() : (int) $request->getData('permissioncategory'));
$permission->setElement(empty($request->getData('permissionelement')) ? $permission->getElement() : (int) $request->getData('permissionelement'));
$permission->setComponent(empty($request->getData('permissioncomponent')) ? $permission->getComponent() : (int) $request->getData('permissioncomponent'));
$permission->setPermission((int) ($request->getData('permissioncreate') ?? 0)
| (int) ($request->getData('permissionread') ?? 0)
| (int) ($request->getData('permissionupdate') ?? 0)
| (int) ($request->getData('permissiondelete') ?? 0)
| (int) ($request->getData('permissionpermission') ?? 0));
$permission->setPermission(($request->getDataInt('permissioncreate') ?? 0)
| ($request->getDataInt('permissionread') ?? 0)
| ($request->getDataInt('permissionupdate') ?? 0)
| ($request->getDataInt('permissiondelete') ?? 0)
| ($request->getDataInt('permissionpermission') ?? 0));
return $permission;
}
@ -2823,7 +2955,7 @@ final class ApiController extends Controller
{
$this->apiUpdate([[
'name' => 'temp.json',
'download_url' => 'https://raw.githubusercontent.com/Karaka-Management/' . ($request->getData('url') ?? ''),
'download_url' => 'https://raw.githubusercontent.com/Karaka-Management/' . ($request->getDataString('url') ?? ''),
]]);
}
@ -2914,7 +3046,7 @@ final class ApiController extends Controller
SystemUtils::runProc(
OperatingSystem::getSystem() === SystemType::WIN ? 'php.exe' : 'php',
\escapeshellarg($cliPath)
. ' post:/admin/event '
. ' /admin/event '
. '-g ' . \escapeshellarg($data[$count - 2] ?? '') . ' '
. '-i ' . \escapeshellarg($data[$count - 1] ?? '') . ' '
. '-d ' . \escapeshellarg($jsonData),
@ -3005,10 +3137,10 @@ final class ApiController extends Controller
{
/** @var Contact $element */
$element = new Contact();
$element->setType((int) ($request->getData('type') ?? 0));
$element->setSubtype((int) ($request->getData('subtype') ?? 0));
$element->content = (string) ($request->getData('content') ?? '');
$element->account = (int) ($request->getData('account') ?? 0);
$element->setType($request->getDataInt('type') ?? 0);
$element->setSubtype($request->getDataInt('subtype') ?? 0);
$element->content = $request->getDataString('content') ?? '';
$element->account = $request->getDataInt('account') ?? 0;
return $element;
}

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -42,7 +42,7 @@ use Web\Backend\Views\TableView;
* This class is responsible for the basic admin activities such as managing accounts, groups, permissions and modules.
*
* @package Modules\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
* @codeCoverageIgnore
@ -139,14 +139,14 @@ final class BackendController extends Controller
$mapper = AccountMapper::getAll()->with('createdBy');
$list = AccountMapper::find(
search: $request->getData('search'),
search: $request->getDataString('search'),
mapper: $mapper,
id: (int) ($request->getData('id') ?? 0),
secondaryId: (string) ($request->getData('subid') ?? ''),
type: $request->getData('pType'),
pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')),
sortBy: $request->getData('sort_by') ?? '',
sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
id: $request->getDataInt('id') ?? 0,
secondaryId: $request->getDataString('subid') ?? '',
type: $request->getDataString('pType'),
pageLimit: empty($request->getDataInt('limit') ?? 0) ? 100 : ((int) $request->getData('limit')),
sortBy: $request->getDataString('sort_by') ?? '',
sortOrder: $request->getDataString('sort_order') ?? OrderType::DESC,
searchFields: $searchField,
filters: $filterField
);
@ -166,6 +166,7 @@ final class BackendController extends Controller
$templateIds[] = (int) $template->content;
}
/** @var \Modules\Media\Models\Media[] $mediaTemplates */
$mediaTemplates = MediaMapper::getAll()
->where('id', $templateIds, 'in')
->execute();
@ -225,11 +226,11 @@ final class BackendController extends Controller
// audit log
if ($request->getData('ptype') === 'p') {
$view->setData('auditlogs',
AuditMapper::getAll()->with('createdBy')->where('id', (int) ($request->getData('audit') ?? 0), '<')->limit(25)->execute()
AuditMapper::getAll()->with('createdBy')->where('id', $request->getDataInt('audit') ?? 0, '<')->limit(25)->execute()
);
} elseif ($request->getData('ptype') === 'n') {
$view->setData('auditlogs',
AuditMapper::getAll()->with('createdBy')->where('id', (int) ($request->getData('audit') ?? 0), '>')->limit(25)->execute()
AuditMapper::getAll()->with('createdBy')->where('id', $request->getDataInt('audit') ?? 0, '>')->limit(25)->execute()
);
} else {
$view->setData('auditlogs',
@ -312,14 +313,14 @@ final class BackendController extends Controller
$mapper = GroupMapper::getAll()->with('createdBy');
$list = GroupMapper::find(
search: $request->getData('search'),
search: $request->getDataString('search'),
mapper: $mapper,
id: (int) ($request->getData('id') ?? 0),
secondaryId: (string) ($request->getData('subid') ?? ''),
type: $request->getData('pType'),
pageLimit: empty((int) ($request->getData('limit') ?? 0)) ? 100 : ((int) $request->getData('limit')),
sortBy: $request->getData('sort_by') ?? '',
sortOrder: $request->getData('sort_order') ?? OrderType::DESC,
id: $request->getDataInt('id') ?? 0,
secondaryId: $request->getDataString('subid') ?? '',
type: $request->getDataString('pType'),
pageLimit: empty($request->getDataInt('limit') ?? 0) ? 100 : ((int) $request->getData('limit')),
sortBy: $request->getDataString('sort_by') ?? '',
sortOrder: $request->getDataString('sort_order') ?? OrderType::DESC,
searchFields: $searchField,
filters: $filterField
);
@ -342,6 +343,7 @@ final class BackendController extends Controller
$templateIds[] = (int) $template->content;
}
/** @var \Modules\Media\Models\Media[] $mediaTemplates */
$mediaTemplates = MediaMapper::getAll()
->where('id', $templateIds, 'in')
->execute();
@ -405,9 +407,9 @@ final class BackendController extends Controller
// audit log
if ($request->getData('ptype') === 'p') {
$view->setData('auditlogs', $mapperQuery->where('id', (int) ($request->getData('audit') ?? 0), '<')->limit(25)->execute());
$view->setData('auditlogs', $mapperQuery->where('id', $request->getDataInt('audit') ?? 0, '<')->limit(25)->execute());
} elseif ($request->getData('ptype') === 'n') {
$view->setData('auditlogs', $mapperQuery->where('id', (int) ($request->getData('audit') ?? 0), '>')->limit(25)->execute());
$view->setData('auditlogs', $mapperQuery->where('id', $request->getDataInt('audit') ?? 0, '>')->limit(25)->execute());
} else {
$view->setData('auditlogs', $mapperQuery->where('id', 0, '>')->limit(25)->execute());
}
@ -475,6 +477,7 @@ final class BackendController extends Controller
$templateIds[] = (int) $template->content;
}
/** @var \Modules\Media\Models\Media[] $mediaTemplates */
$mediaTemplates = MediaMapper::getAll()
->where('id', $templateIds, 'in')
->execute();
@ -511,7 +514,7 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-info');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$id = $request->getData('id') ?? '';
$id = $request->getDataString('id') ?? '';
$view->setData('modules', $this->app->moduleManager->getAllModules());
$view->setData('active', $this->app->moduleManager->getActiveModules());
$view->setData('installed',$this->app->moduleManager->getInstalledModules());
@ -561,7 +564,7 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-log');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$id = (string) ($request->getData('id') ?? '');
$id = $request->getDataString('id') ?? '';
$queryMapper = AuditMapper::getAll()
->with('createdBy')
@ -596,7 +599,7 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-route-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$module = $request->getData('id') ?? '';
$module = $request->getDataString('id') ?? '';
$view->setData('module', $module);
$appPath = __DIR__ . '/../../../Web';
@ -645,7 +648,7 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-hook-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$module = $request->getData('id') ?? '';
$module = $request->getDataString('id') ?? '';
$view->setData('module', $module);
$appPath = __DIR__ . '/../../../Web';
@ -693,7 +696,7 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
$id = $request->getData('id') ?? '';
$id = $request->getDataString('id') ?? '';
/** @var null|\Model\NullSetting|\Model\Setting[] $settings */
$settings = SettingMapper::getAll()->where('module', $id)->execute();
@ -710,8 +713,8 @@ final class BackendController extends Controller
if ($request->getData('id') === 'Admin') {
$view->setTemplate('/Modules/' . $request->getData('id') . '/Admin/Settings/Theme/Backend/settings');
} elseif (\is_file(__DIR__ . '/../../' . ($request->getData('id') ?? '') . '/Admin/Settings/Theme/Backend/settings.tpl.php')) {
return $this->app->moduleManager->get($request->getData('id') ?? '')
} elseif (\is_file(__DIR__ . '/../../' . ($request->getDataString('id') ?? '') . '/Admin/Settings/Theme/Backend/settings.tpl.php')) {
return $this->app->moduleManager->get($request->getDataString('id') ?? '')
->viewModuleSettings($request, $response, $data);
} else {
$view->setTemplate('/Modules/Admin/Theme/Backend/modules-settings');
@ -727,7 +730,7 @@ final class BackendController extends Controller
);
$view->setData('generalSettings', $generalSettings);
$view->setData('defaultlocalization', LocalizationMapper::get()->where('id', (int) $generalSettings[SettingsEnum::DEFAULT_LOCALIZATION . ':::Admin']->content)->execute());
$view->setData('defaultlocalization', LocalizationMapper::get()->where('id', (int) $generalSettings[SettingsEnum::DEFAULT_LOCALIZATION]->content)->execute());
return $view;
}

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -25,7 +25,7 @@ use phpOMS\Views\View;
* This class is responsible for the basic admin activities such as managing accounts, groups, permissions and modules.
*
* @package Modules\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
@ -76,9 +76,9 @@ final class CliController extends Controller
public function cliRunEvent(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
$event = $this->app->eventManager->triggerSimilar(
$request->getData('g'),
$request->getData('i'),
\json_decode($request->getData('d'), true)
$request->getDataString('g') ?? '',
$request->getDataString('i') ?? '',
$request->getDataJson('d')
);
$view = new View($this->app->l11nManager, $request, $response);

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -22,7 +22,7 @@ use phpOMS\Module\ModuleAbstract;
* This class is responsible for the basic admin activities such as managing accounts, groups, permissions and modules.
*
* @package Modules\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Location;
* Account class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Account mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Account external class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\DataStorage\Database\Query\Builder;
* Account mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum;
* Status for external references
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,15 +20,19 @@ use phpOMS\Stdlib\Base\Enum;
* Type for external references
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
abstract class AccountExternalSubtype extends Enum
{
public const STRIPE = 1;
public const PAYPAL = 2;
public const GOOGLE_PAY = 3;
public const AMAZON_PAY = 4;
public const VENMO = 5;
}

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum;
* Type for external references
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\DataStorage\Database\Query\Builder;
* Account mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\Account\PermissionType;
* A single permission for an account consisting of read, create, modify, delete and permission flags.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Account permission mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Location;
* Address model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -21,7 +21,7 @@ use phpOMS\Localization\Defaults\CountryMapper;
* Address mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Account\AccountStatus;
* Api key class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\DataStorage\Database\Query\Builder;
* Account mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -21,7 +21,7 @@ use phpOMS\Application\ApplicationType;
* App model.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Account mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ namespace Modules\Admin\Models;
* Information such as phone number, email, ...
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Contact mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* App model.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Account mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Account group class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Query\Builder;
* Group mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\Account\PermissionType;
* A single permission for a group consisting of read, create, modify, delete and permission flags.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Group permission mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -24,7 +24,7 @@ use phpOMS\Localization\Localization;
* Localization mapper.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -21,7 +21,7 @@ use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
* Module class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Module mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum;
* Permision state enum.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -18,7 +18,7 @@ namespace Modules\Admin\Models;
* Null model
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* Mapper class.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum;
* Permision state enum.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\DataStorage\Database\Query\Where;
* Query builder for selects which immediately check if a user/group has the appropriate permissions
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -20,7 +20,7 @@ use phpOMS\Stdlib\Base\Enum;
* Default settings enum.
*
* @package Modules\Admin\Models
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\Views\View;
* Component view.
*
* @package Modules\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
* @codeCoverageIgnore

View File

@ -6,7 +6,7 @@
*
* @package Modules\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
@ -23,7 +23,7 @@ use phpOMS\Views\View;
* Component view.
*
* @package Modules\Admin
* @license OMS License 1.0
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
* @codeCoverageIgnore

View File

@ -6,9 +6,9 @@
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "dom.popup", "selector": "#group-selector-tpl", "aniIn": "fadeIn", "id": "<?= $this->getId(); ?>"},
{"key": 2, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/lang}/{/app}/admin/group?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 2, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/base}/admin/group?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1},
{"key": 4, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/lang}/{/app}/admin/group?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 4, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/base}/admin/group?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}
]
}

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

View File

@ -6,7 +6,7 @@
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/

Some files were not shown because too many files have changed in this diff Show More