# 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('');
}
if (exponent_permissions_check('manage_core', exponent_core_makeLocation('SharedCoreModule'))) {
    $i18n = exponent_lang_loadFile('modules/SharedCoreModule/actions/save_core.php');
    $core = null;
    if (isset($_POST['id'])) {
        $core = $db->selectObject('sharedcore_core', 'id=' . intval($_POST['id']));
    }
    $core = sharedcore_core::update($_POST, $core);
    $existing = $db->countObjects('sharedcore_core', "path='" . $core->path . "'");
    if ($existing && !isset($core->id)) {
        $post = $_POST;
        $post['_formError'] = sprintf($i18n['core_exists'], $core->path);
        exponent_sessions_set('last_POST', $post);
        header('Location: ' . $_SERVER['HTTP_REFERER']);
        exit('Redirecting...');
    }
    if (substr($core->path, -1, 1) != '/') {
        $core->path .= '/';
    }
    if (file_exists($core->path . 'exponent_version.php')) {
        if (isset($core->id)) {
            $db->updateObject($core, 'sharedcore_core');
        } else {
示例#2
0
# for more details.
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: edit_core.php,v 1.6 2005/04/26 04:42:00 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
if (pathos_permissions_check('manage_core', pathos_core_makeLocation('sharedcoremodule'))) {
    $core = null;
    if (isset($_GET['id'])) {
        $core = $db->selectObject('sharedcore_core', 'id=' . $_GET['id']);
    }
    $form = sharedcore_core::form($core);
    $form->meta('module', 'sharedcoremodule');
    $form->meta('action', 'save_core');
    $template = new template('sharedcoremodule', '_form_editCore');
    $template->assign('is_edit', isset($core->id) ? 1 : 0);
    $template->assign('form_html', $form->toHTML());
    $template->output();
} else {
    echo SITE_403_HTML;
}