Ejemplo n.º 1
0
}
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$GLOBALS['pdo'] = $pdo;
ob_start();
include 'includes/FirePHPCore/fb.php';
/*
/*
* Load the Settings class
*/
require_once 'Settings_class.php';
$settings = new Settings($pdo);
$settings->load();
/*
 * Common functions
 */
require_once 'functions.php';
/*
 * Load the allowed file types list
 */
require_once 'FileTypes_class.php';
$filetypes = new FileTypes_class($pdo);
$filetypes->load();
// Set the revision directory. (relative to $dataDir)
$CONFIG['revisionDir'] = $GLOBALS['CONFIG']['dataDir'] . 'revisionDir/';
// Set the revision directory. (relative to $dataDir)
$CONFIG['archiveDir'] = $GLOBALS['CONFIG']['dataDir'] . 'archiveDir/';
$_GET = sanitizeme($_GET);
$_REQUEST = sanitizeme($_REQUEST);
$_POST = sanitizeme($_POST);
$_SERVER = sanitizeme($_SERVER);
$_FILES = sanitizeme($_FILES);
Ejemplo n.º 2
0
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
// check for valid session
session_start();
//print_r($_REQUEST);exit;
// includes
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
$user_obj = new User($_SESSION['uid'], $pdo);
$filetypes = new FileTypes_class($pdo);
//If the user is not an admin error out.
if (!$user_obj->isRoot() == true) {
    header('Location: error.php?ec=24');
    exit;
}
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'update') {
    draw_header(msg('label_filetypes'), $last_message);
    $filetypes->edit();
    draw_footer();
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'Save') {
    draw_header(msg('label_filetypes'), $last_message);
    if ($filetypes->save($_POST)) {
        $_POST['last_message'] = $GLOBALS['lang']['message_all_actions_successfull'];
    } else {
        $_POST['last_message'] = $GLOBALS['lang']['message_error_performing_action'];