Commit d56a7658 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛
Browse files

Retrieve 'allusers' notifications (#2071)

parent 9e84447d
......@@ -100,9 +100,7 @@ sub getAccepted {
$self->_execute(
"SELECT * FROM "
. $self->dbiTable
. " WHERE done IS NOT NULL AND uid=?"
. ( $ref ? " AND ref=?" : '' )
. " ORDER BY date",
. " WHERE uid=? AND ref=? ORDER BY date",
$uid,
( $ref ? $ref : () )
) or return ();
......
......@@ -65,7 +65,7 @@ sub getAccepted {
my $identifier = &getIdentifier( $self, $uid, $ref );
opendir D, $self->{dirName};
my @notif = grep /^\d{8}${fns}${identifier}\S*\.done$/, readdir(D);
my @notif = grep /^\d{8}${fns}${identifier}\S*\.(?:done|json)$/, readdir(D);
closedir D;
my $files;
......
......@@ -95,8 +95,7 @@ sub getAccepted {
my $filter =
'(&(objectClass=applicationProcess)(description={done}*)'
. "(description={uid}$uid)"
. ( $ref ? '(description={ref}' . $ref . ')' : '' ) . ')';
. "(description={uid}$uid)(description={ref}$ref))";
my @entries = _search( $self, $filter );
my $result;
......
......@@ -167,7 +167,7 @@ sub myNotifs {
my ( $self, $req, $ref ) = @_;
if ($ref) {
return $self->sendJSONresponse( $req, { error => 'Missing parameter' } )
return $self->sendJSONresponse( $req, { error => 'Missing epoch parameter' } )
unless $req->param('epoch');
# Retrieve notification reference=$ref with epoch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment