Ejemplo n.º 1
0
$GO_SECURITY->authenticate();
//see if the user has access to this module
//for this to work there must be a module named 'example'
$GO_MODULES->authenticate('cms');
//load the CMS module class library
require $GO_MODULES->class_path . 'cms.class.inc';
$cms = new cms();
//get the language file
require $GO_LANGUAGE->get_language_file('cms');
$site_id = isset($_REQUEST['site_id']) ? $_REQUEST['site_id'] : 0;
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
$search_word_id = isset($_REQUEST['search_word_id']) ? $_REQUEST['search_word_id'] : 0;
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : 'index.php';
$root_publish_path = $GO_CONFIG->get_setting('cms_publish_path');
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $task == 'save_site') {
    $domain = $cms->prepare_domain(smart_addslashes(trim($_POST['domain'])));
    $name = smart_addslashes(trim($_POST['name']));
    if ($domain == '' || $name == '') {
        $feedback = '<p class="Error">' . $error_missing_field . '</p>';
    } else {
        if ($_POST['site_id'] > 0) {
            if (!($site = $cms->get_site($_POST['site_id']))) {
                $feedback = '<p class="Error">' . $strSaveError . '</p>';
            } else {
                $existing_site = $cms->get_site_by_domain($domain);
                if ($existing_site && $existing_site['id'] != $_POST['site_id']) {
                    $feedback = '<p class="Error">' . $cms_site_exists . '</p>';
                } else {
                    if (isset($_POST['secure'])) {
                        if ($site['acl_read'] == 0) {
                            if (!($acl_read = $GO_SECURITY->get_new_acl('cms read: ' . $domain))) {