Removed founder authorisation.

This commit is contained in:
Ice
2008-02-03 11:46:25 +00:00
parent b6a1614082
commit 341ce7a74c

View File

@@ -27,25 +27,23 @@ $mode = request_var('mode', '');
$page_title = 'Board3portal v' . $current_version; $page_title = 'Board3portal v' . $current_version;
if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER ) $version_array = array('0.1.0', 'p3p1.2.2', 'p3p1.2.1', 'p3p1.2.0', 'p3p1.1.0b');
{
$version_array = array('0.1.0', 'p3p1.2.2', 'p3p1.2.1', 'p3p1.2.0', 'p3p1.1.0b');
$old_version = 0; $old_version = 0;
$phpbb3portal = false; $phpbb3portal = false;
$installed = $updated = $uninstalled =false; $installed = $updated = $uninstalled =false;
$sql = 'SELECT config_value as version $sql = 'SELECT config_value as version
FROM ' . PORTAL_CONFIG_TABLE . " FROM ' . PORTAL_CONFIG_TABLE . "
WHERE config_name = 'portal_version'"; WHERE config_name = 'portal_version'";
$result = @$db->sql_query_limit( $sql, 1 ); $result = @$db->sql_query_limit( $sql, 1 );
if( $db->sql_affectedrows($result) > 0 ) if( $db->sql_affectedrows($result) > 0 )
{ {
$version = $db->sql_fetchrow( $result ); $version = $db->sql_fetchrow( $result );
$old_version = strtolower($version['version']); $old_version = strtolower($version['version']);
} }
else else
{ {
$db->sql_freeresult( $result ); $db->sql_freeresult( $result );
$sql = 'SELECT config_value as version $sql = 'SELECT config_value as version
FROM ' . CONFIG_TABLE . " FROM ' . CONFIG_TABLE . "
@@ -57,26 +55,26 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
$phpbb3portal = true; $phpbb3portal = true;
$old_version = ( strtolower($version['version']) == '1.1.0.b' ) ? '1.1.0b' : strtolower($version['version']) ; $old_version = ( strtolower($version['version']) == '1.1.0.b' ) ? '1.1.0b' : strtolower($version['version']) ;
} }
} }
$db->sql_freeresult( $result ); $db->sql_freeresult( $result );
$check_mode = 'none'; $check_mode = 'none';
if( $old_version == 0 ) if( $old_version == 0 )
{ {
$check_mode = 'install'; $check_mode = 'install';
} }
elseif( $phpbb3portal === TRUE || version_compare( $old_version, $current_version, "<" ) === TRUE ) elseif( $phpbb3portal === TRUE || version_compare( $old_version, $current_version, "<" ) === TRUE )
{ {
$check_mode = 'update'; $check_mode = 'update';
} }
$confirm = request_var('confirm', 0); $confirm = request_var('confirm', 0);
$error_array = array(); $error_array = array();
function split_sql_file($sql, $delimiter) function split_sql_file($sql, $delimiter)
{ {
$sql = str_replace("\r" , '', $sql); $sql = str_replace("\r" , '', $sql);
$data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql); $data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql);
@@ -91,10 +89,10 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
} }
return $data; return $data;
} }
function db_error( $error, $sql, $line, $file, $skip = false ) function db_error( $error, $sql, $line, $file, $skip = false )
{ {
global $error, $lang, $db; global $error, $lang, $db;
if( $skip ) if( $skip )
@@ -112,10 +110,10 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
include $phpbb_root_path . 'install_portal/style/layout_footer.php'; include $phpbb_root_path . 'install_portal/style/layout_footer.php';
exit; exit;
} }
} }
function remove_comments(&$output) function remove_comments(&$output)
{ {
$lines = explode("\n", $output); $lines = explode("\n", $output);
$output = ''; $output = '';
@@ -143,16 +141,16 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
unset($lines); unset($lines);
return $output; return $output;
} }
function remove_remarks(&$sql) function remove_remarks(&$sql)
{ {
$sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
} }
// What sql_layer should we use? // What sql_layer should we use?
switch ($db->sql_layer) switch ($db->sql_layer)
{ {
case 'mysql': case 'mysql':
$db_schema = 'mysql_40'; $db_schema = 'mysql_40';
$delimiter = ';'; $delimiter = ';';
@@ -211,14 +209,14 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
default: default:
trigger_error('Sorry, unsupported DBMS found.'); trigger_error('Sorry, unsupported DBMS found.');
break; break;
} }
// Get old version if it is installed. // Get old version if it is installed.
switch ($mode) switch ($mode)
{ {
// Installing from scratch // Installing from scratch
case 'install': case 'install':
if( $check_mode == 'install' ) if( $check_mode == 'install' )
{ {
if( $confirm == 1) if( $confirm == 1)
@@ -474,9 +472,9 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
{ {
include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx); include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx);
} }
break; break;
// Updating // Updating
case 'update': case 'update':
if( $check_mode == 'update' ) if( $check_mode == 'update' )
{ {
$confirm = request_var('confirm', ''); $confirm = request_var('confirm', '');
@@ -843,9 +841,9 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx); include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx);
} }
break; break;
// Uninstalling // Uninstalling
case 'uninstall': case 'uninstall':
if( $old_version != 0 ) if( $old_version != 0 )
{ {
if( $confirm == 1) if( $confirm == 1)
@@ -958,21 +956,13 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx); include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx);
} }
break; break;
// Welcome page! // Welcome page!
default: default:
include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx); include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx);
break; break;
}
}
else
{
include($phpbb_root_path . 'install_portal/style/layout_header.'.$phpEx);
echo '<h1>' . $user->lang['INSTALLER_ERROR'] . '</h1>';
echo '<p>' . $user->lang['INSTALLER_NEEDS_FOUNDER'] . '</p>';
include($phpbb_root_path . 'install_portal/style/layout_footer.'.$phpEx);
} }
?> ?>