support for empty password strings added

This commit is contained in:
duergner 2003-08-26 20:03:25 +00:00
parent 9afd182a26
commit 42968db7ff
1 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,10 @@ function createUserPDF($accounts) {
$pdfFile->setFont("times","B",10); $pdfFile->setFont("times","B",10);
$pdfFile->Cell(50,5,_("Unix password disabled!"),0,1,"L",0); $pdfFile->Cell(50,5,_("Unix password disabled!"),0,1,"L",0);
} }
elseif($account->unix_password == "") {
$pdfFile->setFont("times","B",10);
$pdfFile->Cell(50,5,_("[Empty password string]"),0,1,"L",0);
}
else { else {
$account->unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->unix_password), MCRYPT_MODE_ECB, $iv); $account->unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->unix_password), MCRYPT_MODE_ECB, $iv);
$account->unix_password = str_replace(chr(00), '', $account->unix_password); $account->unix_password = str_replace(chr(00), '', $account->unix_password);
@ -132,6 +136,10 @@ function createUserPDF($accounts) {
$pdfFile->setFont("times","B",10); $pdfFile->setFont("times","B",10);
$pdfFile->Cell(50,5,_("Samba password set to unix password."),0,1,"L",0); $pdfFile->Cell(50,5,_("Samba password set to unix password."),0,1,"L",0);
} }
elseif($account->smb_password == "") {
$pdfFile->setFont("times","B",10);
$pdfFile->Cell(50,5,_("[Empty password string]"),0,1,"L",0);
}
else { else {
$account->smb_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->smb_password), MCRYPT_MODE_ECB, $iv); $account->smb_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->smb_password), MCRYPT_MODE_ECB, $iv);
$account->smb_password = str_replace(chr(00), '', $account->smb_password); $account->smb_password = str_replace(chr(00), '', $account->smb_password);