mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix FLEXIAPI-397 Fix Carddav Spaces creation and CommaList validation
This commit is contained in:
parent
10cdbb4b6a
commit
0e3b0d36d8
3 changed files with 8 additions and 7 deletions
|
|
@ -19,6 +19,7 @@ v2.1
|
|||
- Fix FLEXIAPI-392 Fix the recover_by_code view and use the account space object
|
||||
- Fix FLEXIAPI-395 Remove config()->set('app.sip_domain') and directly use the correct domain
|
||||
- Fix FLEXIAPI-393 Autofill the digits when pasting a code
|
||||
- Fix FLEXIAPI-397 Fix Carddav Spaces creation and CommaList validation
|
||||
|
||||
v2.0
|
||||
----
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ class CardDavServerController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function store(CardDavServer $request)
|
||||
public function store(CardDavServer $request, Space $space)
|
||||
{
|
||||
$carddavServer = new SpaceCardDavServer;
|
||||
$carddavServer->space_id = $request->space->id;
|
||||
$carddavServer->space_id = $space->id;
|
||||
$carddavServer->fill($request->validated());
|
||||
$carddavServer->enabled = getRequestBoolean($request, 'enabled');
|
||||
$carddavServer->use_exact_match_policy = getRequestBoolean($request, 'use_exact_match_policy');
|
||||
$carddavServer->save();
|
||||
|
||||
return redirect()->route('admin.spaces.integration', $request->space);
|
||||
return redirect()->route('admin.spaces.integration', $space);
|
||||
}
|
||||
|
||||
public function edit(Space $space, int $carddavServerId)
|
||||
|
|
@ -47,7 +47,7 @@ class CardDavServerController extends Controller
|
|||
$carddavServer->use_exact_match_policy = getRequestBoolean($request, 'use_exact_match_policy');
|
||||
$carddavServer->save();
|
||||
|
||||
return redirect()->route('admin.spaces.integration', $request->space);
|
||||
return redirect()->route('admin.spaces.integration', $space);
|
||||
}
|
||||
|
||||
public function delete(Space $space, int $carddavServerId)
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ class CommaList implements Rule
|
|||
{
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
preg_match('/^(\w+),(\w)*/', $value, $matches);
|
||||
preg_match_all('/[^, ]+/', $value, $matches);
|
||||
|
||||
return $value == null || (!empty($matches) && $matches[0] == $value);
|
||||
return $value == null || (!empty($matches) && (implode(',', $matches[0]) == $value));
|
||||
}
|
||||
|
||||
public function message()
|
||||
{
|
||||
return 'The :attribute should be null or contain a list of words separated by commas';
|
||||
return 'The :attribute should be null or contain a list of words separated by commas without spaces';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue