Пример #1
0
    }
    public function _messageList()
    {
        $sql = " SELECT usermessage.* FROM usermessage WHERE 1=1 ORDER BY sentdate DESC ";
        parent::_list($sql);
    }
    public function _threadList()
    {
        $sql = " SELECT forum.*, ";
        $sql .= " CASE WHEN judge=1 THEN id ELSE root END AS rid ";
        $sql .= " FROM forum ";
        //	$sql .= " WHERE active=1 ";
        $sql .= " WHERE 1=1 ";
        parent::_list($sql);
    }
    public function authorization()
    {
        $username = $_SERVER['PHP_AUTH_USER'];
        $passwordmd5 = $_SERVER['PHP_AUTH_PW'];
        $sql = " SELECT * FROM users WHERE username = '******' AND passwordmd5 = '{$passwordmd5}' ";
        if (count($this->db->select($sql)) != 1) {
            $this->response('', 404);
        }
    }
}
$api = new action();
$api->authorization();
$api->processApi(api);
?>