started implementing the configuration dialog stuff
[gwvp.git] / gwvplib / gwvpdatabase.php
index 792c1f7..28d2832 100644 (file)
@@ -147,15 +147,16 @@ function gwvp_getConfigVal($confname)
        
        $conn = gwvp_ConnectDB();
        
-       $sql = "select * from config where config_name='$confname'";
+       $sql = "select config_value from config where config_name='$confname'";
        
        $res = $conn->query($sql);
        
        $return = null;
        foreach($res as $val) {
-               $return = $val;
+               $return = $val["config_value"];
        }
        
+       return $return;
 }
 
 function gwvp_eraseConfigVal($confname)
@@ -199,7 +200,7 @@ function gwvp_setConfigVal($confname, $confval)
 function gwvp_isDBSetup()
 {
        // for sqlite, we just check if the db exists, for everyone else, we check for a conneciton and go yay or nay
-       global $WEB_ROOT_FS, $BASE_URL, $repo_base, $data_directory, $db_type, $db_url;
+       global $WEB_ROOT_FS, $BASE_URL, $data_directory, $db_type, $db_url;
 
        if($db_type == "sqlite") {
                if(file_exists($db_url)) return true;
@@ -212,7 +213,7 @@ function gwvp_isDBSetup()
 
 function gwvp_ConnectDB()
 {
-       global $WEB_ROOT_FS, $BASE_URL, $repo_base, $data_directory, $db_type, $db_name, $DB_CONNECTION;
+       global $WEB_ROOT_FS, $BASE_URL, $data_directory, $db_type, $db_name, $DB_CONNECTION;
 
        // first check if $DB_CONNECTION IS live
        if($DB_CONNECTION != false) return $DB_CONNECTION;