summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/acctfuncs.inc.php15
-rw-r--r--web/lib/confparser.inc.php2
-rw-r--r--web/lib/pkgbasefuncs.inc.php9
-rw-r--r--web/lib/pkgfuncs.inc.php4
-rw-r--r--web/lib/pkgreqfuncs.inc.php2
-rw-r--r--web/lib/version.inc.php2
6 files changed, 23 insertions, 11 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 2d70f65..172b962 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -52,19 +52,21 @@ function html_format_pgp_fingerprint($fingerprint) {
* @param string $C The confirmed password value of the displayed user
* @param string $R The real name of the displayed user
* @param string $L The language preference of the displayed user
+ * @param string $HP The homepage of the displayed user
* @param string $I The IRC nickname of the displayed user
* @param string $K The PGP key fingerprint of the displayed user
* @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 $ON Whether to notify of ownership changes
* @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="",$UN="",$UID=0,$N="") {
+ $L="",$HP="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$ON="",$UID=0,$N="") {
global $SUPPORTED_LANGS;
include("account_edit_form.php");
@@ -86,19 +88,21 @@ function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R=""
* @param string $C The confirmed password for the user
* @param string $R The real name of the user
* @param string $L The language preference of the user
+ * @param string $HP The homepage of the displayed user
* @param string $I The IRC nickname of the user
* @param string $K The PGP fingerprint of the user
* @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 $ON Whether to notify of ownership changes
* @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="",$UN="",$UID=0,$N="") {
+ $R="",$L="",$HP="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$ON="",$UID=0,$N="") {
global $SUPPORTED_LANGS;
$error = '';
@@ -274,13 +278,14 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C=""
$salt = $dbh->quote($salt);
$R = $dbh->quote($R);
$L = $dbh->quote($L);
+ $HP = $dbh->quote($HP);
$I = $dbh->quote($I);
$K = $dbh->quote(str_replace(" ", "", $K));
$q = "INSERT INTO Users (AccountTypeID, Suspended, ";
$q.= "InactivityTS, Username, Email, Passwd, Salt, ";
- $q.= "RealName, LangPreference, IRCNick, PGPKey) ";
+ $q.= "RealName, LangPreference, Homepage, IRCNick, PGPKey) ";
$q.= "VALUES (1, 0, 0, $U, $E, $P, $salt, $R, $L, ";
- $q.= "$I, $K)";
+ $q.= "$HP, $I, $K)";
$result = $dbh->exec($q);
if (!$result) {
$message = __("Error trying to create account, %s%s%s.",
@@ -342,11 +347,13 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C=""
}
$q.= ", RealName = " . $dbh->quote($R);
$q.= ", LangPreference = " . $dbh->quote($L);
+ $q.= ", Homepage = " . $dbh->quote($HP);
$q.= ", IRCNick = " . $dbh->quote($I);
$q.= ", PGPKey = " . $dbh->quote(str_replace(" ", "", $K));
$q.= ", InactivityTS = " . $inactivity_ts;
$q.= ", CommentNotify = " . ($CN ? "1" : "0");
$q.= ", UpdateNotify = " . ($UN ? "1" : "0");
+ $q.= ", OwnershipNotify = " . ($ON ? "1" : "0");
$q.= " WHERE ID = ".intval($UID);
$result = $dbh->exec($q);
diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php
index 6368b86..789300e 100644
--- a/web/lib/confparser.inc.php
+++ b/web/lib/confparser.inc.php
@@ -4,7 +4,7 @@ function config_load() {
global $AUR_CONFIG;
if (!isset($AUR_CONFIG)) {
- $AUR_CONFIG = parse_ini_file("../../conf/config", true, INI_SCANNER_RAW);
+ $AUR_CONFIG = parse_ini_file("/etc/aurweb/config", true, INI_SCANNER_RAW);
}
}
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 1691bff..b082784 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -661,6 +661,9 @@ function pkgbase_adopt ($base_ids, $action=true, $via) {
$q.= "SET MaintainerUID = $uid ";
$q.= "WHERE ID IN (" . implode(",", $base_ids) . ") ";
$dbh->exec($q);
+
+ /* Add the new maintainer to the notification list. */
+ pkgbase_notify($base_ids);
} else {
/* Update the co-maintainer list when disowning a package. */
if (has_credential(CRED_PKGBASE_DISOWN)) {
@@ -692,8 +695,11 @@ function pkgbase_adopt ($base_ids, $action=true, $via) {
}
}
+ foreach ($base_ids as $base_id) {
+ notify(array($action ? 'adopt' : 'disown', $base_id, $uid));
+ }
+
if ($action) {
- pkgbase_notify($base_ids);
return array(true, __("The selected packages have been adopted."));
} else {
return array(true, __("The selected packages have been disowned."));
@@ -1056,7 +1062,6 @@ function pkgbase_set_keywords($base_id, $keywords) {
$i = 0;
foreach ($keywords as $keyword) {
$q = sprintf("INSERT INTO PackageKeywords (PackageBaseID, Keyword) VALUES (%d, %s)", $base_id, $dbh->quote($keyword));
- var_dump($q);
$dbh->exec($q);
$i++;
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index f34dbba..4b0fdba 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -230,7 +230,7 @@ function pkg_providers($name) {
* Get package dependencies for a specific package
*
* @param int $pkgid The package to get dependencies for
- * @param int $limit An upper bound on the number of packages to retrieve
+ * @param int $limit An upper bound for the number of packages to retrieve
*
* @return array All package dependencies for the package
*/
@@ -506,7 +506,7 @@ function pkg_source_link($url, $arch) {
*
* @param string $name The package name for the dependency search
* @param array $provides A list of virtual provisions of the package
- * @param int $limit An upper bound on the number of packages to retrieve
+ * @param int $limit An upper bound for the number of packages to retrieve
*
* @return array All packages that depend on the specified package name
*/
diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php
index cf56663..8ceac8d 100644
--- a/web/lib/pkgreqfuncs.inc.php
+++ b/web/lib/pkgreqfuncs.inc.php
@@ -221,7 +221,7 @@ function pkgreq_close($id, $reason, $comments, $auto_close=false) {
$dbh = DB::connect();
$id = intval($id);
- $uid = uid_from_sid($_COOKIE["AURSID"]);
+ $uid = $auto_close ? 0 : uid_from_sid($_COOKIE["AURSID"]);
if (!$auto_close && !has_credential(CRED_PKGREQ_CLOSE)) {
return array(false, __("Only TUs and developers can close requests."));
diff --git a/web/lib/version.inc.php b/web/lib/version.inc.php
index 9c0a5e6..dcf5666 100644
--- a/web/lib/version.inc.php
+++ b/web/lib/version.inc.php
@@ -1,3 +1,3 @@
<?php
-define("AURWEB_VERSION", "v4.2.1");
+define("AURWEB_VERSION", "v4.4.1");