Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         pages
6
 * @author          Ryan Djurovich,WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @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: intro2.php 1726 2012-08-30 04:38:19Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/pages/intro2.php $
14
 * @lastmodified    $Date: 2012-08-30 06:38:19 +0200 (Thu, 30 Aug 2012) $
15
 *
16
 */
17

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

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

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

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

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