EricWebsite
Member
Hi,
When importing users into a list with import from csv I neeeded to generate Joomla users as well, so I installed the listcsv plugin in the list.
In the first test, this generated an error:
"Fatal error: Array and string offset access syntax with curly braces is no longer supported in ....../plugins/fabrik_list/listcsv/scripts/csv_import_user_class.php on line 99".
Line 99 reads:
Replacing the curly brackets with '(' and ')' will probably do the trick, but the generated password could be a lot better.
I came up with:
A second point: I think it would be a lot easier if the user can set the parameters directly in the plugin (like in juser), rather than have to do that in a copy of create_client_user.php.
Please let me have your thoughts!
When importing users into a list with import from csv I neeeded to generate Joomla users as well, so I installed the listcsv plugin in the list.
In the first test, this generated an error:
"Fatal error: Array and string offset access syntax with curly braces is no longer supported in ....../plugins/fabrik_list/listcsv/scripts/csv_import_user_class.php on line 99".
Line 99 reads:
Code:
$string = $chars{rand(0, $chars_length)};
I came up with:
Code:
private function rand_str()
{
// leave out letter o and zero, 1 (one) an l (letter), etc to avoid confusion
$charslower = "abcdefghijkmnpqrstuvwxyz";
$charsupper = "ABCDEFGHIJKMNPQRSTUVWXYZ";
$charsnumber = "23456789";
$charsspec = "!@#$%&*(){}_+";
// at least 1 lowercase, 1 uppercase, 1 number, 1 special character
$chars = substr(str_shuffle($charslower),0,1);
$chars .= substr(str_shuffle($charsupper),0,1);
$chars .= substr(str_shuffle($charsnumber),0,1);
$chars .= substr(str_shuffle($charsspec),0,1);
// add 8 more from a mix of all
$chars .= substr(str_shuffle($charslower . $charsupper . $charsnumber . $charsspec),0,8);
$password = str_shuffle($chars);
return $password;
}
A second point: I think it would be a lot easier if the user can set the parameters directly in the plugin (like in juser), rather than have to do that in a copy of create_client_user.php.
Please let me have your thoughts!