How to create forgot password link in typo3


 
Create custom forgot password link in typo3. for that you have to simply add below code in your file.

Following code should do the trick.

$user['uid'] = $GLOBALS['TSFE']->fe_user->user['uid'];

$hours = intval($this->conf['forgotLinkHashValidTime']) > 0 ? intval($this->conf['forgotLinkHashValidTime']) : 24;
$validEnd = time() + 3600 * $hours;
$validEndString = date($this->conf['dateFormat'], $validEnd);
$hash = md5(GeneralUtility::generateRandomBytes(64));
$randHash = $validEnd . '|' . $hash;
$randHashDB = $validEnd . '|' . md5($hash);

// Write hash to DB
$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid=' . $user['uid'], array('felogin_forgotHash' => $randHashDB));

// Create hashlink to user
$this->conf['linkPrefix'] = -1;
$isAbsRelPrefix = !empty($GLOBALS['TSFE']->absRefPrefix);
$isBaseURL = !empty($GLOBALS['TSFE']->baseUrl);
$isFeloginBaseURL = !empty($this->conf['feloginBaseURL']);


$configurations['additionalParams'] = '&tx_felogin_pi1[user]='.$user['uid'].'&tx_felogin_pi1[forgothash]='.$randHash;
$configurations['returnLast'] = 'url'; // get it as URL
$configurations['parameter'] = $GLOBALS['TSFE']->id;
$link = $this->cObject->typolink(NULL, $configurations);


// Prefix link if necessary
if ($isFeloginBaseURL) {
	// First priority, use specific base URL
	// "absRefPrefix" must be removed first, otherwise URL will be prepended twice
	if (!empty($GLOBALS['TSFE']->absRefPrefix)) {
		$link = substr($link, strlen($GLOBALS['TSFE']->absRefPrefix));
	}
	$link = $this->conf['feloginBaseURL'] . $link;
} elseif ($isAbsRelPrefix) {
	// Second priority
	// absRefPrefix must not necessarily contain a hostname and URL scheme, so add it if needed
	$link = GeneralUtility::locationHeaderUrl($link);
} elseif ($isBaseURL) {
	// Third priority
	// Add the global base URL to the link
	$link = $GLOBALS['TSFE']->baseUrlWrap($link);
} else {
	// No prefix is set, return the error
	return "Error: there is no prefix for the link. Please set one of the following in your typoscript template: plugin.tx_felogin_pi1.feloginBaseURL = http://yourdomain/, config.baseURL = http://yourdomain/, config.absRelPrefix = http://yourdomain/";
}

Note : $user['uid'] : this will be user id of user.

You will get forgot password link in “$link”.

I hope it will work for you. πŸ™‚

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How to change Email sender, Sender Name and Reply-To in felogin of typo3


 
how to change the Sender Name, Email Sender and Reply-To for felogin with TypoScript.

You have to set typoscript for felogin E-Mail sender, Sender Name and Reply-To.

Following typoscript should do the trick.

plugin.tx_felogin_pi1 {
   email_from = no-reply@knowledgefree.info
   email_fromName = Knowledge Free
   replyTo = info@knowledgefree.info
}

You will receive with Mails for forget Password like below snap. Please see from and reply to in mail systems.

felogin Typo3 - Typoscript

felogin Typo3 – Typoscript

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How to localization fe_login via typoscript || How to extend felogin locallang file in typo3


 
Today i have faced the multi language problem with the fe_login plugin, it comes from the sys_ext of typo library.

If you do not want to changes label from locallang.xlf then you can directly chnages that label via typoscript

Actual path of locallang file : typo3conf/ext/felogin/pi1/locallang.xlf

Use following TypoScript.

For the default language:

plugin.tx_felogin_pi1._LOCAL_LANG.default {
   key = value
}

For a specific language, e.g. Italian, use

plugin.tx_felogin_pi1._LOCAL_LANG.it {
   key = value
}

for username and password below are the Typoscript write into the Login page:

For the default language:

plugin.tx_felogin_pi1._LOCAL_LANG.default {
   username = User name
   password = Password
}

For a specific language, e.g. Italian, use

plugin.tx_felogin_pi1._LOCAL_LANG.it {
   username = Nome utente
   password = Password
}

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya