GNU Computer Monitoring

Version 0.0.10, October 19, 2007

GnoCoMo logo
Username
Password
 
the_title = $title; $this->database = false; $this->path = $path; session_start(); //set_error_handler("error"); } function Head() { ?> <?php echo $this->the_title ?> database) { pg_close($this->database); } echo ""; echo ""; } function Showpage() { $this->config = new gnucomo_config; $this->config->read("gnucomo"); $this->Head(); if (empty($_SESSION['username'])) { // Nobody logged in yet. if (isset($_POST['username']) && isset($_POST['password'])) { // Login form submitted. Try to start a new session. $name = $_POST['username']; // PostgreSQL username $passw = $_POST['password']; // PostgreSQL user password // Connect to the database $this->database = pg_connect($this->config->Database($name, $passw)); if ($this->database == false) { login_form(); } else { session_register('username'); $_SESSION['username'] = $name; session_register('password'); $_SESSION['password'] = $passw; $this->Body(); } } else { // Nobody tried to login yet. Present the login form. login_form(); } } else { $name = $_SESSION['username']; // PostgreSQL username $passw = $_SESSION['password']; // PostgreSQL user password // Connect to the database $this->database = pg_connect($this->config->Database($name, $passw)); $this->Body(); } $this->Tail(); } }