3 * GForge Command-line Interface
5 * Copyright 2005 GForge, LLC
6 * http://fusionforge.org/
8 * @version $Id: default.php,v 1.2 2005/10/10 21:01:14 marcelo Exp $
10 * This file is part of FusionForge.
12 * FusionForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with FusionForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 * Variables passed by parent script:
29 * - $SOAP: Soap object to talk to the server
30 * - $PARAMS: parameters passed to this script
31 * - $LOG: object for logging of events
34 // function to execute
35 // $PARAMS[0] is "project" (the name of this module) and $PARAMS[1] is the name of the function
36 $module_name = array_shift($PARAMS); // Pop off module name ("project")
37 $function_name = array_shift($PARAMS); // Pop off function name
39 switch ($function_name) {
47 exit_error("Unknown function name: ".$function_name);
52 ////////////////////////////////////////////////
54 * project_do_list - List of projects in the server
56 function project_do_list() {
57 global $PARAMS, $SOAP, $LOG;
59 if (get_parameter($PARAMS, "help")) {
63 $res = $SOAP->call("getPublicProjectNames");
64 if (($error = $SOAP->getError())) {
65 exit_error($error, $SOAP->faultcode);
68 show_output($res, array("Project name"));
73 * project_do_mylist - List of projects available to the logged user
75 function project_do_mylist() {
76 global $PARAMS, $SOAP, $LOG;
78 if (get_parameter($PARAMS, "help")) {
82 // Fetch the user ID from the database
83 $params = array("user_ids" => array($SOAP->getSessionUser()));
84 $res = $SOAP->call("getUsersByName",$params);
86 if (($error = $SOAP->getError())) {
87 exit_error($error, $SOAP->faultcode);
90 $user_id = $res[0]["user_id"];
91 $params = array("user_id" => $user_id);
92 $res = $SOAP->call("userGetGroups", $params);
93 if (($error = $SOAP->getError())) {
94 exit_error($error, $SOAP->faultcode);