Project

General

Profile

1
<?php
2

    
3
// $Id: intro2.php 222 2005-11-19 14:51:03Z stefan $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2005, 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.php");
29
} else {
30
	$content = $_POST['content'];
31
}
32

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

    
38
$content=htmlspecialchars($admin->strip_slashes($content));
39

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

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

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

    
62
?>
(6-6/19)