Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
a699a59e
Commit
a699a59e
authored
Apr 13, 2012
by
Frank Becker
Committed by
Dave Lawrence
Apr 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 740536 - Webservice for maximum time of audit_log
r=dkl, a=LpSolit
parent
1ea1d48d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
1 deletion
+70
-1
Bugzilla.pm
Bugzilla/WebService/Bugzilla.pm
+70
-1
No files found.
Bugzilla/WebService/Bugzilla.pm
View file @
a699a59e
...
...
@@ -11,7 +11,8 @@ use strict;
use
base
qw(Bugzilla::WebService)
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Util
qw(datetime_from)
;
use
Bugzilla::WebService::
Util
qw(filter_wants)
;
use
Bugzilla::WebService::
Util
qw(validate filter_wants)
;
use
Bugzilla::
Util
qw(trick_taint)
;
use
DateTime
;
...
...
@@ -114,6 +115,33 @@ sub time {
};
}
sub
last_audit_time
{
my
(
$self
,
$params
)
=
validate
(
@_
,
'class'
);
my
$dbh
=
Bugzilla
->
dbh
;
my
$sql_statement
=
"SELECT MAX(at_time) FROM audit_log"
;
my
$class_values
=
$params
->
{
class
};
my
@class_values_quoted
;
foreach
my
$class_value
(
@$class_values
)
{
push
(
@class_values_quoted
,
$dbh
->
quote
(
$class_value
))
if
$class_value
=~
/^Bugzilla(::[a-zA-Z0-9_]+)*$/
;
}
if
(
@class_values_quoted
)
{
$sql_statement
.=
" WHERE "
.
$dbh
->
sql_in
(
'class'
,
\
@class_values_quoted
);
}
my
$last_audit_time
=
$dbh
->
selectrow_array
(
"$sql_statement"
);
# All Webservices return times in UTC; Use UTC here for backwards compat.
# Hardcode values where appropriate
$last_audit_time
=
datetime_from
(
$last_audit_time
,
'UTC'
);
return
{
last_audit_time
=>
$self
->
type
(
'dateTime'
,
$last_audit_time
)
};
}
sub
parameters
{
my
(
$self
,
$args
)
=
@_
;
my
$user
=
Bugzilla
->
login
();
...
...
@@ -390,3 +418,44 @@ never be stable.
=back
=back
=head2 last_audit_time
B<EXPERIMENTAL>
=over
=item B<Description>
Gets the latest time of the audit_log table.
=item B<Params>
You can pass the optional parameter C<class> to get the maximum for only
the listed classes.
=over
=item C<class> (array) - An array of strings representing the class names.
B<Note:> The class names are defined as "Bugzilla::<class_name>". For the product
use Bugzilla:Product.
=back
=item B<Returns>
A hash with a single item, C<last_audit_time>, that is the maximum of the
at_time from the audit_log.
=item B<Errors> (none)
=item B<History>
=over
=item Added in Bugzilla B<4.4>.
=back
=back
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