Skip to content

Commit a230f0c

Browse files
author
Till Brehm
committed
Merge branch 'patch-rescue' into 'develop'
Patch rescue See merge request ispconfig/ispconfig3!1132
2 parents 54fb5f4 + 9a91040 commit a230f0c

File tree

9 files changed

+51
-14
lines changed

9 files changed

+51
-14
lines changed

interface/lib/classes/auth.inc.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,36 @@ public function check_security_permissions($permission) {
198198

199199
}
200200

201+
/**
202+
* Get the minimum password length.
203+
*/
204+
public function get_min_password_length() {
205+
global $app;
206+
$server_config_array = $app->getconf->get_global_config();
207+
$min_password_length = 8;
208+
if(isset($server_config_array['misc']['min_password_length'])) $min_password_length = $server_config_array['misc']['min_password_length'];
209+
return $min_password_length;
210+
}
211+
212+
/**
213+
* Get the minimum password strength.
214+
*/
215+
public function get_min_password_strength() {
216+
global $app;
217+
$server_config_array = $app->getconf->get_global_config();
218+
$min_password_strength = 0;
219+
if(isset($server_config_array['misc']['min_password_strength'])) $min_password_strength = $server_config_array['misc']['min_password_strength'];
220+
return $min_password_strength;
221+
}
222+
223+
/**
224+
* Generate a ranmdom password.
225+
*
226+
* @param int $minLength
227+
* Minimum number of characters.
228+
* @param boolean $special
229+
* Include special characters, like # and !
230+
*/
201231
public function get_random_password($minLength = 8, $special = false) {
202232
if($minLength < 8) $minLength = 8;
203233
$maxLength = $minLength + 5;

interface/lib/classes/remote.d/mail.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ public function mail_user_add($session_id, $client_id, $params){
222222
if (!isset($params['gid'])) $params['gid'] = -1;
223223
if (!isset($params['maildir_format'])) $params['maildir_format'] = 'maildir';
224224

225-
$affected_rows = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params);
226-
return $affected_rows;
225+
$mailuser_id = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params);
226+
return $mailuser_id;
227227
}
228228

229229
//* Update mail user

interface/lib/classes/validate_password.inc.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ function password_check($field_name, $field_value, $validator) {
111111
$app->uses('ini_parser,getconf');
112112
$server_config_array = $app->getconf->get_global_config();
113113

114-
$min_password_strength = 0;
115-
$min_password_length = 5;
116-
if(isset($server_config_array['misc']['min_password_length'])) $min_password_length = $server_config_array['misc']['min_password_length'];
117-
if(isset($server_config_array['misc']['min_password_strength'])) $min_password_strength = $server_config_array['misc']['min_password_strength'];
114+
$min_password_length = $app->auth->get_min_password_length();
115+
$min_password_strength = $app->auth->get_min_password_strength();
118116

119117
if($min_password_strength > 0) {
120118
$lng_text = $app->lng('weak_password_txt');

interface/web/dashboard/dashlets/databasequota.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ function show() {
1111
return;
1212
}
1313

14+
$modules = $_SESSION['s']['user']['modules'];
15+
if (!in_array($modules, 'sites')) {
16+
return '';
17+
}
18+
1419
$tpl = new tpl;
1520
$tpl->newTemplate("dashlets/templates/databasequota.htm");
1621

interface/web/dashboard/dashlets/quota.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ function show() {
1111
return;
1212
}
1313

14+
$modules = $_SESSION['s']['user']['modules'];
15+
if (!in_array($modules, 'sites')) {
16+
return '';
17+
}
18+
1419
$tpl = new tpl;
1520
$tpl->newTemplate("dashlets/templates/quota.htm");
1621

interface/web/login/password_reset.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@
126126
} elseif ($continue) {
127127
if($client['client_id'] > 0) {
128128
$server_config_array = $app->getconf->get_global_config();
129-
$min_password_length = 8;
130-
if(isset($server_config_array['misc']['min_password_length'])) $min_password_length = $server_config_array['misc']['min_password_length'];
129+
$min_password_length = $app->auth->get_min_password_length();
131130

132131
$new_password = $app->auth->get_random_password($min_password_length, true);
133132
$new_password_encrypted = $app->auth->crypt_password($new_password);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22
$wb['page_head_txt'] = 'ISPConfig Tools';
3-
$wb['page_desc_txt'] = 'Change user settings';
3+
$wb['page_desc_txt'] = 'Gebruikersinstellingen';
44
?>

remoting_client/examples/mail_user_add.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
'disablesmtp' => 'n'
4444
);
4545

46-
$affected_rows = $client->mail_user_add($session_id, $client_id, $params);
46+
$mailuser_id = $client->mail_user_add($session_id, $client_id, $params);
4747

48-
echo "New user: ".$affected_rows."<br>";
48+
echo "New user: ".$mailuser_id."<br>";
4949

5050
if($client->logout($session_id)) {
5151
echo 'Logged out.<br />';

remoting_client/readme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
- Remote API example files
44
--------------------------------------------------------
55

6-
The examples folder contains a example script for every
7-
Remote api function. The login details and URL for the
6+
The examples folder contains an example script for every
7+
remote api function. The login details and URL for the
88
remote connection are defined in the file soap_config.php
99

1010
--------------------------------------------------------
1111
- Remote API documentation
1212
--------------------------------------------------------
1313

14-
The startpage of the API documentation is main.html
14+
The startpage of the API documentation is API-docs/index.html

0 commit comments

Comments
 (0)