Follow-up to bugfix #12612: Removed reference operators for objects and code cleanup
authorOliver Hader <oliver.hader@typo3.org>
Tue, 17 Nov 2009 16:03:27 +0000 (16:03 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 17 Nov 2009 16:03:27 +0000 (16:03 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6450 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/classes/class.ajaxlogin.php
typo3/js/loginrefresh.js

index ffdb0ed..73ae5f6 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-11-17  Oliver Hader  <oliver@typo3.org>
 
        * Fixed bug #12612: Backend Login-Popup not working
+       * Follow-up to bugfix #12612: Removed reference operators for objects and code cleanup
 
 2009-11-17  Benjamin Mack  <benni@typo3.org>
 
index a21128e..e35df88 100644 (file)
@@ -38,11 +38,11 @@ class AjaxLogin {
         * a BE user and reset the timer and hide the login window.
         * If it was unsuccessful, we display that and show the login box again.
         *
-        * @param string $params        Always empty.
-        * @param string $ajaxObj       The Ajax object used to return content and set content types
-        * @return void
+        * @param       array           $parameters: Parameters (not used)
+        * @param       TYPO3AJAX       $ajaxObj: The calling parent AJAX object
+        * @return      void
         */
-       public function login($params = array(), TYPO3AJAX &$ajaxObj = null) {
+       public function login(array $parameters, TYPO3AJAX $ajaxObj) {
                if ($GLOBALS['BE_USER']->user['uid']) {
                        $json = array('success' => TRUE);
                } else {
@@ -55,11 +55,11 @@ class AjaxLogin {
        /**
         * Logs out the current BE user
         *
-        * @param string $params                Always empty.
-        * @param string $TYPO3AJAX     The Ajax object used to return content and set content types
-        * @return void
+        * @param       array           $parameters: Parameters (not used)
+        * @param       TYPO3AJAX       $ajaxObj: The calling parent AJAX object
+        * @return      void
         */
-       public function logout($params = array(), TYPO3AJAX &$ajaxObj = null) {
+       public function logout(array $parameters, TYPO3AJAX $ajaxObj) {
                $GLOBALS['BE_USER']->logoff();
                if($GLOBALS['BE_USER']->user['uid']) {
                        $ajaxObj->addContent('logout', array('success' => FALSE));
@@ -73,11 +73,11 @@ class AjaxLogin {
         * Refreshes the login without needing login information. We just refresh the session.
         *
         *
-        * @param string $params                Always empty.
-        * @param string $ajaxObj       The Ajax object used to return content and set content types
-        * @return void
+        * @param       array           $parameters: Parameters (not used)
+        * @param       TYPO3AJAX       $ajaxObj: The calling parent AJAX object
+        * @return      void
         */
-       public function refreshLogin($params = array(), TYPO3AJAX &$ajaxObj = null) {
+       public function refreshLogin(array $parameters, TYPO3AJAX $ajaxObj) {
                $GLOBALS['BE_USER']->checkAuthentication();
                $ajaxObj->addContent('refresh', array('success' => TRUE));
                $ajaxObj->setContentFormat('json');
@@ -87,11 +87,11 @@ class AjaxLogin {
        /**
         * Checks if the user session is expired yet
         *
-        * @param string $params                Always empty.
-        * @param string $TYPO3AJAX     The Ajax object used to return content and set content types
-        * @return void
+        * @param       array           $parameters: Parameters (not used)
+        * @param       TYPO3AJAX       $ajaxObj: The calling parent AJAX object
+        * @return      void
         */
-       function isTimedOut($params = array(), TYPO3AJAX &$ajaxObj = null) {
+       function isTimedOut(array $parameters, TYPO3AJAX $ajaxObj) {
                if(is_object($GLOBALS['BE_USER'])) {
                        $ajaxObj->setContentFormat('json');
                        if (@is_file(PATH_typo3conf.'LOCK_BACKEND')) {
index 510ddcf..71bdde1 100644 (file)
 /**
  * AJAX login refresh box
  */
-Ext.namespace('Ext.ux.TYPO3');  
+Ext.namespace('Ext.ux.TYPO3');
 
 Ext.ux.TYPO3.loginRefresh = Ext.extend(Ext.util.Observable, {
        locked: 0,
        interval: 60,
-       
+
        constructor: function(config) {
                config = config || {};
                Ext.apply(this, config);
@@ -82,8 +82,7 @@ Ext.ux.TYPO3.loginRefresh = Ext.extend(Ext.util.Observable, {
                this.startTimer();
                Ext.ux.TYPO3.loginRefresh.superclass.constructor.call(this, config);
        },
-       
-       
+
        initComponents: function() {
                var loginPanel = new Ext.FormPanel({
                        url: "ajax.php",
@@ -150,13 +149,13 @@ Ext.ux.TYPO3.loginRefresh = Ext.extend(Ext.util.Observable, {
                        draggable: false,
                        items: [loginPanel]
                });
-               
+
                var progressControl = new Ext.ProgressBar({
                        autoWidth: true,
                        autoHeight: true,
                        value: 30
                });
-               
+
                this.progressWindow = new Ext.Window({
                        closable: false,
                        resizable: false,
@@ -189,7 +188,7 @@ Ext.ux.TYPO3.loginRefresh = Ext.extend(Ext.util.Observable, {
                                        });
                                        TYPO3.loginRefresh.progressWindow.hide();
                                        progressControl.reset();
-                                       TYPO3.loginRefresh.startTimer();                                        
+                                       TYPO3.loginRefresh.startTimer();
                                }
                        }, {
                                text: TYPO3.LLL.core.refresh_direct_logout_button,
@@ -234,29 +233,29 @@ Ext.ux.TYPO3.loginRefresh = Ext.extend(Ext.util.Observable, {
                        if (rest === 1) {
                                control.updateText(String.format(TYPO3.LLL.core.refresh_login_countdown_singular, rest));
                        } else {
-                               control.updateText(String.format(TYPO3.LLL.core.refresh_login_countdown, rest));        
+                               control.updateText(String.format(TYPO3.LLL.core.refresh_login_countdown, rest));
                        }
                });
-               
+
                this.loginRefreshWindow.on('close', function(){
                        TYPO3.loginRefresh.startTimer();
                });
        },
-       
+
        showLoginPopup: function() {
                Ext.getCmp("loginRefreshWindow").hide();
                vHWin=window.open("login_frameset.php","relogin_"+TS.uniqueID,"height=450,width=700,status=0,menubar=0,location=1");
                vHWin.focus();
        },
-       
+
        startTimer: function() {
                Ext.TaskMgr.start(this.loadingTask);
        },
-       
+
        stopTimer: function() {
                Ext.TaskMgr.stop(this.loadingTask);
        },
-       
+
        submitForm: function(challenge) {
                var form = Ext.getCmp("loginform").getForm();
                var fields = form.getValues();
@@ -265,7 +264,7 @@ Ext.ux.TYPO3.loginRefresh = Ext.extend(Ext.util.Observable, {
                } else {
                        if (TS.securityLevel == "superchallenged") {
                                fields.p_field = MD5(fields.p_field);
-                       } 
+                       }
                        if (TS.securityLevel == "superchallenged" || TS.securityLevel == "challenged") {
                                fields.challenge = challenge;
                                fields.userident = MD5(fields.username + ":" + fields.p_field + ":" + challenge);