]> git.wh0rd.org - tt-rss.git/blobdiff - include/sanity_check.php
remove $link
[tt-rss.git] / include / sanity_check.php
index 29de4ff5e8762c115de0aae94317576de0b781e5..0477efd5077fb37d81ea5a7385fe1e061c0b0fe5 100644 (file)
@@ -21,7 +21,7 @@
                return $url_path;
        }
 
-       function initial_sanity_check($link) {
+       function initial_sanity_check() {
 
                $errors = array();
 
                        }
 
                        if (SINGLE_USER_MODE) {
-                               $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
+                               $result = db_query( "SELECT id FROM ttrss_users WHERE id = 1");
 
-                               if ($link) {
-                                       $result = db_query($link, "SELECT id FROM ttrss_users WHERE id = 1");
-
-                                       if (db_num_rows($result) != 1) {
-                                               array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found.");
-                                       }
+                               if (db_num_rows($result) != 1) {
+                                       array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found.");
                                }
                        }
 
                }
        }
 
-       initial_sanity_check($link);
+       initial_sanity_check();
 
 ?>