Removed founder authorisation.
This commit is contained in:
@@ -27,25 +27,23 @@ $mode = request_var('mode', '');
|
||||
|
||||
$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;
|
||||
$phpbb3portal = false;
|
||||
$installed = $updated = $uninstalled =false;
|
||||
$old_version = 0;
|
||||
$phpbb3portal = false;
|
||||
$installed = $updated = $uninstalled =false;
|
||||
|
||||
$sql = 'SELECT config_value as version
|
||||
$sql = 'SELECT config_value as version
|
||||
FROM ' . PORTAL_CONFIG_TABLE . "
|
||||
WHERE config_name = 'portal_version'";
|
||||
$result = @$db->sql_query_limit( $sql, 1 );
|
||||
if( $db->sql_affectedrows($result) > 0 )
|
||||
{
|
||||
$result = @$db->sql_query_limit( $sql, 1 );
|
||||
if( $db->sql_affectedrows($result) > 0 )
|
||||
{
|
||||
$version = $db->sql_fetchrow( $result );
|
||||
$old_version = strtolower($version['version']);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_freeresult( $result );
|
||||
$sql = 'SELECT config_value as version
|
||||
FROM ' . CONFIG_TABLE . "
|
||||
@@ -57,26 +55,26 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
|
||||
$phpbb3portal = true;
|
||||
$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';
|
||||
}
|
||||
elseif( $phpbb3portal === TRUE || version_compare( $old_version, $current_version, "<" ) === TRUE )
|
||||
{
|
||||
}
|
||||
elseif( $phpbb3portal === TRUE || version_compare( $old_version, $current_version, "<" ) === TRUE )
|
||||
{
|
||||
$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);
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
function db_error( $error, $sql, $line, $file, $skip = false )
|
||||
{
|
||||
function db_error( $error, $sql, $line, $file, $skip = false )
|
||||
{
|
||||
global $error, $lang, $db;
|
||||
|
||||
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';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function remove_comments(&$output)
|
||||
{
|
||||
function remove_comments(&$output)
|
||||
{
|
||||
$lines = explode("\n", $output);
|
||||
$output = '';
|
||||
|
||||
@@ -143,16 +141,16 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
|
||||
|
||||
unset($lines);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function remove_remarks(&$sql)
|
||||
{
|
||||
function remove_remarks(&$sql)
|
||||
{
|
||||
$sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
|
||||
}
|
||||
}
|
||||
|
||||
// What sql_layer should we use?
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
// What sql_layer should we use?
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
$db_schema = 'mysql_40';
|
||||
$delimiter = ';';
|
||||
@@ -211,14 +209,14 @@ if( $user->data['is_registered'] && $user->data['user_type'] == USER_FOUNDER )
|
||||
default:
|
||||
trigger_error('Sorry, unsupported DBMS found.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Get old version if it is installed.
|
||||
// Get old version if it is installed.
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
// Installing from scratch
|
||||
case 'install':
|
||||
switch ($mode)
|
||||
{
|
||||
// Installing from scratch
|
||||
case 'install':
|
||||
if( $check_mode == 'install' )
|
||||
{
|
||||
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);
|
||||
}
|
||||
break;
|
||||
// Updating
|
||||
case 'update':
|
||||
break;
|
||||
// Updating
|
||||
case 'update':
|
||||
if( $check_mode == 'update' )
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
break;
|
||||
// Uninstalling
|
||||
case 'uninstall':
|
||||
break;
|
||||
// Uninstalling
|
||||
case 'uninstall':
|
||||
if( $old_version != 0 )
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
break;
|
||||
// Welcome page!
|
||||
default:
|
||||
break;
|
||||
// Welcome page!
|
||||
default:
|
||||
|
||||
include($phpbb_root_path . 'install_portal/style/layout_menu.'.$phpEx);
|
||||
|
||||
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);
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user