This repository was archived by the owner on Sep 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +43
-17
lines changed Expand file tree Collapse file tree 7 files changed +43
-17
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ dynamichelp = "1"
21
21
password.prefix =
22
22
; outbound HTTP proxy to be used by PHP (empty for none)
23
23
httpproxy =
24
+ ; allow password reset
25
+ allow_password_reset = " 1"
24
26
; require secure cookies
25
27
cookie_secure = " 0"
26
28
; show debug toolbar
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ public function indexAction()
81
81
$ formArray ['name ' ]->setValue ($ config ->global ->application ->name );
82
82
$ formArray ['timezone ' ]->setValue ($ config ->global ->default ->timezone );
83
83
84
+ if (isset ($ config ->global ->allow_password_reset )) {
85
+ $ formArray ['allow_password_reset ' ]->setValue ($ config ->global ->allow_password_reset );
86
+ }
84
87
if (isset ($ config ->global ->closeregistration )) {
85
88
$ formArray ['closeregistration ' ]->setValue ($ config ->global ->closeregistration );
86
89
}
@@ -116,10 +119,11 @@ public function indexAction()
116
119
$ config ->global ->application ->lang = $ this ->getParam ('lang ' );
117
120
$ config ->global ->default ->timezone = $ this ->getParam ('timezone ' );
118
121
$ config ->global ->defaultlicense = $ this ->getParam ('licenseSelect ' );
119
- $ config ->global ->dynamichelp = $ this ->getParam ('dynamichelp ' );
122
+ $ config ->global ->allow_password_reset = $ this ->getParam ('allow_password_reset ' );
120
123
$ config ->global ->closeregistration = $ this ->getParam ('closeregistration ' );
121
- $ config ->global ->httpproxy = $ this ->getParam ('httpProxy ' );
124
+ $ config ->global ->dynamichelp = $ this ->getParam ('dynamichelp ' );
122
125
$ config ->global ->gravatar = $ this ->getParam ('gravatar ' );
126
+ $ config ->global ->httpproxy = $ this ->getParam ('httpProxy ' );
123
127
124
128
$ writer = new Zend_Config_Writer_Ini ();
125
129
$ writer ->setConfig ($ config );
Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ public function recoverpasswordAction()
86
86
if ($ this ->logged ) {
87
87
throw new Zend_Exception ('Shouldn \'t be logged in ' );
88
88
}
89
+
90
+ if ((int ) Zend_Registry::get ('configGlobal ' )->get ('allow_password_reset ' , 0 ) === 0 ) {
91
+ throw new Zend_Exception ('Password reset is disabled ' );
92
+ }
93
+
89
94
$ this ->disableLayout ();
90
95
$ email = $ this ->getParam ('email ' );
91
96
if (isset ($ email )) {
@@ -643,6 +648,9 @@ public function loginAction()
643
648
echo JsonComponent::encode (array ('status ' => false , 'message ' => 'Invalid email or password ' ));
644
649
}
645
650
}
651
+
652
+ $ this ->view ->allowPasswordReset = (int ) Zend_Registry::get ('configGlobal ' )->get ('allow_password_reset ' , 0 ) === 1 ;
653
+ $ this ->view ->closeRegistration = (int ) Zend_Registry::get ('configGlobal ' )->get ('closeregistration ' , 0 ) === 1 ;
646
654
}
647
655
648
656
/** Term of service */
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public function createConfigForm()
54
54
55
55
$ dynamichelp = new Zend_Form_Element_Checkbox ('dynamichelp ' );
56
56
$ gravatar = new Zend_Form_Element_Checkbox ('gravatar ' );
57
+ $ allowPasswordReset = new Zend_Form_Element_Checkbox ('allow_password_reset ' );
57
58
$ closeRegistration = new Zend_Form_Element_Checkbox ('closeregistration ' );
58
59
59
60
$ httpProxy = new Zend_Form_Element_Text ('httpProxy ' );
@@ -69,6 +70,7 @@ public function createConfigForm()
69
70
$ gravatar ,
70
71
$ lang ,
71
72
$ name ,
73
+ $ allowPasswordReset ,
72
74
$ closeRegistration ,
73
75
$ submit ,
74
76
$ httpProxy ,
Original file line number Diff line number Diff line change @@ -49,10 +49,12 @@ $(document).ready(function () {
49
49
} ) ;
50
50
51
51
// Deal with password recovery
52
- $ ( 'a#forgotPasswordLink' ) . click ( function ( ) {
53
- midas . loadDialog ( "forgotpassword" , "/user/recoverpassword" ) ;
54
- midas . showDialog ( "Recover Password" ) ;
55
- } ) ;
52
+ if ( $ ( 'a#forgotPasswordLink' ) . length ) {
53
+ $ ( 'a#forgotPasswordLink' ) . click ( function ( ) {
54
+ midas . loadDialog ( "forgotpassword" , "/user/recoverpassword" ) ;
55
+ midas . showDialog ( "Recover Password" ) ;
56
+ } ) ;
57
+ }
56
58
57
59
$ ( "a.registerLink" ) . unbind ( 'click' ) . click ( function ( ) {
58
60
midas . showOrHideDynamicBar ( 'register' ) ;
Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.clu
83
83
<label for='dynamichelp'>Dynamic help</label>
84
84
{$ this ->configForm ['dynamichelp ' ]}
85
85
</div>
86
+ <div qtip='If you enable this feature, password reset will not be allowed.' class='allowPasswordReset'>
87
+ <label for='allow_password_reset'>Allow password reset</label>
88
+ {$ this ->configForm ['allow_password_reset ' ]}
89
+ </div>
86
90
<div qtip='If you enable this feature, user registration will not be allowed.' class='closeRegistration'>
87
91
<label for='closeregistration'>Close registration</label>
88
92
{$ this ->configForm ['closeregistration ' ]}
Original file line number Diff line number Diff line change @@ -30,8 +30,14 @@ echo '<script type="text/javascript" src="'.$this->coreWebroot.'/public/js/user/
30
30
<td><label for="email"><?php echo $ this ->t ('Email ' ) ?> </label></td>
31
31
<td>
32
32
<label for="password"><?php echo $ this ->t ('Password ' ) ?> </label>
33
- <a id='forgotPasswordLink' style='text-decoration: underline;font-size: 10px;'
34
- href="#"><?php echo $ this ->t ('Forgot your password ' ) ?> ?</a>
33
+ <?php
34
+ if ($ this ->allowPasswordReset ) {
35
+ ?>
36
+ <a id='forgotPasswordLink' style='text-decoration: underline;font-size: 10px;'
37
+ href="#"><?php echo $ this ->t ('Forgot your password ' ); ?> ?</a>
38
+ <?php
39
+ }
40
+ ?>
35
41
</td>
36
42
<td></td>
37
43
</tr>
@@ -46,16 +52,14 @@ echo '<script type="text/javascript" src="'.$this->coreWebroot.'/public/js/user/
46
52
</tr>
47
53
<tr>
48
54
<td>
49
- <?php if (!isset (Zend_Registry::get ('configGlobal ' )->closeregistration ) || Zend_Registry::get (
50
- 'configGlobal '
51
- )->closeregistration == "0 " ) {
52
- echo $ this ->t ("Not registered yet? " ); ?>
53
- <a class="registerLink" style='text-decoration: underline;'><?php echo $ this ->t ("Register here " ) ?> </a>
55
+ <?php
56
+ if (!$ this ->closeRegistration ) {
57
+ echo $ this ->t ("Not registered yet? " ); ?>
58
+ <a class="registerLink" style='text-decoration: underline;'><?php echo $ this ->t ("Register here " ); ?> </a>
59
+ <?php
60
+ }
61
+ ?>
54
62
</td>
55
- <?php
56
- } else {
57
- echo '</td> ' ;
58
- } ?>
59
63
<td><?php echo $ this ->form ['remerberMe ' ] ?>
60
64
<label id="rememberMeText" for="remerberMe"><?php echo $ this ->t ("Remember Me " ) ?> </label></td>
61
65
<td></td>
You can’t perform that action at this time.
0 commit comments