[aur-dev] [PATCH 2/2] Change merge notification email

2015-06-16 Thread Marcel Korpel
Signed-off-by: Marcel Korpel 
---
 web/lib/pkgbasefuncs.inc.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index e255cb4..0007164 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -461,7 +461,7 @@ function pkgbase_delete ($base_ids, $merge_base_id, $via, 
$grant=false) {
$body = "";
if ($merge_base_id) {
$body .= username_from_sid($_COOKIE['AURSID']) 
. " merged \"".$pkgbase_name."\" into \"$merge_base_name\".\n\n";
-   $body .= "You will no longer receive 
notifications about this package, please go to https://aur.archlinux.org"; . 
get_pkgbase_uri($merge_base_name) . " and click the Notify button if you wish 
to recieve them again.";
+   $body .= "You will no longer receive 
notifications about this package, but you will automatically receive 
notifications about \"$merge_base_name\".";
} else {
$body .= username_from_sid($_COOKIE['AURSID']) 
. " deleted \"".$pkgbase_name."\".\n\n";
$body .= "You will no longer receive 
notifications about this package.";
-- 
2.4.3


[aur-dev] [PATCH 1/2] Merge user ids in CommentNotify

2015-06-16 Thread Marcel Korpel
Fixes FS#27687.

Signed-off-by: Marcel Korpel 
---
 web/lib/pkgbasefuncs.inc.php | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index c8c99eb..e255cb4 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -508,6 +508,24 @@ function pkgbase_delete ($base_ids, $merge_base_id, $via, 
$grant=false) {
$q.= "WHERE PackageBaseID IN (" . implode(",", $base_ids) . ")";
$dbh->exec($q);
 
+   /* Merge comment notifications */
+   $q = "SELECT UserID FROM CommentNotify ";
+   $q.= "WHERE PackageBaseID IN (" . implode(",", $base_ids) . ")";
+   $result = $dbh->query($q);
+
+   while ($uid = $result->fetchColumn(0)) {
+   /* Check if a user already gets notifications from 
$merge_base_id */
+   $q = "SELECT COUNT(*) FROM CommentNotify WHERE ";
+   $q .= "UserID = $uid AND PackageBaseID = " . 
intval($merge_base_id);
+
+   $result_notif = $dbh->query($q);
+   if ($result_notif->fetchColumn() == 0) {
+   $q = "INSERT INTO CommentNotify (PackageBaseID, 
UserID) VALUES (";
+   $q.= intval($merge_base_id) . ", $uid)";
+   $dbh->exec($q);
+   }
+   }
+
/* Merge votes */
foreach ($base_ids as $base_id) {
$q = "UPDATE PackageVotes ";
-- 
2.4.3


[aur-dev] [PATCH] Improve INSTALL details for nginx and config.

2015-06-16 Thread Leonidas Spyropoulos
Signed-off-by: Leonidas Spyropoulos 
---
 INSTALL | 39 +--
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/INSTALL b/INSTALL
index 9040c17..d78740a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,14 +6,41 @@ Setup on Arch Linux
$ cd /srv/http/
$ git clone git://projects.archlinux.org/aurweb.git
 
-2) Setup a web server with PHP and MySQL. Configure the web server to redirect
-   all URLs to /index.php/foo/bar/. The following block can be used with nginx:
-
-location ~ .* {
-rewrite ^/(.*)$ /index.php/$1 last;
+2) Setup a web server with PHP support and MySQL. Configure the web server
+   to redirect all URLs to /index.php/foo/bar/. For nginx a working setup
+   could be:
+
+http {
+   include   mime.types;
+   default_type  application/octet-stream;
+   sendfileon;
+   keepalive_timeout  65;
+   server {
+   listen   80;
+   server_name  localhost;
+   error_log  /var/log/nginx/aurweb.error.log notice;
+   location ~ ^/[^/]+\.php($|/) {
+   fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
+   fastcgi_index  index.php;
+   fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$;
+   fastcgi_param  SCRIPT_FILENAME  
$document_root$fastcgi_script_name;
+   fastcgi_param  PATH_INFO$fastcgi_path_info;
+   includefastcgi_params;
+   }
+   location ~ .* {
+   rewrite ^/(.*)$ /index.php/$1 last;
+   }
+   error_page   500 502 503 504  /50x.html;
+   location = /50x.html {
+   root   /usr/share/nginx/html;
+   }
+   }
+   root   /srv/http/aurweb/web/html;
+   index  index.php index.html index.htm;
 }
 
-3) Copy conf/config.proto to conf/config and adjust the configuration.
+3) Copy conf/config.proto to conf/config and adjust the configuration (pay
+   attention on disable_http_login, enable_maintenance and aur_location)
 
 4) Create a new MySQL database and a user and import the AUR SQL schema:
 
-- 
2.4.3


[aur-dev] [PATCH] reloadtestdb.sh: Use aurweb as main directory

2015-06-16 Thread Marcel Korpel
By default, aurweb is cloned into the aurweb directory nowadays.
---
 schema/reloadtestdb.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/schema/reloadtestdb.sh b/schema/reloadtestdb.sh
index ec8..e839dce 100755
--- a/schema/reloadtestdb.sh
+++ b/schema/reloadtestdb.sh
@@ -11,7 +11,7 @@ echo "Using database $DB_NAME, user $DB_USER, host $DB_HOST"
 
 mydir=$(pwd)
 if [ $(basename $mydir) != "schema" ]; then
-   echo "you must be in the aur/schema directory to run this script"
+   echo "you must be in the aurweb/schema directory to run this script"
exit 1
 fi
 
-- 
2.4.3


[aur-dev] [PATCH] Add aur-git/ and git-interface/git-auth.sh to gitignore.

2015-06-16 Thread Leonidas Spyropoulos
Signed-off-by: Leonidas Spyropoulos 
---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index 590e1ef..c41bf3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@ po/POTFILES
 scripts/git-integration/__pycache__/
 scripts/git-integration/templates/
 web/locale/*/
+aur.git/
+git-interface/git-auth.sh
-- 
2.4.3


[aur-dev] [PATCH] gendummydata.py: Remove CategoryID from dummy data

2015-06-16 Thread Marcel Korpel
---
 schema/gendummydata.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/schema/gendummydata.py b/schema/gendummydata.py
index 7b18a50..9dd2f45 100755
--- a/schema/gendummydata.py
+++ b/schema/gendummydata.py
@@ -202,9 +202,9 @@ for p in list(seen_pkgs.keys()):
 
uuid = genUID() # the submitter/user
 
-   s = ("INSERT INTO PackageBases (ID, Name, CategoryID, SubmittedTS, "
- "SubmitterUID, MaintainerUID, PackagerUID) VALUES (%d, '%s', %d, %d, 
%d, %s, %s);\n")
-   s = s % (seen_pkgs[p], p, genCategory(), NOW, uuid, muid, puid)
+   s = ("INSERT INTO PackageBases (ID, Name, SubmittedTS, "
+ "SubmitterUID, MaintainerUID, PackagerUID) VALUES (%d, '%s', %d, %d, 
%s, %s);\n")
+   s = s % (seen_pkgs[p], p, NOW, uuid, muid, puid)
out.write(s)
 
s = ("INSERT INTO Packages (ID, PackageBaseID, Name, Version) VALUES "
-- 
2.4.3


[aur-dev] Undefined index: AURSID, was: Re: Difficulties setting up local aurweb server

2015-06-16 Thread Marcel Korpel
* Lukas Fleischer  (Tue, 16 Jun 2015 14:05:59
+0200):
> You need to move the block that handles .php URIs above the
> "match-anything" rule, check [1] for details.

Yes, got it! Now aurweb displays fine and I also got the database
connection working after entering another password.

Now there's a strange thing with the dummy data: after removing
CategoryID, of which I'll send in a patch soon, I get an error viewing
the submitter, maintainer and last packager on a package page. Above a
user name, this appears:

Notice: Undefined index: AURSID in /srv/http/aurweb/web/lib/aur.inc.php
on line 189

This only appears when not logged in (but not in live aurweb). Does
there need to be a check for that cookie being present?

Best, Marcel


Re: [aur-dev] [PATCH] Update french translation

2015-06-16 Thread Xorg

Done. Thanks to have added me.

Is it possible to change wiki links? They refer to english wiki, but 
some wiki pages are translated.



Le 16/06/2015 14:10, Lukas Fleischer a écrit :

On Tue, 16 Jun 2015 at 11:12:54, Xorg wrote:

Hi.

Because I'm not a member of french team on Transifex, I can't push the
updated translation on Transifex.
This is my first patch-send on a mailing-list, sorry if I'm wrong.

I added you to the French team on Transifex. You should be able to
submit your changes there now. Thanks!


Re: [aur-dev] [PATCH] Update french translation

2015-06-16 Thread Lukas Fleischer
On Tue, 16 Jun 2015 at 11:12:54, Xorg wrote:
> Hi.
> 
> Because I'm not a member of french team on Transifex, I can't push the 
> updated translation on Transifex.
> This is my first patch-send on a mailing-list, sorry if I'm wrong.

I added you to the French team on Transifex. You should be able to
submit your changes there now. Thanks!


Re: [aur-dev] Difficulties setting up local aurweb server

2015-06-16 Thread Lukas Fleischer
On Tue, 16 Jun 2015 at 13:32:40, Marcel Korpel wrote:
> * Marcel Korpel  (Tue, 16 Jun 2015 11:55:36
> +0200):
> > Also, when going to /packages/, I get a 404 and the log says that the
> > server is looking for /packages/index.php, so there's clearly
> > something wrong with URL rewriting. I uploaded my current nginx.conf
> > at [2].
> 
> About this part: one way or another I had that location block in my
> nginx.conf, I replaced it with the one in INSTALL, but now I get an
> error about "rewrite or internal redirection cycle", as it wants to
> access an infinite amount of /index.php/index.php/…

You need to move the block that handles .php URIs above the
"match-anything" rule, check [1] for details.

[1] http://nginx.org/en/docs/http/ngx_http_core_module.html#location


Re: [aur-dev] Difficulties setting up local aurweb server

2015-06-16 Thread Marcel Korpel
* Marcel Korpel  (Tue, 16 Jun 2015 11:55:36
+0200):
> Also, when going to /packages/, I get a 404 and the log says that the
> server is looking for /packages/index.php, so there's clearly
> something wrong with URL rewriting. I uploaded my current nginx.conf
> at [2].

About this part: one way or another I had that location block in my
nginx.conf, I replaced it with the one in INSTALL, but now I get an
error about "rewrite or internal redirection cycle", as it wants to
access an infinite amount of /index.php/index.php/…


Re: [aur-dev] Difficulties setting up local aurweb server

2015-06-16 Thread Marcel Korpel
* Lukas Fleischer  (Tue, 16 Jun 2015 07:11:44
+0200):
> Move the root and index directives out of the location block (directly
> under the server block).

Ah, now I made progress. I can visit the homepage correctly, it only
complains that it cannot make a database connection, although my server
is running and username and password are correct. Please have a look at
my conf/config [1]. I also disabled maintenance mode, but that didn't
matter.

Also, when going to /packages/, I get a 404 and the log says that the
server is looking for /packages/index.php, so there's clearly something
wrong with URL rewriting. I uploaded my current nginx.conf at [2].

Please have a look at this again, that would be greatly appreciated!

[1] http://pastebin.com/D1XbnJK1
[2] http://pastebin.com/Z9ay8Pc8


[aur-dev] [PATCH] Update french translation

2015-06-16 Thread Xorg

Sorry for the fail.


--- a/po/fr.po2015-06-13 10:26:08.017665000 +0200
+++ b/po/fr.po2015-06-16 11:03:10.436817224 +0200
@@ -14,8 +14,8 @@
 msgstr ""
 "Project-Id-Version: Arch User Repository (AUR)\n"
 "Report-Msgid-Bugs-To: https://bugs.archlinux.org/index.php?project=2\n";
-"POT-Creation-Date: 2015-06-11 23:45+0200\n"
-"PO-Revision-Date: 2015-06-11 21:46+\n"
+"POT-Creation-Date: 2015-06-14 21:56+0200\n"
+"PO-Revision-Date: 2015-06-16 10:53+\n"
 "Last-Translator: Lukas Fleischer \n"
 "Language-Team: French (http://www.transifex.com/projects/p/aur/language/";
 "fr/)\n"
@@ -32,11 +32,12 @@
 msgstr "Désolé, la page que vous avez demandée n’existe pas."

 msgid "Service Unavailable"
-msgstr ""
+msgstr "Service indisponible"

 msgid ""
 "Don't panic! This site is down due to maintenance. We will be back soon."
 msgstr ""
+"Ne paniquez pas ! Le site est fermé pour maintenance. Nous serons 
bientôt de retour."


 msgid "Account"
 msgstr "Compte"
@@ -116,7 +117,7 @@
 msgstr "Soumettre"

 msgid "Manage Co-maintainers"
-msgstr ""
+msgstr "Gérer les co-mainteneurs"

 msgid "Home"
 msgstr "Accueil"
@@ -156,48 +157,78 @@
 "Les paquets non supportés sont produits par des utilisateurs. Toute "
 "utilisation des fichiers fournis se fait à vos propres risques."

+msgid "Learn more..."
+msgstr "En apprendre plus..."
+
 msgid "Support"
-msgstr ""
+msgstr "Soutien"

 msgid "Package Requests"
-msgstr ""
+msgstr "Requêtes de paquet"

 #, php-format
 msgid ""
 "There are three types of requests that can be filed in the %sPackage 
Actions"

 "%s box on the package details page:"
 msgstr ""
+"Il existe trois types de requêtes qui peuvent être soumises dans la 
boîte %sActions du paquet"

+"%s sur la page des détails d'un paquet :"

 msgid "Orphan Request"
-msgstr ""
+msgstr "Requête de destitution"

 msgid ""
 "Request a package to be disowned, e.g. when the maintainer is 
inactive and "

 "the package has been flagged out-of-date for a long time."
 msgstr ""
+"Demande qu'un paquet soit destitué, c'est-à-dire quand le mainteneur 
est inactif et "

+"que le paquet a été marqué comme périmé depuis un long moment."

 msgid "Deletion Request"
-msgstr ""
+msgstr "Requête de suppression"

 msgid ""
 "Request a package to be removed from the Arch User Repository. Please 
do not "
 "use this if a package is broken and can be fixed easily. Instead, 
contact "

 "the package maintainer and file orphan request if necessary."
 msgstr ""
+"Demande qu'un paquet soit supprimé d'AUR. Prière de ne pas "
+"l'utiliser si un paquet est cassé et que le problème peut être réglé 
facilement. À la place, contactez "
+"le mainteneur du paquet, et soumettez une requête de destitution si 
nécessaire."


 msgid "Merge Request"
-msgstr ""
+msgstr "Requête de fusion"

 msgid ""
 "Request a package to be merged into another one. Can be used when a 
package "

 "needs to be renamed or replaced by a split package."
 msgstr ""
+"Demande que le paquet soit fusionné dans un autre. Peut être utilisé 
quand un paquet "

+"a besoin d'être renommé ou bien remplacé par un paquet splitté."

 #, php-format
 msgid ""
 "If you want to discuss a request, you can use the %saur-requests%s 
mailing "

 "list. However, please do not use that list to file requests."
 msgstr ""
+"Si vous voulez débattre d'une requête, vous pouvez utiliser la 
mailing-list %saur-requests%s. "
+"Cependant, merci de ne pas utiliser cette liste pour soumettre des 
requêtes."

+
+msgid "Submitting Packages"
+msgstr "Soumission de paquets"
+
+#, php-format
+msgid ""
+"Git over SSH is now used to submit packages to the AUR. See the 
%sSubmitting "

+"packages%s section of the Arch User Repository ArchWiki page for more "
+"details."
+msgstr ""
+"Git par-dessus SSH est maintenant utilisé pour soumettre des paquets 
sur AUR. Voir la section %sSoumettre "

+"des paquets%s sur la page Arch User Repository du wiki pour plus de "
+"détails."
+
+msgid "The following SSH fingerprints are used for the AUR:"
+msgstr "Les empreintes SSH suivantes sont utilisées pour AUR :"

 msgid "Discussion"
 msgstr "Discussion"
@@ -208,6 +239,10 @@
 "structure takes place on %saur-general%s. For discussion relating to 
the "

 "development of the AUR web interface, use the %saur-dev%s mailing list."
 msgstr ""
+"Les discussions générales en rapport avec AUR (Arch User Repository, 
dépôt des utilisateurs d’Arch Linux) "

+"et les TU (Trusted User, utilisateurs de confiance) "
+"ont lieu sur %saur-general%s. Pour les discussions en rapport "
+"avec le développement de l'interface web d'AUR, utilisez la 
mailing-list %saur-dev.%s"


 msgid "Bug Reporting"
 msgstr "Rapports de bug"
@@ -219,6 +254,9 @@
 "report packaging bugs contact the package maintainer or leave a 
comment on "

 "the appropriate package page."
 msgstr ""
+"Si vous trouvez un bug dans l'interface web d'AUR, merci de remplir un 
rapport de bug sur "

+"le %sbug tracker%s. N’utilisez le tracker %sque%s pour les bugs de AUR. "
+"Pour signaler un bu

[aur-dev] [PATCH] Update french translation

2015-06-16 Thread Xorg

Hi.

Because I'm not a member of french team on Transifex, I can't push the 
updated translation on Transifex.

This is my first patch-send on a mailing-list, sorry if I'm wrong.
--- a/po/fr.po	2015-06-13 10:26:08.017665000 +0200
+++ b/po/fr.po	2015-06-16 11:03:10.436817224 +0200
@@ -14,8 +14,8 @@
 msgstr ""
 "Project-Id-Version: Arch User Repository (AUR)\n"
 "Report-Msgid-Bugs-To: https://bugs.archlinux.org/index.php?project=2\n";
-"POT-Creation-Date: 2015-06-11 23:45+0200\n"
-"PO-Revision-Date: 2015-06-11 21:46+\n"
+"POT-Creation-Date: 2015-06-14 21:56+0200\n"
+"PO-Revision-Date: 2015-06-16 10:53+\n"
 "Last-Translator: Lukas Fleischer \n"
 "Language-Team: French (http://www.transifex.com/projects/p/aur/language/";
 "fr/)\n"
@@ -32,11 +32,12 @@
 msgstr "Désolé, la page que vous avez demandée n’existe pas."
 
 msgid "Service Unavailable"
-msgstr ""
+msgstr "Service indisponible"
 
 msgid ""
 "Don't panic! This site is down due to maintenance. We will be back soon."
 msgstr ""
+"Ne paniquez pas ! Le site est fermé pour maintenance. Nous serons bientôt de retour."
 
 msgid "Account"
 msgstr "Compte"
@@ -116,7 +117,7 @@
 msgstr "Soumettre"
 
 msgid "Manage Co-maintainers"
-msgstr ""
+msgstr "Gérer les co-mainteneurs"
 
 msgid "Home"
 msgstr "Accueil"
@@ -156,48 +157,78 @@
 "Les paquets non supportés sont produits par des utilisateurs. Toute "
 "utilisation des fichiers fournis se fait à vos propres risques."
 
+msgid "Learn more..."
+msgstr "En apprendre plus..."
+
 msgid "Support"
-msgstr ""
+msgstr "Soutien"
 
 msgid "Package Requests"
-msgstr ""
+msgstr "Requêtes de paquet"
 
 #, php-format
 msgid ""
 "There are three types of requests that can be filed in the %sPackage Actions"
 "%s box on the package details page:"
 msgstr ""
+"Il existe trois types de requêtes qui peuvent être soumises dans la boîte %sActions du paquet"
+"%s sur la page des détails d'un paquet :"
 
 msgid "Orphan Request"
-msgstr ""
+msgstr "Requête de destitution"
 
 msgid ""
 "Request a package to be disowned, e.g. when the maintainer is inactive and "
 "the package has been flagged out-of-date for a long time."
 msgstr ""
+"Demande qu'un paquet soit destitué, c'est-à-dire quand le mainteneur est inactif et "
+"que le paquet a été marqué comme périmé depuis un long moment."
 
 msgid "Deletion Request"
-msgstr ""
+msgstr "Requête de suppression"
 
 msgid ""
 "Request a package to be removed from the Arch User Repository. Please do not "
 "use this if a package is broken and can be fixed easily. Instead, contact "
 "the package maintainer and file orphan request if necessary."
 msgstr ""
+"Demande qu'un paquet soit supprimé d'AUR. Prière de ne pas "
+"l'utiliser si un paquet est cassé et que le problème peut être réglé facilement. À la place, contactez "
+"le mainteneur du paquet, et soumettez une requête de destitution si nécessaire."
 
 msgid "Merge Request"
-msgstr ""
+msgstr "Requête de fusion"
 
 msgid ""
 "Request a package to be merged into another one. Can be used when a package "
 "needs to be renamed or replaced by a split package."
 msgstr ""
+"Demande que le paquet soit fusionné dans un autre. Peut être utilisé quand un paquet "
+"a besoin d'être renommé ou bien remplacé par un paquet splitté."
 
 #, php-format
 msgid ""
 "If you want to discuss a request, you can use the %saur-requests%s mailing "
 "list. However, please do not use that list to file requests."
 msgstr ""
+"Si vous voulez débattre d'une requête, vous pouvez utiliser la mailing-list %saur-requests%s. "
+"Cependant, merci de ne pas utiliser cette liste pour soumettre des requêtes."
+
+msgid "Submitting Packages"
+msgstr "Soumission de paquets"
+
+#, php-format
+msgid ""
+"Git over SSH is now used to submit packages to the AUR. See the %sSubmitting "
+"packages%s section of the Arch User Repository ArchWiki page for more "
+"details."
+msgstr ""
+"Git par-dessus SSH est maintenant utilisé pour soumettre des paquets sur AUR. Voir la section %sSoumettre "
+"des paquets%s sur la page Arch User Repository du wiki pour plus de "
+"détails."
+
+msgid "The following SSH fingerprints are used for the AUR:"
+msgstr "Les empreintes SSH suivantes sont utilisées pour AUR :"
 
 msgid "Discussion"
 msgstr "Discussion"
@@ -208,6 +239,10 @@
 "structure takes place on %saur-general%s. For discussion relating to the "
 "development of the AUR web interface, use the %saur-dev%s mailing list."
 msgstr ""
+"Les discussions générales en rapport avec AUR (Arch User Repository, dépôt des utilisateurs d’Arch Linux) "
+"et les TU (Trusted User, utilisateurs de confiance) "
+"ont lieu sur %saur-general%s. Pour les discussions en rapport "
+"avec le développement de l'interface web d'AUR, utilisez la mailing-list %saur-dev.%s"
 
 msgid "Bug Reporting"
 msgstr "Rapports de bug"
@@ -219,6 +254,9 @@
 "report packaging bugs contact the package maintainer or leave a comment on "
 "the appropriate package page."
 msgstr ""
+"Si vo