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
 * @filesource		$HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/admin/users/save.php $
15
 * @lastmodified    $Date: 2011-01-10 13:21:47 +0100 (Mo, 10. Jan 2011) $
16
 *
17
 */
18 4 ryan
19
// Get posted content
20
if(!isset($_POST['content'])) {
21 558 Ruebenwurz
	header("Location: intro".PAGE_EXTENSION."");
22 286 stefan
	exit(0);
23 4 ryan
} else {
24 222 stefan
	$content = $_POST['content'];
25 4 ryan
}
26
27
// Create new admin object
28
require('../../config.php');
29
require_once(WB_PATH.'/framework/class.admin.php');
30
$admin = new admin('Pages', 'pages_intro');
31
32 368 Ruebenwurz
$content=$admin->strip_slashes($content);
33 222 stefan
34 4 ryan
// Include the WB functions file
35
require_once(WB_PATH.'/framework/functions.php');
36
37
// Write new content
38 558 Ruebenwurz
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
39 4 ryan
$handle = fopen($filename, 'w');
40
if(is_writable($filename)) {
41
	if(fwrite($handle, $content)) {
42
		fclose($handle);
43
		change_mode($filename, 'file');
44
		$admin->print_success($MESSAGE['PAGES']['INTRO_SAVED']);
45
	} else {
46
		fclose($handle);
47
		$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
48
	}
49
} else {
50
	$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
51
}
52
53
// Print admin footer
54
$admin->print_footer();
55
56 239 stefan
?>