--- a/punbb/admin_permissions.php Wed Jul 11 21:28:39 2007 -0400
+++ b/punbb/admin_permissions.php Thu Jul 12 01:04:01 2007 -0400
@@ -26,12 +26,15 @@
// Tell header.php to use the admin template
define('PUN_ADMIN_CONSOLE', 1);
-define('PUN_ROOT', './');
-require PUN_ROOT.'include/common.php';
+//define('PUN_ROOT', './');
+//require PUN_ROOT.'include/common.php';
+
+global $pun_db, $pun_user, $pun_config, $lang_common;
+
require PUN_ROOT.'include/common_admin.php';
-if ($pun_user['g_id'] > PUN_ADMIN)
+if ($pun_user['g_id'] < PUN_ADMIN)
message($lang_common['No permission']);
@@ -45,14 +48,14 @@
{
// Only update values that have changed
if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
- $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());
+ $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());
}
// Regenerate the config cache
require_once PUN_ROOT.'include/cache.php';
generate_config_cache();
- redirect('admin_permissions.php', 'Permissions updated. Redirecting …');
+ pun_redirect('admin_permissions.php', 'Permissions updated. Redirecting …');
}