}
/**
- * Class comment
+ * An action to globally register a new user
*
* @category Action
* @package StatusNet
* @link http://status.net/
*/
-class GlobalRegisterAction extends Action
+class GlobalregisterAction extends GlobalApiAction
{
/**
* For initializing members of the class.
function prepare($argarray)
{
- parent::prepare($argarray);
- return true;
+ try {
+ parent::prepare($argarray);
+ return true;
+ } catch (ClientException $e) {
+ $this->showError($e->getMessage(), $e->getCode());
+ return false;
+ } catch (Exception $e) {
+ common_log(LOG_ERR, $e->getMessage());
+ $this->showError(_('An internal error occurred.'), 500);
+ return false;
+ }
}
/**
function handle($argarray=null)
{
- return;
- }
+ try {
+ $confirm = DomainStatusNetworkPlugin::registerEmail($this->email);
+ EmailRegistrationPlugin::sendConfirmEmail($confirm);
+ $this->showSuccess();
+ } catch (ClientException $e) {
+ $this->showError($e->getMessage(), $e->getCode());
+ } catch (Exception $e) {
+ common_log(LOG_ERR, $e->getMessage());
+ $this->showError(_('An internal error occurred.'), 500);
+ }
- /**
- * Return true if read only.
- *
- * MAY override
- *
- * @param array $args other arguments
- *
- * @return boolean is read only action?
- */
-
- function isReadOnly($args)
- {
- return false;
- }
-
- /**
- * Return last modified, if applicable.
- *
- * MAY override
- *
- * @return string last modified http header
- */
- function lastModified()
- {
- // For comparison with If-Last-Modified
- // If not applicable, return null
- return null;
- }
-
- /**
- * Return etag, if applicable.
- *
- * MAY override
- *
- * @return string etag http header
- */
-
- function etag()
- {
- return null;
+ return;
}
}