mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
N°6912 - Provision user without contact
This commit is contained in:
@@ -867,12 +867,12 @@ class LoginWebPage extends NiceWebPage
|
|||||||
* @api
|
* @api
|
||||||
*
|
*
|
||||||
* @param string $sAuthUser
|
* @param string $sAuthUser
|
||||||
* @param Person $oPerson
|
* @param Person|null $oPerson
|
||||||
* @param array $aRequestedProfiles profiles to add to the new user
|
* @param array $aRequestedProfiles profiles to add to the new user
|
||||||
*
|
*
|
||||||
* @return \UserExternal|null
|
* @return \UserExternal|null
|
||||||
*/
|
*/
|
||||||
public static function ProvisionUser($sAuthUser, $oPerson, $aRequestedProfiles)
|
public static function ProvisionUser(string$sAuthUser, ?Person $oPerson, array $aRequestedProfiles)
|
||||||
{
|
{
|
||||||
if (!MetaModel::IsValidClass('URP_Profiles'))
|
if (!MetaModel::IsValidClass('URP_Profiles'))
|
||||||
{
|
{
|
||||||
@@ -897,7 +897,9 @@ class LoginWebPage extends NiceWebPage
|
|||||||
{
|
{
|
||||||
$oUser = MetaModel::NewObject('UserExternal');
|
$oUser = MetaModel::NewObject('UserExternal');
|
||||||
$oUser->Set('login', $sAuthUser);
|
$oUser->Set('login', $sAuthUser);
|
||||||
$oUser->Set('contactid', $oPerson->GetKey());
|
if (! is_null($oPerson)){
|
||||||
|
$oUser->Set('contactid', $oPerson->GetKey());
|
||||||
|
}
|
||||||
$oUser->Set('language', MetaModel::GetConfig()->GetDefaultLanguage());
|
$oUser->Set('language', MetaModel::GetConfig()->GetDefaultLanguage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user