[TYPO3] sr_feuser_register, md5 password

Ralica Sotirova larry at itsbg.net
Mon May 12 09:35:21 CEST 2008


> Hi Larry!
> Is your template correctly configured? In the sr_feuser_register manual,
> there is an important information in the changelog:
>
> "New TS constant useMd5Password enables md5-hashed passwords when
> extension KB MD5 FE Password (kb_md5fepw) is installed. HTML templates
> should be updated with markers ###FORM_ONSUBMIT### and
> ###PASSWORD_ONCHANGE###. See the example HTML templates.
> ###HIDDENFIELDS### marker is also added to subparts
> ###TEMPLATE_CREATE_SAVED### and ###TEMPLATE_SETFIXED_OK###."
>
> Besides, do you have MD5 passwords enabled (useMd5Password = 1)?
>
> Cheers,
> Ro
Hi, Ro
Thanks for your answer. I found this http://bugs.typo3.org/view.php?id=8011
in the bugtracker.
Sure, I enabled MD5 passwords, and I'm  actually using the example template.
For me everything works now with this added in
EXT/sr_feuser_register/model/class.tx_srfeuserregister_data.php

 if ($cmdKey == 'create' && $this->controlData->getUseMd5Password()) {
 $parsedArray['password'] = md5($this->getDataArray('password'));
 }

And this added in EXT/newloginbox/pi1/class.tx_newloginbox_pi1.php in hook
section, sends forgot password e-mail.

$temp_chars = "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
$i = 0;
$temp_password = "";
while ($i <= 6) {
$temp_password .= $temp_chars{mt_rand(0,strlen($temp_chars))};
$i++;
}
$temp_md5_password = md5($temp_password);
$temp_values = array("password" => $temp_md5_password );
$temp_where = 'uid=' . $row['uid'];
$res_temp =
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users',$temp_where,$temp_values);
$msg = sprintf($this->pi_getLL('forgot_password_pswmsg', '', 0),
$workingData['forgot_email'], $row['username'], $temp_password );

I know it's not beautiful, but my php coding is even worst than my english,
sorry for that :)

Thanks!
Larry



More information about the TYPO3-english mailing list