Help with created module

17 years 5 months ago #24354 by elockshine
Help with created module was created by elockshine
I have developed a module that shows a simple "Login" button. This button is a form post that takes you and logs you into your local email account.

The problem is that when you click on it, the Joomla site goes away. I want to do this and bring it up in a separate window.

Here is the current code that I have developed
[code:1]<?php
/**
*
* $Id: mod_cbloginmail.php 001 2006-11-07 16:26:21Z elockshine $
* @Copyright (C) 2006 Mail-Block, Inc.
* @ All rights reserved
* @ Released under GNU/GPL License : www.gnu.org/copyleft/gpl.html
* @version 0.90
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

global $my, $database;
if (is_callable(array($params,"get"«»))) { // Mambo 4.5.0 compatibility
$url_redir = $params->get('url_redirect', "www.hd-mail.com/webmail/login.aspx?option=from_www"«»);
$url_newwindow = $params->get('url_newwindow', 1);
} else {
$url_redir = "www.hd-mail.com/webmail/login.aspx?option=from_www";
$url_newwindow = 1;
}

$query = "SELECT cb_hdemail, cb_hdpass FROM #__comprofiler WHERE id = ".$my->id;
$database->setQuery($query);
$rows = $database->loadObjectList();
$hd_user = "";
$hd_password = "";
if (count($rows) > 0) {
$hd_user = $rows[0]->cb_hdemail;
$hd_password = $rows[0]->cb_hdpass;
if (strlen($hd_user) > 0 and strlen($hd_password) > 0){
echo '<form action="'.$url_redir.'" method="post" id="mod_hdmailform" style="margin:0px;">'."\n";
echo '<input type="hidden" name="Name" value="'.$hd_user.'" />'."\n";
echo '<input type="hidden" name="Password" value="'.$hd_password.'" />'."\n";
echo '<input type="submit" name="Submit" class="button" value="'._BUTTON_LOGIN.'" />';
echo '</form>';
}
else{
echo 'Please enter your username and password in your profile.';
}
}
?>
[/code:1]

Any help would be greatly appreciated! (Yes, I am going to release this for anyone to use!)

Eric S. Lockshine
Programmer

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.146 seconds

Facebook Twitter LinkedIn