domci : commas should be followed by space
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5281 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
20
authsql.php
20
authsql.php
@@ -49,7 +49,7 @@ class authsql extends auth
|
||||
$this->db = new dblayer ($this->dsn, $this->username, $this->password,
|
||||
$this->driver_options);
|
||||
if ($this->table === null)
|
||||
throw new Exception (dgettext ("domframework","No SQL table defined"),
|
||||
throw new Exception (dgettext ("domframework", "No SQL table defined"),
|
||||
500);
|
||||
if ($this->fieldIdentifier === null)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
@@ -68,7 +68,7 @@ class authsql extends auth
|
||||
$this->fieldsInfo);
|
||||
$fields = array_flip ($fields);
|
||||
foreach ($fields as $key=>$val)
|
||||
$fields[$key] = array ("varchar","255");
|
||||
$fields[$key] = array ("varchar", "255");
|
||||
$this->db->table = $this->table;
|
||||
$this->db->fields = $fields;
|
||||
$this->db->primary = $this->fieldIdentifier;
|
||||
@@ -139,11 +139,11 @@ class authsql extends auth
|
||||
throw new Exception (dgettext ("domframework",
|
||||
"Bad old password provided"), 401);
|
||||
$cost = 11;
|
||||
$salt=substr(base64_encode(openssl_random_pseudo_bytes(17)),0,22);
|
||||
$salt=str_replace("+",".",$salt);
|
||||
$param='$'.implode('$',array(
|
||||
$salt = substr (base64_encode (openssl_random_pseudo_bytes (17)), 0, 22);
|
||||
$salt = str_replace ("+", ".", $salt);
|
||||
$param = '$'.implode('$', array(
|
||||
"2y", //select the most secure version of blowfish (>=PHP 5.3.7)
|
||||
str_pad($cost,2,"0",STR_PAD_LEFT), //add the cost in two digits
|
||||
str_pad ($cost, 2, "0", STR_PAD_LEFT), //add the cost in two digits
|
||||
$salt //add the salt
|
||||
));
|
||||
//now do the actual hashing
|
||||
@@ -173,11 +173,11 @@ class authsql extends auth
|
||||
"Unable to find the user : '%s'"),
|
||||
$email), 401);
|
||||
$cost = 11;
|
||||
$salt=substr(base64_encode(openssl_random_pseudo_bytes(17)),0,22);
|
||||
$salt=str_replace("+",".",$salt);
|
||||
$param='$'.implode('$',array(
|
||||
$salt = substr (base64_encode (openssl_random_pseudo_bytes (17)), 0, 22);
|
||||
$salt = str_replace ("+", ".", $salt);
|
||||
$param = '$'. implode ('$', array (
|
||||
"2y", //select the most secure version of blowfish (>=PHP 5.3.7)
|
||||
str_pad($cost,2,"0",STR_PAD_LEFT), //add the cost in two digits
|
||||
str_pad ($cost, 2, "0", STR_PAD_LEFT), //add the cost in two digits
|
||||
$salt //add the salt
|
||||
));
|
||||
//now do the actual hashing
|
||||
|
||||
Reference in New Issue
Block a user