* Mail/OAuth: fix mail account creation failed for regular EGroupware users / non-admins

This commit is contained in:
ralf 2023-02-20 15:36:52 +01:00
parent 188334d647
commit 178047d8d6

View File

@ -1570,9 +1570,16 @@ class admin_mail
}
$content['acc_oauth_access_token'] = $oidc->getAccessToken();
if (empty($GLOBALS['egw_info']['user']['apps']['admin']))
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'mail';
$obj = new mail_wizard();
}
else
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'admin';
$obj = new self;
}
unset($content['oauth_failure']);
if (!empty($content['acc_id']))
{
@ -1592,10 +1599,17 @@ class admin_mail
* @param array $content
*/
public static function oauthFailure(Throwable $exception=null, array $content)
{
if (empty($GLOBALS['egw_info']['user']['apps']['admin']))
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'mail';
$obj = new mail_wizard();
}
else
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'admin';
$obj = new self;
}
$content['oauth_failure'] = $exception ?: true;
if (!empty($content['acc_id']))
{