<?
class admin_dialog_master extends admin_dialog {

    function makeData() {
        parent::makeData();
    
        $this->form_fields["email"] = $this->logged_as;
        $this->info = $this->db->get_first("SELECT * FROM "._DB_TABLE_PREFIX."users WHERE id = 1");
    }

    function action_update() {
        $_SESSION["email"] = $_REQUEST["email"];
        $this->info = $this->db->update(_DB_TABLE_PREFIX."users", 
                                        array("email"    => $_REQUEST["email"],
                                              "password" => $_REQUEST["password"]),
                                        "id = 1");
    }

    function action_create() {
        $_SESSION["email"] = $_REQUEST["email"];
        $this->info = $this->db->insert(_DB_TABLE_PREFIX."users", 
                                        array("id"       => "1", 
                                              "email"    => $_REQUEST["email"],
                                              "password" => $_REQUEST["password"]));
    }
    
}
?>