Skip to content
Snippets Groups Projects

Hotline#13248 Auth With Blowfish Password

Merged Patrick Barroca requested to merge hotline#13248-auth-with-blowfish-password into hotline_6.41
Compare and
+ 204
20
Preferences
Compare changes
Files
+ 12
4
@@ -18,9 +18,6 @@
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OPAC3 : Gestion des utilisateurs
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class UsersLoader extends Storm_Model_Loader {
public function findAllLike($search, $by_right = null, $limit = 500) {
@@ -184,9 +181,19 @@ class UsersLoader extends Storm_Model_Loader {
->setNaissance($source->getNaissance())
->setIdSite($source->getIdSite());
}
public function findBlowfish($login) {
return array_filter(
Class_Users::findAllBy(['login' => $login]),
function($user) {
return substr($user->getPassword(), 0, 4) === '$2a$';
});
}
}
class Class_Users extends Storm_Model_Abstract {
use Trait_Translator;
@@ -773,7 +780,8 @@ class Class_Users extends Storm_Model_Abstract {
}
$this->check($this->getPassword(), $this->_("Vous devez compléter le champ 'Mot de passe'"));
$this->check(mb_strlen($this->getPassword(),'UTF-8') <= 50, $this->_("Le champ 'Mot de passe' doit être inférieur à 50 caractères"));
$this->check(mb_strlen($this->getPassword(),
'UTF-8') <= 255, $this->_("Le champ 'Mot de passe' doit être inférieur à 255 caractères"));
if ($this->getRoleLevel() > 1 and $this->getRoleLevel() < 5 and $this->getIdSite() == 0) {
$cls_role= new ZendAfi_Acl_AdminControllerRoles();