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
114a91ea
Commit
114a91ea
authored
15 years ago
by
Nigel Kukard
Browse files
Options
Downloads
Patches
Plain Diff
* Commit of cosmetic and code cleanups and addition of extra error checking in groups
parent
643ca8af
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webui/group-add.php
+1
-12
1 addition, 12 deletions
webui/group-add.php
webui/group-delete.php
+48
-12
48 additions, 12 deletions
webui/group-delete.php
with
49 additions
and
24 deletions
webui/group-add.php
+
1
−
12
View file @
114a91ea
...
...
@@ -92,30 +92,19 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") {
$_POST
[
'group_disabled'
],
$_POST
[
'group_comment'
],
));
if
(
$res
)
{
if
(
$res
!==
FALSE
)
{
?>
<div
class=
"notice"
>
Group created
</div>
<?php
}
else
{
?>
<div
class=
"warning"
>
Failed to create group
</div>
<div
class=
"warning"
>
<?php
print_r
(
$stmt
->
errorInfo
())
?>
</div>
<?php
}
}
else
{
?>
<div
class=
"warning"
>
Group name cannot be empty!
</div>
<?php
}
...
...
This diff is collapsed.
Click to expand it.
webui/group-delete.php
+
48
−
12
View file @
114a91ea
...
...
@@ -79,37 +79,73 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") {
$db
->
beginTransaction
();
$res
=
$db
->
exec
(
"DELETE FROM ${DB_TABLE_PREFIX}users_to_groups WHERE GroupID = "
.
$db
->
quote
(
$_POST
[
'group_id'
]));
$res
=
$db
->
exec
(
"
DELETE FROM
${DB_TABLE_PREFIX}users_to_groups
WHERE
GroupID = "
.
$db
->
quote
(
$_POST
[
'group_id'
])
.
"
"
);
if
(
$res
!==
FALSE
)
{
$res
=
$db
->
exec
(
"DELETE FROM ${DB_TABLE_PREFIX}group_attributes WHERE GroupID = "
.
$db
->
quote
(
$_POST
[
'group_id'
]));
?>
<div
class=
"notice"
>
User to group mappings removed
</div>
<?php
}
else
{
?>
<div
class=
"warning"
>
Error removing user mappings from group
</div>
<div
class=
"warning"
>
<?php
print_r
(
$db
->
errorInfo
())
?>
</div>
<?php
}
if
(
$res
!==
FALSE
)
{
$res
=
$db
->
exec
(
"
DELETE FROM
${DB_TABLE_PREFIX}group_attributes
WHERE
GroupID = "
.
$db
->
quote
(
$_POST
[
'group_id'
])
.
"
"
);
if
(
$res
!==
FALSE
)
{
?>
<div
class=
"notice"
>
Group group attributes removed
</div>
<?php
}
else
{
?>
<div
class=
"warning"
>
Error removing group attributes
</div>
<div
class=
"warning"
>
<?php
print_r
(
$db
->
errorInfo
())
?>
</div>
<?php
}
}
if
(
$res
!==
FALSE
)
{
$res
=
$db
->
exec
(
"DELETE FROM ${DB_TABLE_PREFIX}groups WHERE ID = "
.
$db
->
quote
(
$_POST
[
'group_id'
]));
if
(
$res
!==
FALSE
)
{
?>
<div
class=
"notice"
>
Group deleted
</div>
<?php
$db
->
commit
();
}
else
{
?>
<div
class=
"warning"
>
Error deleting group
</div>
<div
class=
"warning"
>
<?php
print_r
(
$db
->
errorInfo
())
?>
</div>
<?php
$db
->
rollback
();
}
}
else
{
}
# Check if all is ok, if so, we can commit, else must rollback
if
(
$res
!==
FALSE
)
{
$db
->
commit
();
?>
<div
class=
"warning"
>
Error deleting group
</div>
<div
class=
"warning"
>
<?php
print_r
(
$db
->
errorInfo
())
?>
</div>
<div
class=
"notice"
>
Changes comitted.
</div>
<?php
$db
->
rollback
();
}
}
else
{
$db
->
rollback
();
?>
<div
class=
"warning"
>
Error deleting group
</div>
<div
class=
"warning"
>
<?php
print_r
(
$db
->
errorInfo
())
?>
</div>
<div
class=
"notice"
>
Changes reverted.
</div>
<?php
$db
->
rollback
();
}
}
else
{
?>
<div
class=
"notice"
>
Group not deleted, aborted by user
</div>
...
...
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