Using Fabrik to login to another application

Status
Not open for further replies.

uglykidjoe

New Member
Is it possible to use Fabrik to grab a user's Joomla credentials to pass into another application to create almost a bridge?

Here is the login.php for the application concerned

Code:
    <form action="<?PHP echo HOST.CLIENT_LOGIN_PAGE ?>" method="post" name="login_form_box">
      <table width="550px" border="0">
        <tr>
          <td width="200px"><strong>Email</strong></td>
          <td><input type="text" name="user" class="login_input_form" value="Username" onfocus="javascript:if(document.login_form_box.user.value=='Username'){document.login_form_box.user.value=''};" onblur="javascript:if(document.login_form_box.user.value==''){document.login_form_box.user.value='Username'};"/>
          </td>
        </tr>
        <tr>
          <td><strong>Password</strong></td>
          <td><input type="text" name="password" class="login_input_form" value="Password" onfocus="javascript:if(document.login_form_box.password.value=='Password'){document.login_form_box.password.value=''};document.login_form_box.password.type='password';" onblur="javascript:if(document.login_form_box.password.value==''){document.login_form_box.password.value='Password';document.login_form_box.password.type='text';}" /><br />
            <a href="<?PHP HOST ?>forgot_password.php" title="Forgot your password">Forgot your password</a>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input name="Submit" type="submit" value="Log in" id="login_button" class="green_button" />
          </td>
        </tr>
      </table>
      <input type="hidden" name="login_form" />
    </form>
The email of the user is used for the username so I presume that I can autofill the username field using

Code:
<?php
global $my;
echo $my->email;
?>
..and setting that part of the form to hidden. Can the password be passed through too?

How do I use the code from the form above to create a Fabrik form?

I am already using the other application's database for storing the using names/passwords using mySQLAuth.

Also is the jump page the same as an "Form Action" page in a html form?
Thanks in advance Steve
 
You'll probably have to write a CURL form processing script.

A "Jump Page" in Fabrik is essentially a redirect. Usually when you submit a form in Fabrik, it will go to the usual "thankyou" page. If you specify a Jump Page, Fabrik will redirect your browser to that page, optionally appending the form data that was just submitted in the Fabrik form as a query string.

But because the login page you want to access expects POST data, not GET data, I don't think a jump page will work. Although you could try it. Create a simple Fabrik form, don't set "Record in Database", and add the 'name' and 'password' fields (and yes, you can default the email using $my->email). Point the Jump Page for the form at your other apps login form's 'action' page. Make sure you select the "short form" for the Jump Page arguments.

For the password, just use a standard text element, and check the 'password' box, which will do the usual "blobs instead of visible text" thing.

If that doesn't work, let me know, and I'll give you some clues on how to script it yourself using CURL.

-- hugh
 
Thanks for the relpy, I am affraid it did not work...please could I have some pointers for CURL, they may be usefull for an invoicing application I want to write in fabrik too.

Kind regards, thanks for your help so far, Steve
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top