3 * FusionForge system users integration
5 * Copyright 2004, Christian Bayle
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 require_once $gfcommon.'include/System.class.php';
25 class UNIX extends System {
27 * Value to add to unix_uid to get unix uid
29 * @var constant $UID_ADD
34 * UNIX() - CONSTRUCTOR
42 * sysCreateUser() - Create a user
44 * @param int The user ID of the user to create
45 * @returns The return status
48 function sysCreateUser($user_id) {
49 $user = &user_get_object($user_id);
53 $res = db_query_params ('UPDATE users SET
58 array ($this->UID_ADD,
63 $this->setError('Error: Cannot Update User UID/GID: '.db_error());
71 * sysRemoveUser() - Remove a user
73 * @param int The user ID of the user to remove
74 * @returns true on success/false on failure
77 function sysRemoveUser($user_id) {
78 $res = db_query_params ('UPDATE users SET unix_status=$1 WHERE user_id=$2',
82 $this->setError('Error: Cannot Update User Unix Status: '.db_error());
89 * Group management functions
93 * sysCheckGroup() - Check for the existence of a group
95 * @param int The ID of the group to check
96 * @returns true on success/false on error
99 function sysCheckGroup($group_id) {
100 $group = group_get_object($group_id);
108 * sysCreateGroup() - Create a group
110 * @param int The ID of the group to create
111 * @returns true on success/false on error
114 function sysCreateGroup($group_id) {
115 $group = group_get_object($group_id);
125 // c-file-style: "bsd"