Merge branch 'fixbug_cyy'

This commit is contained in:
liyuchun
2022-03-23 11:37:35 +08:00
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -502,10 +502,14 @@ class installModel extends model
*/
public function grantPriv()
{
$data = fixer::input('post')
->stripTags('company')
->get();
$requiredFields = explode(',', $this->config->install->step5RequiredFields);
foreach($requiredFields as $field)
{
if($this->post->{$field} == '')
if(empty($data->{$field}))
{
dao::$errors[] = $this->lang->install->errorEmpty[$field];
return false;
@@ -514,7 +518,7 @@ class installModel extends model
/* Insert a company. */
$company = new stdclass();
$company->name = $this->post->company;
$company->name = $data->company;
$company->admins = ",{$this->post->account},";
$this->dao->insert(TABLE_COMPANY)->data($company)->autoCheck()->exec();
if(!dao::isError())
+1 -1
View File
@@ -1260,7 +1260,7 @@ class upgradeModel extends model
if(file_exists($fullPath))
{
$isDir = is_dir($fullPath);
if(($isDir and !$zfile->removeDir($fullPath)) or
if(!is_writable($fullPath) or ($isDir and !$zfile->removeDir($fullPath)) or
(!$isDir and !$zfile->removeFile($fullPath)))
{
$result[] = 'rm -f ' . ($isDir ? '-r ' : '') . $fullPath;
+1 -1
View File
@@ -126,7 +126,7 @@ class userModel extends model
}
else
{
$firstLetter = ucfirst(substr($user->account, 0, 1)) . ':';
$firstLetter = ucfirst(mb_substr($user->account, 0, 1)) . ':';
if(strpos($params, 'noletter') !== false or !empty($this->config->isINT)) $firstLetter = '';
$users[$account] = $firstLetter . (($user->deleted and strpos($params, 'realname') === false) ? $user->account : ($user->realname ? $user->realname : $user->account));
}