26,14 → 26,12 |
class OIDplusPageRaChangeEMail extends OIDplusPagePluginRa { |
|
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'change_ra_email') { |
private function action_Request(array $params): array { |
if (!OIDplus::config()->getValue('allow_ra_email_change') && !OIDplus::authUtils()->isAdminLoggedIn()) { |
throw new OIDplusException(_L('This functionality has been disabled by the administrator.')); |
} |
109,7 → 107,13 |
} |
} |
|
else if ($actionID == 'activate_new_ra_email') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
private function action_Activate(array $params): array { |
if (!OIDplus::config()->getValue('allow_ra_email_change')) { |
throw new OIDplusException(_L('This functionality has been disabled by the administrator.')); |
} |
181,6 → 185,20 |
OIDplus::mailUtils()->sendMail($old_email, OIDplus::config()->getValue('system_title').' - eMail address changed', $message); |
|
return array("status" => 0); |
} |
|
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'change_ra_email') { |
return $this->action_Request($params); |
} else if ($actionID == 'activate_new_ra_email') { |
return $this->action_Activate($params); |
} else { |
return parent::action($actionID, $params); |
} |