mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Fixed mismatched variable names in upgrade process
This commit is contained in:
parent
2aa91d31ea
commit
ae16645c0d
@ -160,11 +160,11 @@ class sql {
|
|||||||
|
|
||||||
$update_query = "";
|
$update_query = "";
|
||||||
$projects = $this->query( "SELECT id, path FROM projects", array(), array(), "fetchAll", "exception" );
|
$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;
|
$convert = false;
|
||||||
$delete = Permissions::LEVELS["delete"];
|
$delete = Permissions::LEVELS["delete"];
|
||||||
|
|
||||||
foreach( $result as $row => $user ) {
|
foreach( $users as $row => $user ) {
|
||||||
|
|
||||||
if( ! is_numeric( $user["project"] ) ) {
|
if( ! is_numeric( $user["project"] ) ) {
|
||||||
|
|
||||||
@ -177,7 +177,8 @@ class sql {
|
|||||||
//change project to users table
|
//change project to users table
|
||||||
$result = $this->query( "ALTER TABLE users DROP COLUMN project", array(), array(), "rowCount", "exception" );
|
$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" );
|
$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 ) {
|
foreach( $projects as $row => $project ) {
|
||||||
|
|
||||||
@ -305,7 +306,7 @@ class sql {
|
|||||||
|
|
||||||
if( ! is_numeric( $user["access"] ) ) {
|
if( ! is_numeric( $user["access"] ) ) {
|
||||||
|
|
||||||
$update = true;
|
$convert = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user