Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
sucs-site
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua Anthony Morgan
sucs-site
Commits
93511244
Commit
93511244
authored
Apr 26, 2015
by
Laurence Sebastian Bowes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a check to disallow awarding zero bananas
parent
2bf9eb8a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
lib/banana-admin.php
lib/banana-admin.php
+14
-8
No files found.
lib/banana-admin.php
View file @
93511244
...
...
@@ -28,12 +28,18 @@ if (isset($session->groups[$permission])) {
$why
=
$_POST
[
'why'
];
if
(
abs
(
$number
)
<=
$maxbanana
){
if
(
(
abs
(
$number
)
<=
$maxbanana
)
&&
$number
<>
0
){
$DB
->
Query
(
"INSERT INTO awards (username, score, whn, who, why) VALUES (?,?,NOW(),?,?)"
,
array
(
$who
,
$number
,
$session
->
username
,
$why
));
header
(
"Location: "
.
$_SERVER
[
'PHP_SELF'
]);
}
else
{
}
// Checks for a nonzero banana and denies awarding if it's zero
elseif
(
$number
==
0
){
trigger_error
(
"Come on "
.
$session
->
username
.
", enter a nonzero value please"
);
}
else
{
trigger_error
(
"Nice try "
.
$session
->
username
.
"! You've submitted a request with too many bananas"
);
}
...
...
@@ -56,7 +62,7 @@ if (isset($session->groups[$permission])) {
}
$secondary
=
$smarty
->
get
TemplateV
ars
(
"secondary"
);
$secondary
=
$smarty
->
get
_template_v
ars
(
"secondary"
);
$secondary
.=
$smarty
->
fetch
(
'banana-award.tpl'
);
$smarty
->
assign
(
'secondary'
,
$secondary
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment