mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Remember user ID when flagging package bases
Add a new FlaggerUID field to the database and use it to store the user ID of the account who recently flagged a package out-of-date. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
57250a1641
commit
e1a258bd83
3 changed files with 12 additions and 2 deletions
|
@ -328,15 +328,15 @@ function pkgbase_flag($base_ids) {
|
|||
return array(false, __("You did not select any packages to flag."));
|
||||
}
|
||||
|
||||
$uid = uid_from_sid($_COOKIE['AURSID']);
|
||||
$dbh = DB::connect();
|
||||
|
||||
$q = "UPDATE PackageBases SET";
|
||||
$q.= " OutOfDateTS = UNIX_TIMESTAMP()";
|
||||
$q.= " OutOfDateTS = UNIX_TIMESTAMP(), FlaggerUID = " . $uid;
|
||||
$q.= " WHERE ID IN (" . implode(",", $base_ids) . ")";
|
||||
$q.= " AND OutOfDateTS IS NULL";
|
||||
$dbh->exec($q);
|
||||
|
||||
$uid = uid_from_sid($_COOKIE['AURSID']);
|
||||
foreach ($base_ids as $base_id) {
|
||||
notify(array('flag', $uid, $base_id));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue