24 |
24 |
25 |
25 |
26 // Tell header.php to use the admin template |
26 // Tell header.php to use the admin template |
27 define('PUN_ADMIN_CONSOLE', 1); |
27 define('PUN_ADMIN_CONSOLE', 1); |
28 |
28 |
29 define('PUN_ROOT', './'); |
29 //define('PUN_ROOT', './'); |
30 require PUN_ROOT.'include/common.php'; |
30 //require PUN_ROOT.'include/common.php'; |
|
31 |
|
32 global $pun_db, $pun_user, $pun_config, $lang_common; |
|
33 |
31 require PUN_ROOT.'include/common_admin.php'; |
34 require PUN_ROOT.'include/common_admin.php'; |
32 |
35 |
33 |
36 |
34 if ($pun_user['g_id'] > PUN_ADMIN) |
37 if ($pun_user['g_id'] < PUN_ADMIN) |
35 message($lang_common['No permission']); |
38 message($lang_common['No permission']); |
36 |
39 |
37 |
40 |
38 if (isset($_POST['form_sent'])) |
41 if (isset($_POST['form_sent'])) |
39 { |
42 { |
43 |
46 |
44 while (list($key, $input) = @each($form)) |
47 while (list($key, $input) = @each($form)) |
45 { |
48 { |
46 // Only update values that have changed |
49 // Only update values that have changed |
47 if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input) |
50 if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input) |
48 $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); |
51 $pun_db->query('UPDATE '.$pun_db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$pun_db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $pun_db->error()); |
49 } |
52 } |
50 |
53 |
51 // Regenerate the config cache |
54 // Regenerate the config cache |
52 require_once PUN_ROOT.'include/cache.php'; |
55 require_once PUN_ROOT.'include/cache.php'; |
53 generate_config_cache(); |
56 generate_config_cache(); |
54 |
57 |
55 redirect('admin_permissions.php', 'Permissions updated. Redirecting …'); |
58 pun_redirect('admin_permissions.php', 'Permissions updated. Redirecting …'); |
56 } |
59 } |
57 |
60 |
58 |
61 |
59 $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions'; |
62 $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions'; |
60 require PUN_ROOT.'header.php'; |
63 require PUN_ROOT.'header.php'; |