public function actionMembershipDetails() { $this->actionUserExists(); $this->response->status = AECToolbox::VerifyMetaUser($this->metaUser); if ($this->response->status === true) { $this->response->status = $this->metaUser->objSubscription->status; } switch (strtolower($this->response->status)) { case 'active': $this->response->status_long = 'Account is fine.'; break; case 'trial': $this->response->status_long = 'Account is fine (using a trial right now).'; break; case 'expired': $this->response->status_long = 'Account has expired.'; break; case 'pending': $this->response->status_long = 'Account is pending - awaiting payment for the last invoice to clear.'; break; case 'open_invoice': $this->response->status_long = 'Account is pending - there is an open invoice waiting to be paid.'; break; case 'hold': $this->response->status_long = 'Account is on manual hold.'; break; default: $this->response->status_long = 'No long status explanation for this.'; break; } if (!empty($this->request->details)) { if (!is_object($this->request->details)) { $this->error = 'details need to be an objects (with "key" and "value" as properties)'; } else { $details = get_object_vars($this->request->details); foreach ($details as $k => $v) { if (empty($k) || empty($v)) { $this->error = 'one or more details empty or malformed'; } else { $this->response->{$k} = AECToolbox::rewriteEngineRQ('{aecjson}' . json_encode($v) . '{/aecjson}', null, $this->metaUser); } } } } }
/** * @param boolean $userid */ static function VerifyUserID($userid) { if (empty($userid)) { return false; } $metaUser = new metaUser($userid); return AECToolbox::VerifyMetaUser($metaUser); }