[API][CONF][!!!] Make the name of cookies configurable
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_feuserauth.php
index f831fa4..7c9fd08 100644 (file)
@@ -76,7 +76,6 @@
  * @subpackage tslib
  */
 class tslib_feUserAuth extends t3lib_userAuth {
-
        var $formfield_permanent = 'permalogin';        // formfield with 0 or 1 // 1 = permanent login enabled // 0 = session is valid for a browser session only
 
        protected $sessionDataLifetime = 86400;         // Lifetime of session data in seconds.
@@ -111,8 +110,9 @@ class tslib_feUserAuth extends t3lib_userAuth {
         */
        public function __construct() {
                $this->session_table = 'fe_sessions';
-               $this->name = 'fe_typo_user';
+               $this->name = self::getCookieName();
                $this->get_name = 'ftu';
+               $this->loginType = 'FE';
 
                $this->user_table = 'fe_users';
                $this->username_column = 'username';
@@ -139,6 +139,22 @@ class tslib_feUserAuth extends t3lib_userAuth {
                $this->getMethodEnabled = TRUE;
        }
 
+
+       /**
+        * @static
+        * @return string
+        *
+        * returns the configured cookie name
+        */
+       public static function getCookieName() {
+               $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['FE']['cookieName']);
+               if (empty($configuredCookieName)) {
+                       $configuredCookieName = 'fe_typo_user';
+               }
+               return $configuredCookieName;
+       }
+
+
        /**
         * Starts a user session
         *