Inloggen lukt niet meer
Ik ben bezig met mijn site, maar sommige users komen de site niet meer op.
Als ik dan hun id verander, lukt het wel weer:
Structuur van id:
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
Wie kan me hiermee helpen?
Groetjes Marvin
Laat je inlog code eens zien. Zonder kunnen wij niets.
Heb je recent iets aan de code aangepast, iets toegevoegd, verwijdert, aangepast.
ik snap het even niet?
Marvin Radioo op 16/12/2010 20:41:51:
inlog code?
ik snap het even niet?
ik snap het even niet?
Zo moeilijk is dit nu niet eh ;)
Laat de code eens zien die achter het formulier zit om in te loggen op je website. Als we die niet te zien krijgen gaan we je niet kunnen helpen.
Code (php)
1
2
3
4
2
3
4
<?php
<form action="/account/submit" method="post" class="login-habblet">
<label for="login-username" class="login-text">Inlognaam</label><input type="text" class="login-field" name="credentials.username" value="" maxlength="32" /><br /><label for="login-password" class="login-text">Wachtwoord</label><input type="password" class="login-field" name="credentials.password" /><input tabindex="4" type="checkbox" name="_login_remember_me" value="true" id="login-remember-me" checked="unchecked"/> Onthoud mij<br /><input type="submit" class="form_submit_grey" name="inloggen" value="Log in" /><br /><br></form>
?>
<form action="/account/submit" method="post" class="login-habblet">
<label for="login-username" class="login-text">Inlognaam</label><input type="text" class="login-field" name="credentials.username" value="" maxlength="32" /><br /><label for="login-password" class="login-text">Wachtwoord</label><input type="password" class="login-field" name="credentials.password" /><input tabindex="4" type="checkbox" name="_login_remember_me" value="true" id="login-remember-me" checked="unchecked"/> Onthoud mij<br /><input type="submit" class="form_submit_grey" name="inloggen" value="Log in" /><br /><br></form>
?>
Gewijzigd op 16/12/2010 20:59:55 door Marvin Radioo
niet je formulier zelf maar het verwerken er van
Code (php)
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
62
63
64
65
66
67
68
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
62
63
64
65
66
67
68
<?php
if (isset($_POST['credentials_username']) && isset($_POST['credentials_password']))
{
$credUser = filter($_POST['credentials_username']);
$credPass = $core->UberHash($_POST['credentials_password']);
$errors = array();
if (strlen($_POST['credentials_username']) < 1)
{
$errors[] = "Please enter your user name";
}
if (strlen($_POST['credentials_password']) < 1)
{
$errors[] = "Please enter your password";
}
if (count($errors) == 0)
{
if ($users->ValidateUser($credUser, $credPass))
{
if (isset($_POST['page']))
{
$reqPage = filter($_POST['page']);
$pos = strrpos($reqPage, WWW);
if ($pos === false || $pos != 0)
{
die("<b>Security warning!</b> An malicious request was detected that tried redirecting you to an external site. Please proceed with caution, this may have been an attempt to steal your login details. <a href='" . WWW . "'>Return to site</a>");
}
else
{
$_SESSION['page-redirect'] = $reqPage;
}
}
$_SESSION['UBER_USER_N'] = $users->GetUserVar($users->Name2id($credUser), 'username');
$_SESSION['UBER_USER_H'] = $credPass;
if (isset($_POST['_login_remember_me']))
{
$_SESSION['set_cookies'] = true;
}
header("Location: " . WWW . "/security_check");
exit;
}
else
{
$errors[] = "Incorrect password";
}
}
if (count($errors) > 0)
{
$loginResult = '<div class="action-error flash-message"><div class="rounded"><ul>';
foreach ($errors as $err)
{
$loginResult .= '<li>' . $err . '</li>';
}
$loginResult .= '</ul></div></div>';
}
}
?>
if (isset($_POST['credentials_username']) && isset($_POST['credentials_password']))
{
$credUser = filter($_POST['credentials_username']);
$credPass = $core->UberHash($_POST['credentials_password']);
$errors = array();
if (strlen($_POST['credentials_username']) < 1)
{
$errors[] = "Please enter your user name";
}
if (strlen($_POST['credentials_password']) < 1)
{
$errors[] = "Please enter your password";
}
if (count($errors) == 0)
{
if ($users->ValidateUser($credUser, $credPass))
{
if (isset($_POST['page']))
{
$reqPage = filter($_POST['page']);
$pos = strrpos($reqPage, WWW);
if ($pos === false || $pos != 0)
{
die("<b>Security warning!</b> An malicious request was detected that tried redirecting you to an external site. Please proceed with caution, this may have been an attempt to steal your login details. <a href='" . WWW . "'>Return to site</a>");
}
else
{
$_SESSION['page-redirect'] = $reqPage;
}
}
$_SESSION['UBER_USER_N'] = $users->GetUserVar($users->Name2id($credUser), 'username');
$_SESSION['UBER_USER_H'] = $credPass;
if (isset($_POST['_login_remember_me']))
{
$_SESSION['set_cookies'] = true;
}
header("Location: " . WWW . "/security_check");
exit;
}
else
{
$errors[] = "Incorrect password";
}
}
if (count($errors) > 0)
{
$loginResult = '<div class="action-error flash-message"><div class="rounded"><ul>';
foreach ($errors as $err)
{
$loginResult .= '<li>' . $err . '</li>';
}
$loginResult .= '</ul></div></div>';
}
}
?>
Dan heb ik dit nog in de aanbieding.
Hoe ziet die $Users->ValidateUser eruit?
En bij het verwerken: credentials_username
Geef het dezelfde (en zonder vreemde tekens) naam.