Project

General

Profile

1
<?php
2
/**
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: intro2.php 1511 2011-09-14 17:24:09Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/pages/intro2.php $
15
 * @lastmodified    $Date: 2011-09-14 19:24:09 +0200 (Wed, 14 Sep 2011) $
16
 *
17
 */
18

    
19
// 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
// Get posted content
30
if(!isset($_POST['content'])) {
31
	header("Location: intro".PAGE_EXTENSION."");
32
	exit(0);
33
} else {
34
	$content = $admin->strip_slashes($_POST['content']);
35
}
36

    
37
// $content = $admin->strip_slashes($content);
38

    
39
// Include the WB functions file
40
require_once(WB_PATH.'/framework/functions.php');
41

    
42
$admin->print_header();
43
// Write new content
44
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
45
if(file_put_contents($filename, utf8_encode($content))===false){
46
	$admin->print_error($MESSAGE['PAGES_NOT_SAVED']);
47
} else {
48
	change_mode($filename);
49
	$admin->print_success($MESSAGE['PAGES']['INTRO_SAVED']);
50
}
51
if(!is_writable($filename)) {
52
	$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
53
}
54

    
55
// Print admin footer
56
$admin->print_footer();
(8-8/22)