25 if (empty($folder_pk)) {
47 $sql =
"select * from foldercontents where parent_fk=$folder_pk";
50 while ($row = pg_fetch_assoc($result)) {
51 switch ($row[
"foldercontents_mode"]) {
56 $uploads[] = $row[
"child_id"];
62 pg_free_result($result);
80 foreach ($GroupArray as &$Grec) {
81 if ($Grec[
'user_pk'] == $GroupRow[
'user_fk']) {
85 if ($Grec[
'group_perm'] < $GroupRow[
'group_perm']) {
86 $Grec[
'group_perm'] = $GroupRow[
'group_perm'];
95 $NewGroup[
'user_pk'] = $GroupRow[
'user_fk'];
96 $NewGroup[
'group_pk'] = $GroupRow[
'group_pk'];
97 $NewGroup[
'group_name'] = $GroupRow[
'group_name'];
98 $NewGroup[
'group_perm'] = $GroupRow[
'group_perm'];
99 $GroupArray[] = $NewGroup;
117 $GroupArray = array();
120 if (empty($user_pk)) {
125 if (empty($user_pk)) {
128 $UserCondition =
" and user_fk=$user_pk ";
131 $sql =
"select group_pk, group_name, group_perm, user_fk from group_user_member, groups where group_pk=$group_pk and group_pk=group_fk $UserCondition";
134 while ($row = pg_fetch_assoc($result)) {
154 $GroupArray = array();
156 if (empty($user_pk)) {
159 if (empty($user_pk)) {
163 $sql =
"select group_fk as group_pk from group_user_member where user_fk=$user_pk";
166 while ($row = pg_fetch_assoc($result)) {
170 pg_free_result($result);
186 $GroupArray = array();
189 $sql =
"select group_pk, group_name from groups";
191 $sql =
"select group_pk, group_name from groups, group_user_member
192 where group_pk=group_fk and user_fk='$user_pk' and group_perm=1";
196 if (pg_num_rows($result) > 0) {
197 while ($row = pg_fetch_assoc($result)) {
198 $GroupArray[$row[
'group_pk']] = $row[
'group_name'];
201 pg_free_result($result);
203 natcasesort($GroupArray);
217 $user_pk = Auth::getUserId();
220 if (empty($group_pk)) {
221 $text = _(
"Error: Group name must be specified.");
226 $sql =
"SELECT group_pk FROM groups WHERE group_pk = '$group_pk'";
229 if (pg_num_rows($result) < 1) {
230 pg_free_result($result);
231 $text = _(
"Group does not exist. Not deleted.");
234 pg_free_result($result);
241 $sql =
"SELECT * FROM group_user_member WHERE group_fk = '$group_pk' and user_fk='$user_pk' and group_perm=1";
244 if (pg_num_rows($result) < 1) {
245 pg_free_result($result);
246 $text = _(
"Permission Denied.");
249 pg_free_result($result);
256 pg_free_result($result);
259 $sql =
"delete from perm_upload where group_fk='$group_pk'";
262 pg_free_result($result);
265 $sql =
"delete from group_user_member where group_fk='$group_pk'";
268 pg_free_result($result);
271 $sql =
"update users set new_upload_group_fk=NULL, new_upload_perm=NULL where new_upload_group_fk='$group_pk'";
274 pg_free_result($result);
277 $sql =
"delete from groups where group_pk='$group_pk'";
280 pg_free_result($result);
286 pg_free_result($result);
Contains the constants and helpers for authentication of user.
DBCheckResult($result, $sql, $filenm, $lineno)
Check the postgres result for unexpected errors. If found, treat them as fatal.
GetUsersGroups($user_pk='')
Find all the groups a user belongs to.
DeleteGroup($group_pk)
Delete a group.
GetUploadsFromFolder($folder_pk)
GetGroupUsers($user_pk, $group_pk, &$GroupArray)
Get all the users users of this group.
AddUserToGroupArray($GroupRow, &$GroupArray)
Check if User is already in the $GroupArray.
GetGroupArray($user_pk)
Get array of groups that this user has admin access to @depricated use UserDao::getAdminGroupMap()
GetUploadsFromFolder_recurse($folder_pk, &$uploads)
GetArrayVal($Key, $Arr)
Get the value from a array(map)
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN