splitted user name

This commit is contained in:
Čarodej
2022-01-14 11:17:00 +01:00
parent 7e9e9ee25b
commit 7dd116a769
45 changed files with 272 additions and 95 deletions

View File

@@ -307,6 +307,21 @@ if (! function_exists('get_shared')) {
}
}
if (! function_exists('split_name')) {
/**
* Split name for 2 parts
*/
function split_name(string $name): array
{
$firstName = explode(' ', $name)[0];
return [
'first_name' => $firstName,
'last_name' => str_replace("$firstName ", '', $name),
];
}
}
if (! function_exists('is_editor')) {
/**
* Check if shared permission is editor