summaryrefslogtreecommitdiff
path: root/app/frontend/controls
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-03-15 16:36:16 +0100
committeremkael <emkael@tlen.pl>2017-03-15 16:47:25 +0100
commitf70a6798f14773faefea6628927d9240940a6f26 (patch)
treea8993536bf9a734f6982775ab4129969da05f0ec /app/frontend/controls
parent917a2dde09925199f9000b35e74fecb67af326ec (diff)
* activation landing page
Diffstat (limited to 'app/frontend/controls')
-rw-r--r--app/frontend/controls/AccountActivation.php38
-rw-r--r--app/frontend/controls/AccountActivation.tpl6
2 files changed, 44 insertions, 0 deletions
diff --git a/app/frontend/controls/AccountActivation.php b/app/frontend/controls/AccountActivation.php
new file mode 100644
index 0000000..f7b7f49
--- /dev/null
+++ b/app/frontend/controls/AccountActivation.php
@@ -0,0 +1,38 @@
+<?php
+
+Prado::using('Application.web.FacadeTemplateControl');
+
+Prado::using('Application.facades.UserFacade');
+
+class AccountActivation extends FacadeTemplateControl {
+
+ private $_emailHash;
+ private $_activationHash;
+
+ public function getEmail() {
+ return $this->_emailHash;
+ }
+
+ public function setEmail($email) {
+ $this->_emailHash = TPropertyValue::ensureString($email);
+ }
+
+ public function getHash() {
+ return $this->_activationHash;
+ }
+
+ public function setHash($hash) {
+ $this->_activationHash = TPropertyValue::ensureString($hash);
+ }
+
+ public function onPreRender($param) {
+ parent::onPreRender($param);
+ $this->SuccessLabel->Visible = $this->Facade->activateUser(
+ $this->Email, $this->Hash
+ );
+ $this->ErrorLabel->Visible = !$this->SuccessLabel->Visible;
+ }
+
+}
+
+?>
diff --git a/app/frontend/controls/AccountActivation.tpl b/app/frontend/controls/AccountActivation.tpl
new file mode 100644
index 0000000..19c00b3
--- /dev/null
+++ b/app/frontend/controls/AccountActivation.tpl
@@ -0,0 +1,6 @@
+<com:TLabel ID="SuccessLabel">
+ <%[ Your account has been activated successfully. ]%>
+</com:TLabel>
+<com:Tlabel ID="ErrorLabel">
+ <%[ There was a problem with account activation. Maybe your account is already active? ]%>
+</com:Tlabel>