You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain circumstances Member::CurrentUser() no returns an object, so Member::CurrentUser()->Email fails.
It is desirable to control this situation.
The correct code can be: EmailVerifiedMember.php
functiononBeforeWrite() {
if (!$this->owner->VerificationString) {
$this->owner->VerificationString = MD5(rand());
}
if (!$this->owner->Verified) {
if ((!$this->owner->VerificationEmailSent)) {
$this->owner->sendemail($this->owner, false);
}
$uid = Member::currentUserID(); // <<<<$oemail = $this->owner->Email; // <<<<$cuser = Member::currentUser(); // <<<<if ($uid && $cuser && ($oemail == $cuser->Email)) { // <<<<//if (Member::currentUserID() && ($this->owner->Email == Member::currentUser()->Email)) {parent::onBeforeWrite();
Security::logout(false);
if (Director::redirected_to() == null) {
$messageSet = array(
'default' => _t('EmailVerifiedMember.EMAILVERIFY','Please verify your email address by clicking on the link in the email before logging in.'),
);
}
Session::set("Security.Message.type", 'bad');
Security::permissionFailure($this->owner, $messageSet);
} elsereturn;
}
parent::onBeforeWrite();
}
Regards,
Jose
The text was updated successfully, but these errors were encountered:
Hi!
In certain circumstances Member::CurrentUser() no returns an object, so Member::CurrentUser()->Email fails.
It is desirable to control this situation.
The correct code can be:
EmailVerifiedMember.php
Regards,
Jose
The text was updated successfully, but these errors were encountered: