This text is replaced by the Flash movie.

Posts Tagged ‘Automatic Login’

CMSMS FrontEnd User Hack…

September 29th, 2008
CMSMS FrontEnd User Hack for Automatic Login
The following step by step method I did Integrating CMSMS and amember for automatic login

Current Version of FrontEndUsers plugin is 1.5.2
CMSMS Version 1.4.1

For Session - I used


    $_SESSION['fe_user_logged_in'] //- just passing a non sense string :) not important.
    $_SESSION['fe_int_username'] //- passing username value
    $_SESSION['fe_int_password'] //- passing password value
 

Note: I used Custom Session variables, cause on my current project I used 4 different apps to pass this session variables... If you are only integrating cmsms on amember, I advice that you get the session of amember username and password.

CMSMS

Front End User Login

-----------------------------------------------------------------------------------------------------
1.)at [index.php] root of cmsms
add session_start(); at the beginning

over modules folder find
FrontEndUsers folder

2.)Injecting the Sessions

on - [action.do_login.php]

find (could be) on line 80:

    
     $this->Audit( 0, $this->Lang('friendlyname'),
     $this->Lang('frontenduser_loggedin').": ".$params['feu_input_username'] );

     //
     // we're logged in
     //

put these following code at bottom of it:

    
     /* Custom Login Session */
     $_SESSION['fe_user_logged_in'] = "logged_in"; // store session data
     $_SESSION['fe_int_username'] = $params['feu_input_username']; //username
     $_SESSION['fe_int_password'] = $params['feu_input_password']; //password
     session_write_close();

3.)Erasing the Session

on - [action.logout.php]

find (could be) on line 53:

    
     $this->SendEvent( 'OnLogout', $parms );
     $this->_SendNotificationEmail('OnLogout',$parms);

     // we're logged out
     // redirect somewhere
     // todo, add more options here.

put these following code at bottom of it:


     /* Custom Logout Session */
     $_SESSION['fe_user_logged_in'] = NULL; // store session data as NULL
     $_SESSION['fe_int_username'] = NULL;
     $_SESSION['fe_int_password'] = NULL;
     session_write_close();
 

4.)This is not necessary but if you want to custom design or name on your login boxes you can edit the hard code at:

[function.user_loginform.php]

Like in this case I added some javascript on input boxes and also changed the class style.


/*
        $smarty->assign('input_username',
        $this->CreateInputText( $id, 'feu_input_username',
        $username,
        $this->GetPreference('usernamefldlength'),
        $this->GetPreference('max_usernamelength')));
*/                   

    $smarty->assign('input_label', $id );
    $smarty->assign('id_password',$id.'feu_input_password');
    $smarty->assign('prompt_password', $this->Lang('prompt_password'));

    $smarty->assign('input_password', '<input type="password" name = "' .$id.  'feu_input_password" class="passwordfield"

    onfocus="this.style.backgroundImage=\'none\'" onblur="if(this.value==\'\'){this.style.backgroundImage=\'url(images/login-password.gif)\'}" />');

/*