I'm currently developing a Joomla component and I'm totally stuck. I want to add a bunch of users to Joomla 2.5 and I theoretically know how to do, but it doesn't work. More specific: The creation of passwords doesn't work as expected...
I'm using the following code to create the user's password :
jimport('joomla.user.helper');
foreach($users as $user)
{
$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword('foo', $salt);
$password = $crypt.":".$salt;
}
If I try this code inside of the default view default.php it works as it should. But if I use the same code inside of the controller it raises an Internal Server Error 500.
I don't understand why this doesn't work inside of the controller ...
Does someone know an answer?
Max
Edit: It seems to be something about the foreach loop... The code works everywhere in the controller besides inside of the loop