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 :

/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).