Results 1 to 2 of 2

Thread: [Core] Decouple Input/Password post data from Login

  1. #1
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default [Core] Decouple Input/Password post data from Login

    Hi all, I'll try to keep this brief but this is related to User.php within the Core and to get the ball rolling on decoupling the requirement of POST data from Input/Password fields.

    The problem
    There have been many other attempts at Authentication plugins for Contao, if they follow the use of a username & password for credentials then they can use the hooks importUser & checkCredentials to use custom authentication.

    However for authentication such as Facebook this requires one of the many hacks:
    1) Rewrite entire login process and setting of cookie as demonstrated in FacebookConnect (http://www.contao.org/en/extension-list ... .3.en.html)
    2) Patching of User class, as I did in Authentication (http://www.contao.org/en/extension-list ... 39.en.html)
    3) Replacing ModuleLogin and manipulating POST data.

    Lines such as:
    Code:
    /**
    	 * Try to login the current user
    	 * @return boolean
    	 */
    	public function login()
    	{
    		$this->loadLanguageFile('default');
    
    		// Do not continue if username or password are missing
    		if (!$this->Input->post('username') || !$this->Input->post('password'))
    		{
    			return false;
    		}
    Are restricting further development to add different authentication types as no hook for custom authentication can be reached without being denied by this logic.

    Also, the Login module needs to have template names decoupled from within the class. Ie
    Code:
    $this->strTemplate = ($this->cols > 1) ? 'mod_login_2cl' : 'mod_login_1cl';
    means that you cannot change which template is being used without trickery.

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: [Core] Decouple Input/Password post data from Login

    Hey, have you requested this as a feature request at the dev site (github)?
    I say this because (as you've discovered!) you won't get much feedback here, whereas at github it will be assessed as to its merits, maybe discussed, and accepted/rejected.
    cheers, murray.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •