55,16 → 55,14 |
} |
|
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
private function action_Request(array $params): array { |
if (empty(self::getFreeRootOid(false))) throw new OIDplusException(_L('FreeOID service not available. Please ask your administrator.')); |
|
if ($actionID == 'request_freeoid') { |
_CheckParamExists($params, 'email'); |
$email = $params['email']; |
|
92,8 → 90,17 |
OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Free OID request', $message); |
|
return array("status" => 0); |
} |
|
} else if ($actionID == 'activate_freeoid') { |
/** |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
private function action_Activate(array $params): array { |
if (empty(self::getFreeRootOid(false))) throw new OIDplusException(_L('FreeOID service not available. Please ask your administrator.')); |
|
_CheckParamExists($params, 'email'); |
_CheckParamExists($params, 'auth'); |
|
197,6 → 204,20 |
"new_oid" => $new_oid, |
"status" => 0 |
); |
} |
|
/** |
* @param string $actionID |
* @param array $params |
* @return array |
* @throws OIDplusException |
* @throws OIDplusMailException |
*/ |
public function action(string $actionID, array $params): array { |
if ($actionID == 'request_freeoid') { |
return $this->action_Request($params); |
} else if ($actionID == 'activate_freeoid') { |
return $this->action_Activate($params); |
} else { |
return parent::action($actionID, $params); |
} |