Members: 16,996
Threads: 38,867
Posts: 159,477
Online: 45

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 23.03.2005, 05:53   #1 (permalink)
Baby Mamber
 
Join Date: Mar 2005
Posts: 9
wene is on a distinguished road
Lightbulb [hack] wrapper login external site

Hello all

i needed to connect to an external site from mambo loggued username.
i modified the mambo wrapper to be able to use login options, like the "ww.login" module, but integrated inside the main wrapper.
the users database in the both side need to already have the same identifiers.

i used Mambo 4.5.2.1 to build this.

Usage :

default :
use normal wrapper without changing options by default.

with "login yes" checked :
  • The wrapper still works the same way.

  • To use connection, the wrapper url should look like this (from wwlogin doc):
    For example... for OScomerce the URL could be http://www.yoursite.com/login.php?action=process
    for my application, the urls is http://www.mysite.com/register.php.

  • The alternative url is used if no user is connected to Mambo or no login value is defined.

  • The "login form input name" and "login form input name" options are used to make the send form compatible with the destination one.
    Some forms use "login" and others "username".

  • The "identifier" option let you choose if you use the Mambo user login/pass or if you use other parameters.
    Attention !! the Mambo option uses md5 encrypted pass.
    So you maybe need to modify your destination' s page form to remove the md5 transformation in the form.

  • Then you can choose if you encrypt datas or not for the "other user".

  • At last, you can add optional fields for your form.
    like
    PHP Code:
    <INPUT type="hidden" name="field" value="ok"
installation :
you need to modify 3 files from mambo orginal installation.

/administrator/components/com_menus_wrapper/wrapper.xml add at the end of the parameters.
PHP Code:
<param name="@spacer" type="spacer" default="" label="" description="" />
<
param name="login" type="radio" default="no" label="Login" description="Allows to connect to another site.">
    <
option value="no">No</option>
    <
option value="yes">Yes</option>
</
param>
<
param name="alt_url" type="text" size="30" default="" label="Alternative Url" description="Alternate page if no user infos " />
<
param name="form_login" type="text" size="30" default="login" label="Login Form Input name = " description="The name of the form input (mostly login or username) " />
<
param name="form_pass" type="text" size="30" default="pass" label="Pass Form Input name = " description="The name of the form input (mostly pass or passwd) " />
<
param name="user_src" type="radio" default="mambo" label="Identifier" description="Use Mambo user or another. (attention !! the mambo option uses md5 pass)">
    <
option value="mambo">Mambo</option>
    <
option value="other">Other</option>
</
param>
<
param name="login_enc" type="radio" default="none" label="Login Encryption" description="Sends Md5 encripted data for other user.">
    <
option value="none">None</option>
    <
option value="login">Login</option>
    <
option value="pass">Pass</option>
    <
option value="both">Both</option>
</
param>
<
param name="other_login" type="text" size="30" default="" label="Other User" description="If you checked Other, enter login " />
<
param name="other_pass" type="text" size="30" default="" label="Other Pass" description="If you checked Other, enter pass " />
<
param name="other_fields" type="textarea" default="" label="Other fields" rows="5" cols="30" description="Here, you can add html hidden fields in the posting form."/>

<
param name="@spacer" type="spacer" default="" label="" description="" /> 
/components/com_wrapper/wrapper.html.php add on line 45 (before the ?>)
PHP Code:
if($params->get( 'login' )=="yes"){

    if ($row->login !="")
    {
    ?>
        <iframe   
        id="blockrandom"
        name="blockrandom"
        width="<?php echo $params->get'width' ); ?>"
        height="<?php echo $params->get'height' ); ?>"
        scrolling="<?php echo $params->get'scrolling' ); ?>
        align="top"
        frameborder="0"
        class="wrapper<?php echo $params->get'pageclass_sfx' ); ?>">
        <?php echo _CMN_IFRAMES?>
        </iframe>
        </div>
        <FORM id="login_wrapper" name="login" action="<?php echo $row->url?>" target="blockrandom" method="post">
        <INPUT type="hidden" name="<?php echo $params->get'form_login' ); ?>" value="<?php echo $row->login?>">
        <INPUT type="hidden" name="<?php echo $params->get'form_pass' ); ?>" value="<?php echo $row->pass?>">
<?php echo $params->get'other_fields' ); ?>
        </FORM>
        <script language="javascript">
        document.login_wrapper.submit();
        </script>
    <?php    
    
}
    else
    {
        if(
$params->get'alt_url' ) !=""){
            
$alt_url $params->get'alt_url' );
        }else{
            
$alt_url $row->url;
        }
        
?>
        <iframe   
        id="blockrandom"
        src="<?php echo $alt_url?>"
        width="<?php echo $params->get'width' ); ?>"
        height="<?php echo $params->get'height' ); ?>"
        scrolling="<?php echo $params->get'scrolling' ); ?>
        align="top"
        frameborder="0"
        class="wrapper<?php echo $params->get'pageclass_sfx' ); ?>">
        <?php echo _CMN_IFRAMES?>
        </iframe>
        </div>
        <?php 
        
}
    } 
    else
    {
then at line (60 before previous add or 110 after previous add) add :
PHP Code:

/components/com_wrapper/wrapper.php add on line 35
PHP Code:
switch ($params->get'user_src' )) {
    case 
"mambo":
        
$login $my->username;
        
$query "SELECT password FROM #__users WHERE id = "$my->id;
        
$database->setQuery$query );
        
$pass $database->loadResult();
    break;
    case 
"other":
        switch (
$params->get'login_enc' )) {
            case 
"none":
                
$login $params->get'other_login' );
                
$pass $params->get'other_pass' );
            break;
            case 
"login":
                
$login md5($params->get'other_login' ));
                
$pass $params->get'other_pass' );
            break;
            case 
"pass":
                
$login $params->get'other_login' );
                
$pass md5($params->get'other_pass' ));
            break;
            case 
"both":
                
$login md5($params->get'other_login' ));
                
$pass md5($params->get'other_pass' ));
            break;
        }
    break;
}

    
$row->login $login;
    
$row->pass $pass
I realised that to connect some kind of sites (like mambo), it doesnt connect under msie 6.0.2900.2180, but it connects with firefox 1.0.1.
can someone tell me why ?

For sure, please tell me what i did wrong and what i could optimise.
If it can help
good luck all.

I added this zip file that you just need to unpack in your mambo root dir (replacing old files).

Last edited by wene; 24.03.2005 at 10:56. Reason: zip file added
wene is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 23.03.2005, 13:18   #2 (permalink)
Baby Mamber
 
Join Date: Aug 2004
Posts: 20
be2004 is on a distinguished road
Default Re: [hack] wrapper login external site

I have a slightly older version (4.5.1a) and wonder if the files have changed somewhat. Can you possibly post your 3 files?

Cheers,
Dave
be2004 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 20.04.2005, 19:54   #3 (permalink)
Baby Mamber
 
Join Date: Jan 2005
Posts: 5
trumpcar is on a distinguished road
Default Re: [hack] wrapper login external site

wene,

This sounds like a very useful addition to the wrapper. Great timing, as I will be requiring this exact functionality in the near future. I'll let you know how it goes.

Once again, nice work!

trumpcar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21.04.2005, 06:58   #4 (permalink)
Baby Mamber
 
Join Date: Mar 2005
Posts: 9
wene is on a distinguished road
Smile Re: [hack] wrapper login external site

hello
thanks for opinions.
i forgot to tell you that there is a mamboforge project for wrapper-login.
you can find it there :
wrapper-login on mamboforge
have good time
wene is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 31.01.2006, 22:15   #5 (permalink)
Baby Mamber
 
Join Date: Jan 2006
Posts: 2
wdoa is on a distinguished road
Default Re: [hack] wrapper login external site

i have successfully used this to pass username and password through to my wrapped asp site, however in Firefox when i click on my menu link to the wrapper i get a blank page in the wrapper and the source looks as though it is stuck at the login form, which is not being submitted. Is there something else i need to do to get it to work in firefox?

Cheers
wdoa is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 31.01.2006, 22:35   #6 (permalink)
Senior Mamber
 
jurek_pl's Avatar
 
Join Date: Aug 2005
Location: Bydgoszcz
Posts: 174
jurek_pl is on a distinguished road
Send a message via ICQ to jurek_pl
Default Re: [hack] wrapper login external site

Excelent work, cheers
jurek_pl is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07.02.2006, 21:05   #7 (permalink)
Baby Mamber
 
Join Date: Jan 2006
Posts: 2
wdoa is on a distinguished road
Default Re: [hack] wrapper login external site

Quote:
Originally Posted by wdoa
i have successfully used this to pass username and password through to my wrapped asp site, however in Firefox when i click on my menu link to the wrapper i get a blank page in the wrapper and the source looks as though it is stuck at the login form, which is not being submitted. Is there something else i need to do to get it to work in firefox?

Cheers

after some source viewing i discovered the form name for the wrapper login is "login" which is the same as the mambo login form name. So i renamed the wrapper login form to login_wrapper, the same as the form ID and all works fine.

Excellent
wdoa is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TUTORIAL: How to INTEGRATE Mambo modules into non-MOS static php pages in your site marcnyc Mambo 4.5 'How Do I' Questions 10 28.02.2006 03:23
Mambo, Invision, seperate site with same login psychowolfman Mambo 4.5 General Talk 4 17.08.2005 16:08
Login does not work on redirected URL pspencer Mambo 4.5.1 Installation and Upgrades 4 14.04.2005 17:45
Can't login on IE permagnus Mambo 4.5.1 Bugs 9 22.03.2005 10:55
Cannot Login to the Frontend kimber Mambo 4.5.1 Bugs 1 15.03.2005 04:39


All times are GMT +2. The time now is 02:20.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.