From 04c2247b0d96df632e7660a5143777e0b1adbf08 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 7 Dec 2015 15:37:26 +0100 Subject: Allow specifying a custom reset-password-url Conflicts: core/js/config.php --- core/js/config.php | 1 + core/js/lostpassword.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'core/js') diff --git a/core/js/config.php b/core/js/config.php index e2d7ae3784c..7fa181c7020 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -141,6 +141,7 @@ $array = array( 'version' => implode('.', OC_Util::getVersion()), 'versionstring' => OC_Util::getVersionString(), 'enable_avatars' => \OC::$server->getConfig()->getSystemValue('enable_avatars', true), + 'lost_password_link'=> \OC::$server->getConfig()->getSystemValue('lost_password_link', null), ) ), "oc_appconfig" => json_encode( diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js index 294a9d8c1cf..df28c2308cb 100644 --- a/core/js/lostpassword.js +++ b/core/js/lostpassword.js @@ -13,22 +13,26 @@ OC.Lostpassword = { resetErrorMsg : t('core', 'Password can not be changed. Please contact your administrator.'), init : function() { - $('#lost-password').click(OC.Lostpassword.sendLink); + $('#lost-password').click(OC.Lostpassword.resetLink); $('#reset-password #submit').click(OC.Lostpassword.resetPassword); }, - sendLink : function(event){ + resetLink : function(event){ event.preventDefault(); if (!$('#user').val().length){ $('#submit').trigger('click'); } else { - $.post( + if (OC.config['lost_password_link']) { + window.location = OC.config['lost_password_link']; + } else { + $.post( OC.generateUrl('/lostpassword/email'), { user : $('#user').val() }, OC.Lostpassword.sendLinkDone - ); + ); + } } }, -- cgit v1.2.3