3 * FusionForge top-level information
5 * Copyright 2002, GForge, LLC
6 * Copyright 2009, Roland Mas
8 * This file is part of FusionForge.
10 * FusionForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published
12 * by the Free Software Foundation; either version 2 of the License,
13 * or (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FusionForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 require_once $gfcommon.'include/Error.class.php';
27 class FusionForge extends Error {
30 var $software_version ;
33 * FusionForge - FusionForge object constructor
35 function FusionForge() {
38 $this->software_name = 'FusionForge' ;
39 $this->software_version = '5.0.50' ;
44 function getNumberOfPublicHostedProjects() {
45 $res = db_query_params ('SELECT count(*) AS count FROM groups WHERE status=$1 AND is_public=1',
47 if (!$res || db_numrows($res) < 1) {
48 $this->setError('Unable to get hosted project count: '.db_error());
51 return $this->parseCount($res);
54 function getNumberOfHostedProjects() {
55 $res = db_query_params ('SELECT count(*) AS count FROM groups WHERE status=$1',
57 if (!$res || db_numrows($res) < 1) {
58 $this->setError('Unable to get hosted project count: '.db_error());
61 return $this->parseCount($res);
64 function getNumberOfActiveUsers() {
65 $res = db_query_params ('SELECT count(*) AS count FROM users WHERE status=$1 and user_id != 100',
67 if (!$res || db_numrows($res) < 1) {
68 $this->setError('Unable to get user count: '.db_error());
71 return $this->parseCount($res);
75 function getPublicProjectNames() {
76 $res = db_query_params ('SELECT unix_group_name FROM groups WHERE status=$1 AND is_public=1 ORDER BY unix_group_name',
79 $this->setError('Unable to get list of public projects: '.db_error());
82 $rows=db_numrows($res);
84 for ($i=0; $i<$rows; $i++) {
85 $result[$i] = db_result($res, $i, 'unix_group_name');
90 function parseCount($res) {
91 $row_count = db_fetch_array($res);
92 return $row_count['count'];
98 // c-file-style: "bsd"