THE ZEPINT NETWORK

programmer assist

PHP PHP XML Feeds

PHP Questions PHP Solutions PHP Articles

PHP is a popular open-source programming language used primarily for developing server-side applications and dynamic web content, and more recently, other software. The name is a recursive acronym for "PHP: Hypertext Preprocessor".

urgent joomla 1.0.5 mod_login SQL query code . . .

DiggBlinkRedditDeliciousTechnorati

question by spicynugget | Hard

Hi, I just fantastico-installed joomla 1.0.5, and everything works great, but I am modifying a few lines of PHP and need some help.

I am working with the mod_login module found at [http://joomla.org.in/doc/modules/mod_login.php.source.html]
text only version at :[http://joomla.org.in/doc/modules/mod_login.php.source.txt]

As you can see by that file, it is simple SQL authentication. The index.php file calls it and then the mod_login module searches the database for credentials and displays appropriate HTML based on results. What I am trying to do is automatically log a user in just based on an external link. The link will call the joomla index.php file, and the mod_login module will determine if [based on the variables passed in the link], the user will be logged in or simply presented with an option to register.

Currently, if you just call the index.php? file, it presents the user with the option to login or register [found at line 73]. I want to be able to have the user authenticated automatically via the link that comes from an OUTSIDE SITE, for example, if a partner website has a link to our site like, http://www.educationforliberty.com/altapps/index.php?username=registered_user_username&passwd=example&autologin=yes

I know that others will be able to see username/password combinations, but all it means for us in this situation is that we control the access that is granted based on inbound external links.

I am looking for a solution that will fall right around line 73 and search the SQL database for credentials, and redirect the window if the proper credentials are given. If they are not given, then the user is presented with the default login/register form found after line 73.

I have attempted to do this at line 73 with

_____________________________

// autologin if a user
if ( $autologin == yes) {

$location = 'http://www.educationforliberty.com/altapps/index.php?option=com_content&task=view&id=12&Itemid=27&data=final_destination_for_authenticated_link';

print "<script language="javascript">
";
print "document.location.href="$location"
";
print "</script>";

}

else {
//load default html to offer registration for user
// open else statement found in original

?>

_____________________________


but there is no authentication aspect in SQL

Post reply Subscriptions

Re: urgent joomla 1.0.5 mod_login SQL query code . . .

reply by Support@PA

== question moved to the PHP topic area ==

Post reply Subscriptions

Re: urgent joomla 1.0.5 mod_login SQL query code . . .

reply by param

Hello

Though it is not a good idea to pass authentication information through a query string
but here is how you can achieve this

get the credentials from the query string

$usr = $_GET[username];
$pass = $_GET[passwd];

there should be a function where the credentials are passed when you login and submit from the home page ....

1. Overwrite the login text box values with the ones passed in the link
when the page is submit ....overwrite the values of the login text boxes
shoudl be something like $_POST[username]

2. Second approach is to call the function which authenticates the login and pass these values explicitly


let me know if you need me to send a code sample

Post reply Subscriptions

Got a PHP Question?

Just Sign Up and ask the top PHP experts!

Search via Google

User Login

Email Address

Password

PHP Experts

Rank Expert Points
#1 Srirangan 2650
#2 Anurag 600
#3 mastercomputers 100
This a list of the Top PHP experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 poizn 100
This is a list of overall best performing experts, how many points do you have?