Superuser log-in through a web interface?

Поиск
Список
Период
Сортировка
От Ken Tozier
Тема Superuser log-in through a web interface?
Дата
Msg-id D05A2AF9-2AD4-11D9-B070-003065F300E2@comcast.net
обсуждение исходный текст
Ответ на How to time several queries?  (nd02tsk@student.hig.se)
Ответы Re: Superuser log-in through a web interface?  (Kevin Barnard <kevin.barnard@gmail.com>)
Список 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";
            }
        }
    }
?>


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: having clause question
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Question about ltree....