Project

General

Profile

1 4 ryan
<?php
2 1386 Luisehahne
/**
3
 *
4
 * @category        admin
5
 * @package         pages
6 1726 Luisehahne
 * @author          Ryan Djurovich,WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 1386 Luisehahne
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id$
13 1457 Luisehahne
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15 1386 Luisehahne
 *
16
 */
17 4 ryan
18 1470 Luisehahne
// Create new admin object
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
$admin = new admin('Pages', 'pages_intro',false);
22
if (!$admin->checkFTAN())
23
{
24
	$admin->print_header();
25
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
26
}
27
28 4 ryan
// Get posted content
29
if(!isset($_POST['content'])) {
30 558 Ruebenwurz
	header("Location: intro".PAGE_EXTENSION."");
31 286 stefan
	exit(0);
32 4 ryan
} else {
33 1511 Luisehahne
	$content = $admin->strip_slashes($_POST['content']);
34 4 ryan
}
35
36 1511 Luisehahne
// $content = $admin->strip_slashes($content);
37 4 ryan
38
// Include the WB functions file
39
require_once(WB_PATH.'/framework/functions.php');
40
41 1470 Luisehahne
$admin->print_header();
42 4 ryan
// Write new content
43 558 Ruebenwurz
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
44 1471 Luisehahne
if(file_put_contents($filename, utf8_encode($content))===false){
45
	$admin->print_error($MESSAGE['PAGES_NOT_SAVED']);
46 4 ryan
} else {
47 1471 Luisehahne
	change_mode($filename);
48 1726 Luisehahne
	$admin->print_success($MESSAGE['PAGES_INTRO_SAVED']);
49 1471 Luisehahne
}
50
if(!is_writable($filename)) {
51 1726 Luisehahne
	$admin->print_error($MESSAGE['PAGES_INTRO_NOT_WRITABLE']);
52 4 ryan
}
53
54
// Print admin footer
55
$admin->print_footer();