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
8fbe540a
Commit
8fbe540a
authored
16 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Add a group
parent
2a152e38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webui/group-add.php
+26
-12
26 additions, 12 deletions
webui/group-add.php
with
26 additions
and
12 deletions
webui/group-add.php
+
26
−
12
View file @
8fbe540a
...
...
@@ -29,29 +29,41 @@ $db = connect_db();
printHeader
(
array
(
"Tabs"
=>
array
(
"Back to groups"
=>
"
policy-
group-main.php"
,
"Back to groups"
=>
"group-main.php"
,
),
));
if
(
$_POST
[
'frmaction'
]
==
"add"
)
{
?>
<p
class=
"pageheader"
>
Add
Policy
Group
</p>
<p
class=
"pageheader"
>
Add Group
</p>
<?php
?>
<form
method=
"post"
action=
"
policy-
group-add.php"
>
<form
method=
"post"
action=
"group-add.php"
>
<div>
<input
type=
"hidden"
name=
"frmaction"
value=
"add2"
/>
<input
type=
"hidden"
name=
"policy_group_id"
value=
"
<?php
echo
$_POST
[
'policy_group_id'
]
?>
"
/>
</div>
<table
class=
"entry"
>
<tr>
<td
class=
"entrytitle"
>
Name
</td>
<td><input
type=
"text"
name=
"policy_group_name"
/></td>
<td><input
type=
"text"
name=
"group_name"
/></td>
</tr>
<tr>
<td
class=
"entrytitle"
>
Priority
</td>
<td><input
type=
"text"
name=
"group_priority"
/></td>
</tr>
<tr>
<td
class=
"entrytitle"
>
Disabled
</td>
<td>
<select
name=
"group_disabled"
>
<option
value=
"0"
>
No
</option>
<option
value=
"1"
>
Yes
</option>
</select>
</td>
</tr>
<tr>
<td
class=
"entrytitle texttop"
>
Comment
</td>
<td><textarea
name=
"
policy_
group_comment"
cols=
"40"
rows=
"5"
></textarea></td>
<td><textarea
name=
"group_comment"
cols=
"40"
rows=
"5"
></textarea></td>
</tr>
<tr>
<td
colspan=
"2"
>
...
...
@@ -67,23 +79,25 @@ if ($_POST['frmaction'] == "add") {
# Check we have all params
}
elseif
(
$_POST
[
'frmaction'
]
==
"add2"
)
{
?>
<p
class=
"pageheader"
>
Policy
Group Add Results
</p>
<p
class=
"pageheader"
>
Group Add Results
</p>
<?php
$stmt
=
$db
->
prepare
(
"INSERT INTO ${DB_TABLE_PREFIX}
policy_
groups (Name,
Comment
,Disabled) VALUES (?,?,
1
)"
);
$stmt
=
$db
->
prepare
(
"INSERT INTO ${DB_TABLE_PREFIX}groups (Name,
Priority
,Disabled
,Comment
) VALUES (?,?,
?,?
)"
);
$res
=
$stmt
->
execute
(
array
(
$_POST
[
'policy_group_name'
],
$_POST
[
'policy_group_comment'
]
$_POST
[
'group_name'
],
$_POST
[
'group_priority'
],
$_POST
[
'group_disabled'
],
$_POST
[
'group_comment'
],
));
if
(
$res
)
{
?>
<div
class=
"notice"
>
Policy g
roup created
</div>
<div
class=
"notice"
>
G
roup created
</div>
<?php
}
else
{
?>
<div
class=
"warning"
>
Failed to create
policy
group
</div>
<div
class=
"warning"
>
Failed to create group
</div>
<div
class=
"warning"
>
<?php
print_r
(
$stmt
->
errorInfo
())
?>
</div>
<?php
}
...
...
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