Hello!
Two things to keep in mind, I only started looking at this 1.5hrs ago, and I don't program in PHP.
OS Ticket v1.18.1 fresh from the site.
Ubuntu 22.04
PHP 8.1
Apache2
I'm using the LDAP plugin, (latest from the website) and was having the issue where it would accept your username and password for a new user, but then when you tried to put in your email addres and other info it would give you the none too helpful error of:
"Unable to register account. See messages below"
Believe it or not, I've narrowed this really really down for you!
First, to help diagnose this, I changed every instance of the message to include a number ('1.' , '2.', etc) to show which one was actually generating the error. It narrowed my error to this line:
if ($errors)
$errors['err'] = $errors['err'] ?: __('1. Unable to register account. See messages below');
I then dug backwards to find it was these lines that create the error text:
else {
try {
UserAccount::checkPassword($_POST['passwd1']);
} catch (BadPassword $ex) {
$errors['passwd1'] = $ex->getMessage();
}
The actual error message being returned by the routine is:
[passwd1] => Password must be at least 6 characters
However, the users password is at least 15 characters.
So, I outputted the contents of the post data at line 55:
elseif ($_POST) {
and I got this:
[CSRFToken] => 6df7b93819856d6452f2d3f518267639d4569df4\n
[do] => import\n
[8178b95c4948dc] => broccolid@mydomain.ca\n
[da4567d711234e] => Broccoli Dragon\n
[52283840e5352a] => \n
[52283840e5352a-ext] => \n
[timezone] => America/Los_Angeles\n
[backend] => ldap.client.p2i1\n
[username] => broccolid\n
Which you may notice doesn't contain a field called passwd1, or any of the other juicy things needed.
So, my suspicion is that the logic is thinking there should be a password on the form, when the authentication is actually done by LDAP, and then it checks to see if everything is hunky-dory and because there is no password it gives the mysterious error.
Now, if I comment out the addition of the error text to the $errors array, it passes normally and everything else works as intended.
I hope this helps with this someone obtuse error.
Cheers