Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
3c524d66
Commit
3c524d66
authored
15 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
List user's groups
Unlink user from group
parent
609aa9b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
webgui/ajax.php
+10
-0
10 additions, 0 deletions
webgui/ajax.php
webgui/include/ajax/functions/AdminUserGroups.php
+40
-27
40 additions, 27 deletions
webgui/include/ajax/functions/AdminUserGroups.php
webgui/js/app/windows/AdminUserGroups.js
+4
-4
4 additions, 4 deletions
webgui/js/app/windows/AdminUserGroups.js
with
54 additions
and
31 deletions
webgui/ajax.php
+
10
−
0
View file @
3c524d66
...
...
@@ -151,6 +151,15 @@
switch
(
$function
)
{
# AdminUserGroups.js functions
case
"removeAdminUserGroup"
:
$res
=
removeAdminUserGroup
(
$soapParams
);
if
(
isset
(
$res
))
{
ajaxException
(
$res
);
}
break
;
case
"getAdminUserGroups"
:
$res
=
getAdminUserGroups
(
$soapParams
);
...
...
@@ -164,6 +173,7 @@
$res
->
setDatasetSize
(
$numResults
);
echo
json_encode
(
$res
->
export
());
break
;
# AdminUserAttributes.js functions
...
...
This diff is collapsed.
Click to expand it.
webgui/include/ajax/functions/AdminUserGroups.php
+
40
−
27
View file @
3c524d66
...
...
@@ -3,45 +3,58 @@
include_once
(
"include/db.php"
);
#
Return list of attributes
function
get
AdminUserGroup
s
(
$params
)
{
#
Unlink user from group
function
remove
AdminUserGroup
(
$params
)
{
global
$db
;
$i
=
0
;
$res
=
DBDo
(
"DELETE FROM users_to_groups WHERE ID = ?"
,
array
(
$params
[
0
]));
if
(
!
is_numeric
(
$res
))
{
return
$res
;
}
return
NULL
;
}
# Return list of groups
function
getAdminUserGroups
(
$params
)
{
global
$db
;
# Filters and sorts are the same here
$filtersorts
=
array
(
'ID'
=>
'users_to_groups.
Group
ID'
,
'ID'
=>
'users_to_groups.ID'
,
'Name'
=>
'groups.Name'
);
$resultArray
=
array
();
$res
=
DBDo
(
"SELECT GroupID FROM users_to_groups WHERE UserID = ?"
,
$params
[
0
]);
if
(
$res
!==
FALSE
)
{
while
(
$row
=
$res
->
fetchObject
())
{
$i
++
;
$item
=
array
();
$item
[
'ID'
]
=
$row
->
groupid
;
$res2
=
DBDo
(
"SELECT Name FROM groups WHERE ID = ?"
,
$item
[
'ID'
]);
if
(
$res
!==
FALSE
)
{
$row
=
$res
->
fetchObject
();
$item
[
'Name'
]
=
$row
->
name
;
if
(
isset
(
$item
[
'Name'
]))
{
array_push
(
$resultArray
,
$item
);
}
}
}
}
$res
=
DBSelectSearch
(
"
SELECT
users_to_groups.ID, groups.Name
FROM
users_to_groups, groups
WHERE
groups.ID = users_to_groups.GroupID
AND users_to_groups.UserID = "
.
DBQuote
(
$params
[
0
])
.
"
"
,
$params
[
1
],
$filtersorts
,
$filtersorts
);
$sth
=
$res
[
0
];
$numResults
=
$res
[
1
];
# If STH is blank, return the error back to whoever requested the data
if
(
$res
==
FALSE
)
{
if
(
!
isset
(
$sth
)
)
{
return
$res
;
}
return
array
(
$resultArray
,
$i
);
$resultArray
=
array
();
# loop through rows
while
(
$row
=
$sth
->
fetchObject
())
{
$item
=
array
();
$item
[
'ID'
]
=
$row
->
id
;
$item
[
'Name'
]
=
$row
->
name
;
# push this row onto array
array_push
(
$resultArray
,
$item
);
}
return
array
(
$resultArray
,
$numResults
);
}
?>
This diff is collapsed.
Click to expand it.
webgui/js/app/windows/AdminUserGroups.js
+
4
−
4
View file @
3c524d66
...
...
@@ -176,14 +176,14 @@ function showAdminGroupAddEditWindow(id) {
// Display edit/add form
function
showAdminGroupRemoveWindow
(
parent
,
id
)
{
function
showAdmin
User
GroupRemoveWindow
(
parent
,
id
)
{
// Mask parent window
parent
.
getEl
().
mask
();
// Display remove confirm window
Ext
.
Msg
.
show
({
title
:
"
Confirm removal
"
,
msg
:
"
Are you very sure you wish to
remove
this group?
"
,
msg
:
"
Are you very sure you wish to
unlink
this group?
"
,
icon
:
Ext
.
MessageBox
.
ERROR
,
buttons
:
Ext
.
Msg
.
YESNO
,
modal
:
false
,
...
...
@@ -198,8 +198,8 @@ function showAdminGroupRemoveWindow(parent,id) {
SOAPUsername
:
globalConfig
.
soap
.
username
,
SOAPPassword
:
globalConfig
.
soap
.
password
,
SOAPAuthType
:
globalConfig
.
soap
.
authtype
,
SOAPModule
:
'
AdminGroups
'
,
SOAPFunction
:
'
removeAdminGroup
'
,
SOAPModule
:
'
Admin
User
Groups
'
,
SOAPFunction
:
'
removeAdmin
User
Group
'
,
SOAPParams
:
'
ID
'
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment