diff auth/opendb.go @ 302:0777aa6de45b

Password reset. Part I
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 01 Aug 2018 12:29:55 +0200
parents a98a282f00e1
children 394fafeb4052
line wrap: on
line diff
--- a/auth/opendb.go	Tue Jul 31 22:24:37 2018 +0200
+++ b/auth/opendb.go	Wed Aug 01 12:29:55 2018 +0200
@@ -24,7 +24,7 @@
 		dbQuote(user), dbQuote(password), sslmode)
 }
 
-func opendb(user, password string) (*sql.DB, error) {
+func OpenDB(user, password string) (*sql.DB, error) {
 	dsn := dbDSN(
 		config.Config.DBHost, config.Config.DBPort,
 		config.Config.DBName,
@@ -45,7 +45,7 @@
 WHERE oid IN (SELECT oid FROM cte) AND rolname <> current_user`
 
 func AllOtherRoles(user, password string) ([]string, error) {
-	db, err := opendb(user, password)
+	db, err := OpenDB(user, password)
 	if err != nil {
 		return nil, err
 	}