4 * FusionForge source control management
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 along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 require 'env.inc.php';
26 require_once $gfwww.'include/squal_pre.php';
27 require_once $gfcommon.'include/cron_utils.php';
29 // MailingList backend class
30 /* This is only sample
31 require_once $gfplugins.'globaldashboard/include/BackendHelloworld.class.php' ;
33 $res = db_query_params ('SELECT id,type, parameters FROM system_event WHERE status=$1 ORDER BY id DESC',
36 printf('Unable to get list of events: '.db_error());
40 while ($data = db_fetch_array ($res)) {
41 if($data['type'] == 'HELLOWORLD_CREATE') {
42 $result = BackendHelloworld::instance()->createList($data['parameters']);
43 } elseif ($data['type'] == 'HELLOWORLD_DELETE') {
44 $result = BackendHelloworld::instance()->deleteList($data['parameters']);
46 $result ? $log="DONE":$test="ERROR";
47 $events[$data['id']]=$log;
48 echo "\n Event ".$data['id']." : ".$data['type']." ".$log." for list id=".$data['parameters'];
51 foreach($events as $event_id => $log) {
52 $sql = "UPDATE system_event SET end_date=$1, log=$2, status='3' WHERE id=$3;";
53 $result = db_query_params($sql,array(time(),$log,$event_id));
55 printf('Unable to update the list of events: '.db_error());
65 // c-file-style: "bsd"