source: extensions/comments_blacklist/admin.php @ 21172

Last change on this file since 21172 was 18651, checked in by mistic100, 12 years ago

handle empty file case, check COA and GuestBook

File size: 926 bytes
Line 
1<?php
2defined('COMM_BLACKLIST_PATH') or die('Hacking attempt!');
3 
4global $template, $page;
5
6// save config
7if (isset($_POST['save_config']))
8{
9  $conf['comments_blacklist'] = array(
10    'action' => $_POST['action'],
11    );
12   
13  file_put_contents(COMM_BLACKLIST_FILE, $_POST['content']);
14  conf_update_param('comments_blacklist', serialize($conf['comments_blacklist']));
15  array_push($page['infos'], l10n('Information data registered in database'));
16}
17 
18// template vars
19$template->assign($conf['comments_blacklist']);
20$template->assign(array(
21  'blacklist' => @file_get_contents(COMM_BLACKLIST_FILE),
22  'COMM_BLACKLIST_PATH'=> get_root_url() . COMM_BLACKLIST_PATH,
23  'COMM_BLACKLIST_ADMIN' => COMM_BLACKLIST_ADMIN,
24  ));
25 
26// send page content
27$template->set_filename('comm_blacklist_content', realpath(COMM_BLACKLIST_PATH . 'admin.tpl'));
28$template->assign_var_from_handle('ADMIN_CONTENT', 'comm_blacklist_content');
29
30?>
Note: See TracBrowser for help on using the repository browser.