summaryrefslogblamecommitdiffstats
path: root/app/class/user.class.php
blob: 6004dc90d6ae14468cc0ba820a095abb68edc376 (plain) (tree)


























                                           















                                                                                 


  
<?php

require_once "class/object.class.php";

/*
 * Application users
 */
class User extends Object
{
    /*
     * Constructor
     */
    function __construct($guid = null)
    {
        $cols = array(
            "guid",
            "key",
            "salt",
            "alias",
            "email",
            "emailConf",
            "emailConfKey"
        );

        parent::__construct("user", $cols);
        $this->loadObj($guid);
    }

    /*
     * Get all users -- ordered by name, ascending
     */
    function getAllUsers_orderByName()
    {
        $query = "SELECT guid FROM `object` WHERE `type` = 'user' ORDER BY name";
        $result = $this->db->query($query);

        $users = array();

        foreach ($result as $u)
            $users[] = new User($u['guid']);

        return $users;
    }
}

?>