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 1470 2011-07-07 15:43:28Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/pages/intro2.php $
15
 * @lastmodified    $Date: 2011-07-07 17:43:28 +0200 (Thu, 07 Jul 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 = $_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(is_writable($filename)) {
46
	if(file_put_contents($filename, utf8_encode($content))===false){
47
		$admin->print_error($MESSAGE['PAGES_NOT_SAVED']);
48
	} else {
49
		change_mode($filename);
50
		$admin->print_success($MESSAGE['PAGES']['INTRO_SAVED']);
51
	}
52
} else {
53
	$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
54
}
55

    
56
// Print admin footer
57
$admin->print_footer();
(7-7/21)