Go to the source code of this file.
|
if(!function_exists("__")) | _md5cr ($pass, $salt="") |
| Hashe un mot de passe en clair en MD5 avec un salt aléatoire. More...
|
|
◆ _md5cr()
if (!function_exists("__")) _md5cr |
( |
|
$pass, |
|
|
|
$salt = "" |
|
) |
| |
Hashe un mot de passe en clair en MD5 avec un salt aléatoire.
- Parameters
-
string | $pass | Mot de passe à crypter (max 32 caractères) |
- Returns
- string Retourne le mot de passe crypté @access private
Definition at line 20 of file change.php.
22 $chars=
"./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
24 $salt.=substr($chars,(mt_rand(0,strlen($chars))),1);
28 return crypt($pass,$salt);
32 ALTERNC_CHANGEPASS_MYSQL_HOST,
33 ALTERNC_CHANGEPASS_MYSQL_USER,
34 ALTERNC_CHANGEPASS_MYSQL_PASSWORD
37 mysql_select_db(ALTERNC_CHANGEPASS_MYSQL_DB);
39 __(
"Can't connect to MySQL server on AlternC!");
43 define(
'SM_PATH',
'../../');
46 require_once(
SM_PATH .
'include/validate.php');
47 require_once(
SM_PATH .
'functions/page_header.php');
48 require_once(
SM_PATH .
'functions/imap.php');
49 require_once(
SM_PATH .
'include/load_prefs.php');
52 sqgetGlobalVar(
'username',
$username, SQ_SESSION);
57 textdomain(
"alternc");
64 if ($_POST[
'acp_oldpass'] && $_POST[
'acp_newpass'] && $_POST[
'acp_verify']) {
65 if ($_POST[
'acp_newpass']!=$_POST[
'acp_verify']) {
66 $errstr=_(
"Your new passwords are differents, pleasy try again.");
69 $r=mysql_query(
"SELECT a.password, a.id FROM address a,domaines d WHERE a.address='".addslashes(
$login).
"' AND a.domain_id=d.id AND d.domaine='".addslashes(
$domain).
"';");
71 if (!(
$c=mysql_fetch_array(
$r))) {
72 $errstr=_(
"Your account has not been found, please try again later or ask an administrator.");
74 if (
$c[
"password"]!=
_md5cr($_POST[
'acp_oldpass'],
$c[
"password"])) {
75 $errstr=_(
"Your current password is incorrect, please try again.");
85 $acp_newpass=$_POST[
'acp_newpass'];
86 $newp=
_md5cr($acp_newpass);
87 mysql_query(
"UPDATE address SET password='".addslashes($newp).
"' WHERE id=".
$c[
"id"].
" ;");
88 $errstr=_(
"Your password has been successfully changed. Don't forget to change it in your mail software if you are using one (Outlook, Mozilla, Thunderbird, Eudora ...)");
91 $onetimepad = OneTimePadCreate(strlen($acp_newpass));
if(!function_exists("__")) _md5cr($pass, $salt="")
Hashe un mot de passe en clair en MD5 avec un salt aléatoire.
References $i.
◆ $base_uri
◆ $errstr
◆ $key
◆ $link
Initial value:=mysql_connect(
ALTERNC_CHANGEPASS_MYSQL_HOST,
ALTERNC_CHANGEPASS_MYSQL_USER,
ALTERNC_CHANGEPASS_MYSQL_PASSWORD
)
Definition at line 31 of file change.php.
Referenced by m_mem\ChangeMail1().
◆ $onetimepad
◆ $username
◆ else
Initial value:{
__(
"Can't connect to MySQL server on AlternC!")
Definition at line 38 of file change.php.
◆ SM_PATH