Merge branch 'cyy_11655' into 'master'
* Fix bug #11655 and add repo create check. See merge request easycorp/zentaopms!2590
This commit is contained in:
@@ -195,7 +195,7 @@
|
||||
<?php endif;?>
|
||||
<td class="c-name text-left table-nest-title" title='<?php echo $product->name?>'>
|
||||
<?php
|
||||
$productLink = html::a($this->createLink('product', 'browse', 'product=' . $product->id), $product->name);
|
||||
$productLink = html::a($this->createLink('product', 'browse', 'productID=' . $product->id), $product->name);
|
||||
echo "<span class='table-nest-icon icon icon-product'></span>" . $productLink;
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -1151,6 +1151,12 @@ class repoModel extends model
|
||||
if(!$this->config->features->checkClient) return true;
|
||||
if(!$this->post->client) return true;
|
||||
|
||||
if(strpos($this->post->client, ' '))
|
||||
{
|
||||
dao::$errors['client'] = $this->lang->repo->error->clientPath;
|
||||
return false;
|
||||
}
|
||||
|
||||
$clientVersionFile = $this->session->clientVersionFile;
|
||||
if(empty($clientVersionFile))
|
||||
{
|
||||
|
||||
@@ -1269,7 +1269,7 @@ class userModel extends model
|
||||
$sessionFails = (int)$this->session->loginFails;
|
||||
$sessionFails += 1;
|
||||
$this->session->set('loginFails', $sessionFails);
|
||||
if($sessionFails >= $this->config->user->failTimes) $this->session->set('loginLocked', date('Y-m-d H:i:s'));
|
||||
if($sessionFails >= $this->config->user->failTimes) $this->session->set("{$account}.loginLocked", date('Y-m-d H:i:s'));
|
||||
|
||||
$user = $this->dao->select('fails')->from(TABLE_USER)->where('account')->eq($account)->fetch();
|
||||
if(empty($user)) return 0;
|
||||
@@ -1300,7 +1300,7 @@ class userModel extends model
|
||||
*/
|
||||
public function checkLocked($account)
|
||||
{
|
||||
if($this->session->loginLocked and (time() - strtotime($this->session->loginLocked)) <= $this->config->user->lockMinutes * 60) return true;
|
||||
if($this->session->{"{$account}.loginLocked"} and (time() - strtotime($this->session->{"{$account}.loginLocked"})) <= $this->config->user->lockMinutes * 60) return true;
|
||||
|
||||
$user = $this->dao->select('locked')->from(TABLE_USER)->where('account')->eq($account)->fetch();
|
||||
if(empty($user)) return false;
|
||||
@@ -1321,7 +1321,7 @@ class userModel extends model
|
||||
$this->dao->update(TABLE_USER)->set('fails')->eq(0)->set('locked')->eq('0000-00-00 00:00:00')->where('account')->eq($account)->exec();
|
||||
|
||||
unset($_SESSION['loginFails']);
|
||||
unset($_SESSION['loginLocked']);
|
||||
unset($_SESSION["{$account}.loginLocked"]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user