|
From: Bart v. B. <ba...@us...> - 2001-12-01 12:43:47
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv27429
Modified Files:
upgrade.php
Log Message:
Fixed some userlevel problems
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/upgrade.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** upgrade.php 2001/11/24 21:04:51 1.4
--- upgrade.php 2001/12/01 12:43:43 1.5
***************
*** 179,183 ****
else
{
- print "$line<br>";
// It's a bird! It's a plane! It's something we didn't expect ;(
}
--- 179,182 ----
***************
*** 202,206 ****
for($i=0; $i < count($insertfile); $i++)
{
! if (preg_match("/^(.*INSERT INTO (.*?)\s.*);$/i", str_replace("phpbb_", $table_prefix, $insertfile[$i]), $matches))
{
$returnvalue[$matches[2]][] = $matches[1];
--- 201,205 ----
for($i=0; $i < count($insertfile); $i++)
{
! if (preg_match("/^.*(INSERT INTO (\w+)\s.*);$/i", str_replace("phpbb_", $table_prefix, $insertfile[$i]), $matches))
{
$returnvalue[$matches[2]][] = $matches[1];
***************
*** 417,434 ****
while (list($table, $definition) = each ($table_def))
{
- print "<font color='green'>Table: $table</font><br>";
if (!inarray($table, $currenttables))
{
print "Creating $table: ";
! $result = query($definition, "Couldn't create table $table");
! if($db->sql_affectedrows($result) < 1)
! {
! echo "Couldn't create table (no affected rows)<br>\n";
! print $definition . "<br>\n";
! }
! else
! {
! print "OK<br>\n";
! }
}
}
--- 416,424 ----
while (list($table, $definition) = each ($table_def))
{
if (!inarray($table, $currenttables))
{
print "Creating $table: ";
! query($definition, "Couldn't create table $table");
! print "OK<br>\n";
}
}
***************
*** 649,652 ****
--- 639,643 ----
case '4':
$row['user_level'] = ADMIN;
+ print $row['username'] . " is an admin. Giving level: ". ADMIN . "<br>\n";
break;
case '-1':
***************
*** 670,674 ****
user_yim = '".$row['user_yim']."',
user_msnm = '".$row['user_msnm']."',
! user_level = '".$row['user_userlevel']."'
WHERE user_id = ".$row['user_id'];
query($sql, "Couldn't update ".USERS_TABLE." table with new BBcode and regdate for user_id ".$row['user_id']);
--- 661,665 ----
user_yim = '".$row['user_yim']."',
user_msnm = '".$row['user_msnm']."',
! user_level = '".$row['user_level']."'
WHERE user_id = ".$row['user_id'];
query($sql, "Couldn't update ".USERS_TABLE." table with new BBcode and regdate for user_id ".$row['user_id']);
***************
*** 681,684 ****
--- 672,676 ----
case 'convert_posts':
common_header();
+
$sql = "ALTER TABLE ".POSTS_TABLE."
ADD bbcode_uid char(10) NOT NULL,
***************
*** 758,762 ****
lock_tables(0);
}
! end_step('convert_pm');
case 'convert_pm':
--- 750,755 ----
lock_tables(0);
}
!
! end_step('convert_pm');
case 'convert_pm':
***************
*** 932,936 ****
{
// Loop fields in table
! print "<p>Table: $table<br>\n";
flush();
--- 925,929 ----
{
// Loop fields in table
! print "Table: $table <br>\n";
flush();
***************
*** 942,946 ****
$current_fields[] = $def['Field'];
}
- //print_r($current_fields);
$alter_sql = "ALTER TABLE $table ";
--- 935,938 ----
***************
*** 962,971 ****
// If the current is not a key of $current_def and it is not a field that is
// to be renamed then the field doesn't currently exist.
- //$changes[] = "\nADD $field $type($size) $default $notnull $auto_increment ";
$changes[] = "\nADD $field ". $create_def[$table][$field];
}
else
{
- //$changes[] = "\nCHANGE $oldfield $field $type($size) $default $notnull $auto_increment";
$changes[] = "\nCHANGE $oldfield $field ". $create_def[$table][$field];
}
--- 954,961 ----
***************
*** 991,995 ****
}
}
- print "$alter_sql<br>\n";
query($alter_sql, "Couldn't alter table $table");
flush();
--- 981,984 ----
|