File inc/struct.inc.php changed (mode: 100644) (index f826798..787bd53) |
... |
... |
$rg_sql_struct[44]['table'] = array( |
640 |
640 |
); |
); |
641 |
641 |
$rg_sql_struct[44]['other'] = array( |
$rg_sql_struct[44]['other'] = array( |
642 |
642 |
'index ldap_cache uuid' => |
'index ldap_cache uuid' => |
643 |
|
"CREATE INDEX ldap_cache_i_uuid on ldap_cache(uuid)" |
|
|
643 |
|
"CREATE INDEX ldap_cache_i_uuid on ldap_cache(uuid)", |
|
644 |
|
'invalidate_confirmation_token' => |
|
645 |
|
"UPDATE users SET confirm_token = '' WHERE confirmed > 1" |
644 |
646 |
); |
); |
645 |
647 |
|
|
646 |
648 |
// Do not forget to add the new tables to statistics |
// Do not forget to add the new tables to statistics |
File inc/user.inc.php changed (mode: 100644) (index 3fa5824..ca0aaa6) |
... |
... |
function rg_user_confirm($db, $token) |
1748 |
1748 |
// "< 2" because we mark with "1" if "no need to confirm" |
// "< 2" because we mark with "1" if "no need to confirm" |
1749 |
1749 |
$params = array("confirmed" => $now, "uid" => $uid); |
$params = array("confirmed" => $now, "uid" => $uid); |
1750 |
1750 |
$sql = 'UPDATE users SET confirmed = @@confirmed@@' |
$sql = 'UPDATE users SET confirmed = @@confirmed@@' |
|
1751 |
|
. ', confirm_token = \'\'' |
1751 |
1752 |
. ' WHERE uid = @@uid@@'; |
. ' WHERE uid = @@uid@@'; |
1752 |
1753 |
$res = rg_sql_query_params($db, $sql, $params); |
$res = rg_sql_query_params($db, $sql, $params); |
1753 |
1754 |
if ($res === FALSE) { |
if ($res === FALSE) { |
|
... |
... |
function rg_user_confirm($db, $token) |
1756 |
1757 |
} |
} |
1757 |
1758 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
1758 |
1759 |
|
|
1759 |
|
rg_cache_set('user' . '::' . $uid . '::' . 'info' |
|
1760 |
|
. '::' . 'confirmed', $now, RG_SOCKET_NO_WAIT); |
|
|
1760 |
|
$_a = array('confirmed' => $now, 'confirm_token' => ''); |
|
1761 |
|
rg_cache_merge('user' . '::' . $uid . '::' . 'info', |
|
1762 |
|
$_a, RG_SOCKET_NO_WAIT); |
1761 |
1763 |
} |
} |
1762 |
1764 |
|
|
1763 |
1765 |
$ret = $uid; |
$ret = $uid; |
File tests/http_confirm.php changed (mode: 100644) (index 08450e6..f1d756b) |
... |
... |
while ($tries) { |
79 |
79 |
sleep(1); |
sleep(1); |
80 |
80 |
} |
} |
81 |
81 |
rg_log_ml('c: ' . print_r($c, TRUE)); |
rg_log_ml('c: ' . print_r($c, TRUE)); |
|
82 |
|
$c = $c['mail/user/welcome']; |
82 |
83 |
$t = explode('below:', $c['body']); |
$t = explode('below:', $c['body']); |
83 |
84 |
$t = ltrim($t[1]); |
$t = ltrim($t[1]); |
84 |
85 |
$t = explode("\n", $t); |
$t = explode("\n", $t); |
|
... |
... |
$data = array(); $headers = array(); |
92 |
93 |
$r = do_req($link . 'XXX?t=http_confirm', $data, $headers); |
$r = do_req($link . 'XXX?t=http_confirm', $data, $headers); |
93 |
94 |
if (!strstr($r['body'], 'Invalid token')) { |
if (!strstr($r['body'], 'Invalid token')) { |
94 |
95 |
rg_log_ml('r: ' . print_r($r, TRUE)); |
rg_log_ml('r: ' . print_r($r, TRUE)); |
95 |
|
rg_log('Somethign wrong with the token!'); |
|
|
96 |
|
rg_log('Something wrong with the token!'); |
96 |
97 |
exit(1); |
exit(1); |
97 |
98 |
} |
} |
98 |
99 |
rg_log_exit(); |
rg_log_exit(); |
99 |
100 |
|
|
100 |
101 |
|
|
101 |
|
rg_log_enter('Trying with the good link...'); |
|
102 |
|
$r = do_req($link . '?t=http_confirm', $data, $headers); |
|
103 |
|
if (!strstr($r['body'], 'Home page of user')) { |
|
|
102 |
|
rg_log_enter('Trying with the good link (first time)...'); |
|
103 |
|
$r = do_req($link . '?t=http_confirm1', $data, $headers); |
|
104 |
|
if (!strstr($r['body'], 'Your e-mail is confirmed now.')) { |
104 |
105 |
rg_log_ml('r: ' . print_r($r, TRUE)); |
rg_log_ml('r: ' . print_r($r, TRUE)); |
105 |
|
rg_log('Somethign wrong with the token!'); |
|
|
106 |
|
rg_log('Something wrong with the token!'); |
|
107 |
|
exit(1); |
|
108 |
|
} |
|
109 |
|
rg_log_exit(); |
|
110 |
|
|
|
111 |
|
|
|
112 |
|
rg_log_enter('Trying with the good link (second time)...'); |
|
113 |
|
$r = do_req($link . '?t=http_confirm2', $data, $headers); |
|
114 |
|
if (!strstr($r['body'], 'Invalid token.')) { |
|
115 |
|
rg_log_ml('r: ' . print_r($r, TRUE)); |
|
116 |
|
rg_log('Reusing a confirmation token must not work!'); |
106 |
117 |
exit(1); |
exit(1); |
107 |
118 |
} |
} |
108 |
119 |
rg_log_exit(); |
rg_log_exit(); |