* Adjust codes.

This commit is contained in:
caoyanyi
2022-03-23 11:32:56 +08:00
parent 39fbdad08a
commit 203a3607d8
2 changed files with 7 additions and 3 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(empty($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 = strip_tags($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(!is_writable($fullPath) or ($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;