[aur-dev] [PATCH] Add timestamp when a package is flagged out-of-date (FS#20848).
--- UPGRADING | 4 ++++ support/schema/aur-schema.sql | 1 + web/lang/cs.po | 2 +- web/lang/de.po | 2 +- web/lang/el_GR.po | 2 +- web/lang/fr.po | 2 +- web/lang/he.po | 2 +- web/lang/hr.po | 2 +- web/lang/hu.po | 2 +- web/lang/it.po | 2 +- web/lang/nb_NO.po | 2 +- web/lang/pl.po | 2 +- web/lang/ro.po | 2 +- web/lang/ru.po | 2 +- web/lang/sr.po | 2 +- web/lang/tr.po | 2 +- web/lang/uk.po | 2 +- web/lang/zh_CN.po | 2 +- web/lib/pkgfuncs.inc | 3 ++- web/template/pkg_details.php | 3 ++- 20 files changed, 25 insertions(+), 18 deletions(-) diff --git a/UPGRADING b/UPGRADING index 743f404..99c5d1a 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,6 +1,10 @@ Upgrading ========= +From 1.7.0 +---------- +ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NOT NULL; + From 1.6.0 to 1.7.0 ------------------- ALTER TABLE Users ADD Salt CHAR(32) NOT NULL DEFAULT ''; diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 250d405..15705a3 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -120,6 +120,7 @@ CREATE TABLE Packages ( LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, OutOfDate TINYINT UNSIGNED DEFAULT 0, + OutOfDateTS BIGINT UNSIGNED NOT NULL, SubmittedTS BIGINT UNSIGNED NOT NULL, ModifiedTS BIGINT UNSIGNED NOT NULL, SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it? diff --git a/web/lang/cs.po b/web/lang/cs.po index e430d05..214df00 100644 --- a/web/lang/cs.po +++ b/web/lang/cs.po @@ -15,7 +15,7 @@ global $_t; $_t["Search by"] = "Vyhledat dle"; -$_t["This package has been flagged out of date."] = "BalÃÄek byl oznaÄen jako zastaralý."; +$_t["This package has been flagged out of date"] = "BalÃÄek byl oznaÄen jako zastaralý"; $_t["Voted"] = "Hlasováno"; diff --git a/web/lang/de.po b/web/lang/de.po index 929e6f8..bbaa16b 100644 --- a/web/lang/de.po +++ b/web/lang/de.po @@ -390,7 +390,7 @@ $_t["You are not allowed to access this area."] = "Es ist Dir nicht erlaubt, auf $_t["Unsafe"] = "Unsicher"; -$_t["This package has been flagged out of date."] = "Dieses Paket wurde als veraltet markiert."; +$_t["This package has been flagged out of date"] = "Dieses Paket wurde als veraltet markiert"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Die obigen Dateien wurden (von %h%s%h) als sicher markiert."; diff --git a/web/lang/el_GR.po b/web/lang/el_GR.po index 5f5c96c..4118c18 100644 --- a/web/lang/el_GR.po +++ b/web/lang/el_GR.po @@ -86,7 +86,7 @@ $_t["Unsupported packages are user produced content. Any use of the provided fil $_t["Search by"] = "ÎναζήÏηÏη καÏά"; -$_t["This package has been flagged out of date."] = "ÎÏ ÏÏ Ïο ÏακÎÏο ÎÏει ÏαÏακÏηÏιÏÏεί ÏαÏÏÏημÎνο."; +$_t["This package has been flagged out of date"] = "ÎÏ ÏÏ Ïο ÏακÎÏο ÎÏει ÏαÏακÏηÏιÏÏεί ÏαÏÏÏημÎνο"; $_t["Voted"] = "ΨηÏιÏμÎνο"; diff --git a/web/lang/fr.po b/web/lang/fr.po index 596f4af..1ce1896 100644 --- a/web/lang/fr.po +++ b/web/lang/fr.po @@ -405,7 +405,7 @@ $_t["Out of Date"] = "Périmé"; $_t["Required by"] = "Requis par"; -$_t["This package has been flagged out of date."] = "Ce paquet a été marqué comme périmé."; +$_t["This package has been flagged out of date"] = "Ce paquet a été marqué comme périmé"; $_t["Toggle Notify"] = "Suivre/Ne plus suivre"; diff --git a/web/lang/he.po b/web/lang/he.po index d5c19b7..ad0c558 100644 --- a/web/lang/he.po +++ b/web/lang/he.po @@ -14,7 +14,7 @@ global $_t; $_t["Confirm your e-mail address:"] = "××ש×ר ×ת××ת ×××××´× ×©××"; -$_t["This package has been flagged out of date."] = "×××××× ×ס××× ×ª ××× ×¢××× ×ת."; +$_t["This package has been flagged out of date"] = "×××××× ×ס××× ×ª ××× ×¢××× ×ת"; $_t["Missing a required field."] = "ש×× ××ר×× ×סר."; diff --git a/web/lang/hr.po b/web/lang/hr.po index 93028b7..4d46fec 100644 --- a/web/lang/hr.po +++ b/web/lang/hr.po @@ -162,7 +162,7 @@ $_t["Description"] = "Opis"; $_t["unknown"] = "nepoznato"; -$_t["This package has been flagged out of date."] = "Paket je obilježen kao zastarijeli."; +$_t["This package has been flagged out of date"] = "Paket je obilježen kao zastarijeli"; $_t["No New Comment Notification"] = "Nemoj me viÅ¡e obavjeÅ¡tavati o novim komentarima"; diff --git a/web/lang/hu.po b/web/lang/hu.po index e198ac3..54f3a12 100644 --- a/web/lang/hu.po +++ b/web/lang/hu.po @@ -6,7 +6,7 @@ global $_t; $_t["Search by"] = "Keresés eszerint"; -$_t["This package has been flagged out of date."] = "Ez a csomag elavultnak van jelölve."; +$_t["This package has been flagged out of date"] = "Ez a csomag elavultnak van jelölve"; $_t["Missing a required field."] = "Egy kötelezÅ mezÅ megadása hiányzik."; diff --git a/web/lang/it.po b/web/lang/it.po index 4bd0727..5876c45 100644 --- a/web/lang/it.po +++ b/web/lang/it.po @@ -411,7 +411,7 @@ $_t["Required by"] = "Richiesto da"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "I file sono stati verificati (da %h%s%h) ed il loro utilizzo è da considerarsi sicuro."; -$_t["This package has been flagged out of date."] = "Questo pacchetto è stato contrassegnato come non aggiornato."; +$_t["This package has been flagged out of date"] = "Questo pacchetto è stato contrassegnato come non aggiornato"; $_t["Toggle Notify"] = "Rimuovi la notifica"; diff --git a/web/lang/nb_NO.po b/web/lang/nb_NO.po index 687e639..1b8b20e 100644 --- a/web/lang/nb_NO.po +++ b/web/lang/nb_NO.po @@ -14,7 +14,7 @@ global $_t; $_t["Search by"] = "Søk etter"; -$_t["This package has been flagged out of date."] = "Denne pakken har blitt merket som utdatert."; +$_t["This package has been flagged out of date"] = "Denne pakken har blitt merket som utdatert"; $_t["Voted"] = "Stemmet"; diff --git a/web/lang/pl.po b/web/lang/pl.po index 967ab36..e337bb1 100644 --- a/web/lang/pl.po +++ b/web/lang/pl.po @@ -367,7 +367,7 @@ $_t["unknown"] = "nieznana"; $_t["Out of Date"] = "Nieaktualny"; -$_t["This package has been flagged out of date."] = "Ten pakiet zostaÅ oznaczony jako nieaktualny."; +$_t["This package has been flagged out of date"] = "Ten pakiet zostaÅ oznaczony jako nieaktualny"; $_t["Required by"] = "Wymagane przez"; diff --git a/web/lang/ro.po b/web/lang/ro.po index 0118f24..3a41477 100644 --- a/web/lang/ro.po +++ b/web/lang/ro.po @@ -14,7 +14,7 @@ global $_t; $_t["Search by"] = "CautÄ dupÄ"; -$_t["This package has been flagged out of date."] = "Acest pachet a fost marcat ca Neactualizat."; +$_t["This package has been flagged out of date"] = "Acest pachet a fost marcat ca Neactualizat"; $_t["Voted"] = "Votat"; diff --git a/web/lang/ru.po b/web/lang/ru.po index 2382b35..020f230 100644 --- a/web/lang/ru.po +++ b/web/lang/ru.po @@ -389,7 +389,7 @@ $_t["You are not allowed to access this area."] = "ÐоÑÑÑп ÑÑда вам $_t["Unsafe"] = "ÐебезопанÑй"; -$_t["This package has been flagged out of date."] = "ÐÐ°ÐºÐµÑ Ð¾ÑмеÑен как ÑÑÑаÑевÑий."; +$_t["This package has been flagged out of date"] = "ÐÐ°ÐºÐµÑ Ð¾ÑмеÑен как ÑÑÑаÑевÑий"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Ð¤Ð°Ð¹Ð»Ñ Ð¿ÑовеÑÐµÐ½Ñ %h%s%h и могÑÑ Ð±ÑÑÑ Ð±ÐµÐ·Ð¾Ð¿Ð°Ñно иÑполÑзованÑ."; diff --git a/web/lang/sr.po b/web/lang/sr.po index ddd54da..c743728 100644 --- a/web/lang/sr.po +++ b/web/lang/sr.po @@ -14,7 +14,7 @@ global $_t; $_t["Search by"] = "Pretražuje se"; -$_t["This package has been flagged out of date."] = "Paket je oznaÄen kao zastareo"; +$_t["This package has been flagged out of date"] = "Paket je oznaÄen kao zastareo"; $_t["Missing a required field."] = "Nedostaje neophodno polje."; diff --git a/web/lang/tr.po b/web/lang/tr.po index 5d41840..df608ac 100644 --- a/web/lang/tr.po +++ b/web/lang/tr.po @@ -400,7 +400,7 @@ $_t["Required by"] = "Ä°htiyaç duyan"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Yukarıdaki dosyalar doÄrulandı (%h%s%h tarafından) ve kullanım için güvenli olarak iÅaretlendi."; -$_t["This package has been flagged out of date."] = "Bu paket güncel deÄil olarak iÅaretlendi."; +$_t["This package has been flagged out of date"] = "Bu paket güncel deÄil olarak iÅaretlendi"; $_t["Toggle Notify"] = "Toggle Notify"; diff --git a/web/lang/uk.po b/web/lang/uk.po index 007c30e..3023f78 100644 --- a/web/lang/uk.po +++ b/web/lang/uk.po @@ -170,7 +170,7 @@ $_t["Description"] = "ÐпиÑ"; $_t["unknown"] = "невÑдомо"; -$_t["This package has been flagged out of date."] = "ЦÑÐ¾Ð¼Ñ Ð¿Ð°ÐºÑÐ½ÐºÑ Ð¿ÑизнаÑено мÑÑÐºÑ ÐаÑÑаÑÑлий"; +$_t["This package has been flagged out of date"] = "ЦÑÐ¾Ð¼Ñ Ð¿Ð°ÐºÑÐ½ÐºÑ Ð¿ÑизнаÑено мÑÑÐºÑ ÐаÑÑаÑÑлий"; $_t["No New Comment Notification"] = "ÐÐµÐ¼Ð°Ñ Ð½Ð¾Ð²Ð¸Ñ ÑповÑÑÐµÐ½Ñ Ð¿Ñо коменÑаÑÑ"; diff --git a/web/lang/zh_CN.po b/web/lang/zh_CN.po index 19cc4f6..42d0f09 100644 --- a/web/lang/zh_CN.po +++ b/web/lang/zh_CN.po @@ -17,7 +17,7 @@ global $_t; $_t["Search by"] = "æç´¢"; -$_t["This package has been flagged out of date."] = "æ¤å 已被æ 记为è¿æã"; +$_t["This package has been flagged out of date"] = "æ¤å 已被æ 记为è¿æã"; $_t["Missing a required field."] = "缺å°å¿ 填项ã"; diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 5605daa..02c9c1c 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -643,7 +643,8 @@ function pkg_flag ($atype, $ids, $action = True) { } $ood = $action ? 1 : 0; - $q = "UPDATE Packages SET OutOfDate = " . $ood; + $q = "UPDATE Packages SET OutOfDate = " . $ood . ","; + $q.= " OutOfDateTS = UNIX_TIMESTAMP()"; $q.= " WHERE ID IN (" . $flag . ")"; db_query($q, $dbh); diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 9c76ab3..a0996b9 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -35,6 +35,7 @@ $license = empty($row['License']) ? $msg : $row['License']; # Print the timestamps for last updates $updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["ModifiedTS"])); $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["SubmittedTS"])); +$out_of_date_time = ($row["OutOfDateTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["OutOfDateTS"])); ?> <div class="pgbox"> @@ -70,7 +71,7 @@ $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval( } if ($row["OutOfDate"] == 1) { - echo "<br /><span class='f6'>".__("This package has been flagged out of date.")."</span>"; + echo "<br /><span class='f6'>".__("This package has been flagged out of date")." (".$out_of_date_time.")</span>"; } ?> </p> -- 1.7.3
On Thu 30 Sep 2010 18:19 +0200, Lukas Fleischer wrote:
--- UPGRADING | 4 ++++ support/schema/aur-schema.sql | 1 + web/lang/cs.po | 2 +- web/lang/de.po | 2 +- web/lang/el_GR.po | 2 +- web/lang/fr.po | 2 +- web/lang/he.po | 2 +- web/lang/hr.po | 2 +- web/lang/hu.po | 2 +- web/lang/it.po | 2 +- web/lang/nb_NO.po | 2 +- web/lang/pl.po | 2 +- web/lang/ro.po | 2 +- web/lang/ru.po | 2 +- web/lang/sr.po | 2 +- web/lang/tr.po | 2 +- web/lang/uk.po | 2 +- web/lang/zh_CN.po | 2 +- web/lib/pkgfuncs.inc | 3 ++- web/template/pkg_details.php | 3 ++- 20 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/UPGRADING b/UPGRADING index 743f404..99c5d1a 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,6 +1,10 @@ Upgrading =========
+From 1.7.0 +---------- +ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NOT NULL; + From 1.6.0 to 1.7.0 ------------------- ALTER TABLE Users ADD Salt CHAR(32) NOT NULL DEFAULT ''; diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 250d405..15705a3 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -120,6 +120,7 @@ CREATE TABLE Packages ( LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, OutOfDate TINYINT UNSIGNED DEFAULT 0, + OutOfDateTS BIGINT UNSIGNED NOT NULL, SubmittedTS BIGINT UNSIGNED NOT NULL, ModifiedTS BIGINT UNSIGNED NOT NULL, SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it?
I was thinking - could we just change things so that OutOfDateTS is the sole indicator of whether a package has been flagged or not? If it's set, then it's out of date. If it's zero or null, then it's up to date. This might also apply to deletion, or orphan requests. Really all these types of flagging could share the same structure and code as far as I can envision it. Also, I think that all these translation changes are really unnecessary.
On Fri, Oct 1, 2010 at 9:39 PM, Loui Chang <louipc.ist@gmail.com> wrote:
On Thu 30 Sep 2010 18:19 +0200, Lukas Fleischer wrote: I was thinking - could we just change things so that OutOfDateTS is the sole indicator of whether a package has been flagged or not?
If it's set, then it's out of date. If it's zero or null, then it's up to date.
This might also apply to deletion, or orphan requests. Really all these types of flagging could share the same structure and code as far as I can envision it.
I made this exact change to the archweb code a while back; this is a great usage of a nullable column. http://projects.archlinux.org/archweb.git/diff/?id=edfdc2&id2=845838 Skip over the new migrations code (main/migrations/*.py); and look at the other changes if you are curious. -Dan
Hello, While working on a better E-mail validation, i found some cross-site vulnerabilities in the lib/accfuncs.inc. Here is the Patch, witch is fixing this problem. I hope, that i found all relevant parts, because I'm not so familiar with this site. You can try it by your own by setting a user name or e-mail with a single quote. Like: "foo'><script>alert('XSS');</script>" I will soon commit a patch for the E-mail validation using this website[1]. The most is working, except an problem with the double quotes. [1] http://www.linuxjournal.com/article/9585 greetings Viktor
On Sat 02 Oct 2010 16:56 +0000, Viktor Leonhardt wrote:
Hello, While working on a better E-mail validation, i found some cross-site vulnerabilities in the lib/accfuncs.inc. Here is the Patch, witch is fixing this problem. I hope, that i found all relevant parts, because I'm not so familiar with this site. You can try it by your own by setting a user name or e-mail with a single quote. Like:
"foo'><script>alert('XSS');</script>"
I will soon commit a patch for the E-mail validation using this website[1]. The most is working, except an problem with the double quotes.
[1] http://www.linuxjournal.com/article/9585
greetings Viktor
From eaea9a4d11c1cd2740079864d28d9a10329fe849 Mon Sep 17 00:00:00 2001 From: Viktor Leonhardt <leonharv@unix-ag.uni-kl.de> Date: Sat, 2 Oct 2010 16:47:52 +0000 Subject: [PATCH] Fixing XSS vulnerability
--- web/lib/acctfuncs.inc | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
Wow I thought that was fixed a long time ago. Thanks.
On Fri 01 Oct 2010 21:41 -0500, Dan McGee wrote:
On Fri, Oct 1, 2010 at 9:39 PM, Loui Chang <louipc.ist@gmail.com> wrote:
On Thu 30 Sep 2010 18:19 +0200, Lukas Fleischer wrote: I was thinking - could we just change things so that OutOfDateTS is the sole indicator of whether a package has been flagged or not?
If it's set, then it's out of date. If it's zero or null, then it's up to date.
This might also apply to deletion, or orphan requests. Really all these types of flagging could share the same structure and code as far as I can envision it.
I made this exact change to the archweb code a while back; this is a great usage of a nullable column. http://projects.archlinux.org/archweb.git/diff/?id=edfdc2&id2=845838
Yep. It makes sense to me.
Skip over the new migrations code (main/migrations/*.py); and look at the other changes if you are curious.
Wow that migrations code is crazy. I just added a text file that people can read and manually update their database.
On Saturday, October 2, 2010, Loui Chang <louipc.ist@gmail.com> wrote:
On Fri 01 Oct 2010 21:41 -0500, Dan McGee wrote:
On Fri, Oct 1, 2010 at 9:39 PM, Loui Chang <louipc.ist@gmail.com> wrote:
On Thu 30 Sep 2010 18:19 +0200, Lukas Fleischer wrote: I was thinking - could we just change things so that OutOfDateTS is the sole indicator of whether a package has been flagged or not?
If it's set, then it's out of date. If it's zero or null, then it's up to date.
This might also apply to deletion, or orphan requests. Really all these types of flagging could share the same structure and code as far as I can envision it.
I made this exact change to the archweb code a while back; this is a great usage of a nullable column. http://projects.archlinux.org/archweb.git/diff/?id=edfdc2&id2=845838
Yep. It makes sense to me.
Skip over the new migrations code (main/migrations/*.py); and look at the other changes if you are curious.
Wow that migrations code is crazy. I just added a text file that people can read and manually update their database.
Crazy if you're viewing it the way you are as something to try and understand. 100% awesome if you realize the generation and application of them is completely automated. Trust me, it is a huge step up and the additional complexity makes it a lot more flexible and robust. -Dan
On Fri, Oct 01, 2010 at 10:39:37PM -0400, Loui Chang wrote:
I was thinking - could we just change things so that OutOfDateTS is the sole indicator of whether a package has been flagged or not?
If it's set, then it's out of date. If it's zero or null, then it's up to date.
I basically agree and I already changed the patch to only the "OutOfDateTS" column only. The only thing that I'm not sure how to implement is the migration code, notably the default timestamp to use for packages that are flagged out-of-date when upgrading. Which is the best value to choose? Zero? UNIX_TIMESTAMP()?
On Sun, Oct 3, 2010 at 1:34 PM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Fri, Oct 01, 2010 at 10:39:37PM -0400, Loui Chang wrote:
I was thinking - could we just change things so that OutOfDateTS is the sole indicator of whether a package has been flagged or not?
If it's set, then it's out of date. If it's zero or null, then it's up to date.
I basically agree and I already changed the patch to only the "OutOfDateTS" column only. The only thing that I'm not sure how to implement is the migration code, notably the default timestamp to use for packages that are flagged out-of-date when upgrading.
Which is the best value to choose? Zero? UNIX_TIMESTAMP()?
Current time is probably the best idea. I also have no idea why this isn't just a datetime column. -Dan
On Sun, Oct 03, 2010 at 01:35:45PM -0500, Dan McGee wrote:
On Sun, Oct 3, 2010 at 1:34 PM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
I basically agree and I already changed the patch to only the "OutOfDateTS" column only. The only thing that I'm not sure how to implement is the migration code, notably the default timestamp to use for packages that are flagged out-of-date when upgrading.
Which is the best value to choose? Zero? UNIX_TIMESTAMP()?
Current time is probably the best idea. I also have no idea why this isn't just a datetime column.
It isn't a DATETIME cause I just copy/pasted the "ModifiedTS" column. Loui, is there any reason for using BIGINTs instead of DATETIMEs for timestamps?
On Tue 05 Oct 2010 14:06 +0200, Lukas Fleischer wrote:
On Sun, Oct 03, 2010 at 01:35:45PM -0500, Dan McGee wrote:
On Sun, Oct 3, 2010 at 1:34 PM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
I basically agree and I already changed the patch to only the "OutOfDateTS" column only. The only thing that I'm not sure how to implement is the migration code, notably the default timestamp to use for packages that are flagged out-of-date when upgrading.
Which is the best value to choose? Zero? UNIX_TIMESTAMP()?
Current time is probably the best idea. I also have no idea why this isn't just a datetime column.
It isn't a DATETIME cause I just copy/pasted the "ModifiedTS" column.
Loui, is there any reason for using BIGINTs instead of DATETIMEs for timestamps?
Not that I know of. It's a legacy of whoever designed the database in the beginning. Generally I haven't touched anything that works because I'm still learning PHP and SQL as needed to fix bugs.
--- UPGRADING | 6 ++++++ support/schema/aur-schema.sql | 3 +-- web/html/pkgsubmit.php | 2 +- web/lang/ca.po | 2 +- web/lang/cs.po | 2 +- web/lang/de.po | 4 ++-- web/lang/el_GR.po | 2 +- web/lang/es.po | 2 +- web/lang/fr.po | 4 ++-- web/lang/he.po | 2 +- web/lang/hr.po | 2 +- web/lang/hu.po | 2 +- web/lang/it.po | 4 ++-- web/lang/nb_NO.po | 2 +- web/lang/pl.po | 2 +- web/lang/pt.po | 2 +- web/lang/ro.po | 2 +- web/lang/ru.po | 4 ++-- web/lang/sr.po | 2 +- web/lang/tr.po | 2 +- web/lang/uk.po | 2 +- web/lang/zh_CN.po | 2 +- web/lib/aurjson.class.php | 2 +- web/lib/pkgfuncs.inc | 13 +++++++++---- web/lib/stats.inc | 2 +- web/template/actions_form.php | 2 +- web/template/pkg_details.php | 5 +++-- web/template/pkg_search_results.php | 2 +- 28 files changed, 47 insertions(+), 36 deletions(-) diff --git a/UPGRADING b/UPGRADING index 743f404..bbf60f0 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,6 +1,12 @@ Upgrading ========= +From 1.7.0 to 1.8.0 +------------------- +ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL; +UPDATE Packages SET OutOfDateTS = UNIX_TIMESTAMP() WHERE OutOfDate = 1; +ALTER TABLE Packages DROP OutOfDate; + From 1.6.0 to 1.7.0 ------------------- ALTER TABLE Users ADD Salt CHAR(32) NOT NULL DEFAULT ''; diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 250d405..93ec9a0 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -119,7 +119,7 @@ CREATE TABLE Packages ( License CHAR(40) NOT NULL DEFAULT '', LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, - OutOfDate TINYINT UNSIGNED DEFAULT 0, + OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL, SubmittedTS BIGINT UNSIGNED NOT NULL, ModifiedTS BIGINT UNSIGNED NOT NULL, SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it? @@ -130,7 +130,6 @@ CREATE TABLE Packages ( INDEX (CategoryID), INDEX (LocationID), INDEX (DummyPkg), - INDEX (OutOfDate), INDEX (NumVotes), INDEX (SubmitterUID), INDEX (MaintainerUID), diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 6f7a669..5ce945d 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -313,7 +313,7 @@ if ($_COOKIE["AURSID"]): } # Update package data - $q = sprintf("UPDATE Packages SET ModifiedTS = UNIX_TIMESTAMP(), Name = '%s', Version = '%s-%s', License = '%s', Description = '%s', URL = '%s', LocationID = 2, FSPath = '%s', URLPath = '%s', OutOfDate = 0 WHERE ID = %d", + $q = sprintf("UPDATE Packages SET ModifiedTS = UNIX_TIMESTAMP(), Name = '%s', Version = '%s-%s', License = '%s', Description = '%s', URL = '%s', LocationID = 2, FSPath = '%s', URLPath = '%s', OutOfDateTS = NULL WHERE ID = %d", mysql_real_escape_string($new_pkgbuild['pkgname']), mysql_real_escape_string($new_pkgbuild['pkgver']), mysql_real_escape_string($new_pkgbuild['pkgrel']), diff --git a/web/lang/ca.po b/web/lang/ca.po index 72118f6..0f6ee45 100644 --- a/web/lang/ca.po +++ b/web/lang/ca.po @@ -367,7 +367,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "He $_t["You must be logged in before you can vote for packages."] = "Heu d'identificar-vos abans de votar paquets."; -$_t["The selected packages have been flagged out-of-date."] = "Els paquets seleccionats s'han marcat com No-Actualitzats."; +$_t["The selected packages have been flagged out-of-date"] = "Els paquets seleccionats s'han marcat com No-Actualitzats"; $_t["The selected packages have been deleted."] = "Els paquets seleccionats s'han esborrat."; diff --git a/web/lang/cs.po b/web/lang/cs.po index e430d05..dc2be9d 100644 --- a/web/lang/cs.po +++ b/web/lang/cs.po @@ -335,7 +335,7 @@ $_t["Proposal"] = "Návrh"; $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "Došlo k chybě při snaze rozbalit archiv - PKGBUILD nenalezen."; -$_t["The selected packages have been flagged out-of-date."] = "Zvoleným balíčkům byl nastaven příznak zastaralé."; +$_t["The selected packages have been flagged out-of-date"] = "Zvoleným balíčkům byl nastaven příznak zastaralé"; $_t["Description"] = "Popis"; diff --git a/web/lang/de.po b/web/lang/de.po index 929e6f8..ec38876 100644 --- a/web/lang/de.po +++ b/web/lang/de.po @@ -390,7 +390,7 @@ $_t["You are not allowed to access this area."] = "Es ist Dir nicht erlaubt, auf $_t["Unsafe"] = "Unsicher"; -$_t["This package has been flagged out of date."] = "Dieses Paket wurde als veraltet markiert."; +$_t["This package has been flagged out of date"] = "Dieses Paket wurde als veraltet markiert"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Die obigen Dateien wurden (von %h%s%h) als sicher markiert."; @@ -416,7 +416,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "Du $_t["You must be logged in before you can vote for packages."] = "Du mußt dich anmelden, um für ein Paket stimmen zu können."; -$_t["The selected packages have been flagged out-of-date."] = "Die gewählten Pakete wurden als \"Veraltet\" markiert."; +$_t["The selected packages have been flagged out-of-date"] = "Die gewählten Pakete wurden als \"Veraltet\" markiert"; $_t["The selected packages have been deleted."] = "Die gewählten Pakete wurden gelöscht."; diff --git a/web/lang/el_GR.po b/web/lang/el_GR.po index 5f5c96c..530bcbe 100644 --- a/web/lang/el_GR.po +++ b/web/lang/el_GR.po @@ -406,7 +406,7 @@ $_t["Re-type password"] = "Πληκτρολογήστε ξανά τον κωδι $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "Σφάλμα κατά το ξεπακετάρισμα του ανεβασμένου αρχείου - δεν υπάρχει PKGBUILD."; -$_t["The selected packages have been flagged out-of-date."] = "Τα συγκεκριμένα πακέτα έχουν επισημανθεί ως παρωχημένα."; +$_t["The selected packages have been flagged out-of-date"] = "Τα συγκεκριμένα πακέτα έχουν επισημανθεί ως παρωχημένα"; $_t["Description"] = "Περιγραφή"; diff --git a/web/lang/es.po b/web/lang/es.po index ee14310..7486bda 100644 --- a/web/lang/es.po +++ b/web/lang/es.po @@ -405,7 +405,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "De $_t["You must be logged in before you can vote for packages."] = "Debe identificarse antes de poder votar paquetes."; -$_t["The selected packages have been flagged out-of-date."] = "Los paquetes seleccionados han sido marcados como desactualizados."; +$_t["The selected packages have been flagged out-of-date"] = "Los paquetes seleccionados han sido marcados como desactualizados"; $_t["The selected packages have been deleted."] = "Los paquetes seleccionados se han borrado."; diff --git a/web/lang/fr.po b/web/lang/fr.po index 5728947..1280d5d 100644 --- a/web/lang/fr.po +++ b/web/lang/fr.po @@ -429,7 +429,7 @@ $_t["You did not select any packages to adopt."] = "Vous n'avez pas sélectionn $_t["You must be logged in before you can get notifications on comments."] = "Vous devez vous identifier avant de pouvoir recevoir des notifications de commentaires."; -$_t["The selected packages have been flagged out-of-date."] = "Les paquets sélectionnés ont été marqués comme périmés."; +$_t["The selected packages have been flagged out-of-date"] = "Les paquets sélectionnés ont été marqués comme périmés"; $_t["The selected packages have been deleted."] = "Les paquets sélectionnés ont été supprimés."; @@ -481,7 +481,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "Vo $_t["You must be logged in before you can vote for packages."] = "Vous devez être authentifié avant de pouvoir voter pour des paquets."; -$_t["The selected packages have been flagged out-of-date."] = "Les paquets sélectionnés ont été marqués comme périmés."; +$_t["The selected packages have been flagged out-of-date"] = "Les paquets sélectionnés ont été marqués comme périmés"; $_t["The selected packages have been deleted."] = "Les paquets sélectionnés ont été supprimés."; diff --git a/web/lang/he.po b/web/lang/he.po index d5c19b7..257c5f7 100644 --- a/web/lang/he.po +++ b/web/lang/he.po @@ -344,7 +344,7 @@ $_t["You did not select any packages to flag."] = "לא בחרת שום חביל $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "שגיאה בניסיון פריסת הקובץ שהועלה - PKGBUILD לא קיים."; -$_t["The selected packages have been flagged out-of-date."] = "החבילות שנבחרו מסומנות כלא עדכניות."; +$_t["The selected packages have been flagged out-of-date"] = "החבילות שנבחרו מסומנות כלא עדכניות"; $_t["Description"] = "תיאור"; diff --git a/web/lang/hr.po b/web/lang/hr.po index 93028b7..527fb72 100644 --- a/web/lang/hr.po +++ b/web/lang/hr.po @@ -258,7 +258,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "Mo $_t["You must be logged in before you can vote for packages."] = "Morate se logirati da bi glasali za pakete."; -$_t["The selected packages have been flagged out-of-date."] = "Odabrani paketi su obilježeni kao zastarijeli."; +$_t["The selected packages have been flagged out-of-date"] = "Odabrani paketi su obilježeni kao zastarijeli"; $_t["The selected packages have been deleted."] = "Odabrani paketi su izbrisani."; diff --git a/web/lang/hu.po b/web/lang/hu.po index e198ac3..0c05307 100644 --- a/web/lang/hu.po +++ b/web/lang/hu.po @@ -324,7 +324,7 @@ $_t["Proposal"] = "Indítvány"; $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "Hiba történt a feltöltes kicsomagolása közben - PKGBUILD nem létezik."; -$_t["The selected packages have been flagged out-of-date."] = "A kiválasztott csomagok elavultnak lettek jelolve."; +$_t["The selected packages have been flagged out-of-date"] = "A kiválasztott csomagok elavultnak lettek jelolve"; $_t["Description"] = "Leíras"; diff --git a/web/lang/it.po b/web/lang/it.po index 4bd0727..e53398d 100644 --- a/web/lang/it.po +++ b/web/lang/it.po @@ -437,7 +437,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "De $_t["Leave the password fields blank to keep your same password."] = "Lascia i campi delle password vuoti per lasciarla inalterata."; -$_t["The selected packages have been flagged out-of-date."] = "I pacchetti selezionati sono stati contrassegnati come non aggiornati."; +$_t["The selected packages have been flagged out-of-date"] = "I pacchetti selezionati sono stati contrassegnati come non aggiornati"; $_t["The selected packages have been deleted."] = "I pacchetti selezionati sono stati rimossi."; @@ -505,7 +505,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "De $_t["You must be logged in before you can vote for packages."] = "Devi autenticarti prima di poter votare i pacchetti."; -$_t["The selected packages have been flagged out-of-date."] = "I pacchetti selezionati sono stati contrassegnati come non aggiornati."; +$_t["The selected packages have been flagged out-of-date"] = "I pacchetti selezionati sono stati contrassegnati come non aggiornati"; $_t["The selected packages have been deleted."] = "I pacchetti selezionati sono stati eliminati."; diff --git a/web/lang/nb_NO.po b/web/lang/nb_NO.po index 687e639..040e084 100644 --- a/web/lang/nb_NO.po +++ b/web/lang/nb_NO.po @@ -332,7 +332,7 @@ $_t["You did not select any packages to flag."] = "Du valgte ingen pakker å fla $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "Feil oppstod under forsøk av å pakke ut opplasting - PKGBUILD finnes ikke."; -$_t["The selected packages have been flagged out-of-date."] = "De valgte pakkene har blitt flagget som utdatert."; +$_t["The selected packages have been flagged out-of-date"] = "De valgte pakkene har blitt flagget som utdatert"; $_t["Description"] = "Beskrivelse"; diff --git a/web/lang/pl.po b/web/lang/pl.po index 967ab36..d946c5f 100644 --- a/web/lang/pl.po +++ b/web/lang/pl.po @@ -387,7 +387,7 @@ $_t["You do not have access to adopt packages."] = "Nie masz uprawnień do przej $_t["You must be logged in before you can disown packages."] = "Musisz być zalogowany aby móc porzucać pakiety."; $_t["Error trying to retrieve package details."] = "Błąd podczas pobierania informacji o pakiecie."; $_t["You must be logged in before you can adopt packages."] = "Musisz być zalogowany aby móc przejmować pakiety."; -$_t["The selected packages have been flagged out-of-date."] = "Wybrane pakiety zostały zaznaczone jako nieaktualne."; +$_t["The selected packages have been flagged out-of-date"] = "Wybrane pakiety zostały zaznaczone jako nieaktualne"; $_t["You did not select any packages to flag."] = "Nie wybrałeś żadnych pakietów do zaznaczenia."; $_t["The selected packages have been unflagged."] = "Wybrane pakiety zostały odznaczone."; $_t["You must be logged in before you can unflag packages."] = "Musisz być zalogowany aby móc odznaczać pakiety."; diff --git a/web/lang/pt.po b/web/lang/pt.po index 117556c..fe5507e 100644 --- a/web/lang/pt.po +++ b/web/lang/pt.po @@ -411,7 +411,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "Vo $_t["You must be logged in before you can vote for packages."] = "Você deve efetuar o login antes de poder votar nos pacotes."; -$_t["The selected packages have been flagged out-of-date."] = "Os pacotes selecionados foram marcados como desatualizados."; +$_t["The selected packages have been flagged out-of-date"] = "Os pacotes selecionados foram marcados como desatualizados"; $_t["The selected packages have been deleted."] = "Os pacotes selecionados foram excluídos."; diff --git a/web/lang/ro.po b/web/lang/ro.po index 0118f24..530c276 100644 --- a/web/lang/ro.po +++ b/web/lang/ro.po @@ -332,7 +332,7 @@ $_t["You did not select any packages to flag."] = "Nu ai selectat niciun pachet $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "Eroarea la încercarea de a dezarhiva - PKGBUILD nu există."; -$_t["The selected packages have been flagged out-of-date."] = "Pachetele selectate au fost marcate ca fiind Neactualizate."; +$_t["The selected packages have been flagged out-of-date"] = "Pachetele selectate au fost marcate ca fiind Neactualizate"; $_t["Description"] = "Descriere"; diff --git a/web/lang/ru.po b/web/lang/ru.po index 2382b35..45612dc 100644 --- a/web/lang/ru.po +++ b/web/lang/ru.po @@ -417,7 +417,7 @@ $_t["You did not select any packages to adopt."] = "Вы не выбрали н $_t["You must be logged in before you can get notifications on comments."] = "Необходимо представиться для получения извещений о коментариях."; -$_t["The selected packages have been flagged out-of-date."] = "Выбранные пакеты помечены как устаревшие."; +$_t["The selected packages have been flagged out-of-date"] = "Выбранные пакеты помечены как устаревшие"; $_t["The selected packages have been deleted."] = "Выбранные пакеты удалены."; @@ -471,7 +471,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "В $_t["You must be logged in before you can vote for packages."] = "Вы должны войти прежде чем голосовать."; -$_t["The selected packages have been flagged out-of-date."] = "Выбраные пакеты помечены как устаревшие."; +$_t["The selected packages have been flagged out-of-date"] = "Выбраные пакеты помечены как устаревшие"; $_t["The selected packages have been deleted."] = "Выбраные пакеты удалены."; diff --git a/web/lang/sr.po b/web/lang/sr.po index ddd54da..65e3fd1 100644 --- a/web/lang/sr.po +++ b/web/lang/sr.po @@ -332,7 +332,7 @@ $_t["Re-type password"] = "Ponovo unesite lozinku"; $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "Greška pri raspakivanju pošiljke — ne postoji PKGBUILD."; -$_t["The selected packages have been flagged out-of-date."] = "Izabrani paketi su označeni kao zastareli."; +$_t["The selected packages have been flagged out-of-date"] = "Izabrani paketi su označeni kao zastareli"; $_t["Description"] = "Opis"; diff --git a/web/lang/tr.po b/web/lang/tr.po index 5d41840..20d202e 100644 --- a/web/lang/tr.po +++ b/web/lang/tr.po @@ -423,7 +423,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "Yo $_t["You must be logged in before you can vote for packages."] = "Paketlere oy vermeden önce giriş yapmalısınız."; -$_t["The selected packages have been flagged out-of-date."] = "Seçilen paketler güncelliğini yitirmiş olarak işaretlendi."; +$_t["The selected packages have been flagged out-of-date"] = "Seçilen paketler güncelliğini yitirmiş olarak işaretlendi"; $_t["The selected packages have been deleted."] = "Seçilen paketler silindi."; diff --git a/web/lang/uk.po b/web/lang/uk.po index 007c30e..042f801 100644 --- a/web/lang/uk.po +++ b/web/lang/uk.po @@ -266,7 +266,7 @@ $_t["You must be logged in before you can get notifications on comments."] = "В $_t["You must be logged in before you can vote for packages."] = "Ви повинні зайти, щоб мати змогу голосувати за пакунки."; -$_t["The selected packages have been flagged out-of-date."] = "Для вибраних пакунків призначено мітку Застарілий."; +$_t["The selected packages have been flagged out-of-date"] = "Для вибраних пакунків призначено мітку Застарілий"; $_t["The selected packages have been deleted."] = "Вибрані пакунки вилучено."; diff --git a/web/lang/zh_CN.po b/web/lang/zh_CN.po index 19cc4f6..93eadef 100644 --- a/web/lang/zh_CN.po +++ b/web/lang/zh_CN.po @@ -334,7 +334,7 @@ $_t["You did not select any packages to flag."] = "您没有选择要标记的 $_t["Error trying to unpack upload - PKGBUILD does not exist."] = "尝试解压上传的包发生错误 - 没有PKGBUILD文件。"; -$_t["The selected packages have been flagged out-of-date."] = "选择的包已被标记为过期。"; +$_t["The selected packages have been flagged out-of-date"] = "选择的包已被标记为过期"; $_t["Description"] = "描述"; diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index a5b3f9e..ab1bdbf 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -21,7 +21,7 @@ class AurJSON { private $exposed_methods = array('search','info','msearch'); private $fields = array('Packages.ID','Name','Version','CategoryID', 'Description', 'LocationID', 'URL','URLPath','License','NumVotes', - 'OutOfDate'); + '(OutOfDateTS IS NOT NULL) AS OutOfDate'); /** * Handles post data, and routes the request. diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 5605daa..0f45124 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -457,7 +457,7 @@ function pkg_search_page($SID="") { PackageCategories.Category, PackageLocations.Location, Packages.Name, Packages.Version, Packages.Description, Packages.NumVotes, - Packages.ID, Packages.OutOfDate + Packages.ID, Packages.OutOfDateTS FROM Packages LEFT JOIN Users ON (Packages.MaintainerUID = Users.ID) "; @@ -510,7 +510,7 @@ function pkg_search_page($SID="") { } if (isset($_GET['outdated'])) { - $q .= "AND OutOfDate = 1 "; + $q .= "AND OutOfDateTS IS NOT NULL "; } $order = $_GET["SO"] == 'd' ? 'DESC' : 'ASC'; @@ -642,8 +642,13 @@ function pkg_flag ($atype, $ids, $action = True) { } } - $ood = $action ? 1 : 0; - $q = "UPDATE Packages SET OutOfDate = " . $ood; + $q = "UPDATE Packages SET"; + if ($action) { + $q.= " OutOfDateTS = UNIX_TIMESTAMP()"; + } + else { + $q.= " OutOfDateTS = NULL"; + } $q.= " WHERE ID IN (" . $flag . ")"; db_query($q, $dbh); diff --git a/web/lib/stats.inc b/web/lib/stats.inc index 85c7e28..6a76558 100644 --- a/web/lib/stats.inc +++ b/web/lib/stats.inc @@ -59,7 +59,7 @@ function user_table($user, $dbh) $maintainer_unsupported_count = db_cache_value(sprintf($base_q, 'unsupported'), $dbh, $apc_prefix . 'user_unsupported_count:' . $escuser); - $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDate = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='" . $escuser . "'"; + $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDateTS IS NOT NULL AND Packages.MaintainerUID = Users.ID AND Users.Username='" . $escuser . "'"; $flagged_outdated = db_cache_value($q, $dbh, $apc_prefix . 'user_flagged_outdated:' . $escuser); diff --git a/web/template/actions_form.php b/web/template/actions_form.php index d1559f5..41d8df9 100644 --- a/web/template/actions_form.php +++ b/web/template/actions_form.php @@ -27,7 +27,7 @@ echo " value='".__("UnNotify")."' title='".__("No New Comment Notification")."'> "; } -if ($row["OutOfDate"] == 0) { +if ($row["OutOfDateTS"] === NULL) { echo "<input type='submit' class='button' name='do_Flag'"; echo " value='".__("Flag Out-of-date")."'>\n"; } else { diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 9c76ab3..2c5b666 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -35,6 +35,7 @@ $license = empty($row['License']) ? $msg : $row['License']; # Print the timestamps for last updates $updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["ModifiedTS"])); $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["SubmittedTS"])); +$out_of_date_time = ($row["OutOfDateTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["OutOfDateTS"])); ?> <div class="pgbox"> @@ -69,8 +70,8 @@ $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval( print "<a href='$urlpath.tar.gz'>".__("Tarball")."</a> :: <a href='$urlpath'>".__("Files")."</a> :: <a href='$urlpath/PKGBUILD'>PKGBUILD</a></span>"; } - if ($row["OutOfDate"] == 1) { - echo "<br /><span class='f6'>".__("This package has been flagged out of date.")."</span>"; + if ($row["OutOfDateTS"] !== NULL) { + echo "<br /><span class='f6'>".__("This package has been flagged out of date")." (".$out_of_date_time.")</span>"; } ?> </p> diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index ab49c6b..bf00da5 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -46,7 +46,7 @@ $atype = account_from_sid($_COOKIE['AURSID']); for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { (($i % 2) == 0) ? $c = "data1" : $c = "data2"; - if ($row["OutOfDate"]): $c = "outofdate"; endif; + if ($row["OutOfDateTS"] !== NULL): $c = "outofdate"; endif; ?> <tr> <?php if ($SID): ?> -- 1.7.3.1
Gnah, made a mistake with converting i8n files. This should hopefully work :) --- UPGRADING | 6 ++++++ support/schema/aur-schema.sql | 3 +-- web/html/pkgsubmit.php | 2 +- web/lang/cs.po | 2 +- web/lang/de.po | 2 +- web/lang/el_GR.po | 2 +- web/lang/fr.po | 2 +- web/lang/he.po | 2 +- web/lang/hr.po | 2 +- web/lang/hu.po | 2 +- web/lang/it.po | 2 +- web/lang/nb_NO.po | 2 +- web/lang/pl.po | 2 +- web/lang/ro.po | 2 +- web/lang/ru.po | 2 +- web/lang/sr.po | 2 +- web/lang/tr.po | 2 +- web/lang/uk.po | 2 +- web/lang/zh_CN.po | 2 +- web/lib/aurjson.class.php | 2 +- web/lib/pkgfuncs.inc | 13 +++++++++---- web/lib/stats.inc | 2 +- web/template/actions_form.php | 2 +- web/template/pkg_details.php | 5 +++-- web/template/pkg_search_results.php | 2 +- 25 files changed, 40 insertions(+), 29 deletions(-) diff --git a/UPGRADING b/UPGRADING index 743f404..bbf60f0 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,6 +1,12 @@ Upgrading ========= +From 1.7.0 to 1.8.0 +------------------- +ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL; +UPDATE Packages SET OutOfDateTS = UNIX_TIMESTAMP() WHERE OutOfDate = 1; +ALTER TABLE Packages DROP OutOfDate; + From 1.6.0 to 1.7.0 ------------------- ALTER TABLE Users ADD Salt CHAR(32) NOT NULL DEFAULT ''; diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 250d405..93ec9a0 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -119,7 +119,7 @@ CREATE TABLE Packages ( License CHAR(40) NOT NULL DEFAULT '', LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, - OutOfDate TINYINT UNSIGNED DEFAULT 0, + OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL, SubmittedTS BIGINT UNSIGNED NOT NULL, ModifiedTS BIGINT UNSIGNED NOT NULL, SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it? @@ -130,7 +130,6 @@ CREATE TABLE Packages ( INDEX (CategoryID), INDEX (LocationID), INDEX (DummyPkg), - INDEX (OutOfDate), INDEX (NumVotes), INDEX (SubmitterUID), INDEX (MaintainerUID), diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 6f7a669..5ce945d 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -313,7 +313,7 @@ if ($_COOKIE["AURSID"]): } # Update package data - $q = sprintf("UPDATE Packages SET ModifiedTS = UNIX_TIMESTAMP(), Name = '%s', Version = '%s-%s', License = '%s', Description = '%s', URL = '%s', LocationID = 2, FSPath = '%s', URLPath = '%s', OutOfDate = 0 WHERE ID = %d", + $q = sprintf("UPDATE Packages SET ModifiedTS = UNIX_TIMESTAMP(), Name = '%s', Version = '%s-%s', License = '%s', Description = '%s', URL = '%s', LocationID = 2, FSPath = '%s', URLPath = '%s', OutOfDateTS = NULL WHERE ID = %d", mysql_real_escape_string($new_pkgbuild['pkgname']), mysql_real_escape_string($new_pkgbuild['pkgver']), mysql_real_escape_string($new_pkgbuild['pkgrel']), diff --git a/web/lang/cs.po b/web/lang/cs.po index e430d05..214df00 100644 --- a/web/lang/cs.po +++ b/web/lang/cs.po @@ -15,7 +15,7 @@ global $_t; $_t["Search by"] = "Vyhledat dle"; -$_t["This package has been flagged out of date."] = "Balíček byl označen jako zastaralý."; +$_t["This package has been flagged out of date"] = "Balíček byl označen jako zastaralý"; $_t["Voted"] = "Hlasováno"; diff --git a/web/lang/de.po b/web/lang/de.po index 929e6f8..bbaa16b 100644 --- a/web/lang/de.po +++ b/web/lang/de.po @@ -390,7 +390,7 @@ $_t["You are not allowed to access this area."] = "Es ist Dir nicht erlaubt, auf $_t["Unsafe"] = "Unsicher"; -$_t["This package has been flagged out of date."] = "Dieses Paket wurde als veraltet markiert."; +$_t["This package has been flagged out of date"] = "Dieses Paket wurde als veraltet markiert"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Die obigen Dateien wurden (von %h%s%h) als sicher markiert."; diff --git a/web/lang/el_GR.po b/web/lang/el_GR.po index 5f5c96c..4118c18 100644 --- a/web/lang/el_GR.po +++ b/web/lang/el_GR.po @@ -86,7 +86,7 @@ $_t["Unsupported packages are user produced content. Any use of the provided fil $_t["Search by"] = "Αναζήτηση κατά"; -$_t["This package has been flagged out of date."] = "Αυτό το πακέτο έχει χαρακτηριστεί παρωχημένο."; +$_t["This package has been flagged out of date"] = "Αυτό το πακέτο έχει χαρακτηριστεί παρωχημένο"; $_t["Voted"] = "Ψηφισμένο"; diff --git a/web/lang/fr.po b/web/lang/fr.po index 5728947..947a826 100644 --- a/web/lang/fr.po +++ b/web/lang/fr.po @@ -405,7 +405,7 @@ $_t["Out of Date"] = "Périmé"; $_t["Required by"] = "Requis par"; -$_t["This package has been flagged out of date."] = "Ce paquet a été marqué comme périmé."; +$_t["This package has been flagged out of date"] = "Ce paquet a été marqué comme périmé"; $_t["Toggle Notify"] = "Annoncer/Ne plus annoncer"; diff --git a/web/lang/he.po b/web/lang/he.po index d5c19b7..ad0c558 100644 --- a/web/lang/he.po +++ b/web/lang/he.po @@ -14,7 +14,7 @@ global $_t; $_t["Confirm your e-mail address:"] = "אישור כתובת הדוא״ל שלך"; -$_t["This package has been flagged out of date."] = "החבילה מסומנת כלא עדכנית."; +$_t["This package has been flagged out of date"] = "החבילה מסומנת כלא עדכנית"; $_t["Missing a required field."] = "שדה הכרחי חסר."; diff --git a/web/lang/hr.po b/web/lang/hr.po index 93028b7..4d46fec 100644 --- a/web/lang/hr.po +++ b/web/lang/hr.po @@ -162,7 +162,7 @@ $_t["Description"] = "Opis"; $_t["unknown"] = "nepoznato"; -$_t["This package has been flagged out of date."] = "Paket je obilježen kao zastarijeli."; +$_t["This package has been flagged out of date"] = "Paket je obilježen kao zastarijeli"; $_t["No New Comment Notification"] = "Nemoj me više obavještavati o novim komentarima"; diff --git a/web/lang/hu.po b/web/lang/hu.po index e198ac3..54f3a12 100644 --- a/web/lang/hu.po +++ b/web/lang/hu.po @@ -6,7 +6,7 @@ global $_t; $_t["Search by"] = "Keresés eszerint"; -$_t["This package has been flagged out of date."] = "Ez a csomag elavultnak van jelölve."; +$_t["This package has been flagged out of date"] = "Ez a csomag elavultnak van jelölve"; $_t["Missing a required field."] = "Egy kötelező mező megadása hiányzik."; diff --git a/web/lang/it.po b/web/lang/it.po index 4bd0727..5876c45 100644 --- a/web/lang/it.po +++ b/web/lang/it.po @@ -411,7 +411,7 @@ $_t["Required by"] = "Richiesto da"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "I file sono stati verificati (da %h%s%h) ed il loro utilizzo è da considerarsi sicuro."; -$_t["This package has been flagged out of date."] = "Questo pacchetto è stato contrassegnato come non aggiornato."; +$_t["This package has been flagged out of date"] = "Questo pacchetto è stato contrassegnato come non aggiornato"; $_t["Toggle Notify"] = "Rimuovi la notifica"; diff --git a/web/lang/nb_NO.po b/web/lang/nb_NO.po index 687e639..1b8b20e 100644 --- a/web/lang/nb_NO.po +++ b/web/lang/nb_NO.po @@ -14,7 +14,7 @@ global $_t; $_t["Search by"] = "Søk etter"; -$_t["This package has been flagged out of date."] = "Denne pakken har blitt merket som utdatert."; +$_t["This package has been flagged out of date"] = "Denne pakken har blitt merket som utdatert"; $_t["Voted"] = "Stemmet"; diff --git a/web/lang/pl.po b/web/lang/pl.po index 967ab36..e337bb1 100644 --- a/web/lang/pl.po +++ b/web/lang/pl.po @@ -367,7 +367,7 @@ $_t["unknown"] = "nieznana"; $_t["Out of Date"] = "Nieaktualny"; -$_t["This package has been flagged out of date."] = "Ten pakiet został oznaczony jako nieaktualny."; +$_t["This package has been flagged out of date"] = "Ten pakiet został oznaczony jako nieaktualny"; $_t["Required by"] = "Wymagane przez"; diff --git a/web/lang/ro.po b/web/lang/ro.po index 0118f24..3a41477 100644 --- a/web/lang/ro.po +++ b/web/lang/ro.po @@ -14,7 +14,7 @@ global $_t; $_t["Search by"] = "Caută după"; -$_t["This package has been flagged out of date."] = "Acest pachet a fost marcat ca Neactualizat."; +$_t["This package has been flagged out of date"] = "Acest pachet a fost marcat ca Neactualizat"; $_t["Voted"] = "Votat"; diff --git a/web/lang/ru.po b/web/lang/ru.po index 2382b35..020f230 100644 --- a/web/lang/ru.po +++ b/web/lang/ru.po @@ -389,7 +389,7 @@ $_t["You are not allowed to access this area."] = "Доступ сюда вам $_t["Unsafe"] = "Небезопаный"; -$_t["This package has been flagged out of date."] = "Пакет отмечен как устаревший."; +$_t["This package has been flagged out of date"] = "Пакет отмечен как устаревший"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Файлы проверены %h%s%h и могут быть безопасно использованы."; diff --git a/web/lang/sr.po b/web/lang/sr.po index ddd54da..c743728 100644 --- a/web/lang/sr.po +++ b/web/lang/sr.po @@ -14,7 +14,7 @@ global $_t; $_t["Search by"] = "Pretražuje se"; -$_t["This package has been flagged out of date."] = "Paket je označen kao zastareo"; +$_t["This package has been flagged out of date"] = "Paket je označen kao zastareo"; $_t["Missing a required field."] = "Nedostaje neophodno polje."; diff --git a/web/lang/tr.po b/web/lang/tr.po index 5d41840..df608ac 100644 --- a/web/lang/tr.po +++ b/web/lang/tr.po @@ -400,7 +400,7 @@ $_t["Required by"] = "İhtiyaç duyan"; $_t["The above files have been verified (by %h%s%h) and are safe to use."] = "Yukarıdaki dosyalar doğrulandı (%h%s%h tarafından) ve kullanım için güvenli olarak işaretlendi."; -$_t["This package has been flagged out of date."] = "Bu paket güncel değil olarak işaretlendi."; +$_t["This package has been flagged out of date"] = "Bu paket güncel değil olarak işaretlendi"; $_t["Toggle Notify"] = "Toggle Notify"; diff --git a/web/lang/uk.po b/web/lang/uk.po index 007c30e..3023f78 100644 --- a/web/lang/uk.po +++ b/web/lang/uk.po @@ -170,7 +170,7 @@ $_t["Description"] = "Опис"; $_t["unknown"] = "невідомо"; -$_t["This package has been flagged out of date."] = "Цьому пакунку призначено мітку Застарілий"; +$_t["This package has been flagged out of date"] = "Цьому пакунку призначено мітку Застарілий"; $_t["No New Comment Notification"] = "Немає нових сповіщень про коментарі"; diff --git a/web/lang/zh_CN.po b/web/lang/zh_CN.po index 19cc4f6..8f1f567 100644 --- a/web/lang/zh_CN.po +++ b/web/lang/zh_CN.po @@ -17,7 +17,7 @@ global $_t; $_t["Search by"] = "搜索"; -$_t["This package has been flagged out of date."] = "此包已被标记为过期。"; +$_t["This package has been flagged out of date"] = "此包已被标记为过期"; $_t["Missing a required field."] = "缺少必填项。"; diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index a5b3f9e..ab1bdbf 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -21,7 +21,7 @@ class AurJSON { private $exposed_methods = array('search','info','msearch'); private $fields = array('Packages.ID','Name','Version','CategoryID', 'Description', 'LocationID', 'URL','URLPath','License','NumVotes', - 'OutOfDate'); + '(OutOfDateTS IS NOT NULL) AS OutOfDate'); /** * Handles post data, and routes the request. diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 5605daa..0f45124 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -457,7 +457,7 @@ function pkg_search_page($SID="") { PackageCategories.Category, PackageLocations.Location, Packages.Name, Packages.Version, Packages.Description, Packages.NumVotes, - Packages.ID, Packages.OutOfDate + Packages.ID, Packages.OutOfDateTS FROM Packages LEFT JOIN Users ON (Packages.MaintainerUID = Users.ID) "; @@ -510,7 +510,7 @@ function pkg_search_page($SID="") { } if (isset($_GET['outdated'])) { - $q .= "AND OutOfDate = 1 "; + $q .= "AND OutOfDateTS IS NOT NULL "; } $order = $_GET["SO"] == 'd' ? 'DESC' : 'ASC'; @@ -642,8 +642,13 @@ function pkg_flag ($atype, $ids, $action = True) { } } - $ood = $action ? 1 : 0; - $q = "UPDATE Packages SET OutOfDate = " . $ood; + $q = "UPDATE Packages SET"; + if ($action) { + $q.= " OutOfDateTS = UNIX_TIMESTAMP()"; + } + else { + $q.= " OutOfDateTS = NULL"; + } $q.= " WHERE ID IN (" . $flag . ")"; db_query($q, $dbh); diff --git a/web/lib/stats.inc b/web/lib/stats.inc index 85c7e28..6a76558 100644 --- a/web/lib/stats.inc +++ b/web/lib/stats.inc @@ -59,7 +59,7 @@ function user_table($user, $dbh) $maintainer_unsupported_count = db_cache_value(sprintf($base_q, 'unsupported'), $dbh, $apc_prefix . 'user_unsupported_count:' . $escuser); - $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDate = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='" . $escuser . "'"; + $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDateTS IS NOT NULL AND Packages.MaintainerUID = Users.ID AND Users.Username='" . $escuser . "'"; $flagged_outdated = db_cache_value($q, $dbh, $apc_prefix . 'user_flagged_outdated:' . $escuser); diff --git a/web/template/actions_form.php b/web/template/actions_form.php index d1559f5..41d8df9 100644 --- a/web/template/actions_form.php +++ b/web/template/actions_form.php @@ -27,7 +27,7 @@ echo " value='".__("UnNotify")."' title='".__("No New Comment Notification")."'> "; } -if ($row["OutOfDate"] == 0) { +if ($row["OutOfDateTS"] === NULL) { echo "<input type='submit' class='button' name='do_Flag'"; echo " value='".__("Flag Out-of-date")."'>\n"; } else { diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 9c76ab3..2c5b666 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -35,6 +35,7 @@ $license = empty($row['License']) ? $msg : $row['License']; # Print the timestamps for last updates $updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["ModifiedTS"])); $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["SubmittedTS"])); +$out_of_date_time = ($row["OutOfDateTS"] == 0) ? "(unknown)" : gmdate("r", intval($row["OutOfDateTS"])); ?> <div class="pgbox"> @@ -69,8 +70,8 @@ $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : gmdate("r", intval( print "<a href='$urlpath.tar.gz'>".__("Tarball")."</a> :: <a href='$urlpath'>".__("Files")."</a> :: <a href='$urlpath/PKGBUILD'>PKGBUILD</a></span>"; } - if ($row["OutOfDate"] == 1) { - echo "<br /><span class='f6'>".__("This package has been flagged out of date.")."</span>"; + if ($row["OutOfDateTS"] !== NULL) { + echo "<br /><span class='f6'>".__("This package has been flagged out of date")." (".$out_of_date_time.")</span>"; } ?> </p> diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index ab49c6b..bf00da5 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -46,7 +46,7 @@ $atype = account_from_sid($_COOKIE['AURSID']); for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { (($i % 2) == 0) ? $c = "data1" : $c = "data2"; - if ($row["OutOfDate"]): $c = "outofdate"; endif; + if ($row["OutOfDateTS"] !== NULL): $c = "outofdate"; endif; ?> <tr> <?php if ($SID): ?> -- 1.7.3.1
On Wed 06 Oct 2010 04:25 +0200, Lukas Fleischer wrote:
Gnah, made a mistake with converting i8n files. This should hopefully work :)
--- UPGRADING | 6 ++++++ support/schema/aur-schema.sql | 3 +-- web/html/pkgsubmit.php | 2 +- web/lang/cs.po | 2 +- web/lang/de.po | 2 +- web/lang/el_GR.po | 2 +- web/lang/fr.po | 2 +- web/lang/he.po | 2 +- web/lang/hr.po | 2 +- web/lang/hu.po | 2 +- web/lang/it.po | 2 +- web/lang/nb_NO.po | 2 +- web/lang/pl.po | 2 +- web/lang/ro.po | 2 +- web/lang/ru.po | 2 +- web/lang/sr.po | 2 +- web/lang/tr.po | 2 +- web/lang/uk.po | 2 +- web/lang/zh_CN.po | 2 +- web/lib/aurjson.class.php | 2 +- web/lib/pkgfuncs.inc | 13 +++++++++---- web/lib/stats.inc | 2 +- web/template/actions_form.php | 2 +- web/template/pkg_details.php | 5 +++-- web/template/pkg_search_results.php | 2 +- 25 files changed, 40 insertions(+), 29 deletions(-)
I still don't believe that all these translation changes are necessary. This:
+ echo "<br /><span class='f6'>".__("This package has been flagged out of date")." (".$out_of_date_time.")</span>";
Could change to this:
+ echo "<br /><span class='f6'>".__("This package has been flagged out of date.")." ($out_of_date_time)</span>";
Also, be sure to rebase your patch against the current master. I pushed some changes that may affect your patch.
On Thu, Oct 07, 2010 at 11:09:36PM -0400, Loui Chang wrote:
This:
+ echo "<br /><span class='f6'>".__("This package has been flagged out of date")." (".$out_of_date_time.")</span>";
Could change to this:
+ echo "<br /><span class='f6'>".__("This package has been flagged out of date.")." ($out_of_date_time)</span>";
Well, it's just a cosmetic change. Having the date in brackets after a punctuation mark looked ugly to me, so I removed the period everywhere. If you want me to keep the patch simple and don't care about the period, I can revert this change and send another patch.
On Sun 10 Oct 2010 20:09 +0200, Lukas Fleischer wrote:
On Thu, Oct 07, 2010 at 11:09:36PM -0400, Loui Chang wrote:
This:
+ echo "<br /><span class='f6'>".__("This package has been flagged out of date")." (".$out_of_date_time.")</span>";
Could change to this:
+ echo "<br /><span class='f6'>".__("This package has been flagged out of date.")." ($out_of_date_time)</span>";
Well, it's just a cosmetic change. Having the date in brackets after a punctuation mark looked ugly to me, so I removed the period everywhere. If you want me to keep the patch simple and don't care about the period, I can revert this change and send another patch.
Just pushed without the i18n stuff. Thanks.
On Sat 04 Dec 2010 22:37 +0000, Viktor Leonhardt wrote:
From 22454f5d4c2815549d93dc909a84b15aee46b8f4 Mon Sep 17 00:00:00 2001 From: Viktor Leonhardt <leonharv@unix-ag.uni-kl.de> Date: Sat, 4 Dec 2010 22:34:53 +0000 Subject: [PATCH] Added german translation
--- +$_t["Some packages may be provided as binaries in [community]."] = "Manche Pakete k??nnten als Bin??r-Pakete in [community] bereitgestellt sein."; +
Thanks for the update Viktor.
participants (4)
-
Dan McGee
-
Loui Chang
-
Lukas Fleischer
-
Viktor Leonhardt