Пример #1
0
/**
 *
 * @package    Max
 * @subpackage SimulationSuite
 */
function checkPermissions($aFiles)
{
    if (($aErrs = OX_DevToolbox::checkFilePermissions($aFiles)) !== true) {
        setcookie('schemaFile', '');
        setcookie('schemaPath', '');
        $errorMessage = join("<br />\n", $aErrs['errors']) . "<br /><br ><hr /><br />\n";
        if (isset($aErrs['fixes'])) {
            $errorMessage .= 'To fix, please execute the following commands:' . "<br /><br >\n" . join("<br />\n", $aErrs['fixes']);
        }
        die($errorMessage);
    }
}
Пример #2
0
}
if (empty($schemaPath) || empty($schemaFile)) {
    $schemaPath = '';
    //OX_CORE;
    $schemaFile = 'tables_core.xml';
}
// ensure correct directory format. $schemaPath requires trailing '/'. Using trailing DIRECTORY_SEPARATOR fails on Windows for reasons unknown
if (isset($schemaPath) && $schemaPath != '') {
    $schemaPath = OX::realPathRelative(urldecode($schemaPath));
    $schemaPath .= '/';
}
setcookie('schemaPath', $schemaPath);
setcookie('schemaFile', $schemaFile);
global $oaSchema;
$oaSchema = new Openads_Schema_Manager($schemaFile, '', $schemaPath);
if (is_array($aErrs = OX_DevToolbox::checkFilePermissions(array(PATH_DEV, PATH_VAR, MAX_PATH . $pluginPath)))) {
    setcookie('schemaFile', '');
    setcookie('schemaPath', '');
    $errorMessage = join("<br />\n", $aErrs['errors']) . "<br /><br ><hr /><br />\n" . 'To fix, please execute the following commands:' . "<br /><br >\n" . join("<br />\n", $aErrs['fixes']);
    die($errorMessage);
}
require_once PATH_DEV . '/lib/xajax.inc.php';
if (array_key_exists('btn_copy_final', $_POST)) {
    $oaSchema->createTransitional();
} else {
    if (array_key_exists('btn_schema_new', $_POST)) {
        $oaSchema->createNew($_POST['new_schema_name']);
    } else {
        if (array_key_exists('btn_delete_trans', $_POST)) {
            $oaSchema->deleteTransitional();
        } else {