5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright 2010 (c) FusionForge Team
8 * http://fusionforge.org/
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once('../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfcommon.'frs/FRSPackage.class.php';
29 require_once $gfcommon.'frs/include/frs_utils.php';
32 if (session_loggedin()) {
33 $group_id = getIntFromRequest('group_id');
34 $filemodule_id = getIntFromRequest('filemodule_id');
35 $start = getIntFromRequest('start');
36 $stop = getIntFromRequest('stop');
38 if ($group_id && $filemodule_id) {
40 // Set up local objects
42 $g = group_get_object($group_id);
43 if (!$g || !is_object($g) || $g->isError()) {
47 $f=new FRSPackage($g,$filemodule_id);
48 if (!$f || !is_object($f)) {
49 exit_error(_('Error Getting FRSPackage'),'frs');
50 } elseif ($f->isError()) {
51 exit_error($f->getErrorMessage(),'frs');
55 if (!$f->stopMonitor()) {
56 exit_error($f->getErrorMessage(),'frs');
58 $feedback = _('Monitoring Has Been Stopped');
59 frs_header(array('title'=>_('Monitoring stopped'),'group'=>$group_id));
63 if (!$f->setMonitor()) {
64 exit_error($f->getErrorMessage(),'frs');
66 $feedback = _('Monitoring Has Been Started');
67 frs_header(array('title'=>_('Monitoring started'),'group'=>$group_id));
72 exit_missing_param('',array(_('Project ID'),_('File Module ID')),'frs');