linking verification of user from php script to nuke 6.9

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   linking verification of user from php script to nuke 6.9
darkstonexa
CZ Newbie
Status: Offline
Joined: Oct 20, 2003
0.00 posts per day
Posts: 13
Points: 1,194
   
I am hoping that someone can point me in the right direction.
I have a php script that requires a user to be logged in to access certain pages
now I want the script to use the values that nuke uses to authenticate user.

I have the script loading in an iframe but can't get it to recognise that I am logged in when I login as a nuke user and hence grant me access to the page I want to view loading in the iframe
the code I have been slowly modifying is as follows but I think I have a problem with the $pwd == $ps section

    include ("../includes/global.php");

    links();
   
    //DB connectivity
    $link=dbconnect();

    $query1 = "SELECT count(*),TO_DAYS(NOW())-TO_DAYS(last_login),last_login,user_password,user_active FROM nuke_users where user_email='$email'  group by user_email";
    if($res = mysql_query ($query1))
    {
        $res = mysql_fetch_array($res);
        //This condition will check for whethere the login details is valid or not ie if count value is 1 then the login details is valid, else invalid and
         //checking for condition if previous login is greater than maximum days or less.If less that $max_days_for_login  days,login will  proceed, else locked
         //encryption done for user password
         $pwd = md5($res[3]);
         if(($res[0] > 0) && ($pwd==$ps) && ($res[1] < $max_days_for_login) && ($res[4] == "1") )
         {
             $member_links=menu($email,$pwd);
             $query2 = "update nuke_users set user_email='$email',last_login=now() where user_email='$email' ";
             mysql_query ($query2);


what happens with the above result is it says invalid user or password..
well i assume that I am calling the user correctly and I am guessing that its the password is a problem becuase as soon as I change $pwd != $ps it lets me into the page I want to view..

Just a thought would ti be something to do witht eh encryption bit? and if so does anyone know how I correct it?


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Im not exactly sure what you are trying to do but your going to have to also pass the cookie to the user somehow that will never work if they dont get the cookie.

Telli




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   
darkstonexa
CZ Newbie
Status: Offline
Joined: Oct 20, 2003
0.00 posts per day
Posts: 13
Points: 1,194
   
I have effctively two sites.
one is phpnuke 6.9 and the other is a php script for a PTR (paid to read) site.

now I am loading the PTR site in an iframe and that is all fine and working.
the next step is I want to drop the login procedures for the PTR site

so what will happen is instead of having to login into two sites
i.e nuke and the PTR
when I log in to phpnuke I am effcectivly logged in to the PTR site
you could say I am trying to create a bolt on module.

what I have been trying to do is alter the variables in the second site to read the details from the nuke_user table instead of its orginal member details tables

but all I get when I load the PTR site ( member area)in the iframe is invalid user or password.

unless I change the bit in the code that says $pwd == $ps to $pwd != $ps
then it loads the memeber area page that I want to load
(code above is the section from the member area php file)

now I don't know enough about php to work out what details I need to pass to confirm whether the user is logged in or not.. or how nuke even deals with it..
I was hoping one of wizards icon_wink.gif would be able to tell me..


hope that explains it now..



Back to top Reply with quote
#4   re: linking verification of user from php script to nuke 6.9
fr33z
CZ Newbie
fr33z has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Dec 16, 2004
0.00 posts per day
Posts: 1
Points: 36
   
darkstonexa

Can I have ur ptr script?

Thx



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum