The "Disable Portal" feature seems to be good. Tested, fixed the lang variables and merged over.

This commit is contained in:
Kevin
2008-10-04 22:12:10 +00:00
parent 9c1bf92d0a
commit 2a944a9caf
6 changed files with 46 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ class acp_portal
'title' => 'ACP_PORTAL_GENERAL_INFO',
'vars' => array(
'legend1' => 'ACP_PORTAL_GENERAL_SETTINGS',
'portal_enable' => array('lang' => 'PORTAL_ENABLE' , 'validate' => 'bool', 'type' => 'radio:yes_no' , 'explain' => true),
'portal_leaders_ext' => array('lang' => 'PORTAL_LEADERS_EXT' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_birthdays_ahead' => array('lang' => 'PORTAL_BIRTHDAYS_AHEAD' , 'validate' => 'int' , 'type' => 'text:3:3' , 'explain' => true),
'portal_forum_index' => array('lang' => 'PORTAL_FORUM_INDEX' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),

View File

@@ -54,6 +54,7 @@ INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_link
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_show_announcements_replies_views', '1');
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_show_news_replies_views', '1');
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_welcome_guest', '1');
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_enable', '1');
# Inserts who have to be checked at a later stage of the block pallet feature #
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_leaders_ext', '0');

View File

@@ -73,4 +73,8 @@ $sql_update['1.0.0RC3'] = array(
"INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_show_news_replies_views', '1');",
);
$sql_update['1.0.3'] = array(
"INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_enable', '1');",
);
?>

View File

@@ -44,8 +44,8 @@ $lang = array_merge($lang, array(
'ACP_PORTAL_VERSION' => '<strong>Board3 Portal Version v%s</strong>',
'ACP_PORTAL_GENERAL_SETTINGS' => 'Allgemeine Einstellungen',
'ACP_PORTAL_GENERAL_SETTINGS_EXPLAIN' => 'Hier kannst du die Haupteinstellungen vornehmen.',
'ACP_PORTAL_ENABLE' => 'Portal aktivieren',
'ACP_PORTAL_ENABLE_EXPLAIN' => 'Wenn deaktiviert, wird das komplette Portal abgeschaltet.',
'PORTAL_ENABLE' => 'Portal aktivieren',
'PORTAL_ENABLE_EXPLAIN' => 'Wenn deaktiviert, wird das komplette Portal abgeschaltet.',
'PORTAL_ADVANCED_STAT' => 'Erweiterte Statistik',
'PORTAL_ADVANCED_STAT_EXPLAIN' => 'Diesen Block auf dem Portal anzeigen.',
'PORTAL_LEADERS' => 'Team',

View File

@@ -45,6 +45,8 @@ $lang = array_merge($lang, array(
'ACP_PORTAL_VERSION' => '<strong>Board3 Portal Version v%s</strong>',
'ACP_PORTAL_GENERAL_SETTINGS' => 'General settings',
'ACP_PORTAL_GENERAL_SETTINGS_EXPLAIN' => 'Here you can change your general and certain specific options.',
'PORTAL_ENABLE' => 'Enable Portal',
'PORTAL_ENABLE_EXPLAIN' => 'Turns the whole portal off.',
'PORTAL_ADVANCED_STAT' => 'Advanced statistics block',
'PORTAL_ADVANCED_STAT_EXPLAIN' => 'Display this block on the portal.',
'PORTAL_LEADERS' => 'Leaders / Team block',

View File

@@ -22,6 +22,42 @@ include($phpbb_root_path . 'portal/includes/functions.'.$phpEx);
$portal_config = obtain_portal_config();
if (!$portal_config['portal_enable'])
{
// Redirect the user to the installer
// We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
// available as used by the redirect function
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$script_name)
{
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
$script_path = trim(dirname($script_name)) . '/'.$phpbb_root_path.'index.' . $phpEx;
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;
if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
{
// HTTP HOST can carry a port number...
if (strpos($server_name, ':') === false)
{
$url .= ':' . $server_port;
}
}
$url .= $script_path;
header('Location: ' . $url);
exit;
}
// Start session management
$user->session_begin();
$auth->acl($user->data);