diff --git a/mojotrollz/api/api_mojotrollz.php b/mojotrollz/api/api_mojotrollz.php index a2c03ff..cb9487f 100644 --- a/mojotrollz/api/api_mojotrollz.php +++ b/mojotrollz/api/api_mojotrollz.php @@ -21,6 +21,21 @@ class api_mojotrollz extends \SYSTEM\API\api_system { return JsonResult::ok(); } + + public static function call_account_action_changepassword($old_password_sha1, $new_password_sha1){ + if(!\SYSTEM\SECURITY\security::isLoggedIn()){ + throw new ERROR("You need to be logged in to change your Password!");} + + return self::call_account_action_change_password(\SYSTEM\SECURITY\security::getUser()->username, $old_password_sha1, $new_password_sha1); + } + + public static function call_account_action_changeemail($new_email){ + if(!\SYSTEM\SECURITY\security::isLoggedIn()){ + throw new ERROR("You need to be logged in to change your EMail!");} + + return self::call_account_action_change_email(\SYSTEM\SECURITY\security::getUser()->username, $new_email); + } + //prevent normal register //public static function call_account_action_create($username, $password_sha, $email, $locale){ // return JsonResult::fail();} diff --git a/mojotrollz/page/account_changeemail/account_changeemail.php b/mojotrollz/page/account_changeemail/account_changeemail.php new file mode 100644 index 0000000..cca7bf6 --- /dev/null +++ b/mojotrollz/page/account_changeemail/account_changeemail.php @@ -0,0 +1,19 @@ +SERVERPATH(), $vars);} + + return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_changeemail/tpl/account_changeemail.tpl'))->SERVERPATH(), $vars); + } + + public static function css() {return array();} +} \ No newline at end of file diff --git a/mojotrollz/page/account_changeemail/autoload.inc b/mojotrollz/page/account_changeemail/autoload.inc new file mode 100644 index 0000000..e2c9da4 --- /dev/null +++ b/mojotrollz/page/account_changeemail/autoload.inc @@ -0,0 +1,2 @@ + user will be loged in + $('#changeemail-help-block').html('EMail sent!'); + }else{ // show errors + $('#changeemail-help-block').html(data.result ? data.result.message : 'Sending EMail failed!'); + } + } + }); + event.preventDefault(); + } + }); +} \ No newline at end of file diff --git a/mojotrollz/page/account_changeemail/tpl/account_changeemail.tpl b/mojotrollz/page/account_changeemail/tpl/account_changeemail.tpl new file mode 100644 index 0000000..08cb30c --- /dev/null +++ b/mojotrollz/page/account_changeemail/tpl/account_changeemail.tpl @@ -0,0 +1,46 @@ +
This function sends an EMail to your old Email-Address with a link to confirm the EMail-Change.
+The EMail-Change effects the Website Account and all WoW-Accounts.
+Caution! This function does not change your WoW-Account's Password.
+To change your WoW-Accounts Password's visit your WoW-Accounts.
+You are logged in as ${email}
+Your Website Account-Name is: ${username}
+ + ${option_confirm_email}To see all your Accounts confirm Your Email!
+To see all your Accounts confirm Your Email!