mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 13:44:35 -04:00
Fixes for contact password not sticking on update
This commit is contained in:
parent
dcaaa53ae6
commit
89dcd43e47
@ -81,6 +81,9 @@ class UpdateClientRequest extends Request
|
|||||||
'email' => ctrans('validation.email', ['attribute' => 'email']),
|
'email' => ctrans('validation.email', ['attribute' => 'email']),
|
||||||
'name.required' => ctrans('validation.required', ['attribute' => 'name']),
|
'name.required' => ctrans('validation.required', ['attribute' => 'name']),
|
||||||
'required' => ctrans('validation.required', ['attribute' => 'email']),
|
'required' => ctrans('validation.required', ['attribute' => 'email']),
|
||||||
|
'contacts.*.password.min' => ctrans('texts.password_strength'),
|
||||||
|
'contacts.*.password.regex' => ctrans('texts.password_strength'),
|
||||||
|
'contacts.*.password.string' => ctrans('texts.password_strength'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,11 +112,12 @@ class UpdateClientRequest extends Request
|
|||||||
if (strlen($contact['password']) == 0) {
|
if (strlen($contact['password']) == 0) {
|
||||||
$input['contacts'][$key]['password'] = '';
|
$input['contacts'][$key]['password'] = '';
|
||||||
} else {
|
} else {
|
||||||
$contact['password'] = str_replace('*', '', $contact['password']);
|
$input['contacts'][$key]['password'] = str_replace('*', '', $contact['password']);
|
||||||
|
|
||||||
if (strlen($contact['password']) == 0) {
|
if (strlen($contact['password']) == 0) {
|
||||||
unset($input['contacts'][$key]['password']);
|
unset($input['contacts'][$key]['password']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,10 @@ class ClientContactRepository extends BaseRepository
|
|||||||
|
|
||||||
$update_contact->fill($contact);
|
$update_contact->fill($contact);
|
||||||
|
|
||||||
if (array_key_exists('password', $contact)) {
|
if (array_key_exists('password', $contact) && strlen($contact['password']) > 1) {
|
||||||
if (strlen($contact['password']) == 0) {
|
|
||||||
$update_contact->password = '';
|
$update_contact->password = Hash::make($contact['password']);
|
||||||
} else {
|
|
||||||
$update_contact->password = Hash::make($contact['password']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_contact->save();
|
$update_contact->save();
|
||||||
|
@ -66,6 +66,10 @@ class AddIsPublicToDocumentsTable extends Migration
|
|||||||
Schema::table('companies', function ($table) {
|
Schema::table('companies', function ($table) {
|
||||||
$table->enum('default_auto_bill', ['off', 'always', 'optin', 'optout'])->default('off');
|
$table->enum('default_auto_bill', ['off', 'always', 'optin', 'optout'])->default('off');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Schema::table('recurring_invoices', function (Blueprint $table) {
|
||||||
|
$table->integer('remaining_cycles')->nullable()->change();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3269,4 +3269,5 @@ return [
|
|||||||
|
|
||||||
'payment_due' => 'Payment due',
|
'payment_due' => 'Payment due',
|
||||||
'account_balance' => 'Account balance',
|
'account_balance' => 'Account balance',
|
||||||
|
'password_strength' => 'Password strength too weak',
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user