Ladies and Gents,
If you could assist me with this, I would be very appreciative. What I'm trying to do is call user session credentials for a user that is logged into a site running Joomla CMS.
I want to use this session info to populate hidden form fields and transmit those credentials to a 3rd party server for authentication against a system.
Here is the code that I have so far:
<?php
/**
* @version $Id: mod_jflogin.php Wed Apr 05 10:46:26 WST 2006 shaynebartlett
* @package J!FAQ
* @copyright Copyright (C) 2005 theJ!factory. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* J!Login is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// NO DIRECT ACCESS
defined( '_VALID_MOS' ) or die( 'Restricted access' );
$return = mosGetParam( $_SERVER, 'REQUEST_URI', null );
// converts & to & for xtml compliance
$return = str_replace( '&', '&', $return );
$url = $params->def( 'url', $return );
$user_label = $params->def( '_user', $return );
$user_field = $params->def( 'user', $return );
$pass_label = $params->def( '_pass', $return );
$pass_field = $params->def( 'pass', $return );
$login = $params->def( 'login', $return );
$class = $params->def( 'moduleclass_sfx', $return );
[COLOR="Red"]// including the username
session_register("SESSION_UNAME");
$SESSION_UNAME = $f_user;
// including the username
session_register("SESSION_PWD");
$SESSION_PWD = $f_pass;[/COLOR]
?>
<div title="JF login" align="left">
<form action="<?php echo $url; ?>" target="_blank" method="post">
<label for="<?php echo $user_field; ?>"><?php echo $user_label; ?></label>
<br />
<input accesskey="U" id="<?php echo $user_field; ?>" tabindex="1" name="<?php echo $user_field; ?>" [COLOR="Red"]value="<?php echo $SESSION_UNAME; ?>"[/COLOR] type="hidden" alt="username" size="20" class="inputbox<?php echo $class; ?>"/>
<br />
<label for="<?php echo $pass_field; ?>"><?php echo $pass_label; ?></label>
<br />
<input accesskey="P" id="<?php echo $pass_field; ?>" tabindex="2" name="<?php echo $pass_field; ?>" [COLOR="Red"]value="<?php echo $SESSION_PWD; ?>[/COLOR]" type="hidden" class="inputbox<?php echo $class; ?>" alt="password" size="20"/>
<br />
<input tabindex="3" type="submit" name="Submit" value="<?php echo $login; ?>" class="button<?php echo $class; ?>" />
</form>
</div>
This code is not mine except for what I've highlighted in RED. I'm not sure if what I'm trying to do will even work, it certainly doesn't work this way. Can anyone assist with this? My goal is basically to make the interface seem like a single-sign-on environment for the users even though it would be authenticating twice with the user of hidden fields.
Thank you very much for any help you can give.