Superuser log-in through a web interface?

From: Ken Tozier <kentozier(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Superuser log-in through a web interface?
Date: 2004-10-31 00:35:50
Message-ID: D05A2AF9-2AD4-11D9-B070-003065F300E2@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

I'm trying to create a php form for logging in to postgress with
different level passwords and my first test with a superuser isn't
working unless I specify a database name. I would like to allow
superusers to log in without specifying a database so they can create
new users, databases etc from a web interface. Does anyone see what I'm
doing wrong in the following example?

Thanks for any help,

Ken

---------------------------------------------
I defined a super user like so

CREATE USER user_name CREATEUSER PASSWORD 'password'

Try to log in through a web form like so:

User: user_name
Password: password

but the connection always fails unless I specify a database.

Relevant PHP:

<?php

function LogInUser()
{
if (isset($_POST['user_name']) &&
isset($_POST['password']))
{
$user = $_POST['user_name'];
$password = $_POST['password'];

$conn_string = "user=".$user." password=".$password." host=localhost
port=5432";
$conn = pg_connect($conn_string);

if ($conn)
{
echo "login succeeded";
}
}
}
?>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2004-10-31 04:29:21 Re: Question about ltree....
Previous Message Tom Lane 2004-10-30 23:12:21 Re: having clause question