This commit is contained in:
tianshujie98
2021-06-09 13:12:31 +08:00
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1411,7 +1411,7 @@ EOD;
$diff = '';
if(substr_count($value, "\n") > 1 or
substr_count($old->$key, "\n") > 1 or
strpos('name,title,desc,spec,steps,content,digest,verify,report,analysis,summary,prevention,resolution', strtolower($key)) !== false)
strpos('name,title,desc,spec,steps,content,digest,verify,report,definition,analysis,summary,prevention,resolution', strtolower($key)) !== false)
{
$diff = commonModel::diff($old->$key, $value);
}
+3 -1
View File
@@ -175,14 +175,16 @@ class userModel extends model
* Get roles for some users.
*
* @param string $users
* @param bool $withRole
* @access public
* @return array
*/
public function getUserRoles($users)
public function getUserRoles($users, $withRole = false)
{
$this->app->loadLang('user');
$users = $this->dao->select('account, role')->from(TABLE_USER)->where('account')->in($users)->fetchPairs();
if(!$users) return array();
if($withRole) return $users;
foreach($users as $account => $role) $users[$account] = zget($this->lang->user->roleList, $role, $role);
return $users;