Authentification des membres ne fonctionne pas
bonjour à tous
j ai un script php qui à partir de la saisie du login et mp d'un membre ouvre une page qui lui permet d'uploader des fichiers sur son espace. (permet de stocker ses fichiers dans différents répertoires qu il peut réouvrir par la suite bien sur)
mais j ai ce messag lorsque je valide ce form de saisie:
Code:
Warning: Cookie names can not contain any of the folllowing '=,; \t\r\n\013\014' (ft_user_/DREAM MATIC/stockage/ft2.php) in C:\wamp\www\DREAM MATIC\stockage\ft2.php on line 255
je vous mets la fonction d'authentification et en gras rouge la fameuse ligne 255 qui semble poser prôblême:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| /**
* Check if a user is authenticated to view the page or not. Must be called on all pages.
*
* @return TRUE if the user is authenticated.
*/
function ft_check_login() {
global $ft;
$valid_login = 0;
if (LOGIN == TRUE) {
if (empty($_SESSION['ft_user_'.MUTEX])) {
$cookie_mutex = str_replace('.', '_', MUTEX);
// Session variable has not been set. Check if there is a valid cookie or login form has been submitted or return false.
if (REMEMBERME == TRUE && !empty($_COOKIE['ft_user_'.$cookie_mutex])) {
// Verify cookie.
$cookie = ft_check_cookie($_COOKIE['ft_user_'.$cookie_mutex]);
if (!empty($cookie)) {
// Cookie valid. Login.
$_SESSION['ft_user_'.MUTEX] = $cookie;
ft_invoke_hook('loginsuccess', $cookie);
ft_redirect();
}
}
if (!empty($_POST['act']) && $_POST['act'] == "dologin") {
// Check username and password from login form.
if (!empty($_POST['ft_user']) && $_POST['ft_user'] == USERNAME && $_POST['ft_pass'] == PASSWORD) {
// Valid login.
$_SESSION['ft_user_'.MUTEX] = USERNAME;
$valid_login = 1;
}
// Default user was not valid, we check additional users (if any).
if (is_array($ft['users']) && sizeof($ft['users']) > 0) {
// Check username and password.
if (array_key_exists($_POST['ft_user'], $ft['users']) && $ft['users'][$_POST['ft_user']]['password'] == $_POST['ft_pass']) {
// Valid login.
$_SESSION['ft_user_'.MUTEX] = $_POST['ft_user'];
$valid_login = 1;
}
}
if ($valid_login == 1) {
// Set cookie.
if (!empty($_POST['ft_cookie']) && REMEMBERME) {
setcookie('ft_user_'.MUTEX, md5($_POST['ft_user'].$_POST['ft_pass']), time()+60*60*24*3);
} else {
// Delete cookie
setcookie('ft_user_'.MUTEX, md5($_POST['ft_user'].$_POST['ft_pass']), time()-3600);
}
ft_invoke_hook('loginsuccess', $_POST['ft_user']);
ft_redirect();
} else {
ft_invoke_hook('loginfail', $_POST['ft_user']);
ft_redirect("act=error");
}
}
return FALSE;
} else {
return TRUE;
}
} else {
return TRUE;
}
} |
est ce que quel qu un aurait une petite idée car je vois pas.
merci du coup de main
stephi