示例#1
0
}
$iModuleId = $this->oDb->getOne("SELECT `ID` FROM `sys_modules` WHERE `uri` = 'map_profiles'");
if ($iModuleId && true === $mixCheckResult) {
    $mixCheckResult = $sConditionalSuccess . "'Profiles Map' module is replaced with new 'World Maps' module, you need to uninstall 'Profiles Map' module.";
}
$iModuleId = $this->oDb->getOne("SELECT `ID` FROM `sys_modules` WHERE `uri` = 'open_social'");
if ($iModuleId && true === $mixCheckResult) {
    $mixCheckResult = $sConditionalSuccess . "'Open Social' module is removed, you need to uninstall this module.";
}
$iModuleId = $this->oDb->getOne("SELECT `ID` FROM `sys_modules` WHERE `uri` = 'data_migration'");
if ($iModuleId && true === $mixCheckResult) {
    $mixCheckResult = $sConditionalSuccess . "'Data Migration from Dolphin 6.1.6' module is removed, you need to uninstall this module.";
}
bx_import('BxDolIO');
$oBxDolIO = new BxDolIO();
$isWritable = $oBxDolIO->isWritable('sitemap.xml');
if (!$isWritable && true === $mixCheckResult) {
    $mixCheckResult = $sConditionalSuccess . "'sitemap.xml' file is not writable, make it writable and try again";
}
$iModuleId = $this->oDb->getOne("SELECT `ID` FROM `sys_modules` WHERE `uri` = 'profiler'");
$isWritable = $oBxDolIO->isWritable('modules/boonex/profiler/log');
if ($iModuleId && !$isWritable && true === $mixCheckResult) {
    $mixCheckResult = $sConditionalSuccess . "'modules/boonex/profiler/log' directory is not writable, make it writable and try again";
}
$iModuleId = $this->oDb->getOne("SELECT `ID` FROM `sys_modules` WHERE `uri` = 'sites'");
$isWritable = $oBxDolIO->isWritable('modules/boonex/sites/data/images/thumbs');
if ($iModuleId && !$isWritable && true === $mixCheckResult) {
    $mixCheckResult = $sConditionalSuccess . "'modules/boonex/sites/data/images/thumbs' directory is not writable, make it writable and try again";
}
$iModuleId = $this->oDb->getOne("SELECT `ID` FROM `sys_modules` WHERE `uri` = 'forum'");
$isFileExists = file_exists(BX_DIRECTORY_PATH_MODULES . 'boonex/forum/classes/en') || file_exists(BX_DIRECTORY_PATH_MODULES . 'boonex/forum/js/en') || file_exists(BX_DIRECTORY_PATH_MODULES . 'boonex/forum/layout/base_en') || file_exists(BX_DIRECTORY_PATH_MODULES . 'boonex/forum/layout/uni_en');
示例#2
0
function checkPreInstallPermission(&$sError)
{
    global $aTemporalityWritableFolders;
    $sFoldersErr = $sFilesErr = $sErrorMessage = '';
    $oBxDolIO = new BxDolIO();
    require_once '../inc/classes/BxDolAdminTools.php';
    $oAdmTools = new BxDolAdminTools();
    $aInstallDirsMerged = array_merge($aTemporalityWritableFolders, $oAdmTools->aInstallDirs);
    foreach ($aInstallDirsMerged as $sFolder) {
        if (!$oBxDolIO->isWritable($sFolder)) {
            $sFoldersErr .= '&nbsp;&nbsp;&nbsp;' . $sFolder . ';<br />';
        }
    }
    foreach ($oAdmTools->aFlashDirs as $sFolder) {
        if (!$oBxDolIO->isWritable($sFolder)) {
            $sFoldersErr .= '&nbsp;&nbsp;&nbsp;' . $sFolder . ';<br />';
        }
    }
    if (strlen($sFoldersErr)) {
        $sError = 'error';
        $sErrorMessage .= '<strong>The following directories have inappropriate permissions</strong>:<br />' . $sFoldersErr;
    }
    foreach ($oAdmTools->aInstallFiles as $sFile) {
        if (!$oBxDolIO->isWritable($sFile)) {
            $sFilesErr .= '&nbsp;&nbsp;&nbsp;' . $sFile . ';<br /> ';
        }
    }
    foreach ($oAdmTools->aFlashFiles as $sFile) {
        if (strpos($sFile, 'ffmpeg') === false) {
            if (!$oBxDolIO->isWritable($sFile)) {
                $sFilesErr .= '&nbsp;&nbsp;&nbsp;' . $sFile . ';<br /> ';
            }
        } else {
            if (!$oBxDolIO->isExecutable($sFile)) {
                $sFilesErr .= '&nbsp;&nbsp;&nbsp;' . $sFile . ';<br /> ';
            }
        }
    }
    if (strlen($sFilesErr)) {
        $sError = 'error';
        $sErrorMessage .= '<strong>The following files have inappropriate permissions</strong>:<br />' . $sFilesErr;
    }
    return $sErrorMessage;
}