Php conversion to nuke

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Php conversion to nuke
hopdadi
CZ Newbie
hopdadi has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 14, 2004
0.00 posts per day
Posts: 7
Points: 464
   
Greetings, I have a reciepe program written for PHP that has its own data base for users. I have placed it as a independant module in my Nuke site throught the use if iframes.

What I want to do is to change the settings inside that to access the nuke database for logon info so users do not have to logon twice, once to the site and once to the reciepe program.

I have changed the sql address in the config.php file for the reciepe program to the same location as Nuke but the prefixs like the default "_nuke" are not mentioned there and I think that is the problem. However I am unsure as what the fix would be. It wouldnt be as simple as to add the prefix setting in the config file would it? Dont the other .php files call for the prefix string also?


Thanks for the help
Jim



Back to top Reply with quote
#2   re: Php conversion to nuke
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,440
   
Your gonna need to pass the cookie from nuke to recipes also so they stay logged in. The table prefixes will not fix the problem.




_________________
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   re: Php conversion to nuke
hopdadi
CZ Newbie
hopdadi has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 14, 2004
0.00 posts per day
Posts: 7
Points: 464
   
Thanks, How is that done? I am not a PHP programer, nor play one on tv icon_biggrin.gif

Possibly adding a simple code to the php files? I hope...

Thanks Jim



Back to top Reply with quote
#4   re: Php conversion to nuke
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,440
   
cookiedecode( $user );
$user_name = $cookie[1];


Add $cookie as a global statement. Dunno if it will work you might have to make more changes to the code itself.



_________________
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
#5   re: Php conversion to nuke
hopdadi
CZ Newbie
hopdadi has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 14, 2004
0.00 posts per day
Posts: 7
Points: 464
   
I added it to the header.php file and got this responce

Fatal error: Call to undefined function: cookiedecode() in /var/www/cyberbrau/header.php on line 5

Here is the first portion of the header code for reference


if (!session_is_registered('user') && $user){
    print "Tisk, Tisk. <br>No doing that, $user... if that is your real name.";
    exit;
}
if ($admin && $user != "admin"){
    print "You are not admin, don't try that.";
    exit;
}
cookiedecode( $user );
$user_name = $cookie[1];

session_start();
#session_register("nuke_user");
require("conf.php");
include("functions.php");



global $mysql_link;
$mysql_link = mysql_connect($host, $dbusername, $auth);
mysql_select_db($datasource, $mysql_link);

if ($admin_ip == $REMOTE_ADDR){ $admin_ip=1; };

if ($pass){ $result = login($username,$pass); if (!$result){
$error="<font color=red>Login Failure</font>";}
}

if ($logout) { session_unset("user");
    if ($useforum){
        forum_logout();
    }

}



Back to top Reply with quote
#6   re: Php conversion to nuke
hopdadi
CZ Newbie
hopdadi has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 14, 2004
0.00 posts per day
Posts: 7
Points: 464
   
I added the global cookie statement in the global section on the header and moved the code you provided after the "if ($admin && $user != "admin"){
print "You are not admin, don't try that.";
exit;" line.

It now works without errors but does not yet capture the user that is signed in on the nukesite.

Back to square . Any ideas?

I did try to add the code you supplied to the config file for the reciepe program and got the same undefined error. I removed it.



Back to top Reply with quote
#7   re: Php conversion to nuke
hopdadi
CZ Newbie
hopdadi has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 14, 2004
0.00 posts per day
Posts: 7
Points: 464
   
I spoke to the author of the reciepe program , he told me that I need to set these variables from the nuke so it could use them for authentication.


$_SESSION['user'];
$_SESSION['userid'];
$_SESSION['useremail'];

Do you know where I would put these? Since I am using I frames, its not really inside nuke. Sure wish I could get this to work.

I need a way that the recipe program could retrieve the cookie info from the nuke session and set the varibles above. Is this possible?

Thanks



Back to top Reply with quote
#8   
dementeddogz
CZ Active Member
dementeddogz has been a member for over 19 year's 19 Year Member
Age: 46
Gender: Male
Fav. Sports Team: Miami
Status: Offline
Joined: Mar 12, 2005
0.02 posts per day
Posts: 163
Points: 21,847
   
If Im mistaken here chalk it up to an extreme need for sleep. But the recipie mod youre using is not built for nuke? May have misread that if so disregard this post , if not nuke does have a recipe mod that also integrates with an Ingredient module....



Back to top Reply with quote
#9   re: Php conversion to nuke
hopdadi
CZ Newbie
hopdadi has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 14, 2004
0.00 posts per day
Posts: 7
Points: 464
   
Correct, not built for nuke. Its a beer reciepe calculator and there is nothing like it for nuke. It can run on its own in a iframe just fine. However it uses its own database for users. What I want to do is to override it so you dont have to log in twice, once to my website and they once into the module (iframe). Does that make sense? I just want it to see that hopdadi is already signed in (nuke) so reconize him as such.

Thanks so much for your help.



Back to top Reply with quote
#10   
dementeddogz
CZ Active Member
dementeddogz has been a member for over 19 year's 19 Year Member
Age: 46
Gender: Male
Fav. Sports Team: Miami
Status: Offline
Joined: Mar 12, 2005
0.02 posts per day
Posts: 163
Points: 21,847
   
Yep i get what youre saying now. Didnt say beer reciepe at first :p And I knew of a few full recipe modules



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