* Finish task #57907

This commit is contained in:
zenggang
2022-06-21 02:50:55 +00:00
parent 0f0fd55ba3
commit b761aa029b
2 changed files with 13 additions and 2 deletions
+10
View File
@@ -516,6 +516,16 @@ class installModel extends model
}
}
/* Check password. */
if(!validater::checkReg($this->post->password, '|(.){6,}|')) dao::$errors['password'][] = $this->lang->error->passwordrule;
if(isset($this->config->safe->mode) and (strlen($this->post->password) < $this->config->safe->mode)) dao::$errors['password'][] = $this->lang->user->weakPassword;
if(!empty($this->config->safe->changeWeak))
{
if(!isset($this->config->safe->weak)) $this->app->loadConfig('admin');
if(strpos(",{$this->config->safe->weak},", ",{$this->post->password},") !== false) dao::$errors['password'][] = sprintf($this->lang->user->errorWeak, $this->config->safe->weak);
}
if(dao::isError()) return false;
/* Insert a company. */
$company = new stdclass();
$company->name = $data->company;
+3 -2
View File
@@ -46,7 +46,7 @@
</div>
<div class='modal-body'>
<form method='post'>
<table class='table table-form mw-400px' style='margin: 0 auto'>
<table class='table table-form mw-500px' style='margin: 0 auto'>
<tr>
<th class='c-company'><?php echo $lang->install->company;?></th>
<td class='c-company-value'><?php echo html::input('company', '', "class='form-control'");?></td>
@@ -61,7 +61,8 @@
</tr>
<tr>
<th><?php echo $lang->install->password;?></th>
<td><?php echo html::input('password', '', "class='form-control'");?></td>
<td><?php echo html::input('password', '', "class='form-control' oninput=\"this.value = this.value.replace(/[\u4e00-\u9fa5d]/g, '');\"");?></td>
<td><?php echo $lang->user->placeholder->password1;?></td>
</tr>
<tr>
<th></th><td><?php echo html::checkBox('importDemoData', $lang->install->importDemoData);?></td>