1 |
4
|
ryan
|
<?php
|
2 |
|
|
|
3 |
47
|
stefan
|
// $Id$
|
4 |
4
|
ryan
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
915
|
Ruebenwurz
|
Copyright (C) 2004-2009, Ryan Djurovich
|
9 |
4
|
ryan
|
|
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 |
558
|
Ruebenwurz
|
header("Location: intro".PAGE_EXTENSION."");
|
29 |
286
|
stefan
|
exit(0);
|
30 |
4
|
ryan
|
} else {
|
31 |
222
|
stefan
|
$content = $_POST['content'];
|
32 |
4
|
ryan
|
}
|
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 |
368
|
Ruebenwurz
|
$content=$admin->strip_slashes($content);
|
40 |
222
|
stefan
|
|
41 |
4
|
ryan
|
// Include the WB functions file
|
42 |
|
|
require_once(WB_PATH.'/framework/functions.php');
|
43 |
|
|
|
44 |
|
|
// Write new content
|
45 |
558
|
Ruebenwurz
|
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
|
46 |
4
|
ryan
|
$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 |
239
|
stefan
|
?>
|