Found a bug in sr_feuser_register (2.5.6):
When I try to combine both features, disable emailconfirmation (setfixed = false) and autologin after creating an account, I experience two strange behaviors:
- - The Template “a mail has been send … toconfirm” is shown after creation, even though he setfixed-feature is disabled
- Autologin doesn’t happen
after some debugging effort I supposably found a bug.
I used the following constants in template:
plugin.tx_srfeuserregister_pi1.enableEmailOnApprove = 0
plugin.tx_srfeuserregister_pi1.useMd5Password = 0
plugin.tx_srfeuserregister_pi1.enableAutoLoginOnCreate = 1
plugin.tx_srfeuserregister_pi1.userGroupAfterConfirmation = 4
plugin.tx_srfeuserregister_pi1.formFields =
username, password, gender, first_name, last_name, email,
address, zip, city, static_info_country
plugin.tx_srfeuserregister_pi1.enableEmailConfirmation = 0
plugin.tx_srfeuserregister_pi1.pid = 264
plugin.tx_srfeuserregister_pi1.userGroupAfterAcceptation = 4
plugin.tx_srfeuserregister_pi1.userGroupUponRegistration = 4
plugin.tx_srfeuserregister_pi1.enableAutoLoginOnConfirmation = 0
plugin.tx_srfeuserregister_pi1.loginPID = 229
plugin.tx_srfeuserregister_pi1.defaultCODE = CREATE
plugin.tx_srfeuserregister_pi1.file.templateFile =
fileadmin/templates/tx_srfeuserregister_pi1_css_tmpl.html
SOLUTION:
class: tx_srfeuserregister_pi1
funtion: init()
the lines
if (isset($this->conf['setfixed'])) {
$this->setfixedEnabled = $this->conf['setfixed'];
}
have to be located BEFORE the call
$this->control->init(
$this, $this->conf, $this->config, $this->display,
$this->data, $this->marker, $this->auth, $this->email, $this->tca);
…because the init function of tx_srfeuserregister_control references the pibase-member setfixedEnabled. Otherwise the setfixedEnabled used by the control class will always be true even though setfixed is set to false (enableEmailConfirmation = 0)
——————————–
SOLUTION
——————————–
CLASS: tx_srfeuserregister_pi1
function init(&$conf) {
global $TSFE, $TCA, $TYPO3_CONF_VARS;
// plugin initialization
$this->conf = $conf;
if (t3lib_extMgm::isLoaded('sr_freecap') ) {
require_once(t3lib_extMgm::extPath('sr_freecap').'pi2/class.tx_srfreecap_pi2.php');
$this->freeCap = t3lib_div::makeInstance('tx_srfreecap_pi2');
}
$this->lang = t3lib_div::makeInstance('tx_srfeuserregister_lang');
$this->data = t3lib_div::makeInstance('tx_srfeuserregister_data');
$this->auth = t3lib_div::makeInstance('tx_srfeuserregister_auth');
$this->marker = t3lib_div::makeInstance('tx_srfeuserregister_marker');
$this->tca = t3lib_div::makeInstance('tx_srfeuserregister_tca');
$this->display = t3lib_div::makeInstance('tx_srfeuserregister_display');
$this->email = t3lib_div::makeInstance('tx_srfeuserregister_email');
$this->control = t3lib_div::makeInstance('tx_srfeuserregister_control');
// BUGFIX Oliver Meimberg
// ADD THIS HERE
if (isset($this->conf['setfixed'])) {
$this->setfixedEnabled = $this->conf['setfixed'];
}
$this->lang->init($this, $this->conf, $this->config);
$this->lang->pi_loadLL();
$this->data->init($this, $this->conf, $this->config,
$this->lang, $this->tca, $this->auth, $this->control, $this->freeCap);
$this->control->init($this, $this->conf, $this->config, $this->display,
$this->data, $this->marker, $this->auth, $this->email, $this->tca);
$this->pi_USER_INT_obj = 1;
$this->pi_setPiVarDefaults();
$this->sys_language_content =
t3lib_div::testInt($TSFE->config['config']['sys_language_uid']) ?
intval($TSFE->config['config']['sys_language_uid']) : 0;
// prepare for character set settings
if ($TSFE->metaCharset) {
$this->charset = $TSFE->csConvObj->parse_charset($TSFE->metaCharset);
}
// Initialise fileFunc object
$this->fileFunc = t3lib_div::makeInstance(’t3lib_basicFileFunctions’);
// BUGFIX Oliver Meimberg
// REMOVE THIS
// if (isset($this->conf['setfixed'])) {
// $this->setfixedEnabled = $this->conf['setfixed'];
// }
[...]
}