Project

General

Profile

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