1
|
<?php
|
2
|
/**
|
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: intro2.php 1471 2011-07-07 16:07:27Z Luisehahne $
|
14
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/pages/intro2.php $
|
15
|
* @lastmodified $Date: 2011-07-07 18:07:27 +0200 (Thu, 07 Jul 2011) $
|
16
|
*
|
17
|
*/
|
18
|
|
19
|
// Create new admin object
|
20
|
require('../../config.php');
|
21
|
require_once(WB_PATH.'/framework/class.admin.php');
|
22
|
$admin = new admin('Pages', 'pages_intro',false);
|
23
|
if (!$admin->checkFTAN())
|
24
|
{
|
25
|
$admin->print_header();
|
26
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
27
|
}
|
28
|
|
29
|
// Get posted content
|
30
|
if(!isset($_POST['content'])) {
|
31
|
header("Location: intro".PAGE_EXTENSION."");
|
32
|
exit(0);
|
33
|
} else {
|
34
|
$content = $_POST['content'];
|
35
|
}
|
36
|
|
37
|
$content = $admin->strip_slashes($content);
|
38
|
|
39
|
// Include the WB functions file
|
40
|
require_once(WB_PATH.'/framework/functions.php');
|
41
|
|
42
|
$admin->print_header();
|
43
|
// Write new content
|
44
|
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
|
45
|
if(file_put_contents($filename, utf8_encode($content))===false){
|
46
|
$admin->print_error($MESSAGE['PAGES_NOT_SAVED']);
|
47
|
} else {
|
48
|
change_mode($filename);
|
49
|
$admin->print_success($MESSAGE['PAGES']['INTRO_SAVED']);
|
50
|
}
|
51
|
if(!is_writable($filename)) {
|
52
|
$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']);
|
53
|
}
|
54
|
|
55
|
// Print admin footer
|
56
|
$admin->print_footer();
|