From 7bdb12995a12b2f6ea913616e9f985c2360e8304 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 14:15:13 +0800 Subject: [PATCH 01/11] * finish task #6185. --- module/user/control.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index 6718ac3213..0ae554abab 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -372,14 +372,17 @@ class user extends control */ public function setReferer($referer = '') { - if(!empty($referer)) - { - $this->referer = helper::safe64Decode($referer); - } - else - { - $this->referer = $this->server->http_referer ? $this->server->http_referer: ''; - } + $this->referer = $this->server->http_referer ? $this->server->http_referer: ''; + if(!empty($referer)) $this->referer = helper::safe64Decode($referer); + + /* Build zentao link regular. */ + $webRoot = $this->config->webRoot; + $linkReg = $webRoot . 'index.php?' . $this->config->moduleVar . '=\w+&' . $this->config->methodVar . '=\w+'; + if($this->config->requestType == 'PATH_INFO') $linkReg = $webRoot . '\w+' . $this->config->requestFix . '\w+'; + $linkReg = str_replace(array('/', '.', '?', '-'), array('\/', '\.', '\?', '\-'), $linkReg); + + /* Check zentao link by regular. */ + $this->referer = preg_match('/^' . $linkReg . '/', $this->referer) ? $this->referer : $webRoot; } /** From 7964ce412ff8574be0c2faf989e68fdbc42f2794 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 15:27:39 +0800 Subject: [PATCH 02/11] * finish task #6190. --- module/project/model.php | 12 +++++++ module/task/model.php | 68 +++++++++------------------------------- 2 files changed, 27 insertions(+), 53 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index afc9f6bd45..36c187ef2d 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2002,6 +2002,13 @@ class projectModel extends model { foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team; } + + $parents = array(); + foreach($tasks as $task) + { + if($task->parent > 0) $parents[$task->parent] = $task->parent; + } + $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); foreach($tasks as $task) { @@ -2012,6 +2019,11 @@ class projectModel extends model $tasks[$task->parent]->children[$task->id] = $task; unset($tasks[$task->id]); } + else + { + $parent = $parents[$task->parent]; + $task->parentName = $parent->name; + } } } return $this->loadModel('task')->processTasks($tasks); diff --git a/module/task/model.php b/module/task/model.php index 2609e58603..1c614379ef 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1655,41 +1655,9 @@ class taskModel extends model $parents = array(); foreach($tasks as $task) { - if($task->parent == -1) $parents[] = $task->id; - } - if(!empty($parents)) - { - /* Select children task. */ - $children = $this->dao->select('DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') - ->from(TABLE_TASK)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') - ->leftJoin(TABLE_MODULE)->alias('t4')->on('t1.module = t4.id') - ->where('t1.parent')->in($parents) - ->andWhere('t1.deleted')->eq(0) - ->beginIF($productID)->andWhere("((t4.root=" . (int)$productID . " and t4.type='story') OR t2.product=" . (int)$productID . ")")->fi() - ->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi() - ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() - ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($type == 'finishedbyme') - ->andWhere('t1.finishedby', 1)->eq($this->app->user->account) - ->orWhere('t1.finishedList')->like("%,{$this->app->user->account},%") - ->markRight(1) - ->fi() - ->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi() - ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() - ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() - ->orderBy("t1.$orderBy") - ->fetchAll('id'); - - if(!empty($children)) - { - foreach($children as $child) - { - $tasks[$child->parent]->children[$child->id] = $child; - } - } + if($task->parent > 0) $parents[$task->parent] = $task->parent; } + $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); foreach($tasks as $task) { @@ -1700,6 +1668,11 @@ class taskModel extends model $tasks[$task->parent]->children[$task->id] = $task; unset($tasks[$task->id]); } + else + { + $parent = $parents[$task->parent]; + $task->parentName = $parent->name; + } } } @@ -1842,26 +1815,9 @@ class taskModel extends model $parents = array(); foreach($tasks as $task) { - if($task->parent == -1) $parents[] = $task->id; - } - if(!empty($parents)) - { - /* Select children task. */ - $children = $this->dao->select('id, parent, name, assignedTo, pri, status, estimate, consumed, closedReason, `left`') - ->from(TABLE_TASK) - ->where('story')->eq((int)$storyID) - ->andwhere('parent')->in($parents) - ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() - ->fetchAll('id'); - - if(!empty($children)) - { - foreach($children as $child) - { - $tasks[$child->parent]->children[$child->id] = $child; - } - } + if($task->parent > 0) $parents[$task->parent] = $task->parent; } + $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); foreach($tasks as $task) { @@ -1872,6 +1828,11 @@ class taskModel extends model $tasks[$task->parent]->children[$task->id] = $task; unset($tasks[$task->id]); } + else + { + $parent = $parents[$task->parent]; + $task->parentName = $parent->name; + } } } @@ -2671,6 +2632,7 @@ class taskModel extends model echo ""; break; case 'name': + if($task->parent > 0 and isset($task->parentName)) $task->name = "{$task->parentName} / {$task->name}"; if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if(empty($task->children) and $task->module and isset($modulePairs[$task->module])) echo "" . $modulePairs[$task->module] . ' '; if($task->parent > 0) echo '' . $this->lang->task->childrenAB . ' '; From 13d46d92a1d688c250ac29ec4eea23602b72c0cc Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 15:50:27 +0800 Subject: [PATCH 03/11] * finish task #2662. --- lib/phpmailer/class.smtp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/phpmailer/class.smtp.php b/lib/phpmailer/class.smtp.php index d8bfd6f136..1d2aa89c82 100644 --- a/lib/phpmailer/class.smtp.php +++ b/lib/phpmailer/class.smtp.php @@ -617,7 +617,7 @@ class SMTP { protected function parseHelloFields($type) { - $this->server_caps = []; + $this->server_caps = array(); $lines = explode("\n", $this->helo_rply); foreach ($lines as $n => $s) { @@ -639,7 +639,7 @@ class SMTP { break; case 'AUTH': if (!is_array($fields)) { - $fields = []; + $fields = array(); } break; default: From db78f99f3490e0e5d3868e27e8b3027cd1d38b41 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 15:51:33 +0800 Subject: [PATCH 04/11] * finish task #6199. --- www/upgrade.php.tmp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/upgrade.php.tmp b/www/upgrade.php.tmp index 609ed1c84b..13abaab89e 100644 --- a/www/upgrade.php.tmp +++ b/www/upgrade.php.tmp @@ -12,9 +12,9 @@ /* Judge my.php exists or not. */ define('IN_UPGRADE', true); $dbConfig = dirname(dirname(__FILE__)) . '/config/db.php'; +$myConfig = dirname(dirname(__FILE__)) . '/config/my.php'; if(file_exists($dbConfig)) { - $myConfig = dirname(dirname(__FILE__)) . '/config/my.php'; if(file_exists($myConfig)) { $myContent = trim(file_get_contents($myConfig)); @@ -35,6 +35,7 @@ if(file_exists($dbConfig)) file_put_contents($myConfig, $myContent); } } +if(!file_exists($myConfig)) die(header('location: install.php')); error_reporting(0); From 842667e0a0a2c484084cd4afaa47842eb71d477f Mon Sep 17 00:00:00 2001 From: reneeteng Date: Wed, 7 Aug 2019 16:20:43 +0800 Subject: [PATCH 05/11] * Lang testcase type. --- module/project/lang/en.php | 2 +- module/testcase/lang/en.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/project/lang/en.php b/module/project/lang/en.php index cd77bb4913..7ded04f922 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -115,7 +115,7 @@ $lang->project->statusList['closed'] = 'Closed'; $lang->project->aclList['open'] = "Default (Users who can visit {$lang->projectCommon} can access it.)"; $lang->project->aclList['private'] = 'Private (For team members only.)'; -$lang->project->aclList['custom'] = 'Whitelist (Team members and the whitelist users can access it.)'; +$lang->project->aclList['custom'] = 'Custom (Team members and the whitelist users can access it.)'; /* Method list. */ $lang->project->index = "{$lang->projectCommon} Home"; diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index df0e01009b..7174ebf558 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -68,10 +68,10 @@ $lang->testcase->stepNumberAB = 'S'; $lang->testcase->createBug = 'Report Bug'; $lang->testcase->fromModule = 'Source Module'; $lang->testcase->fromCase = 'Source Case'; -$lang->testcase->sync = 'Sync. Case'; +$lang->testcase->sync = 'Synchronize Case'; $lang->testcase->ignore = 'Ignore'; $lang->testcase->fromTesttask = 'From Test Request'; -$lang->testcase->fromCaselib = 'From CaseLib'; +$lang->testcase->fromCaselib = 'From Case Library'; $lang->testcase->deleted = 'Deleted'; $lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case. @@ -118,7 +118,7 @@ $lang->testcase->copy = 'Copy Case'; $lang->testcase->group = 'Group'; $lang->testcase->groupName = 'Group Name'; $lang->testcase->step = 'Steps'; -$lang->testcase->stepChild = 'Child Step'; +$lang->testcase->stepChild = 'Child Steps'; $lang->testcase->viewAll = 'All Cases'; $lang->testcase->new = 'New'; @@ -143,7 +143,7 @@ $lang->testcase->lblTypeValue = 'Type Value'; $lang->testcase->lblStageValue = 'Phase Value'; $lang->testcase->lblStatusValue = 'Status Value'; -$lang->testcase->legendBasicInfo = 'Basic Info'; +$lang->testcase->legendBasicInfo = 'Basic Information'; $lang->testcase->legendAttatch = 'Files'; $lang->testcase->legendLinkBugs = 'Bugs'; $lang->testcase->legendOpenAndEdit = 'Create/Edit'; @@ -168,8 +168,8 @@ $lang->testcase->priList[4] = 4; $lang->testcase->typeList[''] = ''; $lang->testcase->typeList['feature'] = 'Feature'; $lang->testcase->typeList['performance'] = 'Performance'; -$lang->testcase->typeList['config'] = 'Config'; -$lang->testcase->typeList['install'] = 'Install'; +$lang->testcase->typeList['config'] = 'Configuration'; +$lang->testcase->typeList['install'] = 'Installation'; $lang->testcase->typeList['security'] = 'Security'; $lang->testcase->typeList['interface'] = 'Interface'; $lang->testcase->typeList['other'] = 'Others'; From fd0bfd97e5de79cfcd74a41ef4a2f35ecefbca04 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 7 Aug 2019 16:56:37 +0800 Subject: [PATCH 06/11] * finish task #6201. --- xuanxuan/module/chat/ext/model/class/xuanxuan.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php index 1392498605..728e0799a5 100644 --- a/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/chat/ext/model/class/xuanxuan.class.php @@ -92,7 +92,7 @@ class xuanxuanChat extends chatModel $position = strrpos($host, ':'); $port = $position === false ? '' : substr($host, $position + 1); $server = $this->config->xuanxuan->server; - if($port and strpos($server, ":$port") === false) + if($port and strpos($server, ":") === false) { $server = rtrim($server, '/'); $server = "{$server}:{$port}"; From 2fbe7943f37ddb81894f9dd375869832b22c04a8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Aug 2019 10:25:03 +0800 Subject: [PATCH 07/11] * finish task #6212. --- module/action/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/action/model.php b/module/action/model.php index 4c6093d3f0..20231c749b 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -45,9 +45,11 @@ class actionModel extends model $action->actor = $actor; $action->action = $actionType; $action->date = helper::now(); - $action->comment = trim(strip_tags($comment, $this->config->allowedTags)); $action->extra = $extra; + $_POST['comment'] = $comment; + $action->comment = fixer::input('post')->stripTags('comment')->get('comment'); + /* Process action. */ $action = $this->loadModel('file')->processImgURL($action, 'comment', $this->post->uid); if($autoDelete) $this->file->autoDelete($this->post->uid); From 321b27c81b7f1cc8adebc40d05f0bd771d445817 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Aug 2019 13:12:49 +0800 Subject: [PATCH 08/11] * finish task #6208. --- module/sso/model.php | 6 ---- module/user/js/batchcreate.js | 17 ++++++++-- module/user/lang/zh-cn.php | 3 ++ module/user/model.php | 45 +++++++++------------------ module/user/view/batchcreate.html.php | 2 ++ 5 files changed, 33 insertions(+), 40 deletions(-) diff --git a/module/sso/model.php b/module/sso/model.php index fd53fd52da..8d902b3107 100644 --- a/module/sso/model.php +++ b/module/sso/model.php @@ -61,12 +61,6 @@ class ssoModel extends model $user = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($data->account)->fetch(); if($user) die(js::alert($this->lang->sso->bindHasAccount)); - if(isset($this->config->safe->mode) and $this->user->computePasswordStrength($data->password1) < $this->config->safe->mode) - { - dao::$errors['password1'][] = $this->lang->user->weakPassword; - return false; - } - $user = new stdclass(); $user->account = $data->account; $user->password = md5($data->password1); diff --git a/module/user/js/batchcreate.js b/module/user/js/batchcreate.js index 570f4b526e..bce0dc7c6b 100644 --- a/module/user/js/batchcreate.js +++ b/module/user/js/batchcreate.js @@ -10,15 +10,26 @@ function changeGroup(role, i) } $('#group' + i).trigger('chosen:updated'); } + function toggleCheck(obj, i) { - if($(obj).val() == '') + var $this = $(obj); + var password = $this.val(); + var $ditto = $('#ditto' + i); + var $passwordStrength = $this.closest('.input-group').find('.passwordStrength'); + if(password == '') { - $('#ditto' + i).attr('checked', true); + $ditto.attr('checked', true); + $ditto.closest('.input-group-addon').show(); + $passwordStrength.hide(); + $passwordStrength.html(''); } else { - $('#ditto' + i).removeAttr('checked'); + $ditto.removeAttr('checked'); + $ditto.closest('.input-group-addon').hide(); + $passwordStrength.html(passwordStrengthList[computePasswordStrength(password)]); + $passwordStrength.show(); } } diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index 506799db86..5b70b18831 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -113,6 +113,7 @@ $lang->user->loginFailed = "登录失败,请检查您的用户名或密码是 $lang->user->lockWarning = "您还有%s次尝试机会。"; $lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s分钟后重试。"; $lang->user->weakPassword = "您的密码强度小于系统设定。"; +$lang->user->errorWeak = "密码不能使用【%s】这些常用弱口令。"; $lang->user->roleList[''] = ''; $lang->user->roleList['dev'] = '研发'; @@ -171,6 +172,8 @@ $lang->user->error->realname = "【ID %s】的真实姓名必须填写"; $lang->user->error->password = "【ID %s】的密码必须为六位以上"; $lang->user->error->mail = "【ID %s】的邮箱地址不正确"; $lang->user->error->reserved = "【ID %s】的用户名已被系统预留"; +$lang->user->error->weakPassword = "【ID %s】的密码强度小于系统设定。"; +$lang->user->error->commonWeak = "【ID %s】的密码不能使用【%s】这些常用若口令。"; $lang->user->error->verifyPassword = "验证失败,请检查您的系统登录密码是否正确"; $lang->user->error->originalPassword = "原密码不正确"; diff --git a/module/user/model.php b/module/user/model.php index 069be4698e..40d737f1f9 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -220,12 +220,6 @@ class userModel extends model ->remove('group, password1, password2, verifyPassword') ->get(); - if(isset($this->config->safe->mode) and $this->computePasswordStrength($this->post->password1) < $this->config->safe->mode) - { - dao::$errors['password1'][] = $this->lang->user->weakPassword; - return false; - } - if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) { dao::$errors['verifyPassword'][] = $this->lang->user->error->verifyPassword; @@ -276,17 +270,21 @@ class userModel extends model $users->account[$i] = trim($users->account[$i]); if($users->account[$i] != '') { - if(strtolower($users->account[$i]) == 'guest') die(js::error(sprintf($this->lang->user->error->reserved, $i+1))); + if(strtolower($users->account[$i]) == 'guest') die(js::error(sprintf($this->lang->user->error->reserved, $i + 1))); $account = $this->dao->select('account')->from(TABLE_USER)->where('account')->eq($users->account[$i])->fetch(); - if($account) die(js::error(sprintf($this->lang->user->error->accountDupl, $i+1))); - if(in_array($users->account[$i], $accounts)) die(js::error(sprintf($this->lang->user->error->accountDupl, $i+1))); - if(!validater::checkAccount($users->account[$i])) die(js::error(sprintf($this->lang->user->error->account, $i+1))); - if($users->realname[$i] == '') die(js::error(sprintf($this->lang->user->error->realname, $i+1))); - if($users->email[$i] and !validater::checkEmail($users->email[$i])) die(js::error(sprintf($this->lang->user->error->mail, $i+1))); + if($account) die(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1))); + if(in_array($users->account[$i], $accounts)) die(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1))); + if(!validater::checkAccount($users->account[$i])) die(js::error(sprintf($this->lang->user->error->account, $i + 1))); + if($users->realname[$i] == '') die(js::error(sprintf($this->lang->user->error->realname, $i + 1))); + if($users->email[$i] and !validater::checkEmail($users->email[$i])) die(js::error(sprintf($this->lang->user->error->mail, $i + 1))); $users->password[$i] = (isset($prev['password']) and $users->ditto[$i] == 'on' and empty($users->password[$i])) ? $prev['password'] : $users->password[$i]; - if(!validater::checkReg($users->password[$i], '|(.){6,}|')) die(js::error(sprintf($this->lang->user->error->password, $i+1))); + if(!validater::checkReg($users->password[$i], '|(.){6,}|')) die(js::error(sprintf($this->lang->user->error->password, $i + 1))); $role = $users->role[$i] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : '') : $users->role[$i]; + /* Check weak and common weak password. */ + if(isset($this->config->safe->mode) and $this->computePasswordStrength($users->password[$i]) < $this->config->safe->mode) die(js::error(sprintf($this->lang->user->error->weakPassword, $i + 1))); + if(!empty($this->config->safe->changeWeak) and strpos(",{$this->config->safe->weak},", ",{$this->post->password1},") !== false) die(js::error(sprintf($this->lang->user->error->commonWeak, $i + 1, $this->config->safe->weak))); + $data[$i] = new stdclass(); $data[$i]->dept = $users->dept[$i] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $users->dept[$i]; $data[$i]->account = $users->account[$i]; @@ -377,12 +375,6 @@ class userModel extends model ->remove('password1, password2, groups,verifyPassword') ->get(); - if(isset($this->config->safe->mode) and isset($user->password) and $this->computePasswordStrength($this->post->password1) < $this->config->safe->mode) - { - dao::$errors['password1'][] = $this->lang->user->weakPassword; - return false; - } - if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) { dao::$errors['verifyPassword'][] = $this->lang->user->error->verifyPassword; @@ -560,12 +552,6 @@ class userModel extends model ->remove('account, password1, password2, originalPassword') ->get(); - if(isset($this->config->safe->mode) and $this->computePasswordStrength($this->post->password1) < $this->config->safe->mode) - { - dao::$errors['password1'][] = $this->lang->user->weakPassword; - return false; - } - if(empty($_POST['originalPassword']) or md5($this->post->originalPassword) != $this->app->user->password) { dao::$errors['originalPassword'][] = $this->lang->user->error->originalPassword; @@ -595,12 +581,6 @@ class userModel extends model if(!$user) return false; $password = md5($this->post->password1); - if(isset($this->config->safe->mode) and $this->computePasswordStrength($this->post->password1) < $this->config->safe->mode) - { - dao::$errors['password1'][] = $this->lang->user->weakPassword; - return false; - } - $this->dao->update(TABLE_USER)->set('password')->eq($password)->autoCheck()->where('account')->eq($this->post->account)->exec(); return !dao::isError(); } @@ -620,6 +600,9 @@ class userModel extends model { if($this->post->password1 != $this->post->password2) dao::$errors['password'][] = $this->lang->error->passwordsame; if(!validater::checkReg($this->post->password1, '|(.){6,}|')) dao::$errors['password'][] = $this->lang->error->passwordrule; + + if(isset($this->config->safe->mode) and $this->computePasswordStrength($this->post->password1) < $this->config->safe->mode) dao::$errors['password1'][] = $this->lang->user->weakPassword; + if(!empty($this->config->safe->changeWeak) and strpos(",{$this->config->safe->weak},", ",{$this->post->password1},") !== false) dao::$errors['password1'][] = sprintf($this->lang->user->errorWeak, $this->config->safe->weak); } return !dao::isError(); } diff --git a/module/user/view/batchcreate.html.php b/module/user/view/batchcreate.html.php index 877dedbe87..990e55b5cb 100644 --- a/module/user/view/batchcreate.html.php +++ b/module/user/view/batchcreate.html.php @@ -76,6 +76,7 @@
"; if($i != 0) echo " 0 ? "checked" : '') . " /> {$lang->user->ditto}"; ?>
@@ -116,4 +117,5 @@ +user->passwordStrengthList)?> From ccb5ddd4744a3a6faea6b558e76464aaec9936da Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Aug 2019 13:21:56 +0800 Subject: [PATCH 09/11] * finish task #6209. --- module/tutorial/control.php | 2 +- module/tutorial/view/index.html.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/tutorial/control.php b/module/tutorial/control.php index 6c98ca423a..8cd151406b 100644 --- a/module/tutorial/control.php +++ b/module/tutorial/control.php @@ -71,7 +71,7 @@ class tutorial extends control { $this->session->set('tutorialMode', false); $this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', 0); - if(empty($referer)) $referer = $this->createLink('index'); + if(empty($referer)) $referer = helper::safe64Encode(helper::createLink('my', 'index', '', 'html')); die(js::locate(helper::safe64Decode($referer), 'parent')); } diff --git a/module/tutorial/view/index.html.php b/module/tutorial/view/index.html.php index 8b48a0cff0..6675547e4f 100644 --- a/module/tutorial/view/index.html.php +++ b/module/tutorial/view/index.html.php @@ -12,7 +12,7 @@ ?> - +
@@ -22,7 +22,7 @@

tutorial->congratulation ?>

-   tutorial->exit ?> +   ' class='btn btn-success'> tutorial->exit ?>
@@ -36,7 +36,7 @@

tutorial->common ?>

From dec97060a67c363cdd223bf5af325e2b1579c0c8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Aug 2019 16:29:51 +0800 Subject: [PATCH 10/11] * finish task #6205. --- module/product/model.php | 5 +++-- module/release/lang/zh-cn.php | 1 + module/release/model.php | 5 +++++ module/task/js/start.js | 2 +- module/testsuite/control.php | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index e514e67dfc..2206bcbb79 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -636,7 +636,7 @@ class productModel extends model { if(($plan->end != '0000-00-00' and strtotime($plan->end) - time() <= 0) or $plan->end == '2030-01-01') continue; $year = substr($plan->end, 0, 4); - $roadmap[$year][$plan->branch][] = $plan; + $roadmap[$year][$plan->branch][$plan->end] = $plan; $total++; } @@ -650,7 +650,7 @@ class productModel extends model foreach($releases as $release) { $year = substr($release->date, 0, 4); - $roadmap[$year][$release->branch][] = $release; + $roadmap[$year][$release->branch][$release->date] = $release; $total++; if($count > 0 and $total >= $count) break; @@ -664,6 +664,7 @@ class productModel extends model { foreach($branchRoadmaps as $branch => $roadmaps) { + krsort($roadmaps); $totalData = count($roadmaps); $rows = ceil($totalData / 8); $maxPerRow = ceil($totalData / $rows); diff --git a/module/release/lang/zh-cn.php b/module/release/lang/zh-cn.php index fb2a646e98..91903b68a1 100644 --- a/module/release/lang/zh-cn.php +++ b/module/release/lang/zh-cn.php @@ -28,6 +28,7 @@ $lang->release->confirmUnlinkStory = "您确认移除该需求吗?"; $lang->release->confirmUnlinkBug = "您确认移除该Bug吗?"; $lang->release->existBuild = '『版本』已经有『%s』这条记录了。您可以更改『发布名称』或者选择一个『版本』。'; $lang->release->noRelease = '暂时没有发布。'; +$lang->release->errorDate = '发布日期不能大于今天。'; $lang->release->basicInfo = '基本信息'; diff --git a/module/release/model.php b/module/release/model.php index bb22044618..1162d939dd 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -106,6 +106,11 @@ class releaseModel extends model $productID = (int)$productID; $branch = (int)$branch; $buildID = 0; + + /* Check date must be not more than today. */ + if($this->post->date > date('Y-m-d')) return dao::$errors[] = $this->lang->release->errorDate; + + /* Auto create build when release is not link build. */ if($this->post->build == false && $this->post->name) { $build = $this->dao->select('*')->from(TABLE_BUILD) diff --git a/module/task/js/start.js b/module/task/js/start.js index 1b64249543..42d34541d7 100644 --- a/module/task/js/start.js +++ b/module/task/js/start.js @@ -8,4 +8,4 @@ function checkLeft() if(!result) setTimeout(function() {$.enableForm()}, 500); return result; } -} \ No newline at end of file +} diff --git a/module/testsuite/control.php b/module/testsuite/control.php index cffacb98dd..f97162dd4d 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -659,6 +659,7 @@ class testsuite extends control $this->view->position[] = $this->lang->testsuite->view; $this->view->lib = $lib; + $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->actions = $this->loadModel('action')->getList('caselib', $libID); $this->display(); } From bd9e0ce1f6410a4535c727f9459e061ea3bbf5b9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Aug 2019 16:42:05 +0800 Subject: [PATCH 11/11] * finish task #6188. --- module/bug/css/create.css | 1 + 1 file changed, 1 insertion(+) diff --git a/module/bug/css/create.css b/module/bug/css/create.css index f1e616083b..f006a70179 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -38,6 +38,7 @@ html[lang='en'] #deadlineTd .input-group-addon{padding: 5px 18px} .title-group #severity + .chosen-container > .chosen-single {border-radius: 0!important;} .title-group #pri + .chosen-container > .chosen-single {border-top-left-radius: 0!important; border-bottom-left-radius: 0!important;} .title-group .has-icon-right{min-width:700px} +#mainContent .center-block{padding-bottom:40px;} #typeBox {width:180px;} #osBox {width:190px;}