Просмотр исходного кода

Merge branch 'master' of https://github.com/unacms/una

AntonLV 1 год назад
Родитель
Сommit
60e3f53545
1 измененных файлов с 16 добавлено и 1 удалено
  1. 16 1
      template/scripts/BxBaseServiceAccount.php

+ 16 - 1
template/scripts/BxBaseServiceAccount.php

@@ -69,7 +69,22 @@ class BxBaseServiceAccount extends BxDol
             else if($mixedResult === true){
                 $sRedirectUrl = BxDolForm::getSubmittedValue('relocate','post');
                 if(empty($sRedirectUrl)){
-                    $sRedirectUrl = '/';
+                    if (!getParam('sys_account_auto_profile_creation')){
+                        
+                        $aModulesProfile = bx_srv('system', 'get_modules_by_type', ['profile']);
+
+                        $sDefaultProfileType = getParam('sys_account_default_profile_type');
+                        if(count($aModulesProfile) == 1)
+                            $sProfileModule = $aModulesProfile[0]['name'];
+                        else if(!empty($sDefaultProfileType)) 
+                            $sProfileModule = $sDefaultProfileType;
+                        
+                        $sRedirectUrl = !empty($sProfileModule) ? bx_api_get_relative_url(BxDolPermalinks::getInstance()->permalink(BxDolService::call($sProfileModule, 'profile_create_url', array(false)))) : '/';
+
+                    }
+                    else{
+                        $sRedirectUrl = '/';
+                    }    
                 }
                 else{
                     $parts = parse_url($sRedirectUrl);