Exemplo n.º 1
0
# Copyright (c) 2004-2011 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/** @define "BASE" "../../../../.." */
if (!defined('EXPONENT')) {
    exit('');
}
$errors = null;
$continue = URL_FULL . 'index.php?section=' . SITE_DEFAULT_SECTION;
expSession::clearAllUsersSessionCache();
$template = new template('importer', '_eql_results', $loc);
//GREP:UPLOADCHECK
if (!expFile::restoreDatabase($db, $_FILES['file']['tmp_name'], $errors)) {
    $template->assign('success', 0);
    $template->assign('errors', $errors);
} else {
    $template->assign('success', 1);
    $template->assign('continue', $continue);
}
$template->output();
Exemplo n.º 2
0
}
// PERM CHECK
$source_select = array();
$module = "containermodule";
$view = "_sourcePicker";
$clickable_mods = null;
// Show all
$dest = null;
if (expSession::is_set("source_select") && defined('SOURCE_SELECTOR')) {
    $source_select = expSession::get("source_select");
    $view = $source_select["view"];
    $module = $source_select["module"];
    $clickable_mods = $source_select["showmodules"];
    $dest = $source_select['dest'];
}
expSession::clearAllUsersSessionCache('containermodule');
$orphans = array();
foreach ($db->selectObjects("sectionref", "module='" . preg_replace('/[^A-Za-z0-9_]/', '', $_GET['module']) . "' AND refcount=0") as $orphan) {
    $obj = null;
    $loc = expCore::makeLocation($orphan->module, $orphan->source, $orphan->internal);
    if (class_exists($orphan->module)) {
        $modclass = $orphan->module;
        $mod = new $modclass();
        if (class_exists($modclass)) {
            ob_start();
            if (expModules::controllerExists($modclass)) {
                renderAction(array('controller' => $modclass, 'action' => 'showall', 'src' => $orphan->source));
            } else {
                $mod->show("Default", $loc);
            }
            $obj->output = ob_get_contents();
Exemplo n.º 3
0
        $section->sef_name = $router->encode($section->name);
    }
    if (!section::isValidName($section->sef_name)) {
        expValidator::failAndReturnToForm('You have invalid characters in the SEF Name field.');
    }
    if (section::isDuplicateName($section)) {
        expValidator::failAndReturnToForm(gt('The name specified in the SEF Name field is a duplicate of an existing page.'));
    }
    if (isset($section->id)) {
        if ($section->parent != $old_parent) {
            // Old_parent id was different than the new parent id.  Need to decrement the ranks
            // of the old children (after ours), and then add
            $section = section::changeParent($section, $old_parent, $section->parent);
        }
        // Existing section.  Update the database record.
        // The 'id=x' where clause is implicit with an updateObject
        $db->updateObject($section, 'section');
    } else {
        // Since this is new, we need to increment ranks, in case the user
        // added it in the middle of the level.
        $db->increment('section', 'rank', 1, 'rank >= ' . $section->rank . ' AND parent=' . $section->parent);
        // New section.  Insert a new database record.
        $section->id = $db->insertObject($section, 'section');
    }
    expSession::clearAllUsersSessionCache('navigationmodule');
    navigationmodule::checkForSectionalAdmins($section->id);
    // Go back to where we came from.  Probably the navigation manager.
    expHistory::back();
} else {
    echo SITE_403_HTML;
}
Exemplo n.º 4
0
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
$iloc = expCore::makeLocation($_GET['m'], @$_GET['s'], @$_GET['i']);
// Make sure that secref refcount is indeed 0.
$secref = $db->selectObject("sectionref", "module='" . $iloc->mod . "' AND source='" . $iloc->src . "' AND internal='" . $iloc->int . "'");
if ($secref && $secref->refcount == 0 && expPermissions::check("administrate", $iloc)) {
    // delete in location.
    $modclass = $iloc->mod;
    expSession::clearAllUsersSessionCache('containermodule');
    expSession::clearAllUsersSessionCache($iloc);
    //FIXME: more module/controller glue code
    if (expModules::controllerExists($modclass)) {
        $mod = new $modclass($iloc->src);
        $mod->delete_instance();
    } else {
        $mod = new $modclass();
        $mod->deleteIn($iloc);
    }
    $db->delete("sectionref", "module='" . $iloc->mod . "' AND source='" . $iloc->src . "' AND internal='" . $iloc->int . "'");
    expPermissions::revokeComplete($iloc);
}
expHistory::back();