Browse Source

more work on db update functions

causefx 8 years ago
parent
commit
2ede669292
2 changed files with 4 additions and 16 deletions
  1. 2 14
      api/functions/api-functions.php
  2. 2 2
      api/functions/upgrade-functions.php

+ 2 - 14
api/functions/api-functions.php

@@ -226,6 +226,7 @@ function updateDB($path, $filename, $oldVerNum = false)
                 }
                 }
             }
             }
         }
         }
+        updateConfig(array('configVersion'=>$GLOBALS['installedVersion']));
         return true;
         return true;
     } catch (Dibi\Exception $e) {
     } catch (Dibi\Exception $e) {
         return $e;
         return $e;
@@ -714,20 +715,7 @@ function editTabs($array)
             } catch (Dibi\Exception $e) {
             } catch (Dibi\Exception $e) {
                 return false;
                 return false;
             }
             }
-            break;
-        case 'deleteTab':
-            try {
-                $connect = new Dibi\Connection([
-                    'driver' => 'sqlite3',
-                    'database' => $GLOBALS['dbLocation'].$GLOBALS['dbName'],
-                ]);
-                $connect->query('DELETE FROM tabs WHERE id = ?', $array['data']['id']);
-                writeLog('success', 'Tab Editor Function -  Deleted Tab ['.$array['data']['name'].']', $GLOBALS['organizrUser']['username']);
-                return true;
-            } catch (Dibi\Exception $e) {
-                return false;
-            }
-            break;
+            break
         default:
         default:
             # code...
             # code...
             break;
             break;

+ 2 - 2
api/functions/upgrade-functions.php

@@ -7,7 +7,7 @@ function upgradeCheck()
     $config = loadConfig();
     $config = loadConfig();
     $oldVer = $config['configVersion'];
     $oldVer = $config['configVersion'];
     // Upgrade check start for version below
     // Upgrade check start for version below
-    $versionCheck = '2.0.0-alpha-120';
+    $versionCheck = '2.0.0-alpha-100';
     if (isset($config['dbLocation']) && (!isset($config['configVersion']) || $compare->lessThan($oldVer, $versionCheck))) {
     if (isset($config['dbLocation']) && (!isset($config['configVersion']) || $compare->lessThan($oldVer, $versionCheck))) {
         $updateDB = true;
         $updateDB = true;
         $oldVer = $versionCheck;
         $oldVer = $versionCheck;
@@ -16,8 +16,8 @@ function upgradeCheck()
     if ($updateDB == true) {
     if ($updateDB == true) {
         //return 'Upgraded Needed - Current Version '.$oldVer.' - New Version: '.$versionCheck;
         //return 'Upgraded Needed - Current Version '.$oldVer.' - New Version: '.$versionCheck;
         // Upgrade database to latest version
         // Upgrade database to latest version
-        updateDB($GLOBALS['dbLocation'],$GLOBALS['dbName'],$oldVer);
         unset($config);
         unset($config);
+        updateDB($GLOBALS['dbLocation'],$GLOBALS['dbName'],$oldVer);
     }
     }
     return true;
     return true;
 }
 }