Ajout de secu dans le checkpolicy
This commit is contained in:
parent
f15b47b43a
commit
e11ff7c263
|
@ -43,12 +43,6 @@ if ($password != $passwordconf) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($password)) {
|
|
||||||
$error=_("Please enter a password");
|
|
||||||
include ("hta_adduser.php");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$hta->add_user($user, $password, $dir)) {
|
if (!$hta->add_user($user, $password, $dir)) {
|
||||||
$error=$err->errstr();
|
$error=$err->errstr();
|
||||||
include ("hta_adduser.php");
|
include ("hta_adduser.php");
|
||||||
|
|
|
@ -1123,6 +1123,16 @@ EOF;
|
||||||
*/
|
*/
|
||||||
function checkPolicy($policy,$login,$password) {
|
function checkPolicy($policy,$login,$password) {
|
||||||
global $db,$err;
|
global $db,$err;
|
||||||
|
|
||||||
|
if (empty($login)) {
|
||||||
|
$err->raise("admin",_("-- Program error -- CheckPolicy need a login"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (empty($password)) {
|
||||||
|
$err->raise("admin",_("-- Program error -- CheckPolicy need a password"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$pol=$this->listPasswordPolicies();
|
$pol=$this->listPasswordPolicies();
|
||||||
if (!$pol[$policy]) {
|
if (!$pol[$policy]) {
|
||||||
$err->raise("admin",_("-- Program error -- The requested password policy does not exist!"));
|
$err->raise("admin",_("-- Program error -- The requested password policy does not exist!"));
|
||||||
|
|
|
@ -216,6 +216,14 @@ class m_hta {
|
||||||
function add_user($user,$password,$dir) {
|
function add_user($user,$password,$dir) {
|
||||||
global $err, $bro, $admin;
|
global $err, $bro, $admin;
|
||||||
$err->log("hta","add_user",$user."/".$dir);
|
$err->log("hta","add_user",$user."/".$dir);
|
||||||
|
if (empty($user)) {
|
||||||
|
$err->raise('hta',_("Please enter a user"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (empty($password)) {
|
||||||
|
$err->raise('hta',_("Please enter a password"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$absolute=$bro->convertabsolute($dir,0);
|
$absolute=$bro->convertabsolute($dir,0);
|
||||||
if (!file_exists($absolute)) {
|
if (!file_exists($absolute)) {
|
||||||
$err->raise("hta",printf(("The folder '%s' does not exist"),$dir));
|
$err->raise("hta",printf(("The folder '%s' does not exist"),$dir));
|
||||||
|
|
Loading…
Reference in New Issue