Revision 1470
Added by Luisehahne over 14 years ago
| intro2.php | ||
|---|---|---|
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 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 |
|
|
| 19 | 29 |
// Get posted content |
| 20 | 30 |
if(!isset($_POST['content'])) {
|
| 21 | 31 |
header("Location: intro".PAGE_EXTENSION."");
|
| ... | ... | |
| 24 | 34 |
$content = $_POST['content']; |
| 25 | 35 |
} |
| 26 | 36 |
|
| 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');
|
|
| 37 |
$content = $admin->strip_slashes($content); |
|
| 31 | 38 |
|
| 32 |
$content=$admin->strip_slashes($content); |
|
| 33 |
|
|
| 34 | 39 |
// Include the WB functions file |
| 35 | 40 |
require_once(WB_PATH.'/framework/functions.php'); |
| 36 | 41 |
|
| 42 |
$admin->print_header(); |
|
| 37 | 43 |
// Write new content |
| 38 | 44 |
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION; |
| 39 |
$handle = fopen($filename, 'w'); |
|
| 40 | 45 |
if(is_writable($filename)) {
|
| 41 |
if(fwrite($handle, $content)) {
|
|
| 42 |
fclose($handle); |
|
| 43 |
change_mode($filename, 'file'); |
|
| 46 |
if(file_put_contents($filename, utf8_encode($content))===false){
|
|
| 47 |
$admin->print_error($MESSAGE['PAGES_NOT_SAVED']); |
|
| 48 |
} else {
|
|
| 49 |
change_mode($filename); |
|
| 44 | 50 |
$admin->print_success($MESSAGE['PAGES']['INTRO_SAVED']); |
| 45 |
} else {
|
|
| 46 |
fclose($handle); |
|
| 47 |
$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']); |
|
| 48 | 51 |
} |
| 49 | 52 |
} else {
|
| 50 | 53 |
$admin->print_error($MESSAGE['PAGES']['INTRO_NOT_WRITABLE']); |
| ... | ... | |
| 52 | 55 |
|
| 53 | 56 |
// Print admin footer |
| 54 | 57 |
$admin->print_footer(); |
| 55 |
|
|
| 56 |
?> |
|
Also available in: Unified diff
languages Typo fix (Tks to pcwacht)
update intro, fixed saving
fixed install/save.php (Tks to pcwacht)