Porblem with login!! UIN-what is it? [Session doesn't work]

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
hazy
Posts: 9
Joined: Tue Oct 17, 2006 3:42 pm

Porblem with login!! UIN-what is it? [Session doesn't work]

Post by hazy »

Hallo

I want to create a link between phpMyFAQ and another software in such a way that if you login there than you don't have to type again username and password.

I did it on my localhost. Everyghing was working perfectly.
But if i do the same on my serwer there is a such problem that I CAN log in to phpMyFAQ without retyping username and password but as soon as i want do anything (e.g. i click on: startpage, user administration etc. - menu) i HAVE TO retype user name and password.

Additionally i have notice that uin number is disapiring after i click on anything (that's why i thinkg my username and password are missing )

Below u will find a lines which i did ignore as well some others i have added.

admin/index.php
-----------------------------------------------------------

Code: Select all

$ID = $_GET['SID'];
session_id($ID);
session_start();
.......
// delete cookie before sending a header
//if (isset($_REQUEST['aktion']) && $_REQUEST['aktion'] == 'delcookie') {
//	setcookie('cuser', '', time() + 30);
//	setcookie('cpass', '', time() + 30);
//}
........

// Set cookie before sending a header
/*
if (isset($_POST["aktion"]) && $_POST["aktion"] == "setcookie") {
    if (isset($_POST["cuser"])) {
        setcookie(" ", $_POST["cuser"], time() + (86400 * PMF_AUTH_TIMEOUT));
    }
    if (isset($_POST["cpass"])) {
        setcookie("cpass", $_POST["cpass"], time() + (86400 * PMF_AUTH_TIMEOUT));
    }
}
*/
.....

// If the cookie is set, take the data from it

/*
if (isset($_COOKIE['cuser']) && !preg_match('/^[a-z0-9]$/i', $_COOKIE['cuser'])) {
    $user = $_COOKIE['cuser'];
} else {
    unset($user);
}
if (isset($_COOKIE['cpass']) && !preg_match('/^[a-z0-9]$/i', $_COOKIE['cpass'])) {
    $pass = $_COOKIE['cpass'];
} else {
    unset($pass);
}
*/

.....


$faqusername = $_SESSION['username'];
$faqpassword = $_SESSION['password'];

 $user = $db->escape_string($faqusername);
 $pass = md5($db->escape_string($faqpassword));

// Authenticate the user from login POST variables
/*
if (isset($_POST["faqusername"])) {
    $user = $db->escape_string($_POST["faqusername"]);
}
if (isset($_POST["faqpassword"])) {
    $pass = md5($db->escape_string($_POST["faqpassword"]));
}
*/
Do you know where is the problem. But rember:
- on the localhost is working fine
- I CAN login to the first page with this one on the server. so this means that phpmyfaq reads username and password frome the database

Regards Lukasz
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

did you disabled the IP check in the configuration? That could be the problem.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
the uin parameter is needed to correctly manage the PMF authentication session: I guess you've performed a "bad" customization 'cause it seems you've missed to duplicate user data into the faquser table, at least on the production server.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
hazy
Posts: 9
Joined: Tue Oct 17, 2006 3:42 pm

Post by hazy »

Hallo
I haven't chack for your suggestions but the problem is anyway solved.

Just by modyfing the following line

Code: Select all

//old line
$linkext = "?uin=".$uin; 
//new line
$linkext = "?uin=".$uin . "&SID=" . $ID;
and this seems to be ok!!
So anyway thank you very much for you replays!!!!

but now has rised another question :)
how can i remove the popup window notifing me about "you session will expire in 5minutes" (since im getting this message but in my case it's not a case)
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
hazy wrote:how can i remove the popup window notifing me about "you session will expire in 5minutes" (since im getting this message but in my case it's not a case)
open the inc/constants.php file and set the value of PMF_AUTH_TIMEOUT_WARNING equal to that of PMF_AUTH_TIMEOUT.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
hazy
Posts: 9
Joined: Tue Oct 17, 2006 3:42 pm

Post by hazy »

matteo wrote:Hi,
hazy wrote:how can i remove the popup window notifing me about "you session will expire in 5minutes" (since im getting this message but in my case it's not a case)
open the inc/constants.php file and set the value of PMF_AUTH_TIMEOUT_WARNING equal to that of PMF_AUTH_TIMEOUT.

Ciao,
Matteo
GRACIAS (no idea how to write it but thnx)
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
hazy wrote:GRACIAS (no idea how to write it but thnx)
if you mean the italian for "thanks you" find it below:

Code: Select all

GRAZIE
:D

BTW, I'm glad to be of any help: thanks to you too for choosing PMF ;).

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Post Reply