drafting web app

This commit is contained in:
Dennis Eichhorn 2022-11-04 20:06:42 +01:00
parent 91cd209615
commit 0e341f66e1
22 changed files with 1618 additions and 503 deletions

View File

@ -0,0 +1 @@
"# BEGIN Gzip Compression\n<ifmodule mod_rewrite.c>\n AddEncoding gzip .gz\n <filesmatch \"\\.js\\.gz$\">\n AddType \"text\/javascript\" .gz\n <\/filesmatch>\n <filesmatch \"\\.css\\.gz$\">\n AddType \"text\/css\" .gz\n <\/filesmatch>\n<\/ifmodule>\n\nAddType font\/ttf .ttf\nAddType font\/otf .otf\nAddType application\/font-woff .woff\nAddType application\/vnd.ms-fontobject .eot\n\n<ifmodule mod_deflate.c>\n AddOutputFilterByType DEFLATE text\/text text\/html text\/plain text\/xml text\/css application\/x-javascript application\/javascript text\/javascript\n<\/ifmodule>\n# END Gzip Compression\n\n# Force mime for javascript files\n<Files \"*.js\">\n ForceType text\/javascript\n<\/Files>\n\n# BEGIN Caching\n<ifModule mod_expires.c>\n ExpiresActive On\n ExpiresDefault A300\n\n ExpiresByType image\/x-icon A2592000\n\n <FilesMatch \".(php)$\">\n ExpiresDefault A0\n Header set Cache-Control \"no-store, no-cache, must-revalidate, max-age=0\"\n Header set Pragma \"no-cache\"\n <\/FilesMatch>\n<\/ifModule>\n# END Caching\n\n# BEGIN Spelling\n<IfModule mod_speling.c>\n CheckSpelling On\n CheckCaseOnly On\n<\/IfModule>\n# END Spelling\n\n# BEGIN URL rewrite\n<ifmodule mod_rewrite.c>\n RewriteEngine On\n RewriteBase \/\n RewriteCond %{HTTP:Accept-encoding} gzip\n RewriteCond %{REQUEST_FILENAME} \\.(js|css)$\n RewriteCond %{REQUEST_FILENAME}.gz -f\n RewriteRule ^(.*)$ $1.gz [QSA,L]\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteRule ^(.*)$ \/?{QUERY_STRING} [QSA]\n RewriteCond %{HTTPS} !on\n RewriteCond %{HTTP_HOST} !^(127\\.0\\.0)|(192\\.)|(172\\.)\n RewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI}\n<\/ifmodule>\n# END URL rewrite\n\n# BEGIN Access control\n<Files *.php>\n Order Deny,Allow\n Deny from all\n Allow from 127.0.0.1\n<\/Files>\n<Files index.php>\n Allow from all\n<\/Files>\n# END Access control\n\n# Disable directory view\nOptions All -Indexes\n\n# Disable unsupported scripts\nOptions -ExecCGI\nAddHandler cgi-script .pl .py .jsp .asp .shtml .sh .cgi\n\n#<ifmodule mod_headers.c>\n# # XSS protection\n# header always set x-xss-protection \"1; mode=block\"\n#\n# # Nosnif\n# header always set x-content-type-options \"nosniff\"\n#\n# # Iframes only from self\n# header always set x-frame-options \"SAMEORIGIN\"\n#<\/ifmodule>\n\n<ifmodule mod_headers.c>\n <FilesMatch \"ServiceWorker.js$\">\n Header set Service-Worker-Allowed \"\/\"\n <\/FilesMatch>\n<\/ifmodule>\n\n# Php config\n# This should be removed from here and adjusted in the php.ini file\nphp_value upload_max_filesize 40M\nphp_value post_max_size 40M\nphp_value memory_limit 128M\nphp_value max_input_time 30\nphp_value max_execution_time 30"

View File

@ -1,4 +1,5 @@
<?php
/**
* Karaka
*
@ -10,19 +11,23 @@
* @version 1.0.0
* @link https://karaka.app
*/
declare(strict_types=1);
namespace Applications\Api;
use Models\AccountMapper;
use Models\LocalizationMapper;
use Models\NullAccount;
use phpOMS\Account\Account;
use phpOMS\Account\AccountManager;
use phpOMS\Account\PermissionType;
use phpOMS\Asset\AssetType;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\Application\ApplicationStatus;
use phpOMS\Auth\Auth;
use phpOMS\DataStorage\Cache\CachePool;
use phpOMS\DataStorage\Cookie\CookieJar;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\DatabaseStatus;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
use phpOMS\DataStorage\Session\HttpSession;
use phpOMS\Dispatcher\Dispatcher;
@ -30,11 +35,13 @@ use phpOMS\Event\EventManager;
use phpOMS\Localization\L11nManager;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestMethod;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Model\Html\Head;
use phpOMS\Module\ModuleManager;
use phpOMS\Router\RouteVerb;
use phpOMS\Router\WebRouter;
use phpOMS\System\File\PathException;
use phpOMS\System\MimeType;
use phpOMS\Uri\UriFactory;
use phpOMS\Views\View;
use WebApplication;
@ -53,8 +60,124 @@ final class Application
UriFactory::setQuery('/app', \strtolower($this->app->appName));
}
public function run(HttpRequest $request, HttpResponse $response) : void
public function run(HttpRequest $request, HttpResponse $response): void
{
$response->header->set('Content-Type', 'text/plain; charset=utf-8');
$pageView = new View($this->app->l11nManager, $request, $response);
$this->app->l11nManager = new L11nManager($this->app->appName);
$this->app->dbPool = new DatabasePool();
$this->app->router = new WebRouter($this->app);
$this->app->router->importFromFile(__DIR__ . '/Routes.php');
$this->app->sessionManager = new HttpSession(0);
$this->app->cookieJar = new CookieJar();
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->dbPool->create('core', $this->config['db']['core']['masters']['admin']);
$this->app->dbPool->create('insert', $this->config['db']['core']['masters']['insert']);
$this->app->dbPool->create('select', $this->config['db']['core']['masters']['select']);
$this->app->dbPool->create('update', $this->config['db']['core']['masters']['update']);
$this->app->dbPool->create('delete', $this->config['db']['core']['masters']['delete']);
$this->app->dbPool->create('schema', $this->config['db']['core']['masters']['schema']);
/* Checking csrf token, if a csrf token is required at all has to be decided in the route or controller */
if ($request->getData('CSRF') !== null
&& !\hash_equals($this->app->sessionManager->get('CSRF'), $request->getData('CSRF'))
) {
$response->header->status = RequestStatusCode::R_403;
return;
}
/** @var \phpOMS\DataStorage\Database\Connection\ConnectionAbstract $con */
$con = $this->app->dbPool->get();
DataMapperFactory::db($con);
$this->app->cachePool = new CachePool();
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->eventManager->importFromFile(__DIR__ . '/Hooks.php');
$this->app->accountManager = new AccountManager($this->app->sessionManager);
$this->app->l11nServer = LocalizationMapper::get()->where('id', 1)->execute();
$aid = Auth::authenticate($this->app->sessionManager);
$request->header->account = $aid;
$response->header->account = $aid;
$account = $this->loadAccount($request);
if (!($account instanceof NullAccount)) {
$response->header->l11n = $account->l11n;
} elseif ($this->app->sessionManager->get('language') !== null) {
$response->header->l11n
->loadFromLanguage(
$this->app->sessionManager->get('language'),
$this->app->sessionManager->get('country') ?? '*'
);
} elseif ($this->app->cookieJar->get('language') !== null) {
$response->header->l11n
->loadFromLanguage(
$this->app->cookieJar->get('language'),
$this->app->cookieJar->get('country') ?? '*'
);
}
UriFactory::setQuery('/lang', $response->getLanguage());
$response->header->set('content-language', $response->getLanguage(), true);
$appStatus = ApplicationStatus::NORMAL;
if ($appStatus === ApplicationStatus::READ_ONLY || $appStatus === ApplicationStatus::DISABLED) {
if (!$account->hasGroup(3)) {
if ($request->getRouteVerb() !== RouteVerb::GET) {
// Application is in read only mode or completely disabled
// If read only mode is active only GET requests are allowed
// A user who is part of the admin group is excluded from this rule
$response->header->status = RequestStatusCode::R_405;
return;
}
$this->app->dbPool->remove('admin');
$this->app->dbPool->remove('insert');
$this->app->dbPool->remove('update');
$this->app->dbPool->remove('delete');
$this->app->dbPool->remove('schema');
}
}
$routed = $this->app->router->route(
$request->uri->getRoute(),
$request->getData('CSRF'),
$request->getRouteVerb(),
$this->app->appName,
$this->app->orgId,
$account,
$request->getData()
);
$dispatched = $this->app->dispatcher->dispatch($routed, $request, $response);
if (empty($dispatched)) {
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
$response->header->status = RequestStatusCode::R_404;
$response->set($request->uri->__toString(), [
'status' => \phpOMS\Message\NotificationLevel::ERROR,
'title' => '',
'message' => '',
'response' => [],
]);
}
$pageView->addData('dispatch', $dispatched);
}
private function loadAccount(HttpRequest $request): Account
{
/** @var Account $account */
$account = AccountMapper::get()->with('groups')->with('l11n')->where('id', $request->header->account)->execute();
$this->app->accountManager->add($account);
return $account;
}
}

View File

@ -14,9 +14,12 @@ declare(strict_types=1);
namespace Applications\Backend;
use Models\AccountMapper;
use Models\CoreSettings;
use Models\LocalizationMapper;
use phpOMS\Account\Account;
use phpOMS\Account\NullAccount;
use phpOMS\Account\AccountManager;
use phpOMS\Account\PermissionType;
use phpOMS\Asset\AssetType;
use phpOMS\Auth\Auth;
use phpOMS\DataStorage\Cache\CachePool;
@ -33,10 +36,10 @@ use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestMethod;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Model\Html\Head;
use phpOMS\Router\RouteVerb;
use phpOMS\Router\WebRouter;
use phpOMS\Uri\UriFactory;
use phpOMS\Views\View;
use phpOMS\Utils\Parser\Markdown\Markdown;
use WebApplication;
final class Application
@ -55,6 +58,217 @@ final class Application
public function run(HttpRequest $request, HttpResponse $response) : void
{
$this->app->l11nManager = new L11nManager($this->app->appName);
$this->app->dbPool = new DatabasePool();
$this->app->sessionManager = new HttpSession(0);
$this->app->cookieJar = new CookieJar();
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->dbPool->create('select', $this->config['db']['core']['masters']['select']);
$this->app->router = new WebRouter($this->app);
$this->app->router->importFromFile(__DIR__ . '/../../Routes.php');
/* CSRF token OK? */
if ($request->getData('CSRF') !== null
&& !\hash_equals($this->app->sessionManager->get('CSRF'), $request->getData('CSRF'))
) {
$response->header->status = RequestStatusCode::R_403;
return;
}
/** @var \phpOMS\DataStorage\Database\Connection\ConnectionAbstract $con */
$con = $this->app->dbPool->get();
DataMapperFactory::db($con);
$this->app->cachePool = new CachePool();
$this->app->appSettings = new CoreSettings();
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->accountManager = new AccountManager($this->app->sessionManager);
$this->app->l11nServer = LocalizationMapper::get()->where('id', 1)->execute();
$aid = Auth::authenticate($this->app->sessionManager);
$request->header->account = $aid;
$response->header->account = $aid;
$account = $this->loadAccount($request);
if (!($account instanceof NullAccount)) {
$response->header->l11n = $account->l11n;
} elseif ($this->app->sessionManager->get('language') !== null) {
$response->header->l11n
->loadFromLanguage(
$this->app->sessionManager->get('language'),
$this->app->sessionManager->get('country') ?? '*'
);
} elseif ($this->app->cookieJar->get('language') !== null) {
$response->header->l11n
->loadFromLanguage(
$this->app->cookieJar->get('language'),
$this->app->cookieJar->get('country') ?? '*'
);
}
if (!\in_array($response->getLanguage(), $this->config['language'])) {
$response->header->l11n->setLanguage($this->app->l11nServer->getLanguage());
}
$pageView = new BackendView($this->app->l11nManager, $request, $response);
$head = new Head();
$pageView->setData('head', $head);
$response->set('Content', $pageView);
/* Backend only allows GET */
if ($request->getMethod() !== RequestMethod::GET) {
$this->create406Response($response, $pageView);
return;
}
/* Database OK? */
if ($this->app->dbPool->get()->getStatus() !== DatabaseStatus::OK) {
$this->create503Response($response, $pageView);
return;
}
UriFactory::setQuery('/lang', $response->getLanguage());
$this->app->loadLanguageFromPath(
$response->getLanguage(),
__DIR__ . '/lang/' . $response->getLanguage() . '.lang.php'
);
$response->header->set('content-language', $response->getLanguage(), true);
/* Create html head */
$this->initResponseHead($head, $request, $response);
/* Handle not logged in */
if ($account->getId() < 1) {
$this->createBaseLoggedOutResponse($request, $response, $head, $pageView);
return;
}
$this->createDefaultPageView($request, $response, $pageView);
$dispatched = $this->app->dispatcher->dispatch(
$this->app->router->route(
$request->uri->getRoute(),
$request->getData('CSRF'),
$request->getRouteVerb(),
$this->app->appName,
$this->app->orgId,
$account,
$request->getData()
),
$request,
$response
);
$pageView->addData('dispatch', $dispatched);
}
private function createDefaultPageView(HttpRequest $request, HttpResponse $response, BackendView $pageView) : void
{
$pageView->setTemplate('/Applications/Backend/index');
}
private function create406Response(HttpResponse $response, View $pageView) : void
{
$response->header->status = RequestStatusCode::R_406;
$pageView->setTemplate('/Applications/Backend/Error/406');
$this->app->loadLanguageFromPath(
$response->getLanguage(),
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php'
);
}
private function create503Response(HttpResponse $response, View $pageView) : void
{
$response->header->status = RequestStatusCode::R_503;
$pageView->setTemplate('/Applications/Backend/Error/503');
$this->app->loadLanguageFromPath(
$response->getLanguage(),
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php'
);
}
private function loadAccount(HttpRequest $request) : Account
{
/** @var Account $account */
$account = AccountMapper::get()->with('groups')->with('l11n')->where('id', $request->header->account)->execute();
$this->app->accountManager->add($account);
return $account;
}
private function initResponseHead(Head $head, HttpRequest $request, HttpResponse $response) : void
{
/* Load assets */
$head->addAsset(AssetType::CSS, 'Resources/fonts/fontawesome/css/font-awesome.min.css?v=1.0.0');
$head->addAsset(AssetType::CSS, 'Resources/fonts/linearicons/css/style.css?v=1.0.0');
$head->addAsset(AssetType::CSS, 'Resources/fonts/lineicons/css/lineicons.css?v=1.0.0');
$head->addAsset(AssetType::CSS, 'cssOMS/styles.css?v=1.0.0');
$head->addAsset(AssetType::CSS, 'Resources/fonts/Roboto/roboto.css?v=1.0.0');
// Framework
$head->addAsset(AssetType::JS, 'jsOMS/Utils/oLib.js?v=1.0.0');
$head->addAsset(AssetType::JS, 'jsOMS/UnhandledException.js?v=1.0.0');
$head->addAsset(AssetType::JS, 'Applications/Backend/js/backend.js?v=1.0.0', ['type' => 'module']);
$script = '';
$response->header->set(
'content-security-policy',
'base-uri \'self\'; script-src \'self\' blob: \'sha256-'
. \base64_encode(\hash('sha256', $script, true))
. '\'; worker-src \'self\'',
true
);
if ($request->hasData('debug')) {
$head->addAsset(AssetType::CSS, 'cssOMS/debug.css?v=1.0.0');
\phpOMS\DataStorage\Database\Query\Builder::$log = true;
}
$css = \file_get_contents(__DIR__ . '/css/backend-small.css');
if ($css === false) {
$css = '';
}
$css = \preg_replace('!\s+!', ' ', $css);
$head->setStyle('core', $css ?? '');
$head->title = 'Online Resource Watcher';
}
private function createBaseLoggedOutResponse(HttpRequest $request, HttpResponse $response, Head $head, View $pageView) : void
{
$file = \in_array($request->uri->getPathElement(0), ['forgot', 'reset', 'privacy', 'imprint', 'terms'])
? 'signin-legal'
: 'signin';
if ($file === 'signin-legal') {
$lang = $request->getLanguage();
$path = \is_file(__DIR__ . '/content/' . $request->uri->getPathElement(0) . '.' . $lang . '.md')
? __DIR__ . '/content/' . $request->uri->getPathElement(0) . '.' . $lang . '.md'
: __DIR__ . '/content/' . $request->uri->getPathElement(0) . '.en.md';
$markdown = Markdown::parse(\file_get_contents($path));
$pageView->setData('markdown', $markdown);
}
$response->header->status = RequestStatusCode::R_403;
$pageView->setTemplate('/Applications/Backend/' . $file);
$css = \file_get_contents(__DIR__ . '/css/signin-small.css');
if ($css === false) {
$css = '';
}
$css = \preg_replace('!\s+!', ' ', $css);
$head->setStyle('core', $css ?? '');
}
}

View File

@ -33,7 +33,6 @@ use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestMethod;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Model\Html\Head;
use phpOMS\Router\RouteVerb;
use phpOMS\Router\WebRouter;
use phpOMS\Uri\UriFactory;
use phpOMS\Views\View;
@ -62,18 +61,7 @@ final class Application
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->router = new WebRouter();
$this->app->router->importFromFile(__DIR__ . '/Routes.php');
$this->app->router->add(
'/backend/e403',
function() use ($request, $response) {
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Web/Backend/Error/403_inline');
$response->header->status = RequestStatusCode::R_403;
return $view;
},
RouteVerb::GET
);
$this->app->router->importFromFile(__DIR__ . '/../../Routes.php');
/* CSRF token OK? */
if ($request->getData('CSRF') !== null
@ -117,11 +105,10 @@ final class Application
$pageView = new FrontendView($this->app->l11nManager, $request, $response);
$head = new Head();
$pageView->setData('orgId', $this->app->orgId);
$pageView->setData('head', $head);
$response->set('Content', $pageView);
/* Backend only allows GET */
/* Fontend only allows GET */
if ($request->getMethod() !== RequestMethod::GET) {
$this->create406Response($response, $pageView);
@ -163,16 +150,6 @@ final class Application
$pageView->setTemplate('/Applications/Frontend/index');
}
private function create403Response(HttpResponse $response, View $pageView) : void
{
$response->header->status = RequestStatusCode::R_403;
$pageView->setTemplate('/Applications/Frontend/Error/403');
$this->app->loadLanguageFromPath(
$response->getLanguage(),
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php'
);
}
private function create406Response(HttpResponse $response, View $pageView) : void
{
$response->header->status = RequestStatusCode::R_406;
@ -236,6 +213,6 @@ final class Application
$css = \preg_replace('!\s+!', ' ', $css);
$head->setStyle('core', $css ?? '');
$head->title = 'Karaka Frontend';
$head->title = 'Online Resource Watcher';
}
}

View File

@ -0,0 +1,102 @@
# AGB
## Definitionen
Für die Zwecke dieser AGBs:
* ANGESCHLOSSEN bedeutet ein Unternehmen, das eine Partei kontrolliert, von ihr kontrolliert wird oder mit ihr unter gemeinsamer Kontrolle steht, wobei "Kontrolle" den Besitz von 50 % oder mehr der Aktien, Anteile oder anderer Wertpapiere bedeutet, die zur Wahl von Direktoren oder anderen leitenden Angestellten berechtigt sind.
* LAND bezieht sich auf Deutschland.
* UNTERNEHMEN (in dieser VEREINBARUNG entweder als "das Unternehmen", "wir", "uns" oder "unser" bezeichnet) bezieht sich auf jingga, Gartenstr. 26, 61206 Wöllstadt.
* GERÄT bezeichnet jedes Gerät, das auf den Dienst zugreifen kann, wie z.B. ein Computer, ein Mobiltelefon oder ein digitales Tablet.
* SERVICE bezieht sich auf die Website.
* TERMINE oder VEREINBARUNG bezeichnet diese Bedingungen, die die gesamte Vereinbarung zwischen Ihnen und der FIRMA bezüglich der Nutzung des SERVICE bilden.
* Social-Media-Dienst eines Dritten bezeichnet alle Dienste oder Inhalte (einschließlich Daten, Informationen, Produkte oder Dienste), die von einem Dritten bereitgestellt werden und durch den DIENST angezeigt, einbezogen oder verfügbar gemacht werden können.
* WEBSITE bezieht sich auf jingga.app.
* ANWENDUNG bezieht sich auf alle herunterladbaren oder installierbaren Inhalte, die auf einem bestimmten GERÄT genutzt werden können.
* Sie bezeichnet die Person, die auf die DIENSTE zugreift oder diese nutzt, oder das Unternehmen oder eine andere juristische Person, in deren Namen eine solche Person auf die DIENSTE zugreift oder diese nutzt, je nachdem.
## Kenntnisnahme
Dies sind die GESCHÄFTSBEDINGUNGEN für die Nutzung dieses SERVICE und die Vereinbarung zwischen Ihnen und der FIRMA. Diese BEDINGUNGEN legen die Rechte und Pflichten aller Nutzer in Bezug auf die Nutzung des SERVICE fest.
Ihr Zugang zu und Ihre Nutzung des SERVICE und ANWENDUNGEN setzt voraus, dass Sie die vorliegenden GESCHÄFTSBEDINGUNGEN akzeptieren und einhalten. Diese GESCHÄFTSBEDINGUNGEN gelten für alle Besucher, Nutzer und andere, die auf den SERVICE zugreifen oder ihn nutzen.
Indem Sie auf den SERVICE und ANWENDUNGEN zugreifen oder ihn nutzen, erklären Sie sich damit einverstanden, an diese BEDINGUNGEN gebunden zu sein. Wenn Sie mit irgendeinem Teil dieser Bedingungen nicht einverstanden sind, dürfen Sie nicht auf den SERVICE zugreifen. Sie versichern, dass Sie mindestens 18 Jahre alt sind und die Volljährigkeit erreicht haben. Die FIRMA gestattet Personen unter 18 Jahren oder unter der Volljährigkeit nicht, den SERVICE zu nutzen.
Ihr Zugang zu und Ihre Nutzung des SERVICE und ANWENDUNGEN hängt auch davon ab, dass Sie die Datenschutzrichtlinie der FIRMA akzeptieren und einhalten. Unsere Datenschutzrichtlinie beschreibt unsere Richtlinien und Verfahren für die Erfassung, Nutzung und Offenlegung Ihrer persönlichen Daten, wenn Sie die Anwendung oder die WEBSITE nutzen, und informiert Sie über Ihre Datenschutzrechte und darüber, wie das Gesetz Sie schützt. Bitte lesen Sie Unsere Datenschutzrichtlinien sorgfältig durch, bevor Sie Unseren SERVICE nutzen.
## Urheberrecht
Sofern nicht anders angegeben, sind alle Materialien, einschließlich, aber nicht beschränkt auf Logos, Markennamen, Bilder, Designs, Fotografien, Videos, Audiodateien, Quellcode und schriftliche und andere Materialien, die als Teil unserer WEBSITE, DIENSTE und ANWENDUNGEN erscheinen, Urheberrechte, Marken, Dienstleistungsmarken, Handelsaufmachungen und/oder anderes geistiges Eigentum, ob eingetragen oder nicht eingetragen ("geistiges Eigentum"), das Eigentum von jingga ist oder von jingga kontrolliert oder lizenziert wird. Unsere WEBSITE als Ganzes ist urheberrechtlich und durch Handelsaufmachung geschützt. Nichts auf unserer WEBSITE ist so auszulegen, dass stillschweigend, durch Rechtsverwirkung oder anderweitig eine Lizenz oder ein Recht zur Nutzung von geistigem Eigentum, das auf unserer WEBSITE angezeigt oder verwendet wird, ohne die vorherige schriftliche Genehmigung des Eigentümers des geistigen Eigentums gewährt wird. jingga setzt seine Rechte an geistigem Eigentum in vollem Umfang des Gesetzes aggressiv durch. Die Namen und Logos von jingga dürfen ohne vorherige schriftliche Genehmigung von jingga in keiner Weise verwendet werden, auch nicht in der Werbung oder in der Öffentlichkeitsarbeit im Zusammenhang mit der Verbreitung von Materialien auf unserer WEBSITE. jingga verbietet die Verwendung von Logos von jingga oder einer seiner Tochtergesellschaften als Teil eines Links zu oder von einer WEBSITE, es sei denn, jingga genehmigt einen solchen Link im Voraus und in Schriftform. Die faire Nutzung des geistigen Eigentums von jingga erfordert eine angemessene Anerkennung. Andere Produkt- und Firmennamen, die auf unserer Website erwähnt werden, können das geistige Eigentum ihrer jeweiligen Eigentümer sein.
## Links
Unser SERVICE kann Links zu Websites oder Diensten Dritter enthalten, die nicht im Besitz oder unter der Kontrolle der FIRMA sind.
Die FIRMA hat keine Kontrolle über und übernimmt keine Verantwortung für den Inhalt von Websites oder Diensten Dritter, die Sie besuchen.
## Beendigung
Wir können Ihren Zugang sofort und ohne Vorankündigung oder Haftung kündigen oder aussetzen, aus welchem Grund auch immer, einschließlich und ohne Einschränkung, wenn Sie diese Bedingungen verletzen.
Mit der Beendigung erlischt Ihr Recht zur Nutzung des DIENSTES oder der ANWENDUNG mit sofortiger Wirkung, es sei denn, der DIENST oder die ANWENDUNG stellt einen "Offline"-DIENST oder eine ANWENDUNG dar, einen DIENST oder eine ANWENDUNG, die keine Online-Verbindung erfordert, andere DIENSTE, die wir beendet haben, oder Dienste Dritter. Wir haben keine Kontrolle über die Ressourcen und Dienste Dritter, die für einige unserer DIENSTE und ANWENDUNGEN notwendig sein können. Änderungen durch diese Drittparteien können zur Beendigung des DIENSTES oder der ANWENDUNG oder zur Reduzierung ihrer Funktionalität führen. Sie verstehen diese Abhängigkeiten und Einschränkungen des DIENSTES und der ANWENDUNG und akzeptieren, dass die Beendigung oder reduzierte Funktionalität nicht als Grund für Streitigkeiten, Widerruf oder ähnliches verwendet werden kann.
## Haftungsbeschränkung
Ungeachtet etwaiger Schäden, die Ihnen entstehen könnten, ist die gesamte Haftung der FIRMA und ihrer Zulieferer gemäß den Bestimmungen dieser AGB und Ihr ausschließlicher Rechtsbehelf für alle vorgenannten Punkte auf den Betrag beschränkt, den Sie tatsächlich für den SERVICE bezahlt haben.
Soweit es das anwendbare Recht zulässt, haften die FIRMA oder ihre Lieferanten in keinem Fall für besondere, zufällige, indirekte oder Folgeschäden (einschließlich, aber nicht beschränkt auf Schäden aus entgangenem Gewinn, Verlust von Daten oder anderen Informationen, für Geschäftsunterbrechung, für Personenschäden, Verlust der Privatsphäre, die sich aus der Nutzung oder der Unmöglichkeit der Nutzung des SERVICE, der Software von Dritten und/oder der Hardware von Dritten, die mit dem SERVICE genutzt wird, oder in sonstiger Weise in Verbindung mit einer Bestimmung dieser AGB ergeben oder damit in Zusammenhang stehen), selbst wenn die FIRMA oder ein Lieferant auf die Möglichkeit solcher Schäden hingewiesen wurde und selbst wenn die Abhilfe ihren wesentlichen Zweck verfehlt.
In einigen Staaten oder Ländern ist der Ausschluss stillschweigender Garantien oder die Beschränkung der Haftung für beiläufig entstandene Schäden oder Folgeschäden nicht zulässig, was bedeutet, dass einige der oben genannten Beschränkungen möglicherweise nicht gelten. In diesen Staaten oder Ländern ist die Haftung jeder Partei auf den größtmöglichen gesetzlich zulässigen Umfang beschränkt.
## Haftungsausschluss
Der SERVICE wird Ihnen "WIE BESEHEN" und "WIE VERFÜGBAR" und mit allen Fehlern und Mängeln ohne jegliche Garantie zur Verfügung gestellt. Im größtmöglichen nach geltendem Recht zulässigen Umfang lehnt die FIRMA in ihrem eigenen Namen und im Namen ihrer VERBUNDENEN UNTERNEHMEN und ihrer jeweiligen Lizenzgeber und Dienstleistungsanbieter ausdrücklich alle ausdrücklichen, stillschweigenden, gesetzlichen oder sonstigen Gewährleistungen in Bezug auf den SERVICE ab, einschließlich aller stillschweigenden Gewährleistungen der Marktgängigkeit, der Eignung für einen bestimmten Zweck, des Eigentumsrechts und der Nichtverletzung von Rechten sowie der Gewährleistungen, die sich aus dem Handelsverlauf, der Leistungserbringung, den Gepflogenheiten oder der Handelspraxis ergeben können. Ohne Einschränkung des Vorstehenden übernimmt die FIRMA keine Garantie oder Verpflichtung und gibt keinerlei Zusicherungen ab, dass der SERVICE Ihren Anforderungen entspricht, die beabsichtigten Ergebnisse erzielt, mit anderer Software, Anwendungen, Systemen oder Diensten kompatibel ist oder zusammenarbeitet, ohne Unterbrechung funktioniert, Leistungs- oder Zuverlässigkeitsstandards erfüllt oder fehlerfrei ist oder dass Fehler oder Mängel korrigiert werden können oder werden.
Ohne das Vorstehende einzuschränken, geben weder die FIRMA noch einer ihrer Provider eine ausdrückliche oder stillschweigende Zusicherung oder Gewährleistung jeglicher Art: (i) hinsichtlich des Betriebs oder der Verfügbarkeit des SERVICE oder der darin enthaltenen Informationen, Inhalte und Materialien oder Produkte; (ii) dass der SERVICE ununterbrochen oder fehlerfrei funktioniert; (iii) hinsichtlich der Genauigkeit, Zuverlässigkeit oder Aktualität von Informationen oder Inhalten, die über den SERVICE zur Verfügung gestellt werden; oder (iv) dass der SERVICE, seine Server, die Inhalte oder E-Mails, die von oder im Namen der FIRMA versandt werden, frei von Viren, Skripten, trojanischen Pferden, Würmern, Malware, Zeitbomben oder anderen schädlichen Komponenten sind.
Einige Gerichtsbarkeiten lassen den Ausschluss bestimmter Arten von Garantien oder Einschränkungen der anwendbaren gesetzlichen Rechte eines Verbrauchers nicht zu, so dass einige oder alle der oben genannten Ausschlüsse und Einschränkungen möglicherweise nicht auf Sie zutreffen. In einem solchen Fall werden die in diesem Abschnitt dargelegten Ausschlüsse und Beschränkungen jedoch im größtmöglichen Umfang angewandt, der nach geltendem Recht durchsetzbar ist.
## Geltendes Recht
Die Gesetze des LANDES, unter Ausschluss der Kollisionsnormen, regeln diese Bedingungen und Ihre Nutzung des SERVICE. Ihre Nutzung der ANWENDUNG kann auch anderen lokalen, staatlichen, nationalen oder internationalen Gesetzen unterliegen.
Die Unwirksamkeit einer oder mehrerer Bestimmungen dieser Vereinbarung berührt nicht die Gültigkeit der anderen. Jede Partei dieser AGB kann in diesem Fall verlangen, dass eine neue gültige Bestimmung vereinbart wird, die den wirtschaftlichen Zweck der unwirksamen Bestimmung am besten erreicht.
## Streitbeilegung
Wenn Sie irgendwelche Bedenken oder Streitigkeiten bezüglich des Service haben, erklären Sie sich damit einverstanden, zunächst zu versuchen, die Streitigkeit informell zu lösen, indem Sie die FIRMA kontaktieren.
## Widerruf
Sie haben kein Widerrufsrecht für die DIENSTLEISTUNGEN und ANWENDUNGEN, es sei denn, in Ihrer Gerichtsbarkeit bestehen andere Widerrufsrechte. In einem solchen Fall wird der in diesem Abschnitt beschriebene Widerruf auf den niedrigsten Betrag angewandt, der nach geltendem Recht durchsetzbar ist.
## Lieferung
Die Lieferung der DIENSTLEISTUNGEN und ANWENDUNGEN erfolgt, sofern nicht anders angegeben, innerhalb von 30 Werktagen. Die Lieferung umfasst in diesem Zusammenhang nur den Zugang zu einem Download-Link, die Authentifizierung für einen Online-Dienst oder den Lizenzschlüssel per E-Mail.
## Zahlung
Die Zahlungsbedingungen sind immer Vorauszahlung, sofern nicht anders vereinbart. Zahlungen müssen per Kreditkarte erfolgen.
## Eigentumsvorbehalt
Bis zur vollständigen Bezahlung bleibt das Eigentum an den DIENSTLEISTUNGEN bei uns. Das Eigentum an den DIENSTLEISTUNGEN umfasst nur die Nutzungslizenzen und in keiner Weise das Eigentum an den Vermögenswerten, dem geistigen Eigentum und insbesondere dem Quellcode der DIENSTLEISTUNGEN. Sie haben kein Recht, Kopien unserer DIENSTLEISTUNGEN zu erstellen oder unsere DIENSTLEISTUNGEN unter keinen Umständen weiterzugeben.
## Rechtskonformität
Sie versichern und garantieren, dass (i) Sie sich nicht in einem Land befinden, das einem Embargo der US-Regierung unterliegt oder das von der US-Regierung, der deutschen Regierung oder der EU-Regierung als "Terroristen unterstützendes" Land bezeichnet wurde, und (ii) Sie nicht auf einer Liste der US-Regierung, der deutschen Regierung oder der EU-Regierung mit verbotenen oder eingeschränkten Parteien aufgeführt sind.
## Änderungen dieser Bedingungen
Wir behalten uns das Recht vor, diese Bedingungen nach unserem alleinigen Ermessen jederzeit zu ändern oder zu ersetzen. Wenn eine Änderung wesentlich ist, werden wir uns angemessen bemühen, Sie mindestens 30 Tage vor Inkrafttreten der neuen Bedingungen zu informieren. Was eine wesentliche Änderung darstellt, wird nach unserem alleinigen Ermessen festgelegt.
Indem Sie nach Inkrafttreten dieser Änderungen weiterhin auf unseren SERVICE zugreifen oder ihn nutzen, erklären Sie sich mit den überarbeiteten Bedingungen einverstanden. Wenn Sie mit den neuen Bedingungen ganz oder teilweise nicht einverstanden sind, beenden Sie bitte die Nutzung der WEBSITE und des SERVICE.
## Kontakt
Bei Fragen zu diesen Bedingungen, den Datenschutzrichtlinien oder den Praktiken von Websites oder Diensten Dritter können Sie uns unter info@jingga.app kontaktieren. Sie erkennen ferner an und erklären sich damit einverstanden, dass die FIRMA weder direkt noch indirekt für Schäden oder Verluste verantwortlich oder haftbar ist, die durch oder in Verbindung mit der Nutzung von oder dem Vertrauen auf solche Inhalte, Waren oder Dienstleistungen, die auf oder über solche Websites oder Dienste verfügbar sind, verursacht werden oder angeblich verursacht werden.
Wir empfehlen Ihnen dringend, die Geschäftsbedingungen und Datenschutzrichtlinien der von Ihnen besuchten Websites oder Dienste Dritter zu lesen.
Version 2022-08-14

View File

@ -0,0 +1,102 @@
# Terms of Service
## Definitions
For the purposes of these TERMS:
* AFFILIATED means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.
* COUNTRY refers to Germany
* COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to jingga, Gartenstr. 26, 61206 Woellstadt.
* DEVICE means any device that can access the Service such as a computer, a cellphone or a digital tablet.
* SERVICE refers to the Website
* TERMS or AGREEMENT mean these terms that form the entire agreement between You and the COMPANY regarding the use of the SERVICE.
* Third-party Social Media Service means any services or content (including data, information, products or services) provided by a third-party that may be displayed, included or made available by the SERVICE.
* WEBSITE refers to jingga.app
* APPLICATION refers to all downloadable or installable content which can therfore be used on an a given DEVICE.
* You means the individual accessing or using the SERVICES, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable.
## Acknowledgement
These are the TERMS governing the use of this SERVICE and the agreement that operates between You and the COMPANY. These TERMS set out the rights and obligations of all users regarding the use of the SERVICE.
Your access to and use of the SERVICE and APPLICATIONS is conditioned on Your acceptance of and compliance with these TERMS. These TERMS apply to all visitors, users and others who access or use the SERVICE.
By accessing or using the SERVICE and APPLICATIONS You agree to be bound by these TERMS. If You disagree with any part of these TERMS then You may not access the SERVICE. You represent that you are at least over the age of 18 and be over the Age of Majority. The COMPANY does not permit those under 18 or the Age of Majurity to use the SERVICE.
Your access to and use of the SERVICE and APPLICATIONS is also conditioned on Your acceptance of and compliance with the Privacy Policy of the COMPANY. Our Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your personal information when You use the Application or the WEBSITE and tells You about Your privacy rights and how the law protects You. Please read Our Privacy Policy carefully before using Our SERVICE.
## Copyright
Unless otherwise noted, all materials including without limitation, logos, brand names, images, designs, photographs, videos, audio, source code and written and other materials that appear as part of our WEBSITE, SERVICES and APPLICATIONS are copyrights, trademarks, service marks, trade dress and/or other intellectual property whether registered or unregistered ("Intellectual Property") owned, controlled or licensed by jingga. Our WEBSITE as a whole is protected by copyright and trade dress. Nothing on our WEBSITE should be construed as granting, by implication, estoppel or otherwise, any license or right to use any Intellectual Property displayed or used on our WEBSITE, without the prior written permission of the Intellectual Property owner. jingga aggressively enforces its intellectual property rights to the fullest extent of the law. The names and logos of jingga, may not be used in any way, including in advertising or publicity pertaining to distribution of materials on our WEBSITE, without prior, written permission from jingga. jingga prohibits use of any logo of jingga or any of its affiliates as part of a link to or from any WEBSITE unless jingga approves such link in advance and in writing. Fair use of jingga Intellectual Property requires proper acknowledgment. Other product and company names mentioned in our Website may be the Intellectual Property of their respective owners.
## Links
Our SERVICE may contain links to third-party web sites or services that are not owned or controlled by the COMPANY.
The COMPANY has no control over, and assumes no responsibility for, the contentthird-party web sites or services that You visit.
## Termination
We may terminate or suspend Your access immediately, without prior notice or liability, for any reason whatsoever, including without limitation if You breach these TERMS.
Upon termination, Your right to use the SERVICE or APPLICATION will cease immediately unless the SERVICE or APPLICATION represents a "offline" SERVICE or APPLICATION, a SERVICE or APPLICATION which doesn't require any online connection, other SERVICES which We terminated, or third-party services. We have no contorl over thrid-party resources and services which may be necessary for some of Our SERVICES and APPLICATIONS. Changes by these third-parties may lead to the termination of the SERVICE or APPLICATION or reducing their functionality. You understand these dependencies and SERVICE and APPLICATION limitations and accept that the termination or reduced functionality cannot be used as reason for dispute, revocation or similarly.
## Limitation of Liability
Notwithstanding any damages that You might incur, the entire liability of the COMPANY and any of its suppliers under any provision of this TERMS and Your exclusive remedy for all of the foregoing shall be limited to the amount actually paid by through the SERVICE.
To the maximum extent permitted by applicable law, in no event shall the COMPANY or its suppliers be liable for any special, incidental, indirect, or consequential damages whatsoever (including, but not limited to, damages for loss of profits, loss of data or other information, for business interruption, for personal injury, loss of privacy arising out of or in any way related to the use of or inability to use the SERVICE, third-party software and/or third-party hardware used with the SERVICE, or otherwise in connection with any provision of this TERMS), even if the COMPANY or any supplier has been advised of the possibility of such damages and even if the remedy fails of its essential purpose.
Some states or countries do not allow the exclusion of implied warranties or limitation of liability for incidental or consequential damages, which means that some of the above limitations may not apply. In these states or countries, each party's liability will be limited to the greatest extent permitted by law.
## Disclaimer
The SERVICE is provided to You "AS IS" and "AS AVAILABLE" and with all faults and defects without warranty of any kind. To the maximum extent permitted under applicable law, the COMPANY, on its own behalf and on behalf of its AFFILIATES and its and their respective licensors and service providers, expressly disclaims all warranties, whether express, implied, statutory or otherwise, with respect to the SERVICE, including all implied warranties of merchantability, fitness for a particular purpose, title and non-infringement, and warranties that may arise out of course of dealing, course of performance, usage or trade practice. Without limitation to the foregoing, the COMPANY provides no warranty or undertaking, and makes no representation of any kind that the SERVICE will meet Your requirements, achieve any intended results, be compatible or work with any other software, applications, systems or services, operate without interruption, meet any performance or reliability standards or be error free or that any errors or defects can or will be corrected.
Without limiting the foregoing, neither the COMPANY nor any of the company's provider makes any representation or warranty of any kind, express or implied: (i) as to the operation or availability of the SERVICE, or the information, content, and materials or products included thereon; (ii) that the SERVICE will be uninterrupted or error-free; (iii) as to the accuracy, reliability, or currency of any information or content provided through the SERVICE; or (iv) that the SERVICE, its servers, the content, or e-mails sent from or on behalf of the COMPANY are free of viruses, scripts, trojan horses, worms, malware, timebombs or other harmful components.
Some jurisdictions do not allow the exclusion of certain types of warranties or limitations on applicable statutory rights of a consumer, so some or all of the above exclusions and limitations may not apply to You. But in such a case the exclusions and limitations set forth in this section shall be applied to the greatest extent enforceable under applicable law.
## Governing Law
The laws of the COUNTRY, excluding its conflicts of law rules, shall govern these TERMS and Your use of the SERVICE. Your use of the APPLICATION may also be subject to other local, state, national, or international laws.
The ineffectiveness of one or more provisions of this agreement does not affect the validity of the others. Each party to these TERMS can in this case demand that a new valid provision be agreed which best achieves the economic purpose of the ineffective provision.
## Dispute Resolution
If You have any concern or dispute about the Service, You agree to first try to resolve the dispute informally by contacting the COMPANY.
## Revocation
You have no right of revocation for any SERVICES and APPLICATIONS unless different revocation rights exist in your jurisdiction. In such a case the revocation set forth in this section shall be applied to the lowest amount enforcable under applicable law.
## Delivery
The delivery of any SERVICES and APPLICATIONS unless specified differently takes place within 30 business days. Delivery in this context only includes the access to a download link, authentication to a online service, or license key via email.
## Payment
The payment terms are always prepayment unless otherwise agreed upon. Payments must be done via credit card.
## Reservation of ownership
Until the complete payment the ownership of the SERVICES and APPLICATIONS belongs to Us. Ownership of SERVICES and APPLICATIONS only include user licenses and in no way ownership for the assets, intellectual property and especially the source code of the SERVICES and APPLICATIONS. You have no right to create copies of Our SERVICES or APPLICATIONS or re-distribute our SERVICES and APPLICATIONS under any circumstance.
## Legal Compliance
You represent and warrant that (i) You are not located in a country that is subject to the United States government embargo, or that has been designated by the United States, German or EU government as a "terrorist supporting" country, and (ii) You are not listed on any United States, German or EU government list of prohibited or restricted parties.
## Changes to these Terms
We reserve the right, at Our sole discretion, to modify or replace these TERMS at any time. If a revision is material We will make reasonable efforts to provide at least 30 days' notice prior to any new terms taking effect. What constitutes a material change will be determined at Our sole discretion.
By continuing to access or use Our SERVICE after those revisions become effective, You agree to be bound by the revised terms. If You do not agree to the new terms, in whole or in part, please stop using the WEBSITE and the SERVICE.
## Contact
For questions regarding these TERMS, privacy policies, or practices of any third party websites or services please feel free to contact us at info@jingga.app. You further acknowledge and agree that the COMPANY shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any such content, goods or services available on or through any such websites or services.
We strongly advise You to read the terms and conditions and privacy policies of any third-party web sites or services that You visit.
Version 2022-08-14

View File

@ -13,12 +13,134 @@ body {
flex-direction: column;
}
nav {
overflow-y: auto;
font-size: 0.8em;
color: rgba(0, 0, 0, 0.8);
flex-shrink: 0;
header, footer {
background-size: 100% 100%;
background-repeat: no-repeat;
min-height: 20rem;
display: flex;
flex-direction: column;
user-select: none;
color: #fff;
}
header {
align-items: flex-start;
background-image: url(Applications/Frontend/img/top.svg);
}
header .floater, footer .floater {
display: flex;
flex-direction: row;
align-items: center;
}
#toplogo {
flex: 1;
display: flex;
align-items: center;
}
#toplogo span {
font-size: 1.5rem;
margin-left: 1rem;
font-weight: 400;
}
footer {
align-items: flex-end;
background-image: url(Applications/Frontend/img/bottom.svg);
padding-bottom: 1rem;
}
footer .floater {
align-items: flex-start;
}
#copyright {
flex: 1;
}
main {
flex: 1;
}
nav {
font-size: 0.8em;
display: flex;
flex-direction: row;
user-select: none;
padding: 2rem;
}
nav li {
display: inline-block;
font-weight: 400;
}
#topnav {
margin-right: .5rem;
}
#topnav a, #toplogin a {
border: 2px solid rgba(255, 255, 255, 0);
border-radius: 3rem;
padding: .5rem 1rem .5rem 1rem;
}
#topnav a:hover, #signinButton:hover {
border: 2px solid rgba(255, 255, 255, 0.25);
}
#toplogin {
border-left: 1px solid rgba(255, 255, 255, 0.25);
padding-left: .5rem;
}
#signupButton {
background: rgba(255, 255, 255, 0.25);
}
#signupButton:hover {
border: 2px solid rgba(255, 255, 255, 0);
background: rgba(255, 255, 255, 0.3);
}
.floater {
width: 95%;
max-width: 900px;
margin: 0 auto;
}
.portlet {
background: #fff;
border-radius: 1rem;
}
.portlet-head {
color: #000;
font-weight: 400;
}
.portlet-body {
color: rgba(0, 0, 0, 0.5);
}
@media only screen and (max-width: 650px) {
#toplogo {
display: none;
}
nav {
flex-direction: column;
padding: 1rem 0 0 0;
}
#toplogin {
margin-top: 2rem;
border: none;
padding: 0;
}
header, footer {
min-height: 12rem;
background-size: cover;
}
}

View File

@ -25,6 +25,7 @@ $dispatch = $this->getData('dispatch') ?? [];
<html lang="<?= $this->printHtml($this->response->getLanguage()); ?>">
<head>
<meta charset="utf-8">
<base href="<?= UriFactory::build('{/base}'); ?>/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#343a40">
<meta name="msapplication-navbutton-color" content="#343a40">
@ -44,24 +45,22 @@ $dispatch = $this->getData('dispatch') ?? [];
<script><?= $head->renderScript(); ?></script>
</head>
<body>
<?php include __DIR__ . '/tpl/nav.tpl.php'; ?>
<?php include __DIR__ . '/tpl/header.tpl.php'; ?>
<main>
<div id="content" class="container-fluid" role="main">
<?php
$c = 0;
foreach ($dispatch as $view) {
if (!($view instanceof \phpOMS\Views\NullView)
&& $view instanceof \phpOMS\Contract\RenderableInterface
) {
++$c;
echo $view->render();
<div class="floater">
<div id="content" class="container-fluid" role="main">
<?php
$c = 0;
foreach ($dispatch as $view) {
if (!($view instanceof \phpOMS\Views\NullView)
&& $view instanceof \phpOMS\Contract\RenderableInterface
) {
++$c;
echo $view->render();
}
}
}
if ($c === 0) {
echo '<div class="emptyPage"></div>';
}
?>
?>
</div>
</div>
</main>
<?php include __DIR__ . '/tpl/footer.tpl.php'; ?>

View File

@ -2,4 +2,13 @@
declare(strict_types=1);
return [[
'Home' => 'Home',
'Features' => 'Features',
'Pricing' => 'Pricing',
'SignIn' => 'Sign In',
'SignUp' => 'Sign Up',
'Terms' => 'Terms',
'Privacy' => 'Privacy',
'Imprint' => 'Imprint',
'Contact' => 'Contact',
]];

View File

@ -1,3 +1,17 @@
<?php
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<footer>
footer
<div class="floater">
<div id="copyright">(c) Dennis Eichhorn</div>
<ul id="bottomnav">
<li><a href="<?= UriFactory::build('{/lang}/terms'); ?>"><?= $this->getHtml('Terms', '0', '0'); ?></a></li>
<li><a href="<?= UriFactory::build('{/lang}/privacy'); ?>"><?= $this->getHtml('Privacy', '0', '0'); ?></a></li>
<li><a href="<?= UriFactory::build('{/lang}/imprint'); ?>"><?= $this->getHtml('Imprint', '0', '0'); ?></a></li>
<li><a href="<?= UriFactory::build('{/lang}/contact'); ?>"><?= $this->getHtml('Contact', '0', '0'); ?></a></li>
</ul>
</div>
</footer>

View File

@ -1,2 +1,17 @@
<nav>ttt
</nav>
<?php
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
?>
<nav>
<ul id="topnav">
<li><a href="<?= UriFactory::build('{/lang}'); ?>"><?= $this->getHtml('Home', '0', '0'); ?></a></li>
<li><a href="<?= UriFactory::build('{/lang}/features'); ?>"><?= $this->getHtml('Features', '0', '0'); ?></a></li>
<li><a href="<?= UriFactory::build('{/lang}/pricing'); ?>"><?= $this->getHtml('Pricing', '0', '0'); ?></a></li>
</ul>
<ul id="toplogin">
<li><a id="signinButton" target="_blank" href="<?= UriFactory::build('{/lang}/backend'); ?>"><?= $this->getHtml('SignIn', '0', '0'); ?></a></li>
<li><a id="signupButton" href="<?= UriFactory::build('{/lang}/signup'); ?>"><?= $this->getHtml('SignUp', '0', '0'); ?></a></li>
</ul>
</nav>

View File

@ -1,8 +1,44 @@
<?php
declare(strict_types=1);
namespace Controllers;
use Models\AccountMapper;
use phpOMS\Auth\LoginReturnType;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Model\Message\Notify;
use phpOMS\Model\Message\NotifyType;
use phpOMS\Model\Message\Reload;
use phpOMS\System\MimeType;
use WebApplication;
class ApiController
{
private WebApplication $app;
public function __construct(WebApplication $app = null)
{
$this->app = $app;
}
public function apiLogin(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
{
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
$login = AccountMapper::login((string) ($request->getData('user') ?? ''), (string) ($request->getData('pass') ?? ''));
if ($login >= LoginReturnType::OK) {
$this->app->sessionManager->set('UID', $login, true);
$this->app->sessionManager->save();
$response->set($request->uri->__toString(), new Reload());
} else {
$response->set($request->uri->__toString(), new Notify(
'Login failed due to wrong login information',
NotifyType::INFO
));
}
}
}

View File

@ -1,137 +1,109 @@
<?php
declare(strict_types=1);
namespace Controllers;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
use phpOMS\Utils\Parser\Markdown\Markdown;
class FrontController
{
/* Service provider */
public function viewFrontend(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function frontView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/front');
return $view;
}
public function viewFrontendLogin(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function featureView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/features');
return $view;
}
public function viewFrontendForgot(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function pricingView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/pricing');
return $view;
}
public function viewFrontendPricing(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function signupView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/signin');
return $view;
}
public function viewFrontendContact(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function imprintView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/default');
$lang = $request->getLanguage();
$path = \is_file(__DIR__ . '/../Applications/Frontend/content/imprint.' . $lang . '.md')
? __DIR__ . '/../Applications/Frontend/content/imprint.' . $lang . '.md'
: __DIR__ . '/../Applications/Frontend/content/imprint.en.md';
$markdown = Markdown::parse(\file_get_contents($path));
$view->setData('text', $markdown);
return $view;
}
public function viewFrontendImprint(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function termsView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/default');
$lang = $request->getLanguage();
$path = \is_file(__DIR__ . '/../Applications/Frontend/content/terms.' . $lang . '.md')
? __DIR__ . '/../Applications/Frontend/content/terms.' . $lang . '.md'
: __DIR__ . '/../Applications/Frontend/content/terms.en.md';
$markdown = Markdown::parse(\file_get_contents($path));
$view->setData('text', $markdown);
return $view;
}
public function viewFrontendTerms(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function privacyView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/default');
$lang = $request->getLanguage();
$path = \is_file(__DIR__ . '/../Applications/Frontend/content/privacy.' . $lang . '.md')
? __DIR__ . '/../Applications/Frontend/content/privacy.' . $lang . '.md'
: __DIR__ . '/../Applications/Frontend/content/privacy.en.md';
$markdown = Markdown::parse(\file_get_contents($path));
$view->setData('text', $markdown);
return $view;
}
public function viewFrontendAbout(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewFrontendPrivacy(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewFrontendDemo(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewFrontendOrganizationList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewFrontendOrganizationSetting(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewFrontendUserList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewFrontendUserSetting(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
/* User */
public function viewBackendDashboard(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendLogin(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendForgot(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendOrgSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendUserList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendUserSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendPosts(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendImprint(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendTerms(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBackendPrivacy(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
{
}
public function viewBuildSoftware(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
public function contactView(RequestAbstract $request, ResponseAbstract $response, mixed $data = null): RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Applications/Frontend/tpl/contact');
return $view;
}
}

View File

@ -1,275 +0,0 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://karaka.app
*/
declare(strict_types=1);
namespace Install;
use phpOMS\DataStorage\Database\DatabaseStatus;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
use phpOMS\Dispatcher\Dispatcher;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Localization\Localization;
use phpOMS\Log\FileLogger;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Router\RouteVerb;
use phpOMS\Router\WebRouter;
use phpOMS\System\MimeType;
use phpOMS\Uri\UriFactory;
use phpOMS\Views\View;
/**
* Application class.
*
* @package Install
* @license OMS License 1.0
* @link https://karaka.app
* @since 1.0.0
*
* @property \phpOMS\Router\WebRouter $router
*/
final class WebApplication extends InstallAbstract
{
/**
* Constructor.
*
* @param array $config Core config
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function __construct(array $config)
{
$this->setupHandlers();
$this->logger = FileLogger::getInstance($config['log']['file']['path'], false);
$request = $this->initRequest($config['page']['root'], $config['language'][0]);
$response = $this->initResponse($request, $config['language']);
UriFactory::setupUriBuilder($request->uri);
$this->run($request, $response);
$response->header->push();
echo $response->getBody();
}
/**
* Initialize current application request
*
* @param string $rootPath Web root path
* @param string $language Fallback language
*
* @return HttpRequest Initial client request
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function initRequest(string $rootPath, string $language) : HttpRequest
{
$request = HttpRequest::createFromSuperglobals();
$subDirDepth = \substr_count($rootPath, '/');
$request->createRequestHashs($subDirDepth);
$request->uri->setRootPath($rootPath);
UriFactory::setupUriBuilder($request->uri);
$langCode = \strtolower($request->uri->getPathElement(0));
$request->header->l11n->setLanguage(
empty($langCode) || !ISO639x1Enum::isValidValue($langCode) ? $language : $langCode
);
UriFactory::setQuery('/lang', $request->getLanguage());
return $request;
}
/**
* Initialize basic response
*
* @param HttpRequest $request Client request
* @param array $languages Supported languages
*
* @return HttpResponse Initial client request
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function initResponse(HttpRequest $request, array $languages) : HttpResponse
{
$response = new HttpResponse(new Localization());
$response->header->set('content-type', 'text/html; charset=utf-8');
$response->header->set('x-xss-protection', '1; mode=block');
$response->header->set('x-content-type-options', 'nosniff');
$response->header->set('x-frame-options', 'SAMEORIGIN');
$response->header->set('referrer-policy', 'same-origin');
if ($request->isHttps()) {
$response->header->set('strict-transport-security', 'max-age=31536000');
}
$response->header->l11n->setLanguage(
!\in_array($request->getLanguage(), $languages) ? 'en' : $request->getLanguage()
);
return $response;
}
/**
* Rendering backend.
*
* @param HttpRequest $request Request
* @param HttpResponse $response Response
*
* @return void
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function run(HttpRequest $request, HttpResponse $response) : void
{
$this->dispatcher = new Dispatcher($this);
$this->router = new WebRouter();
$this->setupRoutes();
$response->header->set('content-language', $response->getLanguage(), true);
UriFactory::setQuery('/lang', $response->getLanguage());
$this->dispatcher->dispatch(
$this->router->route(
$request->uri->getRoute(),
$request->getData('CSRF'),
$request->getRouteVerb()
),
$request,
$response
);
}
/**
* Setup routes for installer
*
* @return void
*
* @since 1.0.0
* @codeCoverageIgnore
*/
private function setupRoutes() : void
{
$this->router->add('^.*', '\Install\WebApplication::installView', RouteVerb::GET);
$this->router->add('^.*', '\Install\WebApplication::installRequest', RouteVerb::PUT);
}
/**
* Create install view
*
* @param HttpRequest $request Request
* @param HttpResponse $response Response
*
* @return void
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public static function installView(HttpRequest $request, HttpResponse $response) : void
{
$view = new View(null, $request, $response);
$view->setTemplate('/Install/index');
$response->set('Content', $view);
}
/**
* Handle install request.
*
* @param HttpRequest $request Request
* @param HttpResponse $response Response
*
* @return void
*
* @api
*
* @since 1.0.0
*/
public static function installRequest(HttpRequest $request, HttpResponse $response) : void
{
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
if (!empty(self::validateRequest($request))) {
$response->header->status = RequestStatusCode::R_400;
return;
}
$db = self::setupDatabaseConnection($request);
$db->connect();
if ($db->getStatus() !== DatabaseStatus::OK) {
$response->header->status = RequestStatusCode::R_400;
return;
}
DataMapperFactory::db($db);
self::clearOld();
self::installConfigFile($request);
self::installCore($db);
self::installGroups($db);
self::installUsers($request, $db);
self::installApplications($request, $db);
self::configureCoreModules($request, $db);
$response->header->status = RequestStatusCode::R_200;
}
/**
* Validate install request.
*
* @param HttpRequest $request Request
*
* @return array<string, bool>
*
* @since 1.0.0
*/
private static function validateRequest(HttpRequest $request) : array
{
$valid = [];
if (($valid['php_extensions'] = !self::hasPhpExtensions())
|| ($valid['iDbHost'] = empty($request->getData('dbhost')))
|| ($valid['iDbType'] = empty($request->getData('dbtype')))
|| ($valid['iDbPort'] = empty($request->getData('dbport')))
|| ($valid['iDbName'] = empty($request->getData('dbname')))
|| ($valid['iSchemaUser'] = empty($request->getData('schemauser')))
//|| ($valid['iSchemaPassword'] = empty($request->getData('schemapassword')))
|| ($valid['iCreateUser'] = empty($request->getData('createuser')))
//|| ($valid['iCreatePassword'] = empty($request->getData('createpassword')))
|| ($valid['iSelectUser'] = empty($request->getData('selectuser')))
//|| ($valid['iSelectPassword'] = empty($request->getData('selectpassword')))
|| ($valid['iDeleteUser'] = empty($request->getData('deleteuser')))
//|| ($valid['iDeletePassword'] = empty($request->getData('deletepassword')))
|| ($valid['iDbName'] = !self::testDbConnection($request))
|| ($valid['iOrgName'] = empty($request->getData('orgname')))
|| ($valid['iAdminName'] = empty($request->getData('adminname')))
//|| ($valid['iAdminPassword'] = empty($request->getData('adminpassword')))
|| ($valid['iAdminEmail'] = empty($request->getData('adminemail')))
|| ($valid['iDomain'] = empty($request->getData('domain')))
|| ($valid['iWebSubdir'] = empty($request->getData('websubdir')))
|| ($valid['iDefaultLang'] = empty($request->getData('defaultlang')))
) {
return $valid;
}
return [];
}
}

View File

@ -1,4 +1,5 @@
<?php
/**
* Karaka
*
@ -10,6 +11,7 @@
* @version 1.0.0
* @link https://karaka.app
*/
declare(strict_types=1);
namespace Install;
@ -28,12 +30,14 @@ use phpOMS\Account\PermissionType;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\DataStorage\Database\Schema\Builder as SchemaBuilder;
use phpOMS\Message\RequestAbstract;
abstract class InstallAbstract extends ApplicationAbstract
{
protected function setupHandlers() : void
protected function setupHandlers(): void
{
\set_exception_handler(['\phpOMS\UnhandledHandler', 'exceptionHandler']);
\set_error_handler(['\phpOMS\UnhandledHandler', 'errorHandler']);
@ -41,24 +45,24 @@ abstract class InstallAbstract extends ApplicationAbstract
\mb_internal_encoding('UTF-8');
}
protected static function clearOld() : void
protected static function clearOld(): void
{
\file_put_contents(__DIR__ . '/../Routes.php', '<?php return [];');
\file_put_contents(__DIR__ . '/../Hooks.php', '<?php return [];');
}
protected static function hasPhpExtensions() : bool
protected static function hasPhpExtensions(): bool
{
return \extension_loaded('pdo')
&& \extension_loaded('mbstring');
}
protected static function testDbConnection(RequestAbstract $request) : bool
protected static function testDbConnection(RequestAbstract $request): bool
{
return true;
}
protected static function setupDatabaseConnection(RequestAbstract $request) : ConnectionAbstract
protected static function setupDatabaseConnection(RequestAbstract $request): ConnectionAbstract
{
return ConnectionFactory::create([
'db' => (string) $request->getData('dbtype'),
@ -70,13 +74,13 @@ abstract class InstallAbstract extends ApplicationAbstract
]);
}
protected static function installConfigFile(RequestAbstract $request) : void
protected static function installConfigFile(RequestAbstract $request): void
{
self::editConfigFile($request);
self::editHtaccessFile($request);
}
protected static function editConfigFile(RequestAbstract $request) : void
protected static function editConfigFile(RequestAbstract $request): void
{
$db = $request->getData('dbtype');
$host = $request->getData('dbhost');
@ -107,7 +111,7 @@ abstract class InstallAbstract extends ApplicationAbstract
\file_put_contents(__DIR__ . '/../config.php', $config);
}
protected static function editHtaccessFile(RequestAbstract $request) : void
protected static function editHtaccessFile(RequestAbstract $request): void
{
$fullTLD = $request->getData('domain');
$tld = \str_replace(['.', 'http://', 'https://'], ['\.', '', ''], $request->getData('domain') ?? '');
@ -119,12 +123,13 @@ abstract class InstallAbstract extends ApplicationAbstract
\file_put_contents(__DIR__ . '/../../server/config.json', \json_encode($config, \JSON_PRETTY_PRINT));
}
protected static function installCore(ConnectionAbstract $db) : void
protected static function installCore(ConnectionAbstract $db): void
{
self::createBaseTables($db);
self::populateBaseTableData($db);
}
protected static function createBaseTables(ConnectionAbstract $db) : void
protected static function createBaseTables(ConnectionAbstract $db): void
{
$path = __DIR__ . '/db.json';
if (!\is_file($path)) {
@ -142,13 +147,109 @@ abstract class InstallAbstract extends ApplicationAbstract
}
}
protected static function installGroups(ConnectionAbstract $db) : void
protected static function populateBaseTableData(ConnectionAbstract $db): void
{
self::installMainGroups($db);
self::installGroupPermissions($db);
$sqlite = new SQLiteConnection([
'db' => 'sqlite',
'database' => __DIR__ . '/../phpOMS/Localization/Defaults/localization.sqlite',
]);
self::installCountries($sqlite, $db);
self::installLanguages($sqlite, $db);
self::installCurrencies($sqlite, $db);
$sqlite->close();
}
protected static function installMainGroups(ConnectionAbstract $db) : void
private static function installCountries(SQLiteConnection $sqlite, ConnectionAbstract $con): void
{
$query = new Builder($con);
$query->insert('country_name', 'country_code2', 'country_code3', 'country_numeric', 'country_region', 'country_developed')
->into('country');
$querySqlite = new Builder($sqlite);
$countries = $querySqlite->select('*')->from('country')->execute();
if ($countries === null) {
return;
}
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_numeric'],
$country['country_region'],
(int) $country['country_developed']
);
}
$query->execute();
}
private static function installLanguages(SQLiteConnection $sqlite, ConnectionAbstract $con): void
{
$query = new Builder($con);
$query->insert('language_name', 'language_native', 'language_639_1', 'language_639_2T', 'language_639_2B', 'language_639_3')
->into('language');
$querySqlite = new Builder($sqlite);
$languages = $querySqlite->select('*')->from('language')->execute();
if ($languages === null) {
return;
}
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'])
);
}
$query->execute();
}
private static function installCurrencies(SQLiteConnection $sqlite, ConnectionAbstract $con): void
{
$query = new Builder($con);
$query->insert('currency_id', 'currency_name', 'currency_code', 'currency_number', 'currency_symbol', 'currency_subunits', 'currency_decimal', 'currency_countries')
->into('currency');
$querySqlite = new Builder($sqlite);
$currencies = $querySqlite->select('*')->from('currency')->execute();
if ($currencies === null) {
return;
}
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_subunits'],
$currency['currency_decimal'] === null ? null : \trim($currency['currency_decimal']),
$currency['currency_countries'] === null ? null : \trim($currency['currency_countries'])
);
}
$query->execute();
}
protected static function installGroups(ConnectionAbstract $db): void
{
self::installMainGroups($db);
}
protected static function installMainGroups(ConnectionAbstract $db): void
{
$guest = new Group('guest');
$guest->setStatus(GroupStatus::ACTIVE);
@ -163,29 +264,12 @@ abstract class InstallAbstract extends ApplicationAbstract
GroupMapper::create()->execute($admin);
}
protected static function installGroupPermissions(ConnectionAbstract $db) : void
{
$searchPermission = new GroupPermission(
group: 2,
category: PermissionCategory::SEARCH,
permission: PermissionType::READ
);
$adminPermission = new GroupPermission(
group: 3,
permission: PermissionType::READ | PermissionType::CREATE | PermissionType::MODIFY | PermissionType::DELETE | PermissionType::PERMISSION
);
GroupPermissionMapper::create()->execute($searchPermission);
GroupPermissionMapper::create()->execute($adminPermission);
}
protected static function installUsers(RequestAbstract $request, ConnectionAbstract $db) : void
protected static function installUsers(RequestAbstract $request, ConnectionAbstract $db): void
{
self::installMainUser($request, $db);
}
protected static function installApplications(RequestAbstract $request, ConnectionAbstract $db) : void
protected static function installApplications(RequestAbstract $request, ConnectionAbstract $db): void
{
if ($request->getData('installtype') === 'orm') {
\copy(__DIR__ . '/Templates/ORMRoutes.php', __DIR__ . '/../Routes.php');
@ -194,7 +278,7 @@ abstract class InstallAbstract extends ApplicationAbstract
}
}
protected static function installMainUser(RequestAbstract $request, ConnectionAbstract $db) : void
protected static function installMainUser(RequestAbstract $request, ConnectionAbstract $db): void
{
$account = new Account();
$account->setStatus(AccountStatus::ACTIVE);

View File

@ -1,15 +1,78 @@
<?php
declare(strict_types=1);
use phpOMS\Router\RouteVerb;
return [
'.*?/about' => 'FrontController:aboutView',
'.*?/imprint' => 'FrontController:imprintView',
'.*?/terms' => 'FrontController:termsView',
'.*?/privacy' => 'FrontController:privacyView',
'.*?/contact' => 'FrontController:contactView',
'.*?/imprint' => [
[
'dest' => '\Controllers\FrontController:imprintView',
'verb' => RouteVerb::GET,
],
],
'.*?/terms' => [
[
'dest' => '\Controllers\FrontController:termsView',
'verb' => RouteVerb::GET,
],
],
'.*?/privacy' => [
[
'dest' => '\Controllers\FrontController:privacyView',
'verb' => RouteVerb::GET,
],
],
'.*?/contact' => [
[
'dest' => '\Controllers\FrontController:contactView',
'verb' => RouteVerb::GET,
],
],
'^/*$' => 'FrontController:frontView',
'.*?/login' => 'FrontController:loginView',
'^/*$' => [
[
'dest' => '\Controllers\FrontController:frontView',
'verb' => RouteVerb::GET,
],
],
'.*?/features' => [
[
'dest' => '\Controllers\FrontController:featureView',
'verb' => RouteVerb::GET,
],
],
'.*?/pricing' => [
[
'dest' => '\Controllers\FrontController:pricingView',
'verb' => RouteVerb::GET,
],
],
'.*?/signin' => [
[
'dest' => '\Controllers\BackendController:signinView',
'verb' => RouteVerb::GET,
],
],
'.*?/signup' => [
[
'dest' => '\Controllers\FrontController:signupView',
'verb' => RouteVerb::GET,
],
],
'.*?/api/download' => 'ApiController:downloadView',
'.*?/api/download' => [
[
'dest' => '\Controllers\ApiController:downloadView',
'verb' => RouteVerb::GET,
],
],
'^.*?/login(\?.*|$)' => [
[
'dest' => '\Controllers\ApiController:apiLogin',
'verb' => RouteVerb::SET,
'permission' => [
],
],
],
];

View File

@ -98,6 +98,415 @@
}
}
},
"language": {
"name": "language",
"fields": {
"language_id": {
"name": "language_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"language_name": {
"name": "language_name",
"type": "VARCHAR(100)",
"null": false
},
"language_native": {
"name": "language_native",
"type": "VARCHAR(100)",
"null": false
},
"language_639_1": {
"name": "language_639_1",
"type": "VARCHAR(2)",
"null": false,
"unique": true
},
"language_639_2T": {
"name": "language_639_2T",
"type": "VARCHAR(3)",
"null": false,
"unique": true
},
"language_639_2B": {
"name": "language_639_2B",
"type": "VARCHAR(3)",
"null": false
},
"language_639_3": {
"name": "language_639_3",
"type": "VARCHAR(10)",
"null": false
}
}
},
"currency": {
"name": "currency",
"fields": {
"currency_id": {
"name": "currency_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"currency_name": {
"name": "currency_name",
"type": "VARCHAR(100)",
"null": false
},
"currency_number": {
"name": "currency_number",
"type": "VARCHAR(3)",
"null": false
},
"currency_symbol": {
"name": "currency_symbol",
"type": "VARCHAR(5)",
"null": true
},
"currency_code": {
"name": "currency_code",
"type": "VARCHAR(3)",
"null": false,
"unique": true
},
"currency_decimal": {
"name": "currency_decimal",
"type": "VARCHAR(10)",
"null": false
},
"currency_subunits": {
"name": "currency_subunits",
"type": "INT(11)",
"null": true
},
"currency_countries": {
"name": "currency_countries",
"type": "TEXT",
"null": false
}
}
},
"l11n": {
"name": "l11n",
"fields": {
"l11n_id": {
"name": "l11n_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"l11n_country": {
"name": "l11n_country",
"type": "VARCHAR(2)",
"default": null,
"null": true,
"foreignTable": "country",
"foreignKey": "country_code2"
},
"l11n_language": {
"name": "l11n_language",
"type": "VARCHAR(2)",
"default": null,
"null": true,
"foreignTable": "language",
"foreignKey": "language_639_1"
},
"l11n_datetime": {
"name": "l11n_datetime",
"type": "INT(11)",
"default": null,
"null": true
},
"l11n_currency": {
"name": "l11n_currency",
"type": "VARCHAR(3)",
"default": null,
"null": true,
"foreignTable": "currency",
"foreignKey": "currency_code"
},
"l11n_currency_format": {
"name": "l11n_currency_format",
"type": "VARCHAR(20)",
"null": false
},
"l11n_number_thousand": {
"name": "l11n_number_thousand",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_number_decimal": {
"name": "l11n_number_decimal",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_angle": {
"name": "l11n_angle",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_temperature": {
"name": "l11n_temperature",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_weight_very_light": {
"name": "l11n_weight_very_light",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_weight_light": {
"name": "l11n_weight_light",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_weight_medium": {
"name": "l11n_weight_medium",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_weight_heavy": {
"name": "l11n_weight_heavy",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_weight_very_heavy": {
"name": "l11n_weight_very_heavy",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_speed_very_slow": {
"name": "l11n_speed_very_slow",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_speed_slow": {
"name": "l11n_speed_slow",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_speed_medium": {
"name": "l11n_speed_medium",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_speed_fast": {
"name": "l11n_speed_fast",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_speed_very_fast": {
"name": "l11n_speed_very_fast",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_speed_sea": {
"name": "l11n_speed_sea",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_length_very_short": {
"name": "l11n_length_very_short",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_length_short": {
"name": "l11n_length_short",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_length_medium": {
"name": "l11n_length_medium",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_length_long": {
"name": "l11n_length_long",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_length_very_long": {
"name": "l11n_length_very_long",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_length_sea": {
"name": "l11n_length_sea",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_area_very_small": {
"name": "l11n_area_very_small",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_area_small": {
"name": "l11n_area_small",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_area_medium": {
"name": "l11n_area_medium",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_area_large": {
"name": "l11n_area_large",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_area_very_large": {
"name": "l11n_area_very_large",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_very_small": {
"name": "l11n_volume_very_small",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_small": {
"name": "l11n_volume_small",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_medium": {
"name": "l11n_volume_medium",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_large": {
"name": "l11n_volume_large",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_very_large": {
"name": "l11n_volume_very_large",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_teaspoon": {
"name": "l11n_volume_teaspoon",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_tablespoon": {
"name": "l11n_volume_tablespoon",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_volume_glass": {
"name": "l11n_volume_glass",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_timezone": {
"name": "l11n_timezone",
"type": "VARCHAR(255)",
"default": null,
"null": true
},
"l11n_datetime_very_short": {
"name": "l11n_datetime_very_short",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_datetime_short": {
"name": "l11n_datetime_short",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_datetime_medium": {
"name": "l11n_datetime_medium",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_datetime_long": {
"name": "l11n_datetime_long",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_datetime_very_long": {
"name": "l11n_datetime_very_long",
"type": "VARCHAR(20)",
"default": null,
"null": true
},
"l11n_precision_very_short": {
"name": "l11n_precision_very_short",
"type": "SMALLINT(4)",
"default": null,
"null": true
},
"l11n_precision_short": {
"name": "l11n_precision_short",
"type": "SMALLINT(4)",
"default": null,
"null": true
},
"l11n_precision_medium": {
"name": "l11n_precision_medium",
"type": "SMALLINT(4)",
"default": null,
"null": true
},
"l11n_precision_long": {
"name": "l11n_precision_long",
"type": "SMALLINT(4)",
"default": null,
"null": true
},
"l11n_precision_very_long": {
"name": "l11n_precision_very_long",
"type": "SMALLINT(4)",
"default": null,
"null": true
}
}
},
"org": {
"name": "org",
"fields": {
@ -200,6 +609,11 @@
"type": "TINYINT",
"null": false
},
"account_type": {
"name": "account_type",
"type": "TINYINT",
"null": false
},
"account_login": {
"name": "account_login",
"type": "VARCHAR(50)",
@ -207,18 +621,48 @@
"null": true,
"unique": true
},
"account_name1": {
"name": "account_name1",
"type": "VARCHAR(255)",
"null": false,
"annotations": {
"gdpr": true
}
},
"account_name2": {
"name": "account_name2",
"type": "VARCHAR(255)",
"null": false,
"annotations": {
"gdpr": true
}
},
"account_name3": {
"name": "account_name3",
"type": "VARCHAR(255)",
"null": false,
"annotations": {
"gdpr": true
}
},
"account_password": {
"name": "account_password",
"type": "VARCHAR(64)",
"default": null,
"null": true
},
"account_reset_hash": {
"name": "account_reset_hash",
"account_password_temp": {
"name": "account_password_temp",
"type": "VARCHAR(64)",
"default": null,
"null": true
},
"account_password_temp_limit": {
"name": "account_password_temp_limit",
"type": "DATETIME",
"default": null,
"null": true
},
"account_email": {
"name": "account_email",
"type": "VARCHAR(70)",
@ -233,18 +677,19 @@
"null": false,
"default": 0
},
"account_lang": {
"name": "account_lang",
"type": "VARCHAR(2)",
"null": false
},
"account_org": {
"name": "account_org",
"type": "INT",
"null": true,
"account_lactive": {
"name": "account_lactive",
"type": "DATETIME",
"default": null,
"foreignTable": "org",
"foreignKey": "org_id"
"null": true
},
"account_localization": {
"name": "account_localization",
"type": "INT",
"default": null,
"null": true,
"foreignTable": "l11n",
"foreignKey": "l11n_id"
},
"account_created_at": {
"name": "account_created_at",
@ -253,6 +698,72 @@
}
}
},
"group": {
"name": "group",
"fields": {
"group_id": {
"name": "group_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"group_name": {
"name": "group_name",
"type": "VARCHAR(50)",
"null": false
},
"group_status": {
"name": "group_status",
"type": "TINYINT",
"null": false
},
"group_desc": {
"name": "group_desc",
"type": "TEXT",
"default": null,
"null": true
},
"group_desc_raw": {
"name": "group_desc_raw",
"type": "TEXT",
"default": null,
"null": true
},
"group_created": {
"name": "group_created",
"type": "DATETIME",
"default": null,
"null": true
}
}
},
"account_group": {
"name": "account_group",
"fields": {
"account_group_id": {
"name": "account_group_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"account_group_group": {
"name": "account_group_group",
"type": "INT",
"null": false,
"foreignTable": "group",
"foreignKey": "group_id"
},
"account_group_account": {
"name": "account_group_account",
"type": "INT",
"null": false,
"foreignTable": "account",
"foreignKey": "account_id"
}
}
},
"org_bill": {
"name": "org_bill",
"fields": {
@ -399,7 +910,7 @@
},
"resource_info_account": {
"name": "resource_info_account",
"type": "VARCHAR(255)",
"type": "INT",
"null": true,
"default": null,
"foreignTable": "account",

View File

@ -17,7 +17,7 @@ declare(strict_types=1);
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="Install/img/favicon.ico" type="image/x-icon">
<script src="../jsOMS/Utils/oLib.js"></script>
</head>
<body>
@ -325,6 +325,7 @@ import { EventManager } from '../jsOMS/Event/EventManager.js'
import { Form } from '../jsOMS/UI/Component/Form.js'
import { redirectMessage } from '../jsOMS/Model/Message/Redirect.js';
import { Logger } from '../jsOMS/Log/Logger.js';
import { NotificationManager } from '../jsOMS/Message/Notification/NotificationManager.js';
jsOMS.ready(function ()
{
@ -359,15 +360,19 @@ jsOMS.ready(function ()
/* setup App */
const app = {
responseManager: new ResponseManager(),
eventManager: new EventManager()
eventManager: new EventManager(),
logger: Logger.getInstance(true, false, false),
notifyManager: new NotificationManager()
};
/** global: jsOMS */
window.omsApp = app;
const formManager = new Form(app);
app.responseManager.add('redirect', redirectMessage);
const formManager = new Form(app),
logger = Logger.getInstance();
window.logger = logger;
window.logger = app.logger;
formManager.bind('installForm');
formManager.get('installForm').injectSubmit(function(e) {
const valid = e.isValid();

View File

@ -1,15 +1,56 @@
<?php
declare(strict_types=1);
use phpOMS\Router\RouteVerb;
return [
'.*?/about' => 'FrontController:aboutView',
'.*?/imprint' => 'FrontController:imprintView',
'.*?/terms' => 'FrontController:termsView',
'.*?/privacy' => 'FrontController:privacyView',
'.*?/contact' => 'FrontController:contactView',
'.*?/imprint' => [
[
'dest' => '\Controllers\FrontController:imprintView',
'verb' => RouteVerb::GET,
],
],
'.*?/terms' => [
[
'dest' => '\Controllers\FrontController:termsView',
'verb' => RouteVerb::GET,
],
],
'.*?/privacy' => [
[
'dest' => '\Controllers\FrontController:privacyView',
'verb' => RouteVerb::GET,
],
],
'.*?/contact' => [
[
'dest' => '\Controllers\FrontController:contactView',
'verb' => RouteVerb::GET,
],
],
'^/*$' => 'FrontController:frontView',
'.*?/login' => 'FrontController:loginView',
'.*?/api/download' => 'ApiController:downloadView',
'^/*$' => [
[
'dest' => '\Controllers\FrontController:frontView',
'verb' => RouteVerb::GET,
],
],
'.*?/features' => [
[
'dest' => '\Controllers\FrontController:featureView',
'verb' => RouteVerb::GET,
],
],
'.*?/pricing' => [
[
'dest' => '\Controllers\FrontController:pricingView',
'verb' => RouteVerb::GET,
],
],
'.*?/signup' => [
[
'dest' => '\Controllers\FrontController:signupView',
'verb' => RouteVerb::GET,
],
],
];

@ -1 +1 @@
Subproject commit ddb28a71425c3d94d6f6fa09b6f696f9eae33fb4
Subproject commit 0faa4de2f7573252ad737fd450f695a022913dec