* Generate/regenerate a token for the user and load the tplParams
*/
public function setDataFromUser(array $user, string $token) {
- // xxx this is not generating https://blah - just the path. Why?
$resetUrlPlaintext = \CRM_Utils_System::url('civicrm/login/password', ['token' => $token], TRUE, NULL, FALSE);
$resetUrlHtml = htmlspecialchars($resetUrlPlaintext);
- $usernamePlaintext = $user['name'];
- $usernameHtml = htmlspecialchars($user['name']);
$this->logParams = [
- 'userID' => $user['id'],
- 'username' => $usernamePlaintext,
- 'email' => $user['uf_name'],
+ 'userID' => $user['id'],
+ 'username' => $user['username'],
+ 'email' => $user['uf_name'],
+ 'url' => $resetUrlPlaintext,
];
$this
->setResetUrlPlaintext($resetUrlPlaintext)
->setResetUrlHtml($resetUrlHtml)
- ->setUsernamePlaintext($usernamePlaintext)
- ->setUsernameHtml($usernameHtml)
+ ->setUsernamePlaintext($user['username'])
+ ->setUsernameHtml(htmlspecialchars($user['username']))
->setTo($user['uf_name']);
return $this;
}
var ts = $scope.ts = CRM.ts(null),
ctrl = this;
- console.log('init crmResetPassword component starting');
+ // console.log('init crmResetPassword component starting');
// $onInit gets run after the this controller is called, and after the bindings have been applied.
// this.$onInit = function() { console.log('user', ctrl.userId); };
- ctrl.formSubmitted = false;
- ctrl.newPassword = '';
- ctrl.newPasswordAgain = '';
- ctrl.identifier = '';
- ctrl.busy = '';
- ctrl.pwnd = false;
- ctrl.resetSuccessfullySubmitted = false;
+
+ ctrl.completeReset = () => {
+ ctrl.busy='';
+ ctrl.formSubmitted = false;
+ ctrl.identifier = '';
+ ctrl.newPassword = '';
+ ctrl.newPasswordAgain = '';
+ ctrl.pwnd = false;
+ ctrl.resetSuccessfullySubmitted=false;
+ ctrl.token='';
+ };
+ ctrl.completeReset();
let updateAngular = (prop, newVal) => {
$timeout(() => {