5 * Provides some top-level information about the FusionForge installation.
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with FusionForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 require_once $gfcommon.'include/Error.class.php';
25 class FusionForge extends Error {
28 var $software_version ;
31 * FusionForge - FusionForge object constructor
33 function FusionForge() {
36 $this->software_name = 'FusionForge' ;
37 $this->software_version = '4.7' ;
42 function getNumberOfPublicHostedProjects() {
43 $res=db_query("SELECT count(*) AS count FROM groups WHERE status='A' AND is_public=1");
44 if (!$res || db_numrows($res) < 1) {
45 $this->setError('Unable to get hosted project count: '.db_error());
48 return $this->parseCount($res);
51 function getNumberOfHostedProjects() {
52 $res=db_query("SELECT count(*) AS count FROM groups WHERE status='A'");
53 if (!$res || db_numrows($res) < 1) {
54 $this->setError('Unable to get hosted project count: '.db_error());
57 return $this->parseCount($res);
60 function getNumberOfActiveUsers() {
61 $res = db_query("SELECT count(*) AS count FROM users WHERE status='A' and user_id != 100");
62 if (!$res || db_numrows($res) < 1) {
63 $this->setError('Unable to get user count: '.db_error());
66 return $this->parseCount($res);
70 function getPublicProjectNames() {
71 $res = db_query("SELECT unix_group_name FROM groups WHERE status='A' AND is_public=1");
73 $this->setError('Unable to get list of public projects: '.db_error());
76 $rows=db_numrows($res);
78 for ($i=0; $i<$rows; $i++) {
79 $result[$i] = db_result($res, $i, 'unix_group_name');
84 function parseCount($res) {
85 $row_count = db_fetch_array($res);
86 return $row_count['count'];
94 // c-file-style: "bsd"