Project

General

Profile

1
<?php
2

    
3
// $Id: intro2.php 915 2009-01-21 19:27:01Z Ruebenwurzel $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

    
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

    
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

    
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

    
24
*/
25

    
26
// Get posted content
27
if(!isset($_POST['content'])) {
28
	header("Location: intro".PAGE_EXTENSION."");
29
	exit(0);
30
} else {
31
	$content = $_POST['content'];
32
}
33

    
34
// Create new admin object
35
require('../../config.php');
36
require_once(WB_PATH.'/framework/class.admin.php');
37
$admin = new admin('Pages', 'pages_intro');
38

    
39
$content=$admin->strip_slashes($content);
40

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

    
44
// Write new content
45
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
46
$handle = fopen($filename, 'w');
47
if(is_writable($filename)) {
48
	if(fwrite($handle, $content)) {
49
		fclose($handle);
50
		change_mode($filename, 'file');
51
		$admin->print_success($MESSAGE['PAGES']['INTRO_SAVED']);
52
	} else {
53
		fclose($handle);
54
		$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
55
	}
56
} else {
57
	$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
58
}
59

    
60
// Print admin footer
61
$admin->print_footer();
62

    
63
?>
(6-6/16)