diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 19:55:26 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 19:55:26 +0100 |
commit | 4100263bd6c39c48625ffc13997f37c056700f00 (patch) | |
tree | 7e6dd83ebf9e01da6d271c8998258a61d571ba2f /core | |
parent | bec34f12757517a784f6e35fc6b7294ab1673c59 (diff) | |
parent | 87bc02c6cd482a28aa175d269d48a849ca9eb399 (diff) | |
download | nextcloud-server-4100263bd6c39c48625ffc13997f37c056700f00.tar.gz nextcloud-server-4100263bd6c39c48625ffc13997f37c056700f00.zip |
Merge pull request #20996 from owncloud/issue-12215-remove-password-reset-when-not-possible
Issue 12215 remove password reset when not possible
Diffstat (limited to 'core')
-rw-r--r-- | core/js/config.php | 1 | ||||
-rw-r--r-- | core/js/lostpassword.js | 12 | ||||
-rw-r--r-- | core/templates/login.php | 8 |
3 files changed, 15 insertions, 6 deletions
diff --git a/core/js/config.php b/core/js/config.php index 8956689e74e..e51ae903729 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), 'modRewriteWorking' => (getenv('front_controller_active') === 'true'), ) ), 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 - ); + ); + } } }, diff --git a/core/templates/login.php b/core/templates/login.php index 03be6258fdf..7b09d4fac95 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -56,11 +56,15 @@ script('core', [ <input type="submit" id="submit" class="login primary icon-confirm svg" title="<?php p($l->t('Log in')); ?>" value="" disabled="disabled"/> </p> - <?php if (isset($_['invalidpassword']) && ($_['invalidpassword'])): ?> + <?php if (!empty($_['invalidpassword']) && !empty($_['canResetPassword'])) { ?> <a id="lost-password" class="warning" href=""> <?php p($l->t('Wrong password. Reset it?')); ?> </a> - <?php endif; ?> + <?php } else if (!empty($_['invalidpassword'])) { ?> + <p class="warning"> + <?php p($l->t('Wrong password.')); ?> + </p> + <?php } ?> <?php if ($_['rememberLoginAllowed'] === true) : ?> <div class="remember-login-container"> <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white"> |