Hi all,
Stupid question and it should be obvious, but I didn't touch it so far. When (what file\function name) username is disabled on join and the first\last name is used as a username, where to remove\replace date adding "feature" to username that exists on join process? Why the heck it adds the date to it, instead of checking it instantly and offer a choice either to change the username manually or to select another one from the list on join step, like on all other sites?
http://boonexpert.com |
Someone else asked about this on the forums. I don't recall an answer but I think one was provided, or least changed it from the date. Geeks, making the world a better place |
Honestly, I've searched everywhere on forums before making this thread, but only found two threads with the same subject with no answers, only question was asked. http://boonexpert.com |
Yes, I found the topic that I recalled and no solution but doing it after the fact. Sticking the date on is not a great solution, better would be to add a random number. I am not at my work computer so I don't have access to the Dolphin files. Hopefully someone will answer later on. Geeks, making the world a better place |
The nickname is generated in inc\classes\BxDolJoinProcessor.php in the function registerMember() at about line 241
It does one of two things.
If the firstname field is empty it will generate a nickname using the genRndPwd function which will result in a nickname of 10 random characters.
If the first name field is not empty which will be the majority of cases then the nickname is run though the uriGenerate function which is what ends up appending the date to it.
You do not want to modify the uriGenerate function as it is used thoughout the site to generate uri's for everything. So only modify the section inc\classes\BxDolJoinProcessor.php where the empty nickname is handled and modify to do what your need it to do.
As for stopping to prompt a user for input and let them decide. Good luck with that. The dolphin join process was not exactly designed for a stop, ask questions and continue type situation.
https://www.deanbassett.com |
Thank you Deano for reply.
registerMember() calls $oPC->createProfile() which is in BxDolProfilesController , but still can't find where it calls for genRndPwd: there are only processing for all inputs by types which are in variables ($sItemName), so it's kind of hard to monitor every field. Do I miss something?
http://boonexpert.com |
Thank you Deano for reply.
registerMember() calls $oPC->createProfile() which is in BxDolProfilesController , but still can't find where it calls for genRndPwd: there are only processing for all inputs by types which are in variables ($sItemName), so it's kind of hard to monitor every field. Do I miss something?
Yea, you did. Here is the section of code in inc\classes\BxDolJoinProcessor.php that you need to rewrite.
function registerMember() { $oPC = new BxDolProfilesController();
$oZ = new BxDolAlerts('profile', 'before_join', 0, 0, $this->aValues[0]); $oZ->alert();
$aProfile1 = $this->oPF->getProfileFromValues($this->aValues[0]); if (empty($aProfile1['NickName'])) $aProfile1['NickName'] = uriGenerate((empty($aProfile1['FirstName']) ? genRndPwd(10, false) : $aProfile1['FirstName']), 'Profiles', 'NickName');
list($iId1, $sStatus1) = $oPC->createProfile($aProfile1);
//--- check whether profile was created successfully or not if(!$iId1) { if(isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) @unlink($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']);
return array(false, 'Fail'); }
There is where it will call uriGenerate which adds the date to the profile first name and uses it as a nickname, or genRndPwd to get a random string depending on the situation. But it does not matter. You cannot alter either of those functions because they are used in other areas of dolphin. So you must replace the code above with your own code to get the nickname result you want.
https://www.deanbassett.com |
Oh, silly me.... I was looking in files of 7.1.1, but this code appeared there since 7.1.3 I guess. Found it, it's obvious :) thank you very much! http://boonexpert.com |