todos fixed

This commit is contained in:
Dennis Eichhorn 2023-10-12 22:49:20 +00:00
parent 87d44f7e97
commit 68ff204f10
10 changed files with 45 additions and 61 deletions

View File

@ -33,7 +33,6 @@ $excel = new DefaultExcel();
foreach ($data as $i => $row) {
foreach ($row as $j => $cell) {
// @todo: fix 26 column overflow.
$excel->getActiveSheet()->setCellValue(StringUtils::intToAlphabet($j + 1) . ($i + 1), $cell);
}
}

View File

@ -19,7 +19,7 @@ return [
[
'type' => 'setting',
'name' => SettingsEnum::PASSWORD_PATTERN,
'content' => '/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[.,\/\(\)\{\}\[\]#?!@$%^&*+=\':"-]).{8,}$/',
'content' => '/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[.,\/\(\)\{\}\[\]#?!@$%^&*+=\':-]).{8,}$/',
'module' => 'Admin',
],
[

View File

@ -633,20 +633,7 @@ final class ApiController extends Controller
$new->group = $group ?? $new->group;
$new->account = $account ?? $new->account;
// @todo: this function call seems stupid, it should just pass the $new object.
$this->app->appSettings->set([
[
'id' => $new->id,
'name' => $new->name,
'content' => $new->content,
'unit' => $new->unit,
'app' => $new->app,
'module' => $new->module,
'group' => $new->group,
'account' => $new->account,
'isEncrypted' => $new->isEncrypted,
],
], false);
$this->app->appSettings->set([$new], false);
$this->updateModel($request->header->account, $old, $new, SettingMapper::class, 'settings', $request->getOrigin());
}
@ -1332,8 +1319,6 @@ final class ApiController extends Controller
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateGroupDelete(RequestAbstract $request) : array
@ -1981,6 +1966,7 @@ final class ApiController extends Controller
|| ($val['unit'] = !$request->hasData('unit'))
|| ($val['app'] = !$request->hasData('app'))
|| ($val['password'] = !$request->hasData('password'))
|| ($val['terms'] = (($request->getDataBool('terms_required') ?? false) && ($request->getDataBool('terms') ?? false)))
) {
return $val;
}
@ -2094,13 +2080,6 @@ final class ApiController extends Controller
*/
private function createProfileForAccount(Account $account, RequestAbstract $request) : void
{
// @todo: why do we need the following lines?
if (($request->getDataString('password') ?? '') === ''
|| ($request->getDataString('user') ?? '') === ''
) {
return;
}
$request->setData('iaccount-idlist', $account->id);
$internalResponse = new HttpResponse();
@ -3209,8 +3188,6 @@ final class ApiController extends Controller
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateSettingsDelete(RequestAbstract $request) : array
@ -3277,8 +3254,6 @@ final class ApiController extends Controller
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateApplicationUpdate(RequestAbstract $request) : array
@ -3326,8 +3301,6 @@ final class ApiController extends Controller
*
* @return array<string, bool>
*
* @todo: implement
*
* @since 1.0.0
*/
private function validateApplicationDelete(RequestAbstract $request) : array

View File

@ -15,6 +15,8 @@ declare(strict_types=1);
namespace Modules\Admin\Controller;
use Model\SettingMapper;
use Modules\Admin\Models\SettingsEnum;
use phpOMS\Application\ApplicationStatus;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
@ -135,7 +137,14 @@ final class CliController extends Controller
*/
public function runEncryptionChangeFromHook(mixed ...$data) : void
{
// @todo: start read only mode
/** @var \Model\Setting $setting */
$setting = $this->app->appSettings->get(null, names: SettingsEnum::LOGIN_STATUS);
$oldMode = $setting->content;
// Enter read only mode
$setting->content = (string) ApplicationStatus::READ_ONLY;
$this->app->appSetting->save([$setting]);
$mapper = SettingMapper::yield()
->where('isEncrypted', true);
@ -152,6 +161,9 @@ final class CliController extends Controller
SettingMapper::update()->execute($setting);
}
// @todo: end read only mode
// Restore old mode
$setting->content = $oldMode;
$this->app->appSetting->save([$setting]);
}
}

View File

@ -13,7 +13,7 @@
declare(strict_types=1);
return ['Admin' => [
'AccountCreateMsg' => 'Account successfully created. Link: <a href={url}">Account</a>"',
'AccountCreateMsg' => 'Account successfully created. Link: <a href={url}>Account</a>""',
'AccountCreateTitle' => 'Account',
'FormDataInvalid' => 'Form data invalid, please check your input',
'LOGIN_ERROR' => 'Login failed due to wrong login information.',

View File

@ -13,7 +13,7 @@
declare(strict_types=1);
return ['Admin' => [
'AccountCreateMsg' => 'Account successfully created. Link: <a href={url}">Account</a>"',
'AccountCreateMsg' => 'Account successfully created. Link: <a href={url}>Account</a>""',
'AccountCreateTitle' => 'Account',
'FormDataInvalid' => 'Form data invalid, please check your input',
'LOGIN_ERROR' => 'Login failed due to wrong login information.',

View File

@ -20,9 +20,9 @@ return ['Navigation' => [
'Front' => 'Vorderseite',
'General' => 'Allgemein',
'Groups' => 'Gruppen',
'Hooks' => '',
'Hooks' => 'Hooks',
'Info' => 'Die Info',
'List' => 'Aufführen',
'List' => 'Liste',
'Log' => 'Protokoll',
'Members' => 'Mitglieder',
'Modules' => 'Module',

View File

@ -188,7 +188,7 @@ return ['Admin' => [
'Zip' => 'Zip.',
'active' => '',
'available' => '',
'i:LoginRetries' => "Mængden af \u{200b}\u{200b}tilladte retries (-1 = ubegrænset)",
'i:LoginRetries' => 'Mængden af tilladte retries (-1 = ubegrænset)',
'i:PasswordChangeInterval' => 'Interval, hvor passager skal ændres (-1 = aldrig)',
'i:PasswordHistory' => 'Ny adgangskode skal være forskellig fra de sidste N-adgangskoder',
'i:PasswordRegex' => 'Adgangskode krav til brugere',

View File

@ -52,7 +52,7 @@ return ['Admin' => [
'Delete' => 'Löschen',
'Description' => 'Beschreibung',
'Design' => 'Entwurf',
'Destination' => '',
'Destination' => 'Ziel',
'Ele' => 'Ele.',
'Element' => 'Element',
'Email' => 'Email',
@ -68,9 +68,9 @@ return ['Admin' => [
'GroupStatus4' => 'Versteckt',
'Groups' => 'Gruppen',
'Heavy' => 'Schwer',
'Hook' => '',
'Hooks' => '',
'Images' => 'Bilde',
'Hook' => 'Hook',
'Hooks' => 'Hooks',
'Images' => 'Bilder',
'Inactive' => 'Inaktiv',
'Install' => 'Installieren',
'Installed' => 'Eingerichtet',
@ -107,9 +107,9 @@ return ['Admin' => [
'Numeric' => 'Numerisch',
'Organization' => 'Organisation',
'OrganizationName' => 'Organisationsname',
'OwnPermission' => '',
'Page' => 'Buchseite',
'Pages' => '',
'OwnPermission' => 'Eigene Rechte',
'Page' => 'Seite',
'Pages' => 'Seiten',
'Parent' => 'Elternteil',
'Parents' => 'Eltern',
'Password' => 'Passwort',
@ -127,16 +127,16 @@ return ['Admin' => [
'Read' => 'Lesen',
'Release' => 'Freisetzung',
'Reset' => 'Zurücksetzen',
'Route' => '',
'Routes' => '',
'Route' => 'Route',
'Routes' => 'Routes',
'Running' => 'Betrieb',
'Sea' => 'Meer',
'Search' => 'Suche',
'Security' => 'Sicherheit',
'ServerMode-1' => '',
'ServerMode-2' => '',
'ServerMode-3' => '',
'ServerStatus' => '',
'ServerMode-1' => 'Normal',
'ServerMode-2' => 'Lesezugang',
'ServerMode-3' => 'Deaktiviert',
'ServerStatus' => 'Serverstatus',
'Settings' => 'Einstellungen',
'SettingsGeneral' => 'Einstellungen - Allgemein',
'Short' => 'Kurz',
@ -163,15 +163,15 @@ return ['Admin' => [
'Timestamp' => 'Zeitstempel',
'Timezone' => 'Zeitzone',
'Total' => 'Gesamt',
'Trigger' => '',
'Trigger' => 'Trigger',
'Type' => 'Typ',
'Uninstall' => 'Deinstallieren',
'Unit' => 'Einheit',
'Update' => 'Aktualisieren',
'Uppercase' => 'In Großbuchstaben.',
'Username' => 'Nutzername',
'Value' => '',
'Verb' => '',
'Value' => 'Wert',
'Verb' => 'Verb',
'Version' => 'Ausführung',
'VeryFast' => 'Sehr schnell',
'VeryHeavy' => 'Sehr schwer',
@ -186,8 +186,8 @@ return ['Admin' => [
'Website' => 'Webseite',
'Weight' => 'Gewicht',
'Zip' => 'Reißverschluss',
'active' => '',
'available' => '',
'active' => 'aktiv',
'available' => 'verfügbar',
'i:LoginRetries' => 'Betrag der erlaubten Wiederholungen (-1 = unbegrenzt)',
'i:PasswordChangeInterval' => 'Intervall, in dem die Passweiterung geändert werden müssen (-1 = niemals)',
'i:PasswordHistory' => 'Neues Passwort muss sich von den letzten n Kennwörtern unterscheiden',
@ -199,5 +199,5 @@ return ['Admin' => [
'i:rc' => 'RE-Cache für jeden Benutzer zwingen.',
'i:rem' => 'IP-Adresse oder URL für den Fernzugriff.',
'i:timef' => 'Zeitformat.',
'inactive' => '',
'inactive' => 'inaktiv',
]];

View File

@ -109,7 +109,7 @@ return ['Admin' => [
'OrganizationName' => 'Organization Name',
'OwnPermission' => '',
'Page' => 'Page',
'Pages' => '',
'Pages' => 'Pages',
'Parent' => 'Parent',
'Parents' => 'Parents',
'Password' => 'Password',
@ -186,8 +186,8 @@ return ['Admin' => [
'Website' => 'Website',
'Weight' => 'Weight',
'Zip' => 'Zip',
'active' => '',
'available' => '',
'active' => 'active',
'available' => 'available',
'i:LoginRetries' => 'Amount of allowed retries (-1 = unlimited)',
'i:PasswordChangeInterval' => 'Interval in which passwards need to be changed (-1 = never)',
'i:PasswordHistory' => 'New password has to be different from the last N passwords',
@ -199,5 +199,5 @@ return ['Admin' => [
'i:rc' => 'Forcing re-cache for every user.',
'i:rem' => 'IP address or URL for remote access.',
'i:timef' => 'Time format.',
'inactive' => '',
'inactive' => 'inactive',
]];