Skip to content

Commit

Permalink
Merge pull request #221 from NotFoundNL/develop
Browse files Browse the repository at this point in the history
feat: Version 0.19.0
  • Loading branch information
64knl committed Mar 15, 2024
2 parents 4bce578 + ec216be commit a68e791
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 24 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"require": {
"spatie/laravel-package-tools": "^1.14.0",
"spatie/laravel-honeypot": "^4.3.2",
"illuminate/contracts": "^10.0",
"notfoundnl/siteboss-layout": "^1.6",
"illuminate/contracts": "^10.0|^11.0",
"notfoundnl/siteboss-layout": "^1.6.1",
"notfoundnl/siteboss-static": "^1.13",
"mcamara/laravel-localization": "^1.8",
"mcamara/laravel-localization": "^2.0",
"xenolope/quahog": "^3.0",
"firebase/php-jwt": "^6.3",
"intervention/image": "^3.0",
Expand Down
1 change: 1 addition & 0 deletions lang/en/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

'failed' => 'These credentials do not match our records.',
// deepcode ignore HardcodedPassword: Translation
'password' => 'The provided password is incorrect.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
'verify_email' => 'Please verify your email address.',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
// deepcode ignore HardcodedPassword: Translation
'current_password' => 'The password is incorrect.',
'date' => 'The :attribute is not a valid date.',
'date_equals' => 'The :attribute must be a date equal to :date.',
Expand Down Expand Up @@ -96,6 +97,7 @@
'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.',
// deepcode ignore HardcodedPassword: Translation
'password' => 'The password is incorrect.',
'present' => 'The :attribute field must be present.',
'regex' => 'The :attribute format is invalid.',
Expand Down
1 change: 1 addition & 0 deletions lang/nl/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

'failed' => 'Deze combinatie van e-mailadres en wachtwoord is niet geldig.',
'throttle' => 'Te veel mislukte loginpogingen. Probeer het over :seconds seconden nogmaals.',
// deepcode ignore HardcodedPassword: Translation
'password' => 'Het opgegeven wachtwoord is onjuist.',
'verify_email' => 'Om zeker te weten dat jij de eigenaar bent ven het e-mailadres waarmee je inlogt is er een verificatiemail verzonden. Klik op de link in die e-mail om in te loggen. Heb je geen mail ontvangen, klik dan hieronder om deze opnieuw te versturen.',
'verify_email_header' => 'Inloggen bij',
Expand Down
1 change: 1 addition & 0 deletions lang/nl/passwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
|
*/

// deepcode ignore HardcodedPassword: Translation
'password' => 'Je wachtwoord moet minimaal zes tekens lang zijn en de wachtwoorden moeten overeenkomen.',
'reset' => 'Je wachtwoord is aangepast.',
'sent' => 'We hebben een e-mail verstuurd met instructies om een nieuw wachtwoord in te stellen.',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
'boolean' => ':Attribute kan enkel waar of niet waar zijn.',
'confirmed' => ':Attribute bevestiging komt niet overeen.',
// deepcode ignore HardcodedPassword: Translation
'current_password' => 'Het wachtwoord is ongeldig.',
'date' => ':Attribute is geen geldige datum.',
'date_equals' => ':Attribute moet een datum zijn gelijk aan :date.',
Expand Down Expand Up @@ -172,6 +173,7 @@
*/

'attributes' => [
// deepcode ignore HardcodedPassword: Translation
'new_password' => 'nieuw wachtwoord',
],
];
4 changes: 2 additions & 2 deletions src/Http/Controllers/InfoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public function settings()
$settings->background = (object) [
'url' => env('APP_LOGIN_IMAGE_URL', '/siteboss/images/back.jpg'),
'credits' => (object) [
'name' => env('APP_LOGIN_IMAGE_SOURCE_NAME', 'Dr. Matthias Ripp'),
'url' => env('APP_LOGIN_IMAGE_SOURCE_URL', 'https://www.flickr.com/photos/56218409@N03/14605956625'),
'name' => env('APP_LOGIN_IMAGE_SOURCE_NAME', 'zeitfaenger.at'),
'url' => env('APP_LOGIN_IMAGE_SOURCE_URL', 'https://flickr.com/photos/kwarz/'),
'license' => env('APP_LOGIN_IMAGE_SOURCE_LICENSE', 'CC BY 2.0'),
],
];
Expand Down
10 changes: 10 additions & 0 deletions src/Providers/Auth/OpenIDUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,14 @@ public function validateCredentials(Authenticatable $user, array $credentials)
{
throw new NotImplementedException();
}

/**
* Validate a user against the given credentials.
*
* @return void
*/
public function rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false)
{
throw new NotImplementedException();
}
}
14 changes: 12 additions & 2 deletions src/Services/Assets/Components/ComponentText.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public function validate($newValue): bool
*/
protected function customProperties(): object
{
// BUG: TODO: editModal should just be a property,
// not a server property
$customProperties = [];
if (isset($this->properties()->type) && $this->properties()->type == 'richtext') {
if (isset($this->properties()->editorSettings) && trim($this->properties()->editorSettings) !== '') {
$setting = EditorSetting::where('name', $this->properties()->editorSettings)->first();
Expand All @@ -67,11 +70,18 @@ protected function customProperties(): object
}

if (isset($setting->settings)) {
return (object) ['editorSettings' => json_decode($setting->settings)];
$customProperties['editorSettings'] = json_decode($setting->settings);
}
}
if (
$this->assetItem->properties->type == 'richtext' &&
isset($this->assetItem->server_properties->editModal) &&
$this->assetItem->server_properties->editModal === true
) {
$customProperties['editModal'] = true;
}

return (object) [];
return (object) $customProperties;
}

public function asyncPostRequest()
Expand Down
30 changes: 14 additions & 16 deletions src/Services/Auth/RemoteTokenDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

class RemoteTokenDecoder extends AbstractTokenDecoder
{
private \stdClass $decodedToken;
private ?object $decodedToken = null;

protected function decodeToken(): void
{
$this->decodedToken = $this->getDecodedToken();
$this->getDecodedToken();
}

protected function verifyToken(): void
Expand All @@ -38,21 +38,19 @@ protected function verifyToken(): void

public function getDecodedToken(): \stdClass
{
return $this->getRemoteAuthenticatedToken();
}

private function getRemoteAuthenticatedToken(): \stdClass
{
$userEndpoint = $this->openIdConfiguration['userinfo_endpoint'];
if (! $userEndpoint) {
throw OpenIDException::noUserInfoEndpoint();
}

$response = Http::withToken($this->token)->get($userEndpoint);
if (! $response->ok()) {
throw new \Exception('Token is invalid.');
if ($this->decodedToken === null) {
$userEndpoint = $this->openIdConfiguration['userinfo_endpoint'];
if (! $userEndpoint) {
throw OpenIDException::noUserInfoEndpoint();
}

$response = Http::withToken($this->token)->get($userEndpoint);
if (! $response->ok()) {
throw new \Exception('Token is invalid.');
}
$this->decodedToken = (object) $response->json();
}

return (object) $response->json();
return $this->decodedToken;
}
}
1 change: 1 addition & 0 deletions src/Services/Editor/Fields/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public function description(): string
public function properties(): void
{
$this->overview();
$this->required();
$this->addText('downloadUrl', 'Download URL (Use [id])', false);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Services/Editor/Fields/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public function serverProperties(): void
$options[] = (object) ['value' => $table->name, 'label' => $table->name];
}
$this->addDropDown('editorSettings', 'Editor settings (for rich text editor)', $options);

// BUG: TODO: editModal should just be a property,
// not a server property
$this->addCheckbox('editModal', 'Edit texts in popup (required for ContentBlock/Childtable)');
$this->addTitle('Validation');

$this->addDropDown('regExTemplate', 'Built in validations', [
Expand Down

0 comments on commit a68e791

Please sign in to comment.