function exponent_permissions_clear()
{
    exponent_sessions_unset("permissions");
}
 function toHTML($form_id)
 {
     // Form validation script
     if ($this->validationScript != "") {
         $this->scripts[] = $this->validationScript;
         $this->controls["submit"]->validateJS = "validate(this.form)";
     }
     // Persistent Form Data extension
     $formError = "";
     if (exponent_sessions_isset("last_POST")) {
         // We have cached POST data.  Use it to update defaults.
         $last_POST = exponent_sessions_get("last_POST");
         foreach (array_keys($this->controls) as $name) {
             // may need to look to control a la parseData
             $this->controls[$name]->default = @$last_POST[$name];
         }
         $formError = @$last_POST['_formError'];
         exponent_sessions_unset("last_POST");
     }
     $html = "<!-- Form Object '" . $this->name . "' -->\r\n";
     $html = "<!-- initialize eXp.Forms namespace -->\r\n";
     $html .= "<script type=\"text/javascript\" src=\"" . PATH_RELATIVE . "subsystems/forms/lib/js/initNS.js\"></script>\r\n";
     $html .= "<script type=\"text/javascript\" src=\"" . PATH_RELATIVE . "subsystems/forms/js/inputfilters.js.php\"></script>\r\n";
     foreach ($this->scripts as $name => $script) {
         $html .= "<script type=\"text/javascript\" src=\"{$script}\"></script>\r\n";
     }
     $html .= $formError;
     $html .= "<form name=\"" . $this->name . "\" method=\"" . $this->method . "\" action=\"" . $this->action . "\" enctype=\"" . $this->enctype . "\">\r\n";
     foreach ($this->meta as $name => $value) {
         $html .= "<input type=\"hidden\" name=\"{$name}\" id=\"{$name}\" value=\"{$value}\" />\r\n";
     }
     $html .= "<table cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\r\n";
     $rank = 0;
     foreach ($this->controlIdx as $name) {
         $html .= "<tr><td valign=\"top\">" . $this->controlLbl[$name] . "</td><td style='padding-left: 5px;' valign=\"top\">";
         $html .= $this->controls[$name]->controlToHTML($name) . "\r\n";
         $html .= "<td>";
         if ($rank != count($this->controlIdx) - 1) {
             $html .= '<a href="?module=formbuilder&action=order_controls&p=' . $form_id . '&a=' . $rank . '&b=' . ($rank + 1) . '">';
             $html .= "<img border='0' src='" . ICON_RELATIVE . "down.png' />";
             $html .= '</a>';
         } else {
             $html .= "<img src='" . ICON_RELATIVE . "down.disabled.png' />";
         }
         $html .= "&nbsp;";
         if ($rank != 0) {
             $html .= '<a href="?module=formbuilder&action=order_controls&p=' . $form_id . '&a=' . $rank . '&b=' . ($rank - 1) . '">';
             $html .= "<img border='0' src='" . ICON_RELATIVE . "up.png' />";
             $html .= '</a>';
         } else {
             $html .= "<img src='" . ICON_RELATIVE . "up.disabled.png' />";
         }
         $html .= "&nbsp;&nbsp;";
         if (!$this->controls[$name]->_readonly) {
             $html .= '<a href="?module=formbuilder&action=edit_control&id=' . $this->controls[$name]->_id . '&form_id=' . $form_id . '">';
             $html .= '<img border="0" src="' . ICON_RELATIVE . 'edit.png" />';
             $html .= '</a>';
         } else {
             $html .= '<img border="0" src="' . ICON_RELATIVE . 'edit.disabled.png" />';
         }
         $html .= '&nbsp;';
         if (!$this->controls[$name]->_readonly && $this->controls[$name]->_controltype != 'htmlcontrol') {
             $html .= '<a href="?module=formbuilder&action=delete_control&id=' . $this->controls[$name]->_id . '" onClick="return confirm(\'Are you sure you want to delete this control? All data associated with it will be removed from the database!\');">';
         } else {
             $html .= '<a href="?module=formbuilder&action=delete_control&id=' . $this->controls[$name]->_id . '" onClick="return confirm(\'Are you sure you want to delete this?\');">';
         }
         $html .= '<img border="0" src="' . ICON_RELATIVE . 'delete.png" />';
         $html .= '</a>';
         $html .= "</td>";
         $html .= "</td></tr>";
         $rank++;
     }
     $html .= "<tr><td width='5%'></td><td wdith='90%'><td></td width='5%'></tr>\r\n";
     $html .= "</table>\r\n";
     $html .= "</form>\r\n";
     return $html;
 }
            } else {
                $strength_error = exponent_security_checkPasswordStrength($_POST['username'], $_POST['pass1']);
                if ($strength_error != '') {
                    $post = $_POST;
                    unset($post['pass1']);
                    unset($post['pass2']);
                    $post['_formError'] = sprintf($i18n['not_strong_enough'], $strength_error);
                    exponent_sessions_set('last_POST', $post);
                    header('Location: ' . $_SERVER['HTTP_REFERER']);
                } else {
                    // Finally, check the capcha
                    if (SITE_USE_CAPTCHA && strtoupper($_POST['captcha_string']) != $capcha_real) {
                        $post = $_POST;
                        unset($post['captcha_string']);
                        $post['_formError'] = $i18n['bad_captcha'];
                        exponent_sessions_set('last_POST', $post);
                        header('Location: ' . $_SERVER['HTTP_REFERER']);
                    } else {
                        exponent_sessions_unset('capcha_string');
                        $u = exponent_users_create($_POST, null);
                        $u = exponent_users_saveProfileExtensions($_POST, $u, true);
                        exponent_users_login($_POST['username'], $_POST['pass1']);
                        exponent_flow_redirect();
                    }
                }
            }
        }
    }
} else {
    echo SITE_403_HTML;
}
Esempio n. 4
0
 function toHTML()
 {
     // Form validation script
     if ($this->validationScript != "") {
         $this->scripts[] = $this->validationScript;
         $this->controls["submit"]->validateJS = "validate(this.form)";
     }
     // Persistent Form Data extension
     $formError = "";
     if (exponent_sessions_isset("last_POST")) {
         // We have cached POST data.  Use it to update defaults.
         $last_POST = exponent_sessions_get("last_POST");
         foreach (array_keys($this->controls) as $name) {
             // may need to look to control a la parseData
             $this->controls[$name]->default = @$last_POST[$name];
             $this->controls[$name]->inError = 1;
             // Status flag for controls that need to do some funky stuff.
         }
         $formError = @$last_POST['_formError'];
         exponent_sessions_unset("last_POST");
     }
     $html = "<!-- Form Object '" . $this->name . "' -->\r\n";
     $html .= "<script type=\"text/javascript\" src=\"" . PATH_RELATIVE . "subsystems/forms/js/inputfilters.js.php\"></script>\r\n";
     foreach ($this->scripts as $name => $script) {
         $html .= "<script type=\"text/javascript\" src=\"{$script}\"></script>\r\n";
     }
     $html .= '<div class="error">' . $formError . '</div>';
     $html .= "<form name=\"" . $this->name . "\" method=\"" . $this->method . "\" action=\"" . $this->action . "\" enctype=\"" . $this->enctype . "\">\r\n";
     foreach ($this->meta as $name => $value) {
         $html .= "<input type=\"hidden\" name=\"{$name}\" id=\"{$name}\" value=\"{$value}\" />\r\n";
     }
     $html .= "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n";
     foreach ($this->controlIdx as $name) {
         $html .= $this->controls[$name]->toHTML($this->controlLbl[$name], $name) . "\r\n";
     }
     $html .= "<tr><td width='5%'></td><td width='95%'></td></tr>\r\n";
     $html .= "</table>\r\n";
     $html .= "</form>\r\n";
     return $html;
 }
Esempio n. 5
0
# 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
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
if (!defined('SYS_USERS')) {
    require_once 'subsystems/users.php';
}
exponent_users_logout();
exponent_permissions_clear();
exponent_sessions_unset('uilevel');
if (isset($_SESSION['nav_cache']['kids'])) {
    unset($_SESSION['nav_cache']['kids']);
}
if (isset($_SESSION['containers_cache'])) {
    unset($_SESSION['containers_cache']);
}
if (isset($_SESSION['image_cache'])) {
    unset($_SESSION['image_cache']);
}
if (isset($_SESSION['resource_cache'])) {
    unset($_SESSION['resource_cache']);
}
exponent_flow_redirect();
define('SCRIPT_FILENAME', 'edit_page.php');
ob_start();
include_once '../../../exponent.php';
if (!defined('SYS_THEME')) {
    include_once BASE . 'subsystems/theme.php';
}
$id = -1;
if (isset($_GET['sitetemplate_id'])) {
    exponent_sessions_set('sitetemplate_id', intval($_GET['sitetemplate_id']));
    $id = intval($_GET['sitetemplate_id']);
} else {
    if (exponent_sessions_isset('sitetemplate_id')) {
        $id = exponent_sessions_get('sitetemplate_id');
    }
}
$template = $db->selectObject('section_template', 'id=' . $id);
$page = $template && $template->subtheme != '' && is_readable(BASE . 'themes/' . DISPLAY_THEME . '/subthemes/' . $template->subtheme . '.php') ? 'themes/' . DISPLAY_THEME . '/subthemes/' . $template->subtheme . '.php' : 'themes/' . DISPLAY_THEME . '/index.php';
$i18n = exponent_lang_loadFile('modules/NavigationModule/actions/edit_page.php');
exponent_sessions_set('themeopt_override', array('src_prefix' => '@st' . $id, 'ignore_mods' => array('NavigationModule', 'LoginModule'), 'mainpage' => PATH_RELATIVE . 'modules/NavigationModule/actions/edit_page.php', 'backlinktext' => $i18n['back']));
#define('PREVIEW_READONLY',1);
$REDIRECTIONPATH = 'section_template';
if ($user && $user->is_acting_admin == 1) {
    if (is_readable(BASE . $page)) {
        include_once BASE . $page;
    } else {
        echo sprintf($i18n['err_not_readable'], BASE . $page);
    }
    exponent_sessions_unset('themeopt_override');
} else {
    echo SITE_403_HTML;
}
Esempio n. 7
0
#
# 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
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
exponent_sessions_unset('installer_config');
$i18n = exponent_lang_loadFile('install/pages/final.php');
?>
<h2 id="subtitle"><?php 
echo $i18n['subtitle'];
?>
</h2>
<?php 
unlink(BASE . 'install/not_configured');
if (file_exists(BASE . 'install/not_configured')) {
    echo '<br /><br />';
    echo '<span style="color: red">' . $i18n['no_remove'] . '</span>';
}
?>
<br /><br />
<?php 
Esempio n. 8
0
# 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
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
$dest_dir = exponent_sessions_get('dest_dir');
$files = exponent_sessions_get('files_data');
if (!defined('SYS_FILES')) {
    require_once BASE . 'subsystems/files.php';
}
if (!file_exists(BASE . 'files')) {
    mkdir(BASE . 'files', 0777);
}
foreach (array_keys($files) as $mod) {
    exponent_files_copyDirectoryStructure($dest_dir . '/files/' . $mod, BASE . 'files/' . $mod);
    foreach (array_keys($files[$mod][1]) as $file) {
        copy($dest_dir . '/files/' . $mod . '/' . $file, BASE . 'files/' . $mod . '/' . $file);
    }
}
exponent_sessions_unset('dest_dir');
exponent_sessions_unset('files_data');
exponent_files_removeDirectory($dest_dir);
$template = new template('importer', '_files_final');
$template->output();