Add support for package update notifications

Introduce a new notification option to receive notifications when a new
commit is pushed to a package repository.

Implements FS#30109.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2015-11-10 20:18:13 +01:00
parent aa5e58db81
commit 64072461df
8 changed files with 68 additions and 12 deletions

View file

@ -57,13 +57,14 @@ function html_format_pgp_fingerprint($fingerprint) {
* @param string $PK The list of SSH public keys
* @param string $J The inactivity status of the displayed user
* @param string $CN Whether to notify of new comments
* @param string $UN Whether to notify of package updates
* @param string $UID The user ID of the displayed user
* @param string $N The username as present in the database
*
* @return void
*/
function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R="",
$L="",$I="",$K="",$PK="",$J="",$CN="",$UID=0,$N="") {
$L="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$UID=0,$N="") {
global $SUPPORTED_LANGS;
include("account_edit_form.php");
@ -90,13 +91,14 @@ function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R=""
* @param string $PK The list of public SSH keys
* @param string $J The inactivity status of the user
* @param string $CN Whether to notify of new comments
* @param string $UN Whether to notify of package updates
* @param string $UID The user ID of the modified account
* @param string $N The username as present in the database
*
* @return array Boolean indicating success and message to be printed
*/
function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",
$R="",$L="",$I="",$K="",$PK="",$J="",$CN="",$UID=0,$N="") {
$R="",$L="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$UID=0,$N="") {
global $SUPPORTED_LANGS;
$error = '';
@ -344,6 +346,7 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C=""
$q.= ", PGPKey = " . $dbh->quote(str_replace(" ", "", $K));
$q.= ", InactivityTS = " . $inactivity_ts;
$q.= ", CommentNotify = " . ($CN ? "1" : "0");
$q.= ", UpdateNotify = " . ($UN ? "1" : "0");
$q.= " WHERE ID = ".intval($UID);
$result = $dbh->exec($q);