浏览代码

add sso_force_redirect condition

Julio 8 年之前
父节点
当前提交
12631dbe66
共有 1 个文件被更改,包括 11 次插入8 次删除
  1. 11 8
      main/auth/sso/sso.TCC.class.php

+ 11 - 8
main/auth/sso/sso.TCC.class.php

@@ -48,15 +48,18 @@ class ssoTCC
      */
     public function logout()
     {
-        // no_redirect means Drupal sent the signal to logout. When redirecting to Drupal, the $_GET['stop'] param is
-        // set to 1, to allow Drupal to know that this is it, the logout is already done in Chamilo and there's no
-        // need to do it again
-        if (empty($_GET['no_redirect'])) {
-            header('Location: '.$this->deauth_url.'&stop=1');
-        } else {
-            header('Location: '.$this->protocol.$this->domain);
+        $forceSsoRedirect = api_get_setting('sso_force_redirect');
+        if ($forceSsoRedirect === 'true') {
+            // no_redirect means Drupal sent the signal to logout. When redirecting to Drupal, the $_GET['stop'] param is
+            // set to 1, to allow Drupal to know that this is it, the logout is already done in Chamilo and there's no
+            // need to do it again
+            if (empty($_GET['no_redirect'])) {
+                header('Location: '.$this->deauth_url.'&stop=1');
+            } else {
+                header('Location: '.$this->protocol.$this->domain);
+            }
+            exit;
         }
-        exit;
     }
 
     /**