Bernd Wurst
Wenn cracklib nicht funtkioniert, ist das nur einen Hinweis wert, die User sollen dennoch ihr Passwort ändern können
Bernd Wurst commited 9cbd3c5 at 2012-09-10 07:27:03
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written 2008-2012 by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
http://creativecommons.org/publicdomain/zero/1.0/
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once('inc/error.php');
function strong_password($password)
{
if ($password == '' || strlen($password) < 4) {
DEBUG("Passwort zu kurz!");
return "Passwort ist zu kurz!";
}
if (! function_exists("crack_opendict"))
{
DEBUG("cracklib not available!");
return true;
}
if (config('use_cracklib') === NULL or config('use_cracklib') === false) {
DEBUG('Cracklib deaktiviert');
return true;
}
DEBUG("Öffne Wörterbuch: ".config('cracklib_dict'));
if (! ($dict = crack_opendict(config('cracklib_dict'))))
{
logger(LOG_ERR, "inc/security", "cracklib", "could not open cracklib-dictionary »".config('cracklib_dict')."«");
#system_failure("Kann Crack-Lib-Wörterbuch nicht öffnen: ".config('cracklib_dict'));
DEBUG('cracklib tut nicht, dann wird das PW akzeptiert');
warning('Das Passwort konnte aufgrund eines internen Fehlers nicht auf die Passwortstärke geprüft werden.');
return true;
}
// Führe eine Überprüfung des Passworts durch
$check = crack_check($dict, $password);
$message = crack_getlastmessage();
crack_closedict($dict);
if ($check === True)
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX