From ae16645c0da2ad5ef45ab7383af13046989a40fe Mon Sep 17 00:00:00 2001 From: xevidos Date: Wed, 26 Feb 2020 11:14:37 -0500 Subject: [PATCH] Fixed mismatched variable names in upgrade process --- components/sql/class.sql.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/sql/class.sql.php b/components/sql/class.sql.php index fb9e1c5..4ff9c1d 100755 --- a/components/sql/class.sql.php +++ b/components/sql/class.sql.php @@ -160,11 +160,11 @@ class sql { $update_query = ""; $projects = $this->query( "SELECT id, path FROM projects", array(), array(), "fetchAll", "exception" ); - $result = $this->query( "SELECT username,project FROM users", array(), array(), "fetchAll", "exception" ); + $users = $this->query( "SELECT username,project FROM users", array(), array(), "fetchAll", "exception" ); $convert = false; $delete = Permissions::LEVELS["delete"]; - foreach( $result as $row => $user ) { + foreach( $users as $row => $user ) { if( ! is_numeric( $user["project"] ) ) { @@ -177,7 +177,8 @@ class sql { //change project to users table $result = $this->query( "ALTER TABLE users DROP COLUMN project", array(), array(), "rowCount", "exception" ); $result = $this->query( "ALTER TABLE users ADD COLUMN project INT", array(), array(), "rowCount", "exception" ); - foreach( $result as $row => $user ) { + + foreach( $users as $row => $user ) { foreach( $projects as $row => $project ) { @@ -305,7 +306,7 @@ class sql { if( ! is_numeric( $user["access"] ) ) { - $update = true; + $convert = true; break; } }