[API][CONF][!!!] Make the name of cookies configurable
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_beuserauth.php
index 08d2d76..11cbc47 100644 (file)
@@ -66,7 +66,6 @@
  */
 class t3lib_beUserAuth extends t3lib_userAuthGroup {
        var $session_table = 'be_sessions'; // Table to use for session data.
-       var $name = 'be_typo_user'; // Session/Cookie name
 
        var $user_table = 'be_users'; // Table in database with userdata
        var $username_column = 'username'; // Column for login-name
@@ -129,6 +128,28 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
                'resizeTextareas_Flexible' => 1,
        );
 
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->name = self::getCookieName();
+               $this->loginType = 'BE';
+       }
+
+       /**
+        * @static
+        * @return string
+        *
+        * returns the configured cookie name
+        */
+       public static function getCookieName() {
+               $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
+               if (empty($configuredCookieName)) {
+                       $configuredCookieName = 'be_typo_user';
+               }
+               return $configuredCookieName;
+       }
+
 
        /**
         * Sets the security level for the Backend login
@@ -388,4 +409,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_beuserauth.php']);
 }
 
-?>
\ No newline at end of file
+?>