From 36ee5561035af335bc3c900ded7aa89066421226 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 24 Jun 2008 02:53:16 -0400 Subject: Move code out of index.php Move database queries to functions and html to templates. Signed-off-by: Loui Chang --- web/html/index.php | 182 ++--------------------------- web/lib/stats.inc | 72 ++++++++++++ web/template/stats/general_stats_table.php | 38 ++++++ web/template/stats/updates_table.php | 40 +++++++ web/template/stats/user_table.php | 38 ++++++ 5 files changed, 198 insertions(+), 172 deletions(-) create mode 100644 web/lib/stats.inc create mode 100644 web/template/stats/general_stats_table.php create mode 100644 web/template/stats/updates_table.php create mode 100644 web/template/stats/user_table.php (limited to 'web') diff --git a/web/html/index.php b/web/html/index.php index 7a95abfc..ce5e0091 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -5,66 +5,13 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR # Add to handle the i18n of My Packages include("pkgfuncs_po.inc"); include("aur.inc"); +include('stats.inc'); set_lang(); check_sid(); html_header( __("Home") ); - -# Newest packages -$q = "SELECT * FROM Packages WHERE DummyPkg != 1 ORDER BY GREATEST(SubmittedTS,ModifiedTS) DESC LIMIT 0 , 10"; -$newest_packages = db_query($q, $dbh); - -# AUR statistics -$q = "SELECT count(*) FROM Packages,PackageLocations WHERE Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'unsupported'"; -$result = db_query($q, $dbh); -$row = mysql_fetch_row($result); -$unsupported_count = $row[0]; - -$q = "SELECT count(*) FROM Packages,PackageLocations WHERE Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'community'"; -$result = db_query($q, $dbh); -$row = mysql_fetch_row($result); -$community_count = $row[0]; - -$q = "SELECT count(*) from Users"; -$result = db_query($q, $dbh); -$row = mysql_fetch_row($result); -$user_count = $row[0]; - -$q = "SELECT count(*) from Users,AccountTypes WHERE Users.AccountTypeID = AccountTypes.ID AND AccountTypes.AccountType = 'Trusted User'"; -$result = db_query($q, $dbh); -$row = mysql_fetch_row($result); -$tu_count = $row[0]; - -$targstamp = intval(strtotime("-7 days")); -$q = "SELECT count(*) from Packages WHERE (Packages.SubmittedTS >= $targstamp OR Packages.ModifiedTS >= $targstamp)"; -$result = db_query($q, $dbh); -$row = mysql_fetch_row($result); -$update_count = $row[0]; - -$user = username_from_sid($_COOKIE["AURSID"]); - -if (!empty($user)) { - $q = "SELECT count(*) FROM Packages,PackageLocations,Users WHERE Packages.MaintainerUID = Users.ID AND Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'unsupported' AND Users.Username='".mysql_real_escape_string($user)."'"; - $result = db_query($q, $dbh); - $row = mysql_fetch_row($result); - $maintainer_unsupported_count = $row[0]; - - $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDate = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='".mysql_real_escape_string($user)."'"; - $result = db_query($q, $dbh); - $row = mysql_fetch_row($result); - $flagged_outdated = $row[0]; - - # If the user is a TU calculate the number of the packages - $atype = account_from_sid($_COOKIE["AURSID"]); - - if ($atype == 'Trusted User') { - $q = "SELECT count(*) FROM Packages,PackageLocations,Users WHERE Packages.MaintainerUID = Users.ID AND Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'community' AND Users.Username='".mysql_real_escape_string($user)."'"; - $result = db_query($q, $dbh); - $row = mysql_fetch_row($result); - $maintainer_community_count = $row[0]; - } -} +$dbh = db_connect(); ?> @@ -106,127 +53,19 @@ print __( 'Contributed PKGBUILDs must conform to the %hArch Packaging Sta - - - - - - - - - - - - - - - - -
- -
-"> - - + - + '; +} -if ($mod_int != 0): - $modstring = gmdate("r", $mod_int); -elseif ($sub_int != 0): - $modstring = ' ' . gmdate("r", $sub_int); -else: - $modstring = '(unknown)'; -endif; +general_stats_table($dbh); ?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - -
- - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
@@ -236,4 +75,3 @@ endif; diff --git a/web/lib/stats.inc b/web/lib/stats.inc new file mode 100644 index 00000000..e659210f --- /dev/null +++ b/web/lib/stats.inc @@ -0,0 +1,72 @@ += $targstamp OR Packages.ModifiedTS >= $targstamp)"; + $result = db_query($q, $dbh); + $row = mysql_fetch_row($result); + $update_count = $row[0]; + + include('stats/general_stats_table.php'); +} + diff --git a/web/template/stats/general_stats_table.php b/web/template/stats/general_stats_table.php new file mode 100644 index 00000000..254b6b64 --- /dev/null +++ b/web/template/stats/general_stats_table.php @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php new file mode 100644 index 00000000..e1eb888e --- /dev/null +++ b/web/template/stats/updates_table.php @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + +
+ + +
+ +"> + + + + + ' . gmdate("r", $sub_int); +else: + $modstring = '(unknown)'; +endif; +?> + + +
+ diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php new file mode 100644 index 00000000..b8446624 --- /dev/null +++ b/web/template/stats/user_table.php @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+ + + +
+ -- cgit v1.2.3-24-g4f1b From 2feee92a75d4fe7042be52d1eef4e6e466af4967 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Tue, 8 Jul 2008 18:56:42 +0200 Subject: Remember user between sessions. Signed-off-by: Loui Chang --- web/lang/en/index_po.inc | 2 ++ web/lang/it/index_po.inc | 2 ++ web/lib/acctfuncs.inc | 7 ++++++- web/template/login_form.php | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/lang/en/index_po.inc b/web/lang/en/index_po.inc index bdeb87fb..eb626eb9 100644 --- a/web/lang/en/index_po.inc +++ b/web/lang/en/index_po.inc @@ -25,6 +25,8 @@ $_t["en"]["Password:"] = "Password:"; $_t["en"]["Username:"] = "Username:"; +$_t["en"]["Remember me"] = "Remember me"; + $_t["en"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."; $_t["en"]["This is where the intro text will go."] = "This is where the intro text will go."; diff --git a/web/lang/it/index_po.inc b/web/lang/it/index_po.inc index f1e54eb4..12b6e56b 100644 --- a/web/lang/it/index_po.inc +++ b/web/lang/it/index_po.inc @@ -19,6 +19,8 @@ $_t["it"]["Password:"] = "Password:"; $_t["it"]["Username:"] = "Nome utente:"; +$_t["it"]["Remember me"] = "Ricordami" ; + $_t["it"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Benvenuto in AUR! Se sei un nuovo utente, dovresti leggere le %hGuidelines%h."; $_t["it"]["This is where the intro text will go."] = "Qui ci andrà il testo di introduzione."; diff --git a/web/lib/acctfuncs.inc b/web/lib/acctfuncs.inc index bbd6b740..73db2708 100644 --- a/web/lib/acctfuncs.inc +++ b/web/lib/acctfuncs.inc @@ -644,7 +644,12 @@ function try_login() { if ($logged_in) { # set our SID cookie - setcookie("AURSID", $new_sid, 0, "/"); + if ($_POST['remember_me'] == "on") + # Set cookies for 30 days. + $cookie_time = time() + (60 * 60 * 24 * 30); + else + $cookie_time = 0; + setcookie("AURSID", $new_sid, $cookie_time, "/"); # header("Location: /index.php"); header("Location: " . $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); $login_error = ""; diff --git a/web/template/login_form.php b/web/template/login_form.php index b2ed066f..4bfc579a 100644 --- a/web/template/login_form.php +++ b/web/template/login_form.php @@ -16,6 +16,7 @@ } ?>" /> + " /> -- cgit v1.2.3-24-g4f1b From 5528501497af781ff9d05e3110aa5e1b78fb71bf Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Mon, 30 Jun 2008 00:12:59 +0800 Subject: Redirect on package submission On a successful package submit there will be a redirect to the package details page of the packages, no more successful message Also got rid of the $warning stuff, what the hell was that for? Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/pkgsubmit.php | 50 +++++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) (limited to 'web') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 4d15ebe4..0d245b84 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -1,28 +1,15 @@ - -
-
- -
-
- - + +
+
+ +
+
+

- - -

-
- - -
-
- - Date: Wed, 9 Jul 2008 00:30:05 -0400 Subject: Make JSON search return more information. Signed-off-by: Loui Chang --- web/lib/aurjson.class.php | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'web') diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index 953f5aba..6ff9b0f2 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -22,6 +22,8 @@ if (!extension_loaded('json')) class AurJSON { private $dbh = false; private $exposed_methods = array('search','info'); + private $fields = array('ID','Name','Version','Description', + 'URL','URLPath','License','NumVotes','OutOfDate'); /** * Handles post data, and routes the request. @@ -42,7 +44,9 @@ class AurJSON { // do the routing if ( in_array($http_data['type'], $this->exposed_methods) ) { // ugh. this works. I hate you php. - $json = call_user_func_array(array(&$this,$http_data['type']),$http_data['arg']); + $json = call_user_func_array(array(&$this,$http_data['type']), + $http_data['arg']); + // allow rpc callback for XDomainAjax if ( isset($http_data['callback']) ) { return $http_data['callback'] . "({$json})"; @@ -87,22 +91,22 @@ class AurJSON { } $keyword_string = mysql_real_escape_string($keyword_string, $this->dbh); - $query = sprintf( - "SELECT Name,ID FROM Packages WHERE ( Name LIKE '%%%s%%' OR Description LIKE '%%%s%%' ) AND DummyPkg=0", - $keyword_string, $keyword_string ); + + $query = "SELECT " . implode(',', $this->fields) . + " FROM Packages WHERE DummyPkg=0 AND "; + $query .= sprintf("( Name LIKE '%%%s%%' OR Description LIKE '%%%s%%' )", + $keyword_string, $keyword_string); $result = db_query($query, $this->dbh); if ( $result && (mysql_num_rows($result) > 0) ) { $search_data = array(); while ( $row = mysql_fetch_assoc($result) ) { - $elem = array( - 'Name' => $row['Name'], - 'ID' => $row['ID'] ); - array_push($search_data,$elem); - } + array_push($search_data, $row); + } + mysql_free_result($result); - return $this->json_results('search',$search_data); + return $this->json_results('search', $search_data); } else { return $this->json_error('No results found'); @@ -115,7 +119,8 @@ class AurJSON { * @return mixed Returns an array of value data containing the package data **/ private function info($pqdata) { - $base_query = "SELECT ID,Name,Version,Description,URL,URLPath,License,NumVotes,OutOfDate FROM Packages WHERE DummyPkg=0 AND "; + $base_query = "SELECT " . implode(',', $this->fields) . + " FROM Packages WHERE DummyPkg=0 AND "; if ( is_numeric($pqdata) ) { // just using sprintf to coerce the pqd to an int @@ -127,7 +132,8 @@ class AurJSON { if(get_magic_quotes_gpc()) { $pqdata = stripslashes($pqdata); } - $query_stub = sprintf("Name=\"%s\"",mysql_real_escape_string($pqdata)); + $query_stub = sprintf("Name=\"%s\"", + mysql_real_escape_string($pqdata)); } $result = db_query($base_query.$query_stub, $this->dbh); @@ -135,11 +141,11 @@ class AurJSON { if ( $result && (mysql_num_rows($result) > 0) ) { $row = mysql_fetch_assoc($result); mysql_free_result($result); - return $this->json_results('info',$row); + return $this->json_results('info', $row); } else { return $this->json_error('No result found'); } } } -?> + -- cgit v1.2.3-24-g4f1b From 1a1a6eb36e17315f08eee0e44a83fe4bdf0887f5 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Wed, 9 Jul 2008 14:38:08 -0400 Subject: Add a new DEFAULT_LANG constant. DEFAULT_LANG will essentially be used to specify what language strings are initially written in. This will eliminate the need for English translation arrays in AUR and make adding or changing the English strings a lot easier. DEFAULT_LANG may be required for strings to display properly. Also change the output when a translation isn't found. Eliminate the which can cause validation errors depending on where the string is placed. Signed-off-by: Loui Chang --- web/lib/aur.inc | 8 +++----- web/lib/config.inc.proto | 11 ++++++++--- web/lib/translator.inc | 9 ++++++--- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'web') diff --git a/web/lib/aur.inc b/web/lib/aur.inc index 81ffde26..ade5b82c 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -311,12 +311,11 @@ function set_lang() { $LANG = $row[0]; } $update_cookie = 1; - } else { - $LANG = "en"; } + # Set $LANG to default if nothing is valid. if (!array_key_exists($LANG, $SUPPORTED_LANGS)) { - $LANG = "en"; # default to English + $LANG = DEFAULT_LANG; } if ($update_cookie) { @@ -336,7 +335,7 @@ function html_header($title="") { global $SUPPORTED_LANGS; $login = try_login(); - $login_error = $login['error']; + $login_error = $login['error']; $title = htmlspecialchars($title, ENT_QUOTES); @@ -410,4 +409,3 @@ function uid_from_username($username="") return $row[0]; } -?> diff --git a/web/lib/config.inc.proto b/web/lib/config.inc.proto index 7a0a155d..505fa7cc 100644 --- a/web/lib/config.inc.proto +++ b/web/lib/config.inc.proto @@ -16,9 +16,12 @@ define( "USERNAME_MAX_LEN", 16 ); define( "PASSWD_MIN_LEN", 4 ); define( "PASSWD_MAX_LEN", 128 ); -$LOGIN_TIMEOUT = 7200; # number of idle seconds before timeout +# Language that messages are initially written in. +# This should never change. +define("DEFAULT_LANG", "en"); -$SUPPORTED_LANGS = array( # what languages we have translations for +# Languages we have translations for +$SUPPORTED_LANGS = array( "en" => "English", "pl" => "Polski", "it" => "Italiano", @@ -30,4 +33,6 @@ $SUPPORTED_LANGS = array( # what languages we have translations for "fr" => "Français" ); -?> +# Idle seconds before timeout +$LOGIN_TIMEOUT = 7200; + diff --git a/web/lib/translator.inc b/web/lib/translator.inc index 41ece89b..f16bd11f 100644 --- a/web/lib/translator.inc +++ b/web/lib/translator.inc @@ -37,12 +37,16 @@ function __() { # First argument is always string to be translated $tag = $args[0]; - $translated = $_t[$LANG][$tag]; + if (empty($LANG) || $LANG == DEFAULT_LANG) + $translated = $tag; + else + $translated = $_t[$LANG][$tag]; + if (empty($translated)) { # if it's a supported language, but there isn't a translation, # alert the visitor to the missing translation. # - $translated = "_${tag}_"; + $translated = "_${tag}_"; } # This condition is to reorganise the arguments in case of @@ -63,4 +67,3 @@ function __() { return $translated; } -?> -- cgit v1.2.3-24-g4f1b From 6bae84f34a571da9da0f7c2237be3cc544ecb365 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Wed, 9 Jul 2008 14:56:15 -0400 Subject: Change some of the index page notices. Signed-off-by: Loui Chang --- web/html/css/fonts.css | 6 +++++- web/html/index.php | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'web') diff --git a/web/html/css/fonts.css b/web/html/css/fonts.css index dc65070e..baa75609 100644 --- a/web/html/css/fonts.css +++ b/web/html/css/fonts.css @@ -99,5 +99,9 @@ a:hover { h1, h2, h3, h4 { font-size: 16pt; } -span.important { color: #f00; } + +.important { + font-weight: bold; + color: #f00; +} diff --git a/web/html/index.php b/web/html/index.php index ce5e0091..f5e10eeb 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -46,8 +46,8 @@ print __( 'Contributed PKGBUILDs must conform to the %hArch Packaging Sta

-
- +
+

@@ -69,7 +69,12 @@ general_stats_table($dbh); -
+ +
'; +echo __('Unsupported PKGBUILDs are user produced content. Any use of files is at your own risk.'); +?>
+
-- cgit v1.2.3-24-g4f1b From bb2204f0fde89d50a7c2c0554314d30c8289918b Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Thu, 17 Jul 2008 19:44:23 +0200 Subject: Fixed Italian translation. Signed-off-by: Loui Chang --- web/lang/it/acctfuncs_po.inc | 19 ----------- web/lang/it/aur_po.inc | 17 ---------- web/lang/it/index_po.inc | 31 ++++++++---------- web/lang/it/pkgfuncs_po.inc | 77 ++++++++------------------------------------ web/lang/it/search_po.inc | 9 ------ web/lang/it/submit_po.inc | 5 ++- 6 files changed, 29 insertions(+), 129 deletions(-) (limited to 'web') diff --git a/web/lang/it/acctfuncs_po.inc b/web/lang/it/acctfuncs_po.inc index b4be9956..859cfb6b 100644 --- a/web/lang/it/acctfuncs_po.inc +++ b/web/lang/it/acctfuncs_po.inc @@ -83,22 +83,3 @@ $_t["it"]["Developer"] = "Sviluppatore"; $_t["it"]["View this user's packages"] = "Visualizza i pacchetti di quest'utente"; -$_t["it"]["start and end with a letter or number"] = "inizia e finisce con una lettera o un numero"; - -$_t["it"]["Your password must be at least "] = "La password deve essere di almeno "; - -$_t["it"]["The username is invalid."] = "Il nome utente non è valido."; - -$_t["it"]["It must be "] = "Deve essere "; - -$_t["it"]["can contain only one period, underscore or hyphen."] = "può contenere solo un punto, un trattino basso o un trattino."; - -$_t["it"]["It must be between %s and %s characters long"] = "Deve contenere un minimo di %s ed un massimo di %s caratteri"; - -$_t["it"]["Your password must be at least %s characters."] = "La password deve contenere almeno %s caratteri."; - -$_t["it"]["Can contain only one period, underscore or hyphen."] = "Può contenere solo un punto, un trattino basso o un trattino."; - -$_t["it"]["Start and end with a letter or number"] = "Inizia e finisce con una lettera o un numero"; - -?> \ No newline at end of file diff --git a/web/lang/it/aur_po.inc b/web/lang/it/aur_po.inc index ac24bb97..5717d970 100644 --- a/web/lang/it/aur_po.inc +++ b/web/lang/it/aur_po.inc @@ -23,20 +23,3 @@ $_t["it"]["Bugs"] = "Bug"; $_t["it"]["My Packages"] = "I miei pacchetti"; -$_t["it"]["You must supply a password."] = "Devi inserire una password."; - -$_t["it"]["You must supply a username."] = "Devi inserire un nome utente."; - -$_t["it"]["Your account has been suspended."] = "Il tuo account è stato sospeso."; - -$_t["it"]["Error trying to generate session id."] = "Si è verificato un errore durante la generazione dell'id della sessione."; - -$_t["it"]["Error looking up username, %s."] = "Si è verificato un errore durante la ricerca del nome utente %s."; - -$_t["it"]["Incorrect password for username, %s."] = "Password errata per il nome utente %s."; - -$_t["it"]["Login failure: Bad user or pass."] = "Autenticazione fallita: nome utente o password errata. "; - -$_t["it"]["Trusted User"] = "Trusted User"; - -?> \ No newline at end of file diff --git a/web/lang/it/index_po.inc b/web/lang/it/index_po.inc index 12b6e56b..6619d94b 100644 --- a/web/lang/it/index_po.inc +++ b/web/lang/it/index_po.inc @@ -31,16 +31,12 @@ $_t["it"]["For now, it's just a place holder."] = "Per adesso, è solo un segnap $_t["it"]["It's more important to get the login functionality finished."] = "È più importante avere la funzionalità di autenticazione completata."; -$_t["it"]["Error looking up username, %s."] = "Errore durante la ricerca del nome utente %s."; - $_t["it"]["Login"] = "Entra"; $_t["it"]["Though we can't vouch for their contents, we provide a %hlist of user repositories%h for your convenience."] = "Nonostante che non possiamo assicurarvi il loro contenuto, mettiamo a disposizione una %hlista di repositories degli utenti%h per vostra comodità"; $_t["it"]["If you have feedback about the AUR, please leave it in %hFlyspray%h."] = "Se avete delle osservazioni da fare in merito al sistema AUR, potete lasciarle nel %hFlyspray%h."; -$_t["it"]["Incorrect password for username, %s."] = "Password errata per il nome utente %s."; - $_t["it"]["Latest Packages:"] = "Ultimi pacchetti:"; $_t["it"]["Discussion about the AUR takes place on the %sTUR Users List%s."] = "Le discussioni su AUR avvengono nella %sTUR Users List%s."; @@ -63,12 +59,22 @@ $_t["it"]["Contributed PKGBUILDs must conform to the %hArch Packaging Sta $_t["it"]["Statistics"] = "Statistiche"; +$_t["it"]["My Statistics"] = "Le mie statistiche"; + +$_t["it"]["Flagged as safe by me"] = "Pacchetti verificati"; + +$_t["it"]["Flagged as safe"] = "Considerato sicuro"; + +$_t["it"]["User Statistics"] = "Statistiche Utente"; + $_t["it"]["Registered Users"] = "Utenti registrati"; $_t["it"]["Trusted Users"] = "Trusted Users"; $_t["it"]["Packages in unsupported"] = "Pacchetti in unsupported"; +$_t["it"]["Packages in unsupported and flagged as safe"] = "Pacchetti in unsupported considerati sicuri"; + $_t["it"]["Packages in [community]"] = "Pacchetti in [community]"; $_t["it"]["Remember to vote for your favourite packages! The most popular packages are provided as binary packages in [community]."] = "Ricorda di votare i tuoi pacchetti preferiti! I pacchetti più votati saranno disponibili in [community] come precompilati."; @@ -79,22 +85,11 @@ $_t["it"]["The most popular packages will be provided as binary packages in [com $_t["it"]["Packages added or updated in the past 7 days"] = "Pacchetti aggiunti o aggiornati negli ultimi 7 giorni"; -$_t["it"]["Packages in unsupported and flagged as safe"] = "Pacchetti in unsupported considerati sicuri"; - -$_t["it"]["Safe"] = "Sicuri"; - $_t["it"]["Out-of-date"] = "Non aggiornati"; -$_t["it"]["User Statistics"] = "Statistiche dell'utente"; - -$_t["it"]["Flagged as safe by me"] = "Pacchetti verificati"; - -$_t["it"]["Flagged as safe"] = "Considerato sicuro"; - -$_t["it"]["My Statistics"] = "Le mie statistiche"; +$_t["it"]["DISCLAIMER"] = "AVVISO"; -$_t["it"]["Home"] = "Inizio"; +$_t["it"]["Unsupported PKGBUILDs are user produced content. Any use of files is at your own risk."] = "i PKGBUILD presenti in unsupported sono stati inviati dagli utenti e, scaricandoli, accetti di usarli a tuo rischio e pericolo."; -$_t["it"]["DISCLAIMER"] = "Avviso: i PKGBUILD presenti in unsupported sono stati inviati dagli utenti e, scaricandoli, accetti di usarli a tuo rischio e pericolo."; +$_t["it"]["Login failure: Bad user or pass."] = "Autenticazione fallita: nome utente o password errata. "; -?> \ No newline at end of file diff --git a/web/lang/it/pkgfuncs_po.inc b/web/lang/it/pkgfuncs_po.inc index 2cf98a74..e3c5186c 100644 --- a/web/lang/it/pkgfuncs_po.inc +++ b/web/lang/it/pkgfuncs_po.inc @@ -57,7 +57,7 @@ $_t["it"]["orphan"] = "orfano"; $_t["it"]["Un-Vote"] = "Rimuovi il voto"; -$_t["it"]["change category"] = "Cambia categoria"; +$_t["it"]["change category"] = "cambia categoria"; $_t["it"]["UnNotify"] = "Togli la notifica"; @@ -75,6 +75,12 @@ $_t["it"]["Manage"] = "Organizza"; $_t["it"]["Sort by"] = "Ordina per"; +$_t["it"]["Sort order"] = "Ordina in modo"; + +$_t["it"]["Ascending"] = "Ascendente"; + +$_t["it"]["Descending"] = "Discendente"; + $_t["it"]["Actions"] = "Azioni"; $_t["it"]["Sources"] = "Sorgenti"; @@ -83,7 +89,7 @@ $_t["it"]["Search Criteria"] = "Criteri di ricerca"; $_t["it"]["Notify"] = "Notifica"; -$_t["it"]["O%hut-of-Date"] = "N%hon aggiornato"; +$_t["it"]["Out-of-Date"] = "Non aggiornato"; $_t["it"]["Vote"] = "Vota"; @@ -125,82 +131,27 @@ $_t["it"]["First Submitted"] = "Data di primo invio"; $_t["it"]["Last Updated"] = "Ultimo aggiornamento"; -$_t["it"]["Sort order"] = "Ordina in modo"; - -$_t["it"]["Ascending"] = "Ascendente"; - -$_t["it"]["Descending"] = "Discendente"; - $_t["it"]["Search by"] = "Cerca per"; $_t["it"]["Submitter"] = "Contributore"; -$_t["it"]["Leave the password fields blank to keep your same password."] = "Lascia vuoti i campi relativi alla password per mantenerla invariata."; - -$_t["it"]["You have been successfully logged out."] = "Disconnesso."; - -$_t["it"]["You must log in to view user information."] = "Devi autenticarti per visualizzare queste informazioni."; - -$_t["it"]["Could not retrieve information for the specified user."] = "Non è stato possibile trovare le informazioni sull'utente specificato."; - -$_t["it"]["You do not have permission to edit this account."] = "Non disponi dei permessi necessari per modificare questo account."; - -$_t["it"]["Use this form to search existing accounts."] = "Utilizza questo modulo per cercare account esistenti."; - -$_t["it"]["Use this form to create an account."] = "Utilizza questo modulo per creare un account."; - -$_t["it"]["Use this form to update your account."] = "Utilizza questo modulo per aggiornare il vostro account."; +$_t["it"]["All"] = "Tutti"; -$_t["it"]["You are not allowed to access this area."] = "Non disponi dei permessi necessari per accedere."; +$_t["it"]["Unsafe"] = "Non sicuri"; $_t["it"]["Status"] = "Stato"; -$_t["it"]["unknown"] = "sconosciuta"; - $_t["it"]["License"] = "Licenza"; -$_t["it"]["All"] = "Tutti"; - -$_t["it"]["Unsafe"] = "Non sicuri"; - -$_t["it"]["Accounts"] = "Account"; +$_t["it"]["unknown"] = "sconosciuta"; -$_t["it"]["This package has been flagged out of date."] = "Questo pacchetto è stato contrassegnato come non aggiornato."; +$_t["it"]["Required by"] = "Richiesto da"; $_t["it"]["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["it"]["Required by"] = "Richiesto da"; +$_t["it"]["This package has been flagged out of date."] = "Questo pacchetto è stato contrassegnato come non aggiornato."; -$_t["it"]["Out of Date"] = "Non aggiornati"; +$_t["it"]["Toggle Notify"] = "Rimuovi la notifica"; $_t["it"]["Showing results %s - %s of %s"] = "Risultati: %s - %s di %s"; -$_t["it"]["Toggle Notify"] = "Blocca la notifica"; - -$_t["it"]["Statistics"] = "Statistiche"; - -$_t["it"]["Remember to vote for your favourite packages!"] = "Ricorda di votare i tuoi pacchetti preferiti!"; - -$_t["it"]["Packages in unsupported"] = "Pacchetti in unsupported"; - -$_t["it"]["The most popular packages will be provided as binary packages in [community]."] = "I pacchetti più votati saranno disponibili in [community] come precompilati."; - -$_t["it"]["Trusted Users"] = "Trusted Users"; - -$_t["it"]["Packages added or updated in the past 7 days"] = "Pacchetti aggiunti o aggiornati negli ultimi 7 giorni"; - -$_t["it"]["Recent Updates"] = "Aggiornamenti recenti"; - -$_t["it"]["Out-of-date"] = "Non aggiornati"; - -$_t["it"]["Packages in [community]"] = "Pacchetti in [community]"; - -$_t["it"]["My Statistics"] = "Le mie statistiche"; - -$_t["it"]["Registered Users"] = "Utenti registrati"; - -$_t["it"]["Home"] = "Inizio"; - -$_t["it"]["DISCLAIMER"] = "Avviso"; - -?> \ No newline at end of file diff --git a/web/lang/it/search_po.inc b/web/lang/it/search_po.inc index 8d976d05..e475a4d1 100644 --- a/web/lang/it/search_po.inc +++ b/web/lang/it/search_po.inc @@ -69,12 +69,3 @@ $_t["it"]["The selected packages have been unflagged safe."] = "I pacchetti sele $_t["it"]["Couldn't unflag package safe."] = "Impossibile contrassegnare il pacchetto come non sicuro."; -$_t["it"]["Packages"] = "Pacchetti"; - -$_t["it"]["You have been removed from the comment notification list for %s."] = "Sei stato rimosso dalla lista delle notifiche dei commenti di %s."; - -$_t["it"]["My Packages"] = "I miei pacchetti"; - -$_t["it"]["You have been added to the comment notification list for %s."] = "Sei stato aggiunto alla lista delle notifiche dei commenti di %s."; - -?> \ No newline at end of file diff --git a/web/lang/it/submit_po.inc b/web/lang/it/submit_po.inc index 9b5c439e..c510ff4a 100644 --- a/web/lang/it/submit_po.inc +++ b/web/lang/it/submit_po.inc @@ -85,8 +85,7 @@ $_t["it"]["Could not re-tar"] = "Impossibile riarchiviare"; $_t["it"]["Binary packages and filelists are not allowed for upload."] = "Non è consentito inviare pacchetti contenenti binari e filelist."; -$_t["it"]["Missing license variable in PKGBUILD."] = "Nel PKGBUILD manca la variabile license."; - $_t["it"]["Missing arch variable in PKGBUILD."] = "Nel PKGBUILD manca la variabile arch."; -?> \ No newline at end of file +$_t["it"]["Missing license variable in PKGBUILD."] = "Nel PKGBUILD manca la variabile license."; + -- cgit v1.2.3-24-g4f1b From 85ce072f031d1c5352e18ca19deac93c6202127e Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 22 Jul 2008 18:16:23 -0400 Subject: Don't add closing PHP tag to translation files. Signed-off-by: Loui Chang --- web/utils/genpopo | 2 +- web/utils/translation_tool | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'web') diff --git a/web/utils/genpopo b/web/utils/genpopo index bfe3492e..67c02284 100755 --- a/web/utils/genpopo +++ b/web/utils/genpopo @@ -232,7 +232,7 @@ else: if term not in existing_terms: f.write("\n"); f.write('$_t["en"]["%s"] = "%s";\n' % (term, term)) - f.write("\n?>"); + f.write("\n"); f.close() # Print out warnings for unused and little-used common entries. diff --git a/web/utils/translation_tool b/web/utils/translation_tool index ae9ae1de..6967139a 100755 --- a/web/utils/translation_tool +++ b/web/utils/translation_tool @@ -172,7 +172,7 @@ if force: f = open(po,'w') f.write(INC_HEADER) f.write('\ninclude_once(\"en/%s\");\n' % po) - f.write('\n?>') + f.write('\n') f.close() f = open(trans_dir+"/"+po,'w') @@ -183,7 +183,6 @@ if force: trans = raw_input(term+" = ") f.write('$_t["%s"]["%s"] = "%s";\n' % (trans_abbrv, term, trans)) f.write("\n"); - f.write("?>"); f.close() else: # need to leave existing file intact, and only append on terms that are new @@ -216,13 +215,13 @@ else: f = open(po,'w') f.write("".join(contents)) f.write('\ninclude_once(\"%s/%s\");\n' % (trans_abbrv, po)) - f.write("\n?>"); + f.write("\n"); f.close() else: f = open(po,'w') f.write(INC_HEADER) f.write('\ninclude_once(\"%s/%s\");\n' % (trans_abbrv, po)) - f.write('\n?>') + f.write('\n') f.close() # first read in file contents so we can hash what already exists # @@ -264,7 +263,7 @@ else: f.write("\n"); trans = raw_input(term+" = ") f.write('$_t["%s"]["%s"] = "%s";\n' % (trans_abbrv, term, trans)) - f.write("\n?>"); + f.write("\n"); f.close() # Print out warnings for unused and little-used common entries. -- cgit v1.2.3-24-g4f1b From b81e3c2f6814e73973b4d42e66b1d0e58c2943d2 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Wed, 23 Jul 2008 10:07:53 -0400 Subject: Tweak index.php and update translations. Signed-off-by: Loui Chang --- web/html/index.php | 31 ++++++++++++++++--------------- web/lang/ca/index_po.inc | 3 +-- web/lang/de/index_po.inc | 2 +- web/lang/es/index_po.inc | 2 +- web/lang/fr/index_po.inc | 2 +- web/lang/it/index_po.inc | 4 +--- web/lang/pl/index_po.inc | 5 ++--- web/lang/pt/index_po.inc | 5 +---- web/lang/ru/index_po.inc | 3 +-- 9 files changed, 25 insertions(+), 32 deletions(-) (limited to 'web') diff --git a/web/html/index.php b/web/html/index.php index f5e10eeb..c7847f25 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -20,37 +20,36 @@ $dbh = db_connect(); AUR
- - - - +

' - , '' - , '' - , '' +echo __( + 'Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information.', + '', + '', + '', + '' ); ?> -
+
must conform to the %hArch Packaging Standards%h otherwise they will be deleted!' - , '' - , '' +echo __( + 'Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!', + '', '', + '', + '' ); ?>

- +

-
@@ -70,6 +69,7 @@ general_stats_table($dbh);
+
'; echo __('Unsupported PKGBUILDs are user produced content. Any use of files is at your own risk.'); @@ -80,3 +80,4 @@ echo __('Unsupported PKGBUILDs are user produced content. Any use of files is at must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Els PKGBUILDs enviats han de seguir els %hEstàndards d'empaquetament d'Arch%h sinó seran esborrats!"; +$_t["ca"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Els PKGBUILDs enviats %hhan%h de seguir els %hEstàndards d'empaquetament d'Arch%h sinó seran esborrats!"; $_t["ca"]["Login"] = "Entra"; @@ -55,4 +55,3 @@ $_t["ca"]["Logged-in as: %h%s%h"] = "Identificat com: %h%s%h"; $_t["ca"]["Incorrect password for username, %s."] = "Contrasenya incorrecta per a l'usuari, %s."; -?> diff --git a/web/lang/de/index_po.inc b/web/lang/de/index_po.inc index 1b55775d..377a669c 100644 --- a/web/lang/de/index_po.inc +++ b/web/lang/de/index_po.inc @@ -39,7 +39,7 @@ $_t["de"]["Error trying to generate session id."] = "Fehler beim Erstellen der S $_t["de"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information."] = "Willkommen beim AUR! Für weitergehende Informationen lies bitte das %hAUR Benutzerhandbuch%h und die %hAUR TU Richtlinien%h."; -$_t["de"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Deine PKGBUILDs müssen dem %hArch Paket Standard%h entsprechen. Andernfalls werden sie gelöscht!"; +$_t["de"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Deine PKGBUILDs %hmüssen%h dem %hArch Paket Standard%h entsprechen. Andernfalls werden sie gelöscht!"; $_t["de"]["Login"] = "Anmelden"; diff --git a/web/lang/es/index_po.inc b/web/lang/es/index_po.inc index 77e5ee95..821c09d2 100644 --- a/web/lang/es/index_po.inc +++ b/web/lang/es/index_po.inc @@ -39,7 +39,7 @@ $_t["es"]["Error trying to generate session id."] = "Error al intentar crear un $_t["es"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information."] = "¡Bienvenido al AUR! Por favor lea la %hGuía AUR del Usuario%h y la %hGuía TU del AUR%h para más información."; -$_t["es"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "¡Los PKGBUILDS enviados deben cumplir las %hNormas de empaquetado de Arch%h sino serán eliminados!"; +$_t["es"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "¡Los PKGBUILDS enviados %hdeben%h cumplir las %hNormas de empaquetado de Arch%h sino serán eliminados!"; $_t["es"]["Login"] = "Entrar"; diff --git a/web/lang/fr/index_po.inc b/web/lang/fr/index_po.inc index 7c67bf4d..3e522a24 100644 --- a/web/lang/fr/index_po.inc +++ b/web/lang/fr/index_po.inc @@ -40,7 +40,7 @@ $_t["fr"]["Error trying to generate session id."] = "Erreur en essayant de gén $_t["fr"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information."] = "Bienvenue sur AUR ! Lisez, s'il vous plaît, le %hGuide Utilisateur AUR%h et le %hGuide des Utilisateurs de Confiance%h pour plus d'informations."; -$_t["fr"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Les PKGBUILDs proposés doivent se conformer aux %hStandards de l'empaquetage Arch%h sans quoi ils seront supprimés!"; +$_t["fr"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Les PKGBUILDs proposés %hdoivent%h se conformer aux %hStandards de l'empaquetage Arch%h sans quoi ils seront supprimés!"; $_t["fr"]["Login"] = "Se connecter"; diff --git a/web/lang/it/index_po.inc b/web/lang/it/index_po.inc index 6619d94b..17704706 100644 --- a/web/lang/it/index_po.inc +++ b/web/lang/it/index_po.inc @@ -45,8 +45,6 @@ $_t["it"]["Email discussion about the AUR takes place on the %sTUR Users List%s. $_t["it"]["Recent Updates"] = "Aggiornamenti recenti"; -$_t["it"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information. Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Benvenuto in AUR! Per ottenere maggiori informazioni, leggi le %hAUR User Guidelines%h e %hAUR TU Guidelines%h. I PKGBUILD inviati devono essere conformi agli %hArch Packaging Standards%h altrimenti saranno cancellati!"; - $_t["it"]["Community"] = "Community"; $_t["it"]["Package Counts"] = "Conteggio dei pacchetti"; @@ -55,7 +53,7 @@ $_t["it"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR $_t["it"]["Unsupported"] = "Unsupported"; -$_t["it"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "I PKGBUILD inviati devono essere conformi agli %hArch Packaging Standards%h altrimenti saranno cancellati!"; +$_t["it"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "I PKGBUILD inviati %hdevono%h essere conformi agli %hArch Packaging Standards%h altrimenti saranno cancellati!"; $_t["it"]["Statistics"] = "Statistiche"; diff --git a/web/lang/pl/index_po.inc b/web/lang/pl/index_po.inc index a93c6903..889a841b 100644 --- a/web/lang/pl/index_po.inc +++ b/web/lang/pl/index_po.inc @@ -24,7 +24,7 @@ $_t["pl"]["You must supply an email address."] = "Musisz podać adres e-mail."; $_t["pl"]["Incorrect password for email address, %s."] = "Nieprawidłowe hasło dla adresu %s."; $_t["pl"]["Incorrect password for username, %s."] = "Nieprawidłowe hasło dla użytkownika %s."; $_t["pl"]["Logged in as: %h%s%h"] = "Zalogowany jako: %h%s%h"; -$_t["pl"]["Logged-in as: %h%s%h"] = "Zalogowany jako: %h%s%h"; + $_t["pl"]["Error looking up username, %s."] = "Błąd podczas wyszukiwania użytkownika %s."; $_t["pl"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Witamy w AUR! Jeżeli jesteś tu po raz pierwszy, być może zechcesz przeczytać %hInstrukcję%h."; $_t["pl"]["If you have feedback about the AUR, please leave it in %hFlyspray%h."] = "Jeżeli masz uwagi lub pomysły odnośnie AUR, %hFlyspray%h jest odpowiednim miejscem do ich pozostawienia."; @@ -52,7 +52,7 @@ $_t["pl"]["Packages in [community]"] = "Pakietów w [community]"; $_t["pl"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information."] = "Witamy w AUR! Aby uzyskać więcej informacji, przeczytaj %hInstrukcję Użytkownika%h oraz %hInstrukcję Zaufanego Użytkownika%h."; -$_t["pl"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Pliki PKGBUILD muszą być zgodne ze %hStandardami Pakietów Archa%h, inaczej będą usuwane!"; +$_t["pl"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Pliki PKGBUILD %hmuszą%h być zgodne ze %hStandardami Pakietów Archa%h, inaczej będą usuwane!"; $_t["pl"]["Registered Users"] = "Zarejestrowanych użytkowników"; @@ -72,4 +72,3 @@ $_t["pl"]["Home"] = "Start"; $_t["pl"]["DISCLAIMER"] = "ZRZECZENIE"; -?> \ No newline at end of file diff --git a/web/lang/pt/index_po.inc b/web/lang/pt/index_po.inc index 7fe4283e..66de4242 100644 --- a/web/lang/pt/index_po.inc +++ b/web/lang/pt/index_po.inc @@ -53,8 +53,6 @@ $_t["pt"]["Email discussion about the AUR takes place on the %sTUR Users List%s. $_t["pt"]["Recent Updates"] = "Atualizações Recentes"; -$_t["pt"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information. Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Bem-vindo ao AUR! Por favor leia as %hregras de usuário do AUR%h e as %hregras de TU do AUR%h para maiores informações.PKGBUILDs contribuídos devem seguir os %hpadrões Arch de Empacotamento%h caso contrário, eles serão excluídos!"; - $_t["pt"]["Community"] = "Comunidade"; $_t["pt"]["Package Counts"] = "Contagem de Pacotes"; @@ -63,7 +61,7 @@ $_t["pt"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR $_t["pt"]["Unsupported"] = "Sem Suporte"; -$_t["pt"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "PKGBUILDs contribuídos devem seguir os %hpadrões Arch de Empacotamento%h caso contrário, eles serão excluídos!"; +$_t["pt"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "PKGBUILDs contribuídos %hdevem%h seguir os %hpadrões Arch de Empacotamento%h caso contrário, eles serão excluídos!"; $_t["pt"]["Statistics"] = "Estatísticas"; @@ -93,4 +91,3 @@ $_t["pt"]["My Statistics"] = "Minhas Estatísticas"; $_t["pt"]["Flagged as safe by me"] = "Pacotes que marquei como seguros"; -?> \ No newline at end of file diff --git a/web/lang/ru/index_po.inc b/web/lang/ru/index_po.inc index 45b2d402..1a464a0a 100644 --- a/web/lang/ru/index_po.inc +++ b/web/lang/ru/index_po.inc @@ -39,7 +39,7 @@ $_t["ru"]["Error trying to generate session id."] = "Ошибка генерац $_t["ru"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information."] = "Добро пожаловать в AUR! Пожалуйста прочитайте %hAUR User Guidelines%h и %hAUR TU Guidelines%h, чтобы получить больше информации."; -$_t["ru"]["Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Присланые PKGBUILD должны соответствовать %hArch Packaging Standards%h или будут удалены!"; +$_t["ru"]["Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!"] = "Присланые PKGBUILD %hдолжны%h соответствовать %hArch Packaging Standards%h или будут удалены!"; $_t["ru"]["Login"] = "Войти"; @@ -69,4 +69,3 @@ $_t["ru"]["My Statistics"] = "Моя статистика"; $_t["ru"]["Home"] = "Заглавная страница"; -?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 2c6bae2e63c69f87599e5ef081eeba0a8d08bf00 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Wed, 23 Jul 2008 10:36:41 -0400 Subject: Convert special chars in translations to html entities. This closes FS#10809 - bug in french translation of AUR web interface Signed-off-by: Loui Chang --- web/lib/translator.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/lib/translator.inc b/web/lib/translator.inc index f16bd11f..fb9ed635 100644 --- a/web/lib/translator.inc +++ b/web/lib/translator.inc @@ -25,7 +25,6 @@ include_once("common_po.inc"); - function __() { global $_t; global $LANG; @@ -49,6 +48,8 @@ function __() { $translated = "_${tag}_"; } + $translated = htmlspecialchars($translated, ENT_QUOTES); + # This condition is to reorganise the arguments in case of # deprecated usage. __("string", array("string","string")) if (!empty($args[1]) && is_array($args[1])) { @@ -64,6 +65,7 @@ function __() { $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1); } } + return $translated; } -- cgit v1.2.3-24-g4f1b From af1394f0c3d474ee93b2d1170c642bd218d27fb0 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 19 Aug 2008 15:34:04 -0400 Subject: Add initial Turkish language files. Signed-off-by: Loui Chang --- web/lang/account_po.inc | 2 +- web/lang/acctfuncs_po.inc | 3 +- web/lang/aur_po.inc | 2 +- web/lang/common_po.inc | 2 +- web/lang/hacker_po.inc | 2 +- web/lang/index_po.inc | 2 +- web/lang/logout_po.inc | 2 +- web/lang/pkgedit_po.inc | 2 +- web/lang/pkgfuncs_po.inc | 2 +- web/lang/search_po.inc | 2 +- web/lang/submit_po.inc | 2 +- web/lang/tr/account_po.inc | 29 ++++++++ web/lang/tr/acctfuncs_po.inc | 91 ++++++++++++++++++++++++ web/lang/tr/aur_po.inc | 31 ++++++++ web/lang/tr/common_po.inc | 35 ++++++++++ web/lang/tr/hacker_po.inc | 17 +++++ web/lang/tr/index_po.inc | 91 ++++++++++++++++++++++++ web/lang/tr/logout_po.inc | 15 ++++ web/lang/tr/pkgedit_po.inc | 35 ++++++++++ web/lang/tr/pkgfuncs_po.inc | 163 +++++++++++++++++++++++++++++++++++++++++++ web/lang/tr/search_po.inc | 77 ++++++++++++++++++++ web/lang/tr/submit_po.inc | 97 +++++++++++++++++++++++++ web/lang/tr/timeout_po.inc | 17 +++++ 23 files changed, 710 insertions(+), 11 deletions(-) create mode 100644 web/lang/tr/account_po.inc create mode 100644 web/lang/tr/acctfuncs_po.inc create mode 100644 web/lang/tr/aur_po.inc create mode 100644 web/lang/tr/common_po.inc create mode 100644 web/lang/tr/hacker_po.inc create mode 100644 web/lang/tr/index_po.inc create mode 100644 web/lang/tr/logout_po.inc create mode 100644 web/lang/tr/pkgedit_po.inc create mode 100644 web/lang/tr/pkgfuncs_po.inc create mode 100644 web/lang/tr/search_po.inc create mode 100644 web/lang/tr/submit_po.inc create mode 100644 web/lang/tr/timeout_po.inc (limited to 'web') diff --git a/web/lang/account_po.inc b/web/lang/account_po.inc index 86c015be..81a8e7fa 100644 --- a/web/lang/account_po.inc +++ b/web/lang/account_po.inc @@ -26,5 +26,5 @@ include_once("es/account_po.inc"); include_once("de/account_po.inc"); include_once("ru/account_po.inc"); +include_once("tr/account_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/acctfuncs_po.inc b/web/lang/acctfuncs_po.inc index 3e0471c9..cd53a5c7 100644 --- a/web/lang/acctfuncs_po.inc +++ b/web/lang/acctfuncs_po.inc @@ -28,5 +28,6 @@ include_once("de/acctfuncs_po.inc"); include_once("ru/acctfuncs_po.inc"); include_once("fr/acctfuncs_po.inc"); +include_once("tr/acctfuncs_po.inc"); + -?> \ No newline at end of file diff --git a/web/lang/aur_po.inc b/web/lang/aur_po.inc index 631f4cf4..ce89bec1 100644 --- a/web/lang/aur_po.inc +++ b/web/lang/aur_po.inc @@ -28,5 +28,5 @@ include_once("de/aur_po.inc"); include_once("ru/aur_po.inc"); include_once("fr/aur_po.inc"); +include_once("tr/aur_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/common_po.inc b/web/lang/common_po.inc index f4752ca6..e1073d9d 100644 --- a/web/lang/common_po.inc +++ b/web/lang/common_po.inc @@ -28,5 +28,5 @@ include_once("de/common_po.inc"); include_once("ru/common_po.inc"); include_once("fr/common_po.inc"); +include_once("tr/common_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/hacker_po.inc b/web/lang/hacker_po.inc index 67885215..01b60ad5 100644 --- a/web/lang/hacker_po.inc +++ b/web/lang/hacker_po.inc @@ -28,5 +28,5 @@ include_once("de/hacker_po.inc"); include_once("ru/hacker_po.inc"); include_once("fr/hacker_po.inc"); +include_once("tr/hacker_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/index_po.inc b/web/lang/index_po.inc index ecf02b4a..606c6a34 100644 --- a/web/lang/index_po.inc +++ b/web/lang/index_po.inc @@ -28,5 +28,5 @@ include_once("de/index_po.inc"); include_once("ru/index_po.inc"); include_once("fr/index_po.inc"); +include_once("tr/index_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/logout_po.inc b/web/lang/logout_po.inc index 41adfc8b..31f261e7 100644 --- a/web/lang/logout_po.inc +++ b/web/lang/logout_po.inc @@ -26,5 +26,5 @@ include_once("es/logout_po.inc"); include_once("de/logout_po.inc"); include_once("ru/logout_po.inc"); +include_once("tr/logout_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/pkgedit_po.inc b/web/lang/pkgedit_po.inc index 49e7ae49..240b72e5 100644 --- a/web/lang/pkgedit_po.inc +++ b/web/lang/pkgedit_po.inc @@ -28,5 +28,5 @@ include_once("de/pkgedit_po.inc"); include_once("ru/pkgedit_po.inc"); include_once("fr/pkgedit_po.inc"); +include_once("tr/pkgedit_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/pkgfuncs_po.inc b/web/lang/pkgfuncs_po.inc index 32259527..ca00af2c 100644 --- a/web/lang/pkgfuncs_po.inc +++ b/web/lang/pkgfuncs_po.inc @@ -28,5 +28,5 @@ include_once("de/pkgfuncs_po.inc"); include_once("ru/pkgfuncs_po.inc"); include_once("fr/pkgfuncs_po.inc"); +include_once("tr/pkgfuncs_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/search_po.inc b/web/lang/search_po.inc index f9272b99..9230ea38 100644 --- a/web/lang/search_po.inc +++ b/web/lang/search_po.inc @@ -28,5 +28,5 @@ include_once("de/search_po.inc"); include_once("ru/search_po.inc"); include_once("fr/search_po.inc"); +include_once("tr/search_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/submit_po.inc b/web/lang/submit_po.inc index d9e7a1cb..6d3ec857 100644 --- a/web/lang/submit_po.inc +++ b/web/lang/submit_po.inc @@ -28,5 +28,5 @@ include_once("de/submit_po.inc"); include_once("ru/submit_po.inc"); include_once("fr/submit_po.inc"); +include_once("tr/submit_po.inc"); -?> \ No newline at end of file diff --git a/web/lang/tr/account_po.inc b/web/lang/tr/account_po.inc new file mode 100644 index 00000000..3ae5d3cc --- /dev/null +++ b/web/lang/tr/account_po.inc @@ -0,0 +1,29 @@ + Date: Tue, 19 Aug 2008 15:35:58 -0400 Subject: Add Turkish to SUPPORTED_LANGS in config.inc.proto. Signed-off-by: Loui Chang --- web/lib/config.inc.proto | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'web') diff --git a/web/lib/config.inc.proto b/web/lib/config.inc.proto index 505fa7cc..7248b930 100644 --- a/web/lib/config.inc.proto +++ b/web/lib/config.inc.proto @@ -22,15 +22,16 @@ define("DEFAULT_LANG", "en"); # Languages we have translations for $SUPPORTED_LANGS = array( + "ca" => "Català", + "de" => "Deutsch", "en" => "English", - "pl" => "Polski", + "es" => "Español", + "fr" => "Français", "it" => "Italiano", - "ca" => "Català", + "pl" => "Polski", "pt" => "Português", - "es" => "Español", - "de" => "Deutsch", "ru" => "Русский", - "fr" => "Français" + "tr" => "Türkçe" ); # Idle seconds before timeout -- cgit v1.2.3-24-g4f1b From bbebc08104032da5ca3a218d58b2cadc5501f16c Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 19 Aug 2008 15:46:03 -0400 Subject: Remove obsolete test scripts. Signed-off-by: Loui Chang --- web/html/testpo.php | 45 --------------------------------------------- web/lang/ca/test_po.inc | 16 ---------------- web/lang/de/test_po.inc | 16 ---------------- web/lang/en/test_po.inc | 22 ---------------------- web/lang/es/test_po.inc | 16 ---------------- web/lang/fr/test_po.inc | 17 ----------------- web/lang/it/test_po.inc | 16 ---------------- web/lang/pl/test_po.inc | 13 ------------- web/lang/pt/test_po.inc | 22 ---------------------- web/lang/ru/test_po.inc | 16 ---------------- web/lang/test_po.inc | 32 -------------------------------- 11 files changed, 231 deletions(-) delete mode 100644 web/html/testpo.php delete mode 100644 web/lang/ca/test_po.inc delete mode 100644 web/lang/de/test_po.inc delete mode 100644 web/lang/en/test_po.inc delete mode 100644 web/lang/es/test_po.inc delete mode 100644 web/lang/fr/test_po.inc delete mode 100644 web/lang/it/test_po.inc delete mode 100644 web/lang/pl/test_po.inc delete mode 100644 web/lang/pt/test_po.inc delete mode 100644 web/lang/ru/test_po.inc delete mode 100644 web/lang/test_po.inc (limited to 'web') diff --git a/web/html/testpo.php b/web/html/testpo.php deleted file mode 100644 index a8a63375..00000000 --- a/web/html/testpo.php +++ /dev/null @@ -1,45 +0,0 @@ -\n"; - -print "

\n"; -print __("Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h.", - array("","English","", - "","Espaol","", - "","Deutsch","", - "","Franais","")); -print "

\n"; - -print "

\n"; -print __("My current language tag is: '%s'.", array($LANG)); -print "

\n"; - -print "
    \n"; -print __("Hello, world!")."
    \n"; -print __("Hello, again!")."
    \n"; -print "
\n"; -print "\n"; - -?> diff --git a/web/lang/ca/test_po.inc b/web/lang/ca/test_po.inc deleted file mode 100644 index 3f5ddadd..00000000 --- a/web/lang/ca/test_po.inc +++ /dev/null @@ -1,16 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["ca"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Seleccioneu el vostre idioma ací: %h%s%h, %h%s%h, %h%s%h, %h%s%h"; - -$_t["ca"]["Hello, world!"] = "Hola, món!"; - -$_t["ca"]["Hello, again!"] = "Hola, altre cop!"; - -$_t["ca"]["My current language tag is: '%s'."] = "La meua etiqueta actual d'idioma és: '%s'."; - -?> \ No newline at end of file diff --git a/web/lang/de/test_po.inc b/web/lang/de/test_po.inc deleted file mode 100644 index a957522b..00000000 --- a/web/lang/de/test_po.inc +++ /dev/null @@ -1,16 +0,0 @@ -, Matthias Gorissen , Lukas Kropatschek, Niclas Pfeifer - -include_once("translator.inc"); -global $_t; - -$_t["de"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Wähle hier deine Sprache aus: %h%s%h, %h%s%h, %h%s%h, %h%s%h."; - -$_t["de"]["Hello, world!"] = "Hallo, Welt!"; - -$_t["de"]["Hello, again!"] = "Nochmals Hallo!"; - -$_t["de"]["My current language tag is: '%s'."] = "Meine momentan gewählte Sprache ist: '%s'"; - -?> \ No newline at end of file diff --git a/web/lang/en/test_po.inc b/web/lang/en/test_po.inc deleted file mode 100644 index 28c0e104..00000000 --- a/web/lang/en/test_po.inc +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/web/lang/es/test_po.inc b/web/lang/es/test_po.inc deleted file mode 100644 index 83bc7dcf..00000000 --- a/web/lang/es/test_po.inc +++ /dev/null @@ -1,16 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["es"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Seleccione su idioma aquí: %h%s%h, %h%s%h, %h%s%h, %h%s%h."; - -$_t["es"]["Hello, world!"] = "¡Hola, mundo!"; - -$_t["es"]["Hello, again!"] = "¡Hola, otra vez!"; - -$_t["es"]["My current language tag is: '%s'."] = "Mi identificador actual del idioma es: '%s'."; - -?> \ No newline at end of file diff --git a/web/lang/fr/test_po.inc b/web/lang/fr/test_po.inc deleted file mode 100644 index f53af143..00000000 --- a/web/lang/fr/test_po.inc +++ /dev/null @@ -1,17 +0,0 @@ - -# Translator: Cilyan Olowen - -include_once("translator.inc"); -global $_t; - -$_t["fr"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Choisissez votre langue ici: %h%s%h, %h%s%h, %h%s%h, %h%s%h."; - -$_t["fr"]["Hello, world!"] = "Salut tout le monde !"; - -$_t["fr"]["Hello, again!"] = "Salut encore !"; - -$_t["fr"]["My current language tag is: '%s'."] = "Mon choix actuel de langue est: '%s'."; - -?> diff --git a/web/lang/it/test_po.inc b/web/lang/it/test_po.inc deleted file mode 100644 index 55c0a4c4..00000000 --- a/web/lang/it/test_po.inc +++ /dev/null @@ -1,16 +0,0 @@ - and Pierluigi Picciau - -include_once("translator.inc"); -global $_t; - -$_t["it"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Scegli la tua lingua: %h%s%h, %h%s%h, %h%s%h, %h%s%h."; - -$_t["it"]["Hello, world!"] = "Ciao, mondo!"; - -$_t["it"]["Hello, again!"] = "Ciao, di nuovo!"; - -$_t["it"]["My current language tag is: '%s'."] = "Il tag della mia lingua corrente è: '%s'."; - -?> \ No newline at end of file diff --git a/web/lang/pl/test_po.inc b/web/lang/pl/test_po.inc deleted file mode 100644 index 847a0abf..00000000 --- a/web/lang/pl/test_po.inc +++ /dev/null @@ -1,13 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["pl"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Wybierz swój język: %h%s%h, %h%s%h, %h%s%h, %h%s%h."; -$_t["pl"]["Hello, world!"] = "Witaj, świecie!"; -$_t["pl"]["Hello, again!"] = "Witaj, ponownie!"; -$_t["pl"]["My current language tag is: '%s'."] = "Etykieta mojego obecnego języka to: '%s'."; - -?> \ No newline at end of file diff --git a/web/lang/pt/test_po.inc b/web/lang/pt/test_po.inc deleted file mode 100644 index 040e736c..00000000 --- a/web/lang/pt/test_po.inc +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/web/lang/ru/test_po.inc b/web/lang/ru/test_po.inc deleted file mode 100644 index 381abe32..00000000 --- a/web/lang/ru/test_po.inc +++ /dev/null @@ -1,16 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["ru"]["Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h."] = "Выберите ваш язык здесь: %h%s%h, %h%s%h, %h%s%h, %h%s%h."; - -$_t["ru"]["Hello, world!"] = "Всем привет!"; - -$_t["ru"]["Hello, again!"] = "Привет еще раз!"; - -$_t["ru"]["My current language tag is: '%s'."] = "Мой текущий язык: '%s'."; - -?> \ No newline at end of file diff --git a/web/lang/test_po.inc b/web/lang/test_po.inc deleted file mode 100644 index a2c5c5c3..00000000 --- a/web/lang/test_po.inc +++ /dev/null @@ -1,32 +0,0 @@ - \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 361f08a740f403e7f66bd6da071358899cd3ef1f Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 19 Aug 2008 15:48:13 -0400 Subject: Remove obsolete sample PKGBUILD and tarball. Signed-off-by: Loui Chang --- web/testing/xmms-skins.tar.gz | Bin 2850 -> 0 bytes web/testing/xmms-skins/PKGBUILD | 57 ------------------------------ web/testing/xmms-skins/xmms-skins.install | 29 --------------- 3 files changed, 86 deletions(-) delete mode 100644 web/testing/xmms-skins.tar.gz delete mode 100644 web/testing/xmms-skins/PKGBUILD delete mode 100644 web/testing/xmms-skins/xmms-skins.install (limited to 'web') diff --git a/web/testing/xmms-skins.tar.gz b/web/testing/xmms-skins.tar.gz deleted file mode 100644 index 1b313f8c..00000000 Binary files a/web/testing/xmms-skins.tar.gz and /dev/null differ diff --git a/web/testing/xmms-skins/PKGBUILD b/web/testing/xmms-skins/PKGBUILD deleted file mode 100644 index 83d934b6..00000000 --- a/web/testing/xmms-skins/PKGBUILD +++ /dev/null @@ -1,57 +0,0 @@ -# $Id: PKGBUILD,v 1.5 2004/05/24 18:09:09 eric Exp $ -# Maintainer: eric -# Contributor: Damir Perisa -# 0.2 Upgrade: Lukas Sabota - -pkgname=xmms-skins -pkgver=0.2 -pkgrel=2 -pkgdesc="An assortment of skins for XMMS" -url="http://www.xmms.org/skins.php http://www.spacefem.com/xmms.shtml" -depends=('xmms' 'unzip') -install=$pkgname.install -source=(http://spacefem.com/skins/ChalkItUp.tar.gz \ - http://www.xmms.org/files/Skins/Winamp_X_XMMS_1.01.tar.gz \ - http://www.xmms.org/files/Skins/arctic_Xmms.zip \ - http://www.xmms.org/files/Skins/chaos_XMMS.zip \ - http://www.xmms.org/files/Skins/detone_green.zip \ - http://gd.tuwien.ac.at/mm/xmms/Skins/titanium.zip \ - http://www.xmms.org/files/Skins/xmms-256.zip \ - http://themes.freshmeat.net/redir/acquaxmms/33610/url_tgz/acquaxmms-default-1.0.tar.gz \ - http://themes.freshmeat.net/redir/4dweorng/31359/url_tgz/4dweorng-default-1.0.tar.gz \ - http://themes.freshmeat.net/redir/bhxmms/29592/url_tgz/bhxmms-1.0.tar.gz \ - http://themes.freshmeat.net/redir/chaos2-xmms/34064/url_tgz/chaos2-xmms-default-1.4.tar.gz \ - http://www.xmms.org/files/Skins/Eclipse.tar.gz \ - http://themes.freshmeat.net/redir/jvcamp/34423/url_zip/jvcamp.zip \ - http://themes.freshmeat.net/redir/kenwood/34424/url_zip/kenwood1.zip \ - http://themes.freshmeat.net/redir/myxmms/45828/url_tgz/myxmms-default-1.01.tar.gz \ - http://themes.freshmeat.net/redir/ojxmms/29453/url_tgz/ojxmms-1.0.tar.gz \ - http://themes.freshmeat.net/redir/philipsxmms/34426/url_zip/radical.zip \ - http://themes.freshmeat.net/redir/pioneerlite/34425/url_zip/pioneerlite.zip \ - http://themes.freshmeat.net/redir/succubamp/35024/url_tgz/succubamp-default-1.0.tar.gz \ - http://themes.freshmeat.net/redir/ultraclean-xmms/46461/url_tgz/ultraclean-xmms-default.tar.gz \ - http://gd.tuwien.ac.at/mm/xmms/Skins/xmms_skin-0.9.zip \ - http://havardk.xmms.org/skins/xmmsskins-1.0.tar.gz) - -md5sums=('1a541ca4fbcbd60eaffac97a8e01a514' '60b5249618067baba41093d566f56c9f' \ - '2eef6028cb492eb6c61e3d4833f050d1' 'ae60e6fd170737af35caf219ddf859ec' \ - 'd3d5e43860db73a73b37a4949eebfe4f' 'a38d448ac059f42bd32e52f3999a6ca5' \ - '93891ba6259280d07a8781cd89234703' '92dd1ae652c43ea514764460b852f42c' \ - '9f79f309e5859b878b0cdcfb3d97a8b0' '55b6ada4b963132bb561156eddd47615' \ - '880be0a9dbbd9a3a458739063c6e0904' '89c7acb342bee6c7977047669ba195d7' \ - '7caaa4977c73c23e70c758a94c4104ef' '96340dd2f5634a6d49c9a314c1db7ad1' \ - '83f2cdc3d2cd2fbd5f3a4f92eba8d932' '108266865bcf9509edea839ca0a76d57' \ - '2b2fee8ce2ba18074dc202a50372ce95' 'acb8bf4189ad7d00a36ca74514686f8e' \ - 'a770f9e537a0cec3818b331696d7ffff' 'b90c21851264fd273bb06196fb157a7a' \ - 'aaaed9cd81b233e4fe5f896e9353443e' 'f625e06f82d8132209ed947c6d8502a4') - -build() { - cd $startdir/src/ - /bin/mkdir -p $startdir/pkg/usr/share/xmms/Skins - /bin/cp *.zip $startdir/pkg/usr/share/xmms/Skins - /bin/cp *.gz $startdir/pkg/usr/share/xmms/Skins - /bin/rm $startdir/pkg/usr/share/xmms/Skins/ultraclean-xmms-default.tar.gz - /bin/rm $startdir/pkg/usr/share/xmms/Skins/xmmsskins-1.0.tar.gz -} -# vim: ts=2 sw=2 et ft=sh - diff --git a/web/testing/xmms-skins/xmms-skins.install b/web/testing/xmms-skins/xmms-skins.install deleted file mode 100644 index 643d98bf..00000000 --- a/web/testing/xmms-skins/xmms-skins.install +++ /dev/null @@ -1,29 +0,0 @@ -# arg 1: the new package version -post_install() { - echo "=> If you are upgrading from SpamAssassin 2.x, please see the notes" - echo "=> at http://spamassassin.apache.org/full/3.0.x/dist/UPGRADE" - echo "=> In particular, you may need to update your bayes db with:" - echo "=> sa-learn --sync" - echo "=> Also, you may want to set your LANG environment variable to" - echo "=> a non-utf8 value such as LANG=en_US prior to calling SA" -} - -# arg 1: the new package version -# arg 2: the old package version -post_upgrade() { - /bin/true -} - -# arg 1: the old package version -pre_remove() { - /bin/true -} - -# arg 1: the old package version -post_remove() { - /bin/true -} - -op=$1 -shift -$op $* -- cgit v1.2.3-24-g4f1b From b69e2cce56bee61ea445417e29e55d27a15637d5 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 19 Aug 2008 18:08:12 -0400 Subject: Move top page template-example to web/template. Make note in web/README.txt Signed-off-by: Loui Chang --- web/README.txt | 3 +++ web/html/template.php | 20 -------------------- web/lang/ca/template_po.inc | 10 ---------- web/lang/de/template_po.inc | 10 ---------- web/lang/en/template_po.inc | 16 ---------------- web/lang/es/template_po.inc | 10 ---------- web/lang/fr/template_po.inc | 11 ----------- web/lang/it/template_po.inc | 10 ---------- web/lang/pl/template_po.inc | 10 ---------- web/lang/pt/template_po.inc | 16 ---------------- web/lang/ru/template_po.inc | 10 ---------- web/lang/template_po.inc | 32 -------------------------------- web/template/template.phps | 21 +++++++++++++++++++++ 13 files changed, 24 insertions(+), 155 deletions(-) delete mode 100644 web/html/template.php delete mode 100644 web/lang/ca/template_po.inc delete mode 100644 web/lang/de/template_po.inc delete mode 100644 web/lang/en/template_po.inc delete mode 100644 web/lang/es/template_po.inc delete mode 100644 web/lang/fr/template_po.inc delete mode 100644 web/lang/it/template_po.inc delete mode 100644 web/lang/pl/template_po.inc delete mode 100644 web/lang/pt/template_po.inc delete mode 100644 web/lang/ru/template_po.inc delete mode 100644 web/lang/template_po.inc create mode 100644 web/template/template.phps (limited to 'web') diff --git a/web/README.txt b/web/README.txt index 69bec044..249f6052 100644 --- a/web/README.txt +++ b/web/README.txt @@ -92,6 +92,9 @@ Directory Layout: ./template - Where most of the html markup resides and minimal amount of PHP scripting. + There is also a template to model the site's top pages in + template.phps + Scripts: -------- diff --git a/web/html/template.php b/web/html/template.php deleted file mode 100644 index 11e05e0b..00000000 --- a/web/html/template.php +++ /dev/null @@ -1,20 +0,0 @@ -\n"; - - -html_footer(AUR_VERSION); - -?> diff --git a/web/lang/ca/template_po.inc b/web/lang/ca/template_po.inc deleted file mode 100644 index 5ea5ee69..00000000 --- a/web/lang/ca/template_po.inc +++ /dev/null @@ -1,10 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["ca"]["Hi, this is worth reading!"] = "Hola, val la pena llegir açò!"; - -?> \ No newline at end of file diff --git a/web/lang/de/template_po.inc b/web/lang/de/template_po.inc deleted file mode 100644 index 024d7673..00000000 --- a/web/lang/de/template_po.inc +++ /dev/null @@ -1,10 +0,0 @@ -, Matthias Gorissen , Lukas Kropatschek, Niclas Pfeifer - -include_once("translator.inc"); -global $_t; - -$_t["de"]["Hi, this is worth reading!"] = "Hallo - es lohnt sich, dies zu lesen!"; - -?> \ No newline at end of file diff --git a/web/lang/en/template_po.inc b/web/lang/en/template_po.inc deleted file mode 100644 index db437be1..00000000 --- a/web/lang/en/template_po.inc +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/web/lang/es/template_po.inc b/web/lang/es/template_po.inc deleted file mode 100644 index 21e45fce..00000000 --- a/web/lang/es/template_po.inc +++ /dev/null @@ -1,10 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["es"]["Hi, this is worth reading!"] = "Hola, ¡vale la pena llegar hasta aquí!"; - -?> \ No newline at end of file diff --git a/web/lang/fr/template_po.inc b/web/lang/fr/template_po.inc deleted file mode 100644 index 2084c164..00000000 --- a/web/lang/fr/template_po.inc +++ /dev/null @@ -1,11 +0,0 @@ - -# Translator: Cilyan Olowen - -include_once("translator.inc"); -global $_t; - -$_t["fr"]["Hi, this is worth reading!"] = "Salut, ceci vaut la peine d'être lu !"; - -?> diff --git a/web/lang/it/template_po.inc b/web/lang/it/template_po.inc deleted file mode 100644 index defe7ac5..00000000 --- a/web/lang/it/template_po.inc +++ /dev/null @@ -1,10 +0,0 @@ - and Pierluigi Picciau - -include_once("translator.inc"); -global $_t; - -$_t["it"]["Hi, this is worth reading!"] = "Ciao, questo vale la pena di leggerlo!"; - -?> \ No newline at end of file diff --git a/web/lang/pl/template_po.inc b/web/lang/pl/template_po.inc deleted file mode 100644 index c4e56864..00000000 --- a/web/lang/pl/template_po.inc +++ /dev/null @@ -1,10 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["pl"]["Hi, this is worth reading!"] = "Witaj, warto to przeczytać!"; - -?> \ No newline at end of file diff --git a/web/lang/pt/template_po.inc b/web/lang/pt/template_po.inc deleted file mode 100644 index ed4a1d04..00000000 --- a/web/lang/pt/template_po.inc +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/web/lang/ru/template_po.inc b/web/lang/ru/template_po.inc deleted file mode 100644 index 86c3e9b2..00000000 --- a/web/lang/ru/template_po.inc +++ /dev/null @@ -1,10 +0,0 @@ - - -include_once("translator.inc"); -global $_t; - -$_t["ru"]["Hi, this is worth reading!"] = "Привет, это стоит почитать!"; - -?> \ No newline at end of file diff --git a/web/lang/template_po.inc b/web/lang/template_po.inc deleted file mode 100644 index 8d65fc0d..00000000 --- a/web/lang/template_po.inc +++ /dev/null @@ -1,32 +0,0 @@ - \ No newline at end of file diff --git a/web/template/template.phps b/web/template/template.phps new file mode 100644 index 00000000..7a866861 --- /dev/null +++ b/web/template/template.phps @@ -0,0 +1,21 @@ +\n"; + + +html_footer(AUR_VERSION); + -- cgit v1.2.3-24-g4f1b From 73f807a5a86c3ebd2f2de84b721c78271bd0cace Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 19 Aug 2008 18:10:29 -0400 Subject: Remove obsolete Trusted User guidelines. Guidelines are now maintained in the Arch wiki. Signed-off-by: Loui Chang --- web/html/guidelines.html | 273 ----------------------------------------------- 1 file changed, 273 deletions(-) delete mode 100644 web/html/guidelines.html (limited to 'web') diff --git a/web/html/guidelines.html b/web/html/guidelines.html deleted file mode 100644 index c2acd772..00000000 --- a/web/html/guidelines.html +++ /dev/null @@ -1,273 +0,0 @@ - -AUR Guidelines - - - - - - - -

AUR Guidelines

- -
Jun 08, 2005
-
1.1.0
- -
- Ben Mazer - -
-
- The Trusted Users - -
- -

Summary

-

- Basic guidelines for the Arch User Repository. -

- -

Table Of Contents

- - -

Purpose

-

- The AUR -is a community of Arch users, where packages outside of the core Arch -distribution are maintained. The AUR Community Repo is a supplement to -the EXTRA and CURRENT repositories; less popular packages will be -maintained as a service to the general Arch-using population. Packages -in the AUR will depend on EXTRA and CURRENT.

The AUR was -created to lift the burden on the developers. They should be allowed to -focus on adding new features, rather than doing the mundane job of -package maintenance. Therefore, all packages start inside the AUR, and -as developers consider them crucial to the distribution, they will be -adopted into EXTRA/CURRENT. The AUR was also created to allow easy -participation. Arch is completely volunteer-based, and needs help from -its users. Lastly, the AUR helps to further the Arch philosophy of -KISS. The Arch Core (EXTRA/CURRENT/UNSTABLE) is a complete -distribution, but it does not attempt to provide every single package. -The AUR helps by maintaining less popular packages; but the AUR also -follows KISS, and only popular packages from UNSUPPORTED will make it -into the official AUR repository.

-

The User

-

Users of the -AUR can do many things, the main function being to download and use -packages. One can access the AUR by adding this to their pacman.conf -file:

- [community]
Server = ftp://ftp.archlinux.org/community/os/i686/


-But a user can also help with package maintenance, by: submitting -packages (and then maintaining them while they remain in UNSUPPORTED), -filing bug reports, reporting out-of-date packages, helping with other -user-submitted PKGBUILDs, and voting for packages that should be -maintained by the TUs. Once a user account has been created, all -functions can be performed inside the web interface.

Submitting Packages

-

-Inside the web interface, a user can submit a tarball (tar.gz) of a -directory containing build files for a package. The directory inside -the tarball should contain a PKGBUILD, any .install files, patches, etc -(no binaries). Examples of what a directory looks like can be seen inside /var/abs.

- When submitting a package, observe the following rules: -

    -
  • Check -EXTRA, CURRENT, UNSTABLE, UNSUPPORTED, and AUR for the package. If it -is inside any of those repositories in any form, do not submit the -package (if the package is broken in some way, file a bug report).
  • -
  • Verify -carefully that what you are uploading is correct. Follow the -TU/Developer Package Building Guidelines exactly. Broken packages make -the AUR messy, and prevent the TUs from doing their other duties.
  • -
  • If -you are unsure about the package (or the build/submission process) in -any way, submit the PKGBUILD to the AUR Mailing List for public review -before adding it to the AUR.
  • -
  • Make sure the package -is useful. Will anyone else want to use this package? Is it extremely -specialized? If more than a few people would find this package useful, -it is appropriate for submission.
  • -
  • Gain some experience before submitting packages. Build a few packages to learn the process and then submit.
  • -
  • Do -not abandon packages. While in UNSUPPORTED, it is the user's job to -maintain the package. If you do not want to maintain the package for -some reason, post a message to the AUR Mailing List.
  • -
- - -

The TU

-

-The TU -or Trusted User- is a member of the community charged with -keeping the AUR in working order. He maintains popular packages, and -votes in administrative matters. A TU is elected from active community -members by current TUs in a democratic process. TUs are the only -members who have a final say in the direction of the AUR.

-

Adding a TU

-

-TUs are only added as needed, and applications will only be accepted at -certain times. Check the AUR website for details on whether -applications are being accepted.

-TUs are elected democratically. If you would like to become a TU, a -sponsor (another TU) is needed. You must solicit requests for a sponsor -privately before posting on the mailing list. After this is received, a -request must be made on the AUR Mailing List by the sponsor. Ideally, a -TU should have a specific subset of packages he wishes to maintain.

-Four other votes must be received from other TUs or developers for an -applicant to be accepted. Once these have been received, the user will -be given the proper passwords, and a TU will upgrade the user's status -on the web interface.

-Once an application has been published on the mailing list, it is open -for voting for 3 weeks. If the applicant does not receive enough votes -within that time period, he must wait 3 months to submit another -application, with vote tallies being reset.
- -

-

Sanctioning/Removing a TU

-

-There is a basic sanctioning system for TUs. If a TU breaks a rule, -either official or through "community standards" when he was already -aware of this rule, one can request a sanction. If two other votes from -TUs are received, a sanction will be added. After two sanctions, the TU -will automatically come up for a removal vote.

If a TU is not working out, for any reason, one can -request him to be expelled. Someone requesting a removal of a TU must -state a valid reason, and why immediate removal is necessary. Almost -always, previous sanctions will be needed. With four additional votes, -that TU will be immediately removed and his packages will have to be -adopted by a different TU.

-

Other Duties

-

-All other duties (changing rules, adding new regulations, new features, -etc) should be discussed openly on the AUR Mailing List and voted on. -Various pieces of documentation and code can have specified -"maintainers" that can perform basic updates (typo/bug fixes) without a -vote, but any changes should be reported on the mailing list. Any major -changes should receive a simple majority vote.

-

Guidelines for Package Maintenance

-

-

-

Accessing the Repo

-

- Follow these instructions for uploading/modifying packages once you have become a TU: -

    -
  1. Install the "aurtools" package.
  2. -
  3. Email Jason () for a CVS account.
  4. -
  5. Run the following commands to checkout the AUR CVS:
    - - export CVSROOT=":pserver:<userid>@cvs.archlinux.org:/home/cvs-community"
    - cvs login
    - cvs co community
  6. -
  7. To add a PKGBUILD and other build files:
    - - cvs add <directory>
    - cd <directory>
    - cvs add PKGBUILD
    - .
    - .
    - cvs commit
  8. -
  9. To upload a binary package: - tupkg --user <userid> --password <password> <packagefile.pkg.tar.gz>
  10. -
  11. After uploading a package and committing the build files, tag the files with this command: - cvs tag -cFR CURRENT <newpackagebuilddir>
  12. -
  13. Package -changes should be available within 10 minutes. Verify everything was -uploaded properly, then select the newly added or updated package in -the web interface and set yourself as the maintainer.
  14. -
- -

Adopting Packages

-

-A TU may adopt any package at any time. But because the TU's time is -limited, he should try to only adopt popular packages. The voting -mechanism in the AUR allows a TU to quickly gage which packages users -want.

-If a package receives 25 votes, it may be adopted by a TU. A maintainer -should adopt it via the web interface. That maintainer is then -responsible for bug fixes and new version updates. Packages must be -properly cleaned and fixed after adoption.

- -

Disowning packages

-

-If a TU can't or doesn't want to maintain a package any longer, a -notice should be posted to the AUR Mailing List, so another TU can -maintain it. A package can still be disowned even if no other TU wants -to maintain it, but the TUs should try not to drop many packages (they -shouldn't take on more than they have time for). If a package has -become obsolete or isn't used any longer, it can be removed completely -as well.

-If a package has been removed completely, it can be uploaded once again -(fresh) to UNSUPPORTED, where a regular user can maintain the package -instead of the TU.

-

Packaging Etiquette

-

- Adhere to the following rules when building/maintaining packages: -
-

    -
  • Follow all rules in the Arch Packaging Guidelines.
  • -
  • Always run Namcap on all packages and PKGBUILDs.
  • -
  • All -important messages should be echoed inside the .install file. For -example, if a package needs extra setup to work, directions should be -echoed.
  • -
  • Any optional dependencies that aren't -needed to run the package or have it generally function shouldn't be -included, but a warning message inside the .install file should echo -something like: "To enable SMB support, download the Samba package."
  • - -
  • Always look at current packages for ideas on how various problems should be handled. Most problems have already been solved.
  • -
  • Dependencies -are the most common packaging error. Namcap can help detect them, but -it is not always correct. Verify dependencies by looking at source -documentation and the program website.
  • -
  • All packages should be buildable as a user, under fakeroot.
  • -
  • New user creation should only be done when absolutely necessary.
  • -
  • Always -fill out all applicable fields in the PKGBUILD (never forget a URL, -md5sum, etc). The LICENSE variable is not currently used, but will be -very shortly.
  • -
  • All custom variables should begin with an underscore (_).
  • -
  • A PKGBUILD should never modify any files outside of the build directory.
  • -
- -

Frequently Asked Questions

-

- Q: What is the difference between the AUR, COMMUNITY, and TUR? Why don't packages I upload to the AUR show up in pacman?

-A: The TUR, or Trusted User Repository, was the old system used to -manage user submissions. It had a number of flaws, so was discontinued. -The TUR website is still up, but is dead and will be removed shortly. -AUR is the official replacement for the TUR. It is a web system that -allows users to submit their own PKGBUILDs for both the TUs and the -general community to see. COMMUNITY is a new Arch repository, run by -the TUs, that is available via pacman.

-User submitted PKGBUILDs are available from the AUR, but because they -have not been reviewed, packages are not available. If a PKGBUILD is -reviewed, and receives many votes, it may "graduate" into the COMMUNITY -repo. There it will easily be retrievable from pacman.

-If you are a new user, it is safe to use the COMMUNITY repo, as -packages have been verified. Any PKGBUILDs in the UNSUPPORTED section -of the AUR have not been tested, and could be dangerous or broken. Use -at your own risk.

- -- cgit v1.2.3-24-g4f1b From 52fb8550a21aeac6a6c75700c78be36de8983e15 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Tue, 26 Aug 2008 17:49:26 +0200 Subject: doesn't show disown package when already disowned Signed-off-by: Callan Barrett --- web/lib/pkgfuncs.inc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'web') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 77b0ab11..484e5a65 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -512,14 +512,12 @@ function package_details($id=0, $SID="") { if ($row["MaintainerUID"] == 0) { echo "\n"; - } - - if ($row["MaintainerUID"] == uid_from_sid($SID) || - account_from_sid($SID) == "Trusted User" || - account_from_sid($SID) == "Developer") { + } else if ($row["MaintainerUID"] == uid_from_sid($SID) || + account_from_sid($SID) == "Trusted User" || + account_from_sid($SID) == "Developer") { echo "\n"; - } + } if (account_from_sid($SID) == "Trusted User" || account_from_sid($SID) == "Developer") { -- cgit v1.2.3-24-g4f1b From 99881b31db85bcb87bec22258d856521e5bef7ed Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sat, 13 Sep 2008 15:35:32 -0400 Subject: Fix whitespace and indenting in pkgsubmit. Signed-off-by: Loui Chang --- web/html/pkgsubmit.php | 229 ++++++++++++++++++++++++------------------------- 1 file changed, 112 insertions(+), 117 deletions(-) (limited to 'web') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 0d245b84..78d6e50c 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -12,12 +12,12 @@ set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in if ($_COOKIE["AURSID"]): - + # Track upload errors $error = ""; if ($_REQUEST["pkgsubmit"]) { - + # Before processing, make sure we even have a file if ($_FILES['pfile']['size'] == 0){ $error = __("Error - No file uploaded"); @@ -35,30 +35,30 @@ if ($_COOKIE["AURSID"]): $error = __("Could not change directory to %s.", array($tempdir)); } else { - if ($_FILES['pfile']['name'] == "PKGBUILD") { - move_uploaded_file($_FILES['pfile']['tmp_name'], $tempdir . "/PKGBUILD"); - } else { - $tar = new Archive_Tar($_FILES['pfile']['tmp_name']); - $extract = $tar->extract(); - - if (!$extract) { - $error = __("Unknown file format for uploaded file."); - } - } + if ($_FILES['pfile']['name'] == "PKGBUILD") { + move_uploaded_file($_FILES['pfile']['tmp_name'], $tempdir . "/PKGBUILD"); + } else { + $tar = new Archive_Tar($_FILES['pfile']['tmp_name']); + $extract = $tar->extract(); + + if (!$extract) { + $error = __("Unknown file format for uploaded file."); + } + } } } } # Find the PKGBUILD if (!$error) { - $pkgbuild = File_Find::search('PKGBUILD', $tempdir); - - if (count($pkgbuild)) { - $pkgbuild = $pkgbuild[0]; - $pkg_dir = dirname($pkgbuild); - } else { - $error = __("Error trying to unpack upload - PKGBUILD does not exist."); - } + $pkgbuild = File_Find::search('PKGBUILD', $tempdir); + + if (count($pkgbuild)) { + $pkgbuild = $pkgbuild[0]; + $pkg_dir = dirname($pkgbuild); + } else { + $error = __("Error trying to unpack upload - PKGBUILD does not exist."); + } } # if no error, get list of directory contents and process PKGBUILD @@ -108,7 +108,7 @@ if ($_COOKIE["AURSID"]): fclose($fp); # Now process the lines and put any var=val lines into the - # 'pkgbuild' array. Also check to make sure it has the build() + # 'pkgbuild' array. Also check to make sure it has the build() # function. # $seen_build_function = 0; @@ -123,13 +123,13 @@ if ($_COOKIE["AURSID"]): $lparts[1]{strlen($lparts[1])-1} == '"') { $pkgbuild[$lparts[0]] = substr($lparts[1], 1, -1); } - elseif + elseif ($lparts[1]{0} == "'" && $lparts[1]{strlen($lparts[1])-1} == "'") { $pkgbuild[$lparts[0]] = substr($lparts[1], 1, -1); } else { $pkgbuild[$lparts[0]] = $lparts[1]; - } + } } else { $pkgbuild[$lparts[0]] = str_replace(array("(",")","\"","'"), "", $lparts[1]); @@ -150,20 +150,20 @@ if ($_COOKIE["AURSID"]): if (!$seen_build_function) { $error = __("Missing build function in PKGBUILD."); } - + $req_vars = array("md5sums", "source", "url", "pkgdesc", "license", "pkgrel", "pkgver", "arch", "pkgname"); foreach ($req_vars as $var) { - if (!array_key_exists($var, $pkgbuild)) { - $error = __("Missing " . $var . " variable in PKGBUILD."); - } - } + if (!array_key_exists($var, $pkgbuild)) { + $error = __("Missing " . $var . " variable in PKGBUILD."); + } + } } # TODO This is where other additional error checking can be - # performed. Examples: #md5sums == #sources?, md5sums of any + # performed. Examples: #md5sums == #sources?, md5sums of any # included files match?, install scriptlet file exists? # - + # Check for http:// or other protocol in url # if (!$error) { @@ -172,7 +172,7 @@ if ($_COOKIE["AURSID"]): $error = __("Package URL is missing a protocol (ie. http:// ,ftp://)"); } } - + # Now, run through the pkgbuild array and do any $pkgname/$pkgver # substituions. # @@ -195,9 +195,9 @@ if ($_COOKIE["AURSID"]): $pkg_name = str_replace("'", "", $pkgbuild['pkgname']); $pkg_name = escapeshellarg($pkg_name); $pkg_name = str_replace("'", "", $pkg_name); - + $presult = preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/", $pkg_name); - + if (!$presult) { $error = __("Invalid name: only lowercase letters are allowed."); } @@ -213,18 +213,14 @@ if ($_COOKIE["AURSID"]): } if (!@mkdir(INCOMING_DIR . $pkg_name)) { - $error = __( "Could not create directory %s." - , INCOMING_DIR . $pkg_name - ); + $error = __( "Could not create directory %s.", + INCOMING_DIR . $pkg_name); } - rename($pkg_dir, INCOMING_DIR . $pkg_name . "/" . $pkg_name); + rename($pkg_dir, INCOMING_DIR . $pkg_name . "/" . $pkg_name); } else { - $error = __( "You are not allowed to overwrite the %h%s%h package." - , "" - , $pkg_name - , "" - ); + $error = __( "You are not allowed to overwrite the %h%s%h package.", + "", $pkg_name, ""); } } @@ -235,16 +231,16 @@ if ($_COOKIE["AURSID"]): array(INCOMING_DIR . $pkg_name)); } } - + if (!$error) { - $tar = new Archive_Tar($pkg_name . '.tar.gz'); - $create = $tar->create(array($pkg_name)); - + $tar = new Archive_Tar($pkg_name . '.tar.gz'); + $create = $tar->create(array($pkg_name)); + if (!$create) { $error = __("Could not re-tar"); } } - + # Whether it failed or not we can clean this out if (file_exists($tempdir)) { rm_rf($tempdir); @@ -252,13 +248,13 @@ if ($_COOKIE["AURSID"]): # Update the backend database if (!$error) { - + $dbh = db_connect(); - + # This is an overwrite of an existing package, the database ID - # needs to be preserved so that any votes are retained. However, + # needs to be preserved so that any votes are retained. However, # PackageDepends and PackageSources can be purged. - + $q = "SELECT * FROM Packages WHERE Name = '" . mysql_real_escape_string($new_pkgbuild['pkgname']) . "'"; $result = db_query($q, $dbh); $pdata = mysql_fetch_assoc($result); @@ -273,53 +269,52 @@ if ($_COOKIE["AURSID"]): # If the package was a dummy, undummy it if ($pdata['DummyPkg']) { - $q = sprintf( "UPDATE Packages SET DummyPkg = 0, SubmitterUID = %d, MaintainerUID = %d, SubmittedTS = UNIX_TIMESTAMP() WHERE ID = %d" - , uid_from_sid($_COOKIE["AURSID"]) - , uid_from_sid($_COOKIE["AURSID"]) - , $pdata["ID"] - ); + $q = sprintf( "UPDATE Packages SET DummyPkg = 0, SubmitterUID = %d, MaintainerUID = %d, SubmittedTS = UNIX_TIMESTAMP() WHERE ID = %d", + uid_from_sid($_COOKIE["AURSID"]), + uid_from_sid($_COOKIE["AURSID"]), + $pdata["ID"]); - db_query($q, $dbh); + db_query($q, $dbh); } - + # If a new category was chosen, change it to that if ($_POST['category'] > 1) { - $q = sprintf( "UPDATE Packages SET CategoryID = %d WHERE ID = %d" - , mysql_real_escape_string($_REQUEST['category']) - , $pdata["ID"] - ); - - db_query($q, $dbh); - } - + $q = sprintf( "UPDATE Packages SET CategoryID = %d WHERE ID = %d", + mysql_real_escape_string($_REQUEST['category']), + $pdata["ID"]); + + db_query($q, $dbh); + } + # 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" - , mysql_real_escape_string($new_pkgbuild['pkgname']) - , mysql_real_escape_string($new_pkgbuild['pkgver']) - , mysql_real_escape_string($new_pkgbuild['pkgrel']) - , mysql_real_escape_string($new_pkgbuild['license']) - , mysql_real_escape_string($new_pkgbuild['pkgdesc']) - , mysql_real_escape_string($new_pkgbuild['url']) - , mysql_real_escape_string(INCOMING_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz") - , mysql_real_escape_string(URL_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz") - , $pdata["ID"] - ); - + $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", + mysql_real_escape_string($new_pkgbuild['pkgname']), + mysql_real_escape_string($new_pkgbuild['pkgver']), + mysql_real_escape_string($new_pkgbuild['pkgrel']), + mysql_real_escape_string($new_pkgbuild['license']), + mysql_real_escape_string($new_pkgbuild['pkgdesc']), + mysql_real_escape_string($new_pkgbuild['url']), + mysql_real_escape_string(INCOMING_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz"), + mysql_real_escape_string(URL_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz"), + $pdata["ID"]); + db_query($q, $dbh); # Update package depends $depends = explode(" ", $new_pkgbuild['depends']); - foreach ($depends as $dep) { + foreach ($depends as $dep) { $q = "INSERT INTO PackageDepends (PackageID, DepPkgID, DepCondition) VALUES ("; $deppkgname = preg_replace("/[<>]?=.*/", "", $dep); - $depcondition = str_replace($deppkgname, "", $dep); - - if ($deppkgname == "#") { break; } - + $depcondition = str_replace($deppkgname, "", $dep); + + if ($deppkgname == "#") { + break; + } + $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']); - $q .= $pdata["ID"] . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; + $q .= $pdata["ID"] . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; - db_query($q, $dbh); + db_query($q, $dbh); } # Insert sources @@ -328,26 +323,25 @@ if ($_COOKIE["AURSID"]): $q = "INSERT INTO PackageSources (PackageID, Source) VALUES ("; $q .= $pdata["ID"] . ", '" . mysql_real_escape_string($src) . "')"; db_query($q, $dbh); - } + } header('Location: packages.php?ID=' . $pdata['ID']); - + } else { - + # This is a brand new package - $q = sprintf( "INSERT INTO Packages (Name, License, Version, CategoryID, Description, URL, LocationID, SubmittedTS, SubmitterUID, MaintainerUID, FSPath, URLPath) VALUES ('%s', '%s', '%s-%s', %d, '%s', '%s', 2, UNIX_TIMESTAMP(), %d, %d, '%s', '%s')" - , mysql_real_escape_string($new_pkgbuild['pkgname']) - , mysql_real_escape_string($new_pkgbuild['license']) - , mysql_real_escape_string($new_pkgbuild['pkgver']) - , mysql_real_escape_string($new_pkgbuild['pkgrel']) - , mysql_real_escape_string($_REQUEST['category']) - , mysql_real_escape_string($new_pkgbuild['pkgdesc']) - , mysql_real_escape_string($new_pkgbuild['url']) - , uid_from_sid($_COOKIE["AURSID"]) - , uid_from_sid($_COOKIE["AURSID"]) - , mysql_real_escape_string(INCOMING_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz") - , mysql_real_escape_string(URL_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz") - ); + $q = sprintf("INSERT INTO Packages (Name, License, Version, CategoryID, Description, URL, LocationID, SubmittedTS, SubmitterUID, MaintainerUID, FSPath, URLPath) VALUES ('%s', '%s', '%s-%s', %d, '%s', '%s', 2, UNIX_TIMESTAMP(), %d, %d, '%s', '%s')", + mysql_real_escape_string($new_pkgbuild['pkgname']), + mysql_real_escape_string($new_pkgbuild['license']), + mysql_real_escape_string($new_pkgbuild['pkgver']), + mysql_real_escape_string($new_pkgbuild['pkgrel']), + mysql_real_escape_string($_REQUEST['category']), + mysql_real_escape_string($new_pkgbuild['pkgdesc']), + mysql_real_escape_string($new_pkgbuild['url']), + uid_from_sid($_COOKIE["AURSID"]), + uid_from_sid($_COOKIE["AURSID"]), + mysql_real_escape_string(INCOMING_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz"), + mysql_real_escape_string(URL_DIR . $pkg_name . "/" . $pkg_name . ".tar.gz")); $result = db_query($q, $dbh); $packageID = mysql_insert_id($dbh); @@ -358,12 +352,14 @@ if ($_COOKIE["AURSID"]): $q = "INSERT INTO PackageDepends (PackageID, DepPkgID, DepCondition) VALUES ("; $deppkgname = preg_replace("/[<>]?=.*/", "", $dep); $depcondition = str_replace($deppkgname, "", $dep); - - if ($deppkgname == "#") { break; } - - $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']); - $q .= $packageID . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; - + + if ($deppkgname == "#") { + break; + } + + $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']); + $q .= $packageID . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; + db_query($q, $dbh); } @@ -373,10 +369,10 @@ if ($_COOKIE["AURSID"]): $q = "INSERT INTO PackageSources (PackageID, Source) VALUES ("; $q .= $packageID . ", '" . mysql_real_escape_string($src) . "')"; db_query($q, $dbh); - } + } header('Location: packages.php?ID=' . $packageID); - + } } @@ -390,10 +386,10 @@ html_header("Submit"); ?>
-
- -
-
+
+ +
+
@@ -463,15 +459,14 @@ else: ?>
- + -
+
-- cgit v1.2.3-24-g4f1b From 5c3f01909301f641f57b2ffe8b59609de6be2256 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Fri, 12 Sep 2008 20:19:42 -0400 Subject: Use system rm in rm_rf function. PHP can't properly handle symlinks which causes problems when self-referencing symlinks appear. This closes FS#11187. Signed-off-by: Loui Chang --- web/lib/aur.inc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'web') diff --git a/web/lib/aur.inc b/web/lib/aur.inc index ade5b82c..a126bb94 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -374,19 +374,10 @@ function can_submit_pkg($name="", $sid="") { # recursive delete directory # function rm_rf($dirname="") { - $d = dir($dirname); - while ($f = $d->read()) { - if ($f != "." && $f != "..") { - if (is_dir($dirname."/".$f)) { - rm_rf($dirname."/".$f); - } - if (is_file($dirname."/".$f) || is_link($dirname."/".$f)) { - unlink($dirname."/".$f); - } - } + if ($dirname != "") { + exec('rm -rf ' . escapeshellcmd($dirname)); } - $d->close(); - rmdir($dirname); + return; } -- cgit v1.2.3-24-g4f1b From df39cded09cb2a1ed9ee2f11207b28ccbb24fd51 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Mon, 29 Sep 2008 00:07:33 +0800 Subject: Sort required by list in package details page. This closes FS#11420. Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/lib/pkgfuncs.inc | 1 + 1 file changed, 1 insertion(+) (limited to 'web') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 484e5a65..5ba56da0 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -128,6 +128,7 @@ function package_required($pkgid=0) { $q.= "WHERE PackageDepends.PackageID = Packages.ID "; $q.= "AND PackageDepends.DepPkgID = "; $q.= mysql_real_escape_string($pkgid); + $q.= " ORDER BY Name"; $result = db_query($q, $dbh); if (!$result) {return array();} while ($row = mysql_fetch_row($result)) { -- cgit v1.2.3-24-g4f1b From c7bfd9528473da0886afd328f0fa68e26c97ca3d Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Thu, 18 Sep 2008 22:16:40 -0400 Subject: Take formatting out of version number in web/lib/version.inc Signed-off-by: Loui Chang Signed-off-by: Callan Barrett --- web/lib/version.inc | 2 +- web/template/footer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/lib/version.inc b/web/lib/version.inc index dcc2f3c2..9ef059f2 100644 --- a/web/lib/version.inc +++ b/web/lib/version.inc @@ -1,3 +1,3 @@ v1.5.2" ); +define( "AUR_VERSION", "v1.5.2" ); diff --git a/web/template/footer.php b/web/template/footer.php index 9d85c7da..fe8f89cd 100644 --- a/web/template/footer.php +++ b/web/template/footer.php @@ -3,7 +3,7 @@
$ver

\n"; + print "

$ver

\n"; } ?>
-- cgit v1.2.3-24-g4f1b From a0e75dbbfcde794657a344f6b92888b713b950a7 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sun, 28 Sep 2008 17:19:11 -0400 Subject: Update documentation. Signed-off-by: Loui Chang Signed-off-by: Callan Barrett --- web/README | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ web/README.txt | 166 -------------------------------------------------------- 2 files changed, 169 insertions(+), 166 deletions(-) create mode 100644 web/README delete mode 100644 web/README.txt (limited to 'web') diff --git a/web/README b/web/README new file mode 100644 index 00000000..b0e6c39f --- /dev/null +++ b/web/README @@ -0,0 +1,169 @@ +Setup on Arch Linux: +==================== +1) Install Apache, MySQL, PHP, and git + # pacman -Sy apache mysql php git + +2) Set a local 'hostname' of 'aur' + - Edit /etc/hosts and append 'aur' to loopback address + 127.0.0.1 localhost aur + +3) Configure Apache + + - Edit /etc/httpd/conf/httpd.conf and make sure that PHP + support is enabled by uncommenting the LoadModule line + that specifies the PHP module. + + - Also append the following snippet to enable the aur + Virtual Host (Replace MYUSER with your username). + + + Servername aur + DocumentRoot /home/MYUSER/aur/web/html + ErrorLog /var/log/httpd/aur-error.log + CustomLog /var/log/httpd/aur-access.log combined + + Options Indexes FollowSymLinks + AllowOverride All + + + +4) Clone the AUR project (using the MYUSER from above) + $ cd + $ git clone http://projects.archlinux.org/git/aur.git + +5) Configure PHP + Make sure you have mysql and json enabled in PHP. + + - Edit php.ini and uncomment/add these lines: + extension=mysql.so + extension=json.so + + AUR requires PEAR and the File_Find module. + Installing PEAR will vary depending on the system and may already + be included with PHP. You can also find it in the PHP source distribution. + + PHP sources: http://www.php.net/downloads.php + File_Find PEAR module: http://pear.php.net/package/File_Find + + - Install the File_Find PEAR package: + # pear install File_Find + + - Put PEAR in your php include_path in web/html/.htaccess: + + php value include_path = ".:../lib:../lang:/usr/share/pear" + + PEAR's path may vary depending on your set up. + +6) Configure MySQL + - Start the MySQL service. Example: + # /etc/rc.d/mysqld start + + - Connect to the mysql client + # mysql -uroot + + - Issue the following commands to the mysql client + mysql> CREATE DATABASE AUR; + mysql> GRANT ALL PRIVILEGES ON AUR.* to aur@localhost + > identified by 'aur'; + mysql> FLUSH PRIVILEGES; + mysql> quit + + - Load the schema file + # mysql -uaur -p AUR < ~/aur/support/schema/aur-schema.sql + (give password 'aur' at the prompt) + + - Optionally load some test data for development purposes. + # bzcat ~/aur/support/schema/dummy-data.sql.bz2 | mysql -uaur -p AUR + (give password 'aur' at the prompt) + +7) Copy the config.inc.proto file to config.inc. Modify as needed. + # cd ~/aur/web/lib/ + # cp config.inc.profo config.inc + +8) Point your browser to http://aur + + +Web Interface: +============== + +Directory Layout: +----------------- +./html - DocumentRoot for AUR, where the PHP scripts live. +./html/css - CSS stylesheets +./html/images - Any AUR images live here. +./lib - Supporting PHP include files. Access denied to Apache. +./template - Where most of the html markup resides and minimal + amount of PHP scripting. + + There is also a template to model the site's top pages in + template.phps + + +Scripts: +-------- +- lib/aur.inc + This is where we can stick functions that can be shared + between the various scripts. Also a good place to put the + MySQL authentication variables since it should live outside + the DocumentRoot. + +- html/login.php (probably index.php) + PHP script to handle logging users into the AUR web site. It + authenticates using the email address and a password against + the Users table. Once authenticated, a session id is generated + and stored in the Sessions table and sent as a cookie to the + user's browser. + +- html/logout.php + PHP script to logout. It clears the session id from the + Sessions table and unsets the cookie. + +- html/account.php + PHP script to handle registering for a new account. It prompts + the visitor for account information: Email, password, real name, + irc nick. The info is recorded in the Users table. Perhaps later, + we can add a preferences field that allows the user to request to + be notified when new packages are submitted so that they can cast + votes for them? + + If a TU is logged into the system, they can edit accounts and set + the account type (regular user or TU). If a Dev is logged in, they + can also set the account type to Dev. TUs and Devs are able to + delete accounts. If an account is deleted, all "Unsupported" + packages are orphaned (the MaintainerUID field in the Packages + table is set to Null). + +- html/packages.php + PHP script to search the package database. It should support + searching by location ("unsupported", "community", "extra"), name, + category, maintainer, popularity, etc. It should resemble the + packages.php script on archlinux.org. A checkbox should be + included next to each package to allow users to flag a package + out of date, adopt it, and vote for it (and reverse operations). + +- html/pkgsubmit.php + This is the PHP script that allows users to upload a new package. + The package format will be a tgz containing the PKGBUILD, + scriptlets, and patches necessary to build the package from + source. Initially, the user submitting the package can select + its category (network, devel, etc) but that can be modified + later by the adopting TU. The script makes appropriate entries + into the database (and perhaps notifies interested users of the + new package). + + +Terms and Definitions: +====================== +AUR - Arch Linux User-Community Repository + Includes: + - the AUR web site, + - the [unsupported] 'repository' + - the [community] repository managed by the TUs + +TU - Trusted User + A user that can add binary packages to the [community] + repository and administer AUR. + +[unsupported] + The collection of package build files hosted via the AUR web site. + diff --git a/web/README.txt b/web/README.txt deleted file mode 100644 index 249f6052..00000000 --- a/web/README.txt +++ /dev/null @@ -1,166 +0,0 @@ -Setup on Arch Linux: -==================== -1) Install Apache, MySQL, PHP, and git - # pacman -Sy apache mysql php git - -2) Set a local 'hostname' of 'aur' - - Edit /etc/hosts and append 'aur' to loopback address - 127.0.0.1 localhost aur - -3) Configure Apache - - - Edit /etc/httpd/conf/httpd.conf and make sure that PHP - support is enabled by uncommenting the LoadModule line - that specifies the PHP module. - - - Also append the following snippet to enable the aur - Virtual Host (Replace MYUSER with your username). - - - Servername aur - DocumentRoot /home/MYUSER/aur/web/html - ErrorLog /var/log/httpd/aur-error.log - CustomLog /var/log/httpd/aur-access.log combined - - Options Indexes FollowSymLinks - AllowOverride All - - - -4) Clone the AUR project (using the MYUSER from above) - $ cd - $ git clone http://projects.archlinux.org/git/aur.git - -5) Configure PHP - Make sure you have mysql and json enabled in PHP. - - - Edit php.ini and uncomment/add these lines: - extension=mysql.so - extension=json.so - - AUR requires PEAR and the File_Find module. - Installing PEAR will vary depending on the system and may already - be included with PHP. You can also find it in the PHP source distribution. - - PHP sources: http://www.php.net/downloads.php - File_Find PEAR module: http://pear.php.net/package/File_Find - - - Install the File_Find PEAR package: - # pear install File_Find - - - Put PEAR in your php include_path in web/html/.htaccess: - - php value include_path = ".:../lib:../lang:/usr/share/pear" - - PEAR's path may vary depending on your set up. - -6) Configure MySQL - - Connect to the mysql client - # mysql -uroot - - - Issue the following commands to the mysql client - mysql> CREATE DATABASE AUR; - mysql> GRANT ALL PRIVILEGES ON AUR.* to aur@localhost - > identified by 'aur'; - mysql> FLUSH PRIVILEGES; - mysql> quit - - - Load the schema file - # mysql -uaur -p AUR < ~/aur/support/schema/aur-schema.sql - (give password 'aur' at the prompt) - - - Optionally load some test data for development purposes. - # bzcat ~/aur/support/schema/dummy-data.sql.bz2 | mysql -uaur -p AUR - (give password 'aur' at the prompt) - -7) Copy the config.inc.proto file to config.inc. Modify as needed. - cd ~/aur/web/lib/ - cp config.inc.profo config.inc - -8) Point your browser to http://aur - - -Web Interface: -============== - -Directory Layout: ------------------ -./html - DocumentRoot for AUR, where the PHP scripts live. -./html/css - CSS stylesheets -./html/images - Any AUR images live here. -./lib - Supporting PHP include files. Access denied to Apache. -./template - Where most of the html markup resides and minimal - amount of PHP scripting. - - There is also a template to model the site's top pages in - template.phps - - -Scripts: --------- -- lib/aur.inc - This is where we can stick functions that can be shared - between the various scripts. Also a good place to put the - MySQL authentication variables since it should live outside - the DocumentRoot. - -- html/login.php (probably index.php) - PHP script to handle logging users into the AUR web site. It - authenticates using the email address and a password against - the Users table. Once authenticated, a session id is generated - and stored in the Sessions table and sent as a cookie to the - user's browser. - -- html/logout.php - PHP script to logout. It clears the session id from the - Sessions table and unsets the cookie. - -- html/account.php - PHP script to handle registering for a new account. It prompts - the visitor for account information: Email, password, real name, - irc nick. The info is recorded in the Users table. Perhaps later, - we can add a preferences field that allows the user to request to - be notified when new packages are submitted so that they can cast - votes for them? - - If a TU is logged into the system, they can edit accounts and set - the account type (regular user or TU). If a Dev is logged in, they - can also set the account type to Dev. TUs and Devs are able to - delete accounts. If an account is deleted, all "Unsupported" - packages are orphaned (the MaintainerUID field in the Packages - table is set to Null). - -- html/packages.php - PHP script to search the package database. It should support - searching by location ("unsupported", "community", "extra"), name, - category, maintainer, popularity, etc. It should resemble the - packages.php script on archlinux.org. A checkbox should be - included next to each package to allow users to flag a package - out of date, adopt it, and vote for it (and reverse operations). - -- html/pkgsubmit.php - This is the PHP script that allows users to upload a new package. - The package format will be a tgz containing the PKGBUILD, - scriptlets, and patches necessary to build the package from - source. Initially, the user submitting the package can select - its category (network, devel, etc) but that can be modified - later by the adopting TU. The script makes appropriate entries - into the database (and perhaps notifies interested users of the - new package). - - -Terms and Definitions: -====================== -AUR - Arch Linux User-Community Repository - Includes: - - the AUR web site, - - the [unsupported] 'repository' - - the [community] repository managed by the TUs - -TU - Trusted User - A user that can add binary packages to the [community] - repository and administer AUR. - -[unsupported] - The collection of package build files hosted via the AUR web site. - -- cgit v1.2.3-24-g4f1b From 34c8a9cf80fa857f8024eacd65292cd015673165 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Mon, 6 Oct 2008 06:09:06 +0800 Subject: Major rearrangement of tu.php, strings setup for translation All the strings are set up to be translated now, HTML of tu.php has been moved to templates and the worst of it rewritten (there's no longer a massive function in it) Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/tu.php | 438 +++++++------------------------------------- web/template/tu_details.php | 62 +++++++ web/template/tu_list.php | 68 +++++++ 3 files changed, 200 insertions(+), 368 deletions(-) create mode 100644 web/template/tu_details.php create mode 100644 web/template/tu_list.php (limited to 'web') diff --git a/web/html/tu.php b/web/html/tu.php index 524e14d8..e2e44b77 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -8,44 +8,30 @@ set_lang(); check_sid(); html_header(); -# get login privileges -# +# Default votes per page +$pp = 5; + +$atype = ""; if (isset($_COOKIE["AURSID"])) { - # Only logged in users can do stuff - # $atype = account_from_sid($_COOKIE["AURSID"]); -} else { - $atype = ""; } if ($atype == "Trusted User" OR $atype == "Developer") { - # Show the TU interface - # - - # Temp value for results per page $pp = 5; - if (isset($_REQUEST['id'])) { - # Show application details - # depending on action and time frame will show either - # sponsor button, comments and vote buttons - # - - if (intval($_REQUEST['id'])) { + if (isset($_GET['id'])) { + if (is_numeric($_GET['id'])) { $q = "SELECT * FROM TU_VoteInfo "; - $q.= "WHERE ID = " . $_REQUEST['id']; + $q.= "WHERE ID = " . $_GET['id']; $dbh = db_connect(); $results = db_query($q, $dbh); $row = mysql_fetch_assoc($results); if (empty($row)) { - print "Could not retrieve proposal details.\n"; + print __("Could not retrieve proposal details."); } else { - # Print out application details, thanks again AUR - # - $isrunning = $row['End'] > time() ? 1 : 0; $qvoted = "SELECT * FROM TU_Votes WHERE "; @@ -53,30 +39,27 @@ if ($atype == "Trusted User" OR $atype == "Developer") { $qvoted.= "UserID = " . uid_from_sid($_COOKIE["AURSID"]); $hasvoted = mysql_num_rows(db_query($qvoted, $dbh)); - # Can this person vote? - # - $canvote = 1; // we assume they can - $errorvote = ""; // error message to give + $canvote = 1; + $errorvote = ""; if ($isrunning == 0) { $canvote = 0; - $errorvote = "Voting is closed for this proposal."; + $errorvote = __("Voting is closed for this proposal."); } else if ($row['User'] == username_from_sid($_COOKIE["AURSID"])) { $canvote = 0; - $errorvote = "You cannot vote in an proposal regarding you."; + $errorvote = __("You cannot vote in an proposal about you."); } else if ($hasvoted != 0) { $canvote = 0; - $errorvote = "You've already voted in this proposal."; + $errorvote = __("You've already voted in this proposal."); } - # have to put this here so results are correct immediately after voting if ($canvote == 1) { if (isset($_POST['doVote'])) { if (isset($_POST['voteYes'])) { - $myvote = "Yes"; + $myvote = __("Yes"); } else if (isset($_POST['voteNo'])) { - $myvote = "No"; + $myvote = __("No"); } else if (isset($_POST['voteAbstain'])) { - $myvote = "Abstain"; + $myvote = __("Abstain"); } $qvote = "UPDATE TU_VoteInfo SET " . $myvote . " = " . ($row[$myvote] + 1) . " WHERE ID = " . $row['ID']; @@ -87,7 +70,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") { # Can't vote anymore # $canvote = 0; - $errorvote = "You've already voted for this proposal."; + $errorvote = __("You've already voted for this proposal."); # Update if they voted $hasvoted = mysql_num_rows(db_query($qvoted, $dbh)); @@ -95,357 +78,76 @@ if ($atype == "Trusted User" OR $atype == "Developer") { $row = mysql_fetch_assoc($results); } } - - # I think I understand why MVC is good for this stuff.. - echo "
\n"; - echo "
Proposal Details
\n"; - echo "
\n"; - - if ($isrunning == 1) { - print "
This vote is still running.
"; - print "
"; - } - - print "User: "; - - if (!empty($row['User'])) { - print "" . $row['User'] . ""; - } else { - print "N/A"; - } - - print "
\n"; - - print "Submitted: " . gmdate("r", $row['Submitted']) . " by "; - print "" . username_from_id($row['SubmitterID']) . "
\n"; - - if ($isrunning == 0) { - print "Ended: "; - } else { - print "Ends: "; - } - print "" . gmdate("r", $row['End']) . "
\n"; - - print "
\n"; - - $row['Agenda'] = htmlentities($row['Agenda']); - # str_replace seems better than
 because it still maintains word wrapping
-				print str_replace("\n", "
\n", $row['Agenda']); - - print "
\n"; - print "
\n"; - - print "
\n"; - print "\n"; - print "\n"; - print "\n"; - print "
\n"; - print "\n"; - - print "\n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print "\n"; - - $c = "data1"; - - print "\n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print "\n"; - - print "
"; - print "Yes"; - print ""; - print "No"; - print ""; - print "Abstain"; - print ""; - print "Total"; - print ""; - print "Voted?"; - print "
"; - print $row['Yes']; - print ""; - print $row['No']; - print ""; - print $row['Abstain']; - print ""; - print ($row['Yes'] + $row['No'] + $row['Abstain']); - print ""; - - if ($hasvoted == 0) { - print "No"; - } else { - print "Yes"; - } - - print "
\n"; - print "
\n"; - - echo "
\n"; - - # Actions, vote buttons - # - print "
\n"; - print "
\n"; - print "
Vote Actions
\n"; - print "
\n"; - - if ($canvote == 1) { - print "
\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "
\n"; - } else { - print "
$errorvote
"; - } - - print "
\n"; - print "
Back
\n"; - + include("tu_details.php"); } - } else { - print "Vote ID not valid.\n"; + print __("Vote ID not valid."); } } else { - # page listing applications being discussed, voted on and all those finished - # - - # I guess there should be a function since I use this a few times - function gen_results($offset, $limit, $sort, $by, $type="normal") { - - $dbh = db_connect(); - - if (!empty($offset) AND is_numeric($offset)) { - if ($offset >= 1) { - $off = $offset; - } else { - $off = 0; - } - } else { - $off = 0; - } - - $q = "SELECT * FROM TU_VoteInfo"; - - if ($type == "new") { - $q.= " WHERE End > " . time(); - $application = "Current Votes"; - } else { - $application = "All Votes"; - } - - $order = ($by == 'down') ? 'DESC' : 'ASC'; - - # not much to sort, I'm unsure how to sort by username - # when we only store the userid, someone come up with a nifty - # way to do this - # - switch ($sort) { - case 'sub': - $q.= " ORDER BY Submitted $order"; - break; - default: - $q.= " ORDER BY Submitted $order"; - break; - } - - if ($limit != 0) { - $q.= " LIMIT " . $off . ", ". $limit; - } - - $result = db_query($q, $dbh); - - if ($by == "down") { - $by_next = "up"; - } else { - $by_next = "down"; - } - - print "
\n"; - print "\n"; - print "\n"; - print " \n"; - print "\n"; - print "\n"; - print "
\n"; - print " $application\n"; - print "
\n"; - print "\n"; - - print "\n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; -# I'm not sure if abstains are necessary inthis view, it's just extra clutter -# print " \n"; - print " \n"; - print "\n"; - - if (mysql_num_rows($result) == 0) { - print "\n"; - } else { - for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { - # Thankyou AUR - - # alright, I'm going to just have a "new" table and the - # "old" table can just have every vote, works just as well - # and probably saves on doing some crap - # - - (($i % 2) == 0) ? $c = "data1" : $c = "data2"; - print "\n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - # print " \n"; - print "\n"; - } - } + $dbh = db_connect(); - print "
"; - print "Proposal"; - print ""; - print "Start"; - print ""; - print "End"; - print ""; - print "User"; - print ""; - print "Yes"; - print ""; - print "No"; - print ""; -# print "Abstain"; -# print ""; - print "Voted?"; - print "
No results found.
"; - - $prev_Len = 100; - - if (strlen($row["Agenda"]) >= $prev_Len) { - $row["Agenda"] = htmlentities(substr($row["Agenda"], 0, $prev_Len)) . "... -"; - } else { - $row["Agenda"] = htmlentities($row["Agenda"]) . " -"; - } - - print $row["Agenda"]; - print " [More]"; - print ""; - # why does the AUR use gmdate with formatting that includes the offset - # to GMT?! - print gmdate("j M y", $row["Submitted"]); - print ""; - print gmdate("j M y", $row["End"]); - print ""; - - if (!empty($row['User'])) { - print ""; - print $row['User'] . ""; - } else { - print "N/A"; - } - - print ""; - print $row['Yes']; - print ""; - print $row['No']; - print ""; - # See above - # print $row['Abstain']; - # print ""; - - $qvoted = "SELECT * FROM TU_Votes WHERE "; - $qvoted.= "VoteID = " . $row['ID'] . " AND "; - $qvoted.= "UserID = " . uid_from_sid($_COOKIE["AURSID"]); - $hasvoted = mysql_num_rows(db_query($qvoted, $dbh)); - - if ($hasvoted == 0) { - print "No"; - } else { - print "Yes"; - } - - print "
\n"; - print "
\n"; + $offset = $_GET['off']; + $limit = $pp; + $by = $_GET['by']; - if ($type == "old" AND $limit != 0) { - $qnext = "SELECT ID FROM TU_VoteInfo"; - $nextresult = db_query($qnext, $dbh); + if (!empty($offset) AND is_numeric($offset)) { + if ($offset >= 1) { + $off = $offset; + } else { + $off = 0; + } + } else { + $off = 0; + } - print "\n"; + $order = ($by == 'down') ? 'DESC' : 'ASC'; + $lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : ""; + $by_next = ($by == "down") ? "up" : "down"; - if (mysql_num_rows($result)) { - $sort = htmlentities($sort, ENT_QUOTES); - $by = htmlentities($by, ENT_QUOTES); + $prev_Len = 100; - print "\n"; - print "\n"; + $q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order; + $result = db_query($q, $dbh); - print "\n"; - print "\n"; - } - print "
\n"; - if ($off != 0) { - $back = (($off - $limit) <= 0) ? 0 : $off - $limit; - print "Back"; - } - print "\n"; - if (($off + $limit) < mysql_num_rows($nextresult)) { - $forw = $off + $limit; - print "Next"; - } - print "
\n"; - } + $type = __("Current Votes"); + include("tu_list.php"); +?> - print "
\n"; - } +
+ +

- # stop notices, ythanku Xilon - if (empty($_REQUEST['sort'])) { $_REQUEST['sort'] = ""; } - if (empty($_REQUEST['by'])) { $_REQUEST['by'] = ""; } - if (empty($_REQUEST['off'])) { $_REQUEST['off'] = ""; } +Add
"; - gen_results($_REQUEST['off'], $pp, $_REQUEST['sort'], $_REQUEST['by'], "old"); + $type = __("All Votes"); + include("tu_list.php"); + $qnext = "SELECT ID FROM TU_VoteInfo"; + $nextresult = db_query($qnext, $dbh); +?> + + + + + + + +
+ + + + + + + +
+ diff --git a/web/template/tu_details.php b/web/template/tu_details.php new file mode 100644 index 00000000..b1d69f6e --- /dev/null +++ b/web/template/tu_details.php @@ -0,0 +1,62 @@ +
+
+
+ +
+
+ +User: + +&SeB=m'> + +N/A + +
+" . gmdate("r", $row['Submitted']) . "", "" . username_from_id($row['SubmitterID']) . "") ?>
+

+\n", htmlentities($row['Agenda'])) ?>

+
+ + + +
+ + + + + + + + + + + + + + + +
+ + + + + +
+
+
+
+
+
+
+ +
' method='post'> + + + + +
+ +
+ +
+
diff --git a/web/template/tu_list.php b/web/template/tu_list.php new file mode 100644 index 00000000..bec29850 --- /dev/null +++ b/web/template/tu_list.php @@ -0,0 +1,68 @@ +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ = $prev_Len) { + $row["Agenda"] = htmlentities(substr($row["Agenda"], 0, $prev_Len)) . "... - "; + } else { + $row["Agenda"] = htmlentities($row["Agenda"]) . " - "; + } + ?> + '>[] + + " . $row['User'] . ""; + } else { + print "N/A"; + } + ?> + + + + + + + + + +
+
+
-- cgit v1.2.3-24-g4f1b From 4b616e20ba11314616ae42fdcd3f7bf6fbb8c4bd Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sun, 5 Oct 2008 06:40:18 +0800 Subject: Move logout link from main menu to login bar Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/template/header.php | 1 - web/template/login_form.php | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/template/header.php b/web/template/header.php index 88fd6f65..f60acb4f 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -46,7 +46,6 @@ -
  • ">
  • ", username_from_sid($_COOKIE["AURSID"]), "")); +?> +
    + Date: Sun, 5 Oct 2008 20:24:57 -0400 Subject: Show developer-TUs their total community packages. This closes: FS#11561 - Devs in AUR can't see their packages in Community Thanks to Hugo Doria for the original patch. Signed-off-by: Loui Chang Signed-off-by: Callan Barrett --- web/lib/stats.inc | 2 +- web/template/stats/user_table.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/lib/stats.inc b/web/lib/stats.inc index e659210f..6fbc0334 100644 --- a/web/lib/stats.inc +++ b/web/lib/stats.inc @@ -29,7 +29,7 @@ function user_table($user, $dbh) # If the user is a TU calculate the number of the packages $atype = account_from_sid($_COOKIE["AURSID"]); - if ($atype == 'Trusted User') { + if (($atype == 'Trusted User') || ($atype == 'Developer')) { $result = db_query(sprintf($base_q, 'community'), $dbh); $row = mysql_fetch_row($result); $maintainer_community_count = $row[0]; diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php index b8446624..ec719996 100644 --- a/web/template/stats/user_table.php +++ b/web/template/stats/user_table.php @@ -13,7 +13,7 @@ - + -- cgit v1.2.3-24-g4f1b From 2d49849e2cebc9014c9c1d8f009b7397c3fd8269 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Wed, 8 Oct 2008 04:00:00 +0800 Subject: Setup translation files for tu.php Signed-off-by: Callan Barrett --- web/html/tu.php | 2 +- web/lang/tu_po.inc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 web/lang/tu_po.inc (limited to 'web') diff --git a/web/html/tu.php b/web/html/tu.php index e2e44b77..67ac3f2f 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -2,7 +2,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang'); -include("pkgfuncs_po.inc"); +include("tu_po.inc"); include("aur.inc"); set_lang(); check_sid(); diff --git a/web/lang/tu_po.inc b/web/lang/tu_po.inc new file mode 100644 index 00000000..00f603a3 --- /dev/null +++ b/web/lang/tu_po.inc @@ -0,0 +1,4 @@ + Date: Wed, 8 Oct 2008 04:42:47 +0800 Subject: Add comment and submitted to notification emails for comments Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/pkgedit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web') diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php index 610113a5..974f14bd 100644 --- a/web/html/pkgedit.php +++ b/web/html/pkgedit.php @@ -91,7 +91,7 @@ if ($_REQUEST["add_Comment"]) { #TODO: native language emails for users, based on their prefs # Simply making these strings translatable won't work, users would be # getting emails in the language that the user who posted the comment was in - $body = "A comment has been added to ".$row['Name'].", you may view it at:\nhttp://aur.archlinux.org/packages.php?ID=".$_REQUEST["ID"]."\n\n\n---\nYou received this e-mail because you chose to recieve notifications of new comments on this package, if you no longer wish to recieve notifications about this package, please go the the above package page and click the UnNotify button."; + $body = "A comment has been added to ".$row['Name']." by " . username_from_sid($_COOKIE["AURSID"]) . ", you may view it at:\nhttp://aur.archlinux.org/packages.php?ID=".$_REQUEST["ID"]."\n\n\"" . $_POST['comment'] . "\"\n\n---\nYou received this e-mail because you chose to receive notifications of new comments on this package, if you no longer wish to recieve notifications about this package, please go the the above package page and click the UnNotify button."; $body = wordwrap($body, 70); $bcc = implode(', ', $bcc); $headers = "Bcc: $bcc\nReply-to: nobody@archlinux.org\nFrom:aur-notify@archlinux.org\nX-Mailer: PHP\nX-MimeOLE: Produced By AUR\n"; -- cgit v1.2.3-24-g4f1b From 2ce36384da97946bc6fe324a8c32a99c9b2d7873 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Wed, 8 Oct 2008 04:19:07 +0800 Subject: Setup translation for addvote.php Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/addvote.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'web') diff --git a/web/html/addvote.php b/web/html/addvote.php index 8e4df795..449bbb0d 100644 --- a/web/html/addvote.php +++ b/web/html/addvote.php @@ -2,7 +2,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang'); -include("pkgfuncs_po.inc"); +include("tu_po.inc"); include("aur.inc"); set_lang(); check_sid(); @@ -25,23 +25,23 @@ if ($atype == "Trusted User" OR $atype == "Developer") { $check = mysql_num_rows(db_query($qcheck, $dbh)); if ($check == 0) { - $error.= "
    Username does not exist.
    "; + $error.= "
    " . __("Username does not exist.") . "
    "; } else { $qcheck = "SELECT * FROM TU_VoteInfo WHERE User = '" . mysql_real_escape_string($_POST['user']) . "'"; $qcheck.= " AND End > UNIX_TIMESTAMP()"; $check = mysql_num_rows(db_query($qcheck, $dbh)); if ($check != 0) { - $error.= "
    " . htmlentities($_POST['user']) . " already has proposal running for them.
    "; + $error.= "
    " . __("%s already has proposal running for them.", htmlentities($_POST['user'])) . "
    "; } } } if (!empty($_POST['length'])) { if (!is_numeric($_POST['length'])) { - $error.= "
    Length must be a number.
    "; + $error.= "
    " . __("Length must be a number.") . "
    "; } else if ($_POST['length'] < 1) { - $error.= "
    Length must be at least 1.
    "; + $error.= "
    " . __("Length must be at least 1.") . "
    "; } else { $len = (60*60*24)*$_POST['length']; } @@ -50,7 +50,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") { } if (empty($_POST['agenda'])) { - $error.= "
    Proposal cannot be empty.
    "; + $error.= "
    " . __("Proposal cannot be empty.") . "
    "; } } @@ -62,21 +62,21 @@ if ($atype == "Trusted User" OR $atype == "Developer") { $q.= ", " . uid_from_sid($_COOKIE["AURSID"]) . ")"; db_query($q, $dbh); - print "

    New proposal submitted.

    \n"; + print "

    " . __("New proposal submitted.") . "

    \n"; } else { ?> -

    Submit a proposal to vote on.

    +

    "; } ?>
    -Applicant/TU: + '> -(empty if not applicable) +
    -Length in days: + '> -(defaults to 7 if empty) +
    -Proposal:
    +

    @@ -84,9 +84,9 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
    Back"; + print "" . __("Back") . ""; } else { - print "You are not allowed to access this area.\n"; + print __("You are not allowed to access this area."); } html_footer(AUR_VERSION); -- cgit v1.2.3-24-g4f1b From 8f5882e68deec6a8780653ae537aea7aa02283c3 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sun, 5 Oct 2008 01:46:31 +0800 Subject: Convert package flagging to a function Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/packages.php | 101 +++----------------------------------------------- web/lib/pkgfuncs.inc | 74 +++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 96 deletions(-) (limited to 'web') diff --git a/web/html/packages.php b/web/html/packages.php index 4cfe9c48..317583fc 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -37,106 +37,17 @@ if (isset($_COOKIE["AURSID"])) { # grab the list of Package IDs to be operated on # isset($_POST["IDs"]) ? $ids = $_POST["IDs"] : $ids = array(); -#isset($_REQUEST["All_IDs"]) ? -# $all_ids = explode(":", $_REQUEST["All_IDs"]) : -# $all_ids = array(); - # determine what button the visitor clicked # if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { - if (!$atype) { - print __("You must be logged in before you can flag packages."); - print "
    \n"; - - } else { - - if (!empty($ids)) { - $dbh = db_connect(); - - # Flag the packages in $ids array - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if ($first) { - $first = 0; - $flag = $pid; - } else { - $flag .= ", ".$pid; - } - } - $q = "UPDATE Packages SET OutOfDate = 1 "; - $q.= "WHERE ID IN (" . $flag . ")"; - db_query($q, $dbh); - - print "

    \n"; - print __("The selected packages have been flagged out-of-date."); - print "

    \n"; - - # notification by tardo. - $f_name = username_from_sid($_COOKIE['AURSID']); - $f_email = email_from_sid($_COOKIE['AURSID']); - $f_uid = uid_from_sid($_COOKIE['AURSID']); - $q = "SELECT Packages.Name, Users.Email, Packages.ID "; - $q.= "FROM Packages, Users "; - $q.= "WHERE Packages.ID IN (" . $flag .") "; - $q.= "AND Users.ID = Packages.MaintainerUID "; - $q.= "AND Users.ID != " . $f_uid; - $result = db_query($q, $dbh); - if (mysql_num_rows($result)) { - while ($row = mysql_fetch_assoc($result)) { - # construct email - $body = "Your package " . $row['Name'] . " has been flagged out of date by " . $f_name . ". You may view your package at:\nhttp://aur.archlinux.org/packages.php?do_Details=1&ID=" . $row['ID']; - $body = wordwrap($body, 70); - $headers = "To: ".$row['Email']."\nReply-to: nobody@archlinux.org\nFrom:aur-notify@archlinux.org\nX-Mailer: PHP\nX-MimeOLE: Produced By AUR\n"; - @mail(' ', "AUR Out-of-date Notification for ".$row['Name'], $body, $headers); - } - } - - } else { - print "

    \n"; - print __("You did not select any packages to flag."); - print "

    \n"; - } - } - + print "

    "; + print pkg_flag($atype, $ids, True); + print "

    "; } elseif ($_POST['action'] == "do_UnFlag" || isset($_POST['do_UnFlag'])) { - if (!$atype) { - print __("You must be logged in before you can unflag packages."); - print "
    \n"; - - } else { - - if (!empty($ids)) { - $dbh = db_connect(); - - # Un-Flag the packages in $ids array - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if ($first) { - $first = 0; - $unflag = $pid; - } else { - $unflag .= ", ".$pid; - } - } - $q = "UPDATE Packages SET OutOfDate = 0 "; - $q.= "WHERE ID IN (" . $unflag . ")"; - db_query($q, $dbh); - - print "

    \n"; - print __("The selected packages have been unflagged."); - print "

    \n"; - } else { - print "

    \n"; - print __("You did not select any packages to unflag."); - print "

    \n"; - } - - - } - + print "

    "; + print pkg_flag($atype, $ids, False); + print "

    "; } elseif ($_POST['action'] == "do_Disown" || isset($_POST['do_Disown'])) { if (!$atype) { print __("You must be logged in before you can disown packages."); diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 5ba56da0..a508a0be 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -985,4 +985,76 @@ function pkg_search_page($SID="") { return; } -?> +function pkg_flag ($atype, $ids, $action = True) { + if (!$atype) { + if ($action) { + return __("You must be logged in before you can flag packages."); + } else { + return __("You must be logged in before you can unflag packages."); + } + } + + if (empty($ids)) { + if ($action) { + return __("You did not select any packages to flag."); + } else { + return __("You did not select any packages to unflag."); + } + } + + foreach ($ids as $pid => $v) { + if (!is_numeric($pid)) { + if ($action) { + return __("You did not select any packages to flag."); + } else { + return __("You did not select any packages to unflag."); + } + } + } + + $dbh = db_connect(); + + $first = 1; + foreach ($ids as $pid => $v) { + if ($first) { + $first = 0; + $flag = $pid; + } else { + $flag .= ", " . $pid; + } + } + + $ood = $action ? 1 : 0; + $q = "UPDATE Packages SET OutOfDate = " . $ood; + $q.= " WHERE ID IN (" . $flag . ")"; + + db_query($q, $dbh); + + if ($action) { + # Notify of flagging by email + $f_name = username_from_sid($_COOKIE['AURSID']); + $f_email = email_from_sid($_COOKIE['AURSID']); + $f_uid = uid_from_sid($_COOKIE['AURSID']); + $q = "SELECT Packages.Name, Users.Email, Packages.ID "; + $q.= "FROM Packages, Users "; + $q.= "WHERE Packages.ID IN (" . $flag .") "; + $q.= "AND Users.ID = Packages.MaintainerUID "; + $q.= "AND Users.ID != " . $f_uid; + $result = db_query($q, $dbh); + if (mysql_num_rows($result)) { + while ($row = mysql_fetch_assoc($result)) { + # construct email + $body = "Your package " . $row['Name'] . " has been flagged out of date by " . $f_name . ". You may view your package at:\nhttp://aur.archlinux.org/packages.php?ID=" . $row['ID']; + $body = wordwrap($body, 70); + $headers = "To: ".$row['Email']."\nReply-to: nobody@archlinux.org\nFrom:aur-notify@archlinux.org\nX-Mailer: PHP\nX-MimeOLE: Produced By AUR\n"; + @mail(' ', "AUR Out-of-date Notification for ".$row['Name'], $body, $headers); + } + } + } + + if ($action) { + return __("The selected packages have been flagged out-of-date."); + } else { + return __("The selected packages have been unflagged."); + } +} -- cgit v1.2.3-24-g4f1b From a447281d4f5ce2071ebc81b375c70ae44231b046 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sat, 4 Oct 2008 03:42:34 +0800 Subject: Convert package deletion to a function Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/packages.php | 90 +++------------------------------------------------ web/lib/pkgfuncs.inc | 73 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 86 deletions(-) (limited to 'web') diff --git a/web/html/packages.php b/web/html/packages.php index 317583fc..bc3ed188 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -22,7 +22,7 @@ if (isset($_GET['ID'])) { $title = __("Packages"); } -html_header($title); # print out the HTML header +html_header($title); # get login privileges # @@ -95,91 +95,9 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { } elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) { - if (!$atype) { - print __("You must be logged in before you can disown packages."); - print "
    \n"; - } else { - # Delete the packages in $ids array (but only if they are Unsupported) - # - if (!empty($ids)) { - $dbh = db_connect(); - - # Delete the packages in $ids array - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if ($first) { - $first = 0; - $delete = $pid; - } else { - $delete .= ", ".$pid; - } - } - - $field = "MaintainerUID"; - - # Only grab Unsupported packages that "we" own or are not owned at all - # - $ids_to_delete = array(); - $q = "SELECT Packages.ID FROM Packages, PackageLocations "; - $q.= "WHERE Packages.ID IN (" . $delete . ") "; - $q.= "AND Packages.LocationID = PackageLocations.ID "; - $q.= "AND PackageLocations.Location = 'unsupported' "; - # If they're a TU or dev, can always delete, otherwise check ownership - # - if ($atype == "Trusted User" || $atype == "Developer") { - $result = db_query($q, $dbh); - } - if ($result != Null && mysql_num_rows($result) > 0) { - while ($row = mysql_fetch_assoc($result)) { - $ids_to_delete[] = $row['ID']; - } - } - if (!empty($ids_to_delete)) { - # These are the packages that are safe to delete - # - foreach ($ids_to_delete as $id) { - # delete from PackageVotes - $q = "DELETE FROM PackageVotes WHERE PackageID = " . $id; - $result = db_query($q, $dbh); - - # delete from PackageDepends - $q = "DELETE FROM PackageDepends WHERE PackageID = " . $id; - $result = db_query($q, $dbh); - - # delete from PackageSources - $q = "DELETE FROM PackageSources WHERE PackageID = " . $id; - $result = db_query($q, $dbh); - - # delete from PackageComments - $q = "DELETE FROM PackageComments WHERE PackageID = " . $id; - $result = db_query($q, $dbh); - - # delete from Packages - $q = "DELETE FROM Packages WHERE ID = " . $id; - $result = db_query($q, $dbh); - - # delete from CommentNotify - $q = "DELETE FROM CommentNotify WHERE PkgID = " . $id; - $result = db_query($q, $dbh); - - # Print the success message - print "

    \n"; - print __("The selected packages have been deleted."); - print "

    \n"; - } - } else { - print "

    \n"; - print __("None of the selected packages could be deleted."); - print "

    \n"; - } # end if (!empty($ids_to_delete)) - } else { - print "

    \n"; - print __("You did not select any packages to delete."); - print "

    \n"; - } # end if (!empty($ids)) - } # end if (!atype) - + print "

    "; + print pkg_delete($atype, $ids, False); + print "

    "; } elseif ($_POST['action'] == "do_Adopt" || isset($_POST['do_Adopt'])) { if (!$atype) { print __("You must be logged in before you can adopt packages."); diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index a508a0be..c952b85d 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -1058,3 +1058,76 @@ function pkg_flag ($atype, $ids, $action = True) { return __("The selected packages have been unflagged."); } } + +function pkg_delete ($atype, $ids) { + if (!$atype) { + return __("You must be logged in before you can disown packages."); + } + + if (empty($ids)) { + return __("You did not select any packages to delete."); + } + + # Delete the packages in $ids array (but only if they are Unsupported) + # + $dbh = db_connect(); + + # Delete the packages in $ids array + # + $first = 1; + foreach ($ids as $pid => $v) { + if ($first) { + $first = 0; + $delete = $pid; + } else { + $delete .= ", ".$pid; + } + } + + $field = "MaintainerUID"; + + # Only grab Unsupported packages that "we" own or are not owned at all + $ids_to_delete = array(); + $q = "SELECT Packages.ID FROM Packages, PackageLocations "; + $q.= "WHERE Packages.ID IN (" . $delete . ") "; + $q.= "AND Packages.LocationID = PackageLocations.ID "; + $q.= "AND PackageLocations.Location = 'unsupported' "; + + # If they're a TU or dev, can delete + if ($atype == "Trusted User" || $atype == "Developer") { + $result = db_query($q, $dbh); + } + + if ($result != Null && mysql_num_rows($result) > 0) { + while ($row = mysql_fetch_assoc($result)) { + $ids_to_delete[] = $row['ID']; + } + } + + if (empty($ids_to_delete)) { + return __("None of the selected packages could be deleted."); + } + + # These are the packages that are safe to delete + foreach ($ids_to_delete as $id) { + $q = "DELETE FROM PackageVotes WHERE PackageID = " . $id; + $result = db_query($q, $dbh); + + $q = "DELETE FROM PackageDepends WHERE PackageID = " . $id; + $result = db_query($q, $dbh); + + $q = "DELETE FROM PackageSources WHERE PackageID = " . $id; + $result = db_query($q, $dbh); + + $q = "DELETE FROM PackageComments WHERE PackageID = " . $id; + $result = db_query($q, $dbh); + + $q = "DELETE FROM Packages WHERE ID = " . $id; + $result = db_query($q, $dbh); + + $q = "DELETE FROM CommentNotify WHERE PkgID = " . $id; + $result = db_query($q, $dbh); + } + + return __("The selected packages have been deleted."); +} -- cgit v1.2.3-24-g4f1b From 5d4303d0b6afacb2b3a8731bdb9fdbd6c40f5c0e Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sun, 5 Oct 2008 02:13:35 +0800 Subject: Convert package adoption/disowning to a function Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/packages.php | 100 +++----------------------------------------------- web/lib/pkgfuncs.inc | 58 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 94 deletions(-) (limited to 'web') diff --git a/web/html/packages.php b/web/html/packages.php index bc3ed188..5935ebd3 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -49,105 +49,17 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { print pkg_flag($atype, $ids, False); print "

    "; } elseif ($_POST['action'] == "do_Disown" || isset($_POST['do_Disown'])) { - if (!$atype) { - print __("You must be logged in before you can disown packages."); - print "
    \n"; - - } else { - # Disown the packages in $ids array - # - if (!empty($ids)) { - $dbh = db_connect(); - - # Disown the packages in $ids array - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if ($first) { - $first = 0; - $disown = $pid; - } else { - $disown .= ", ".$pid; - } - } - - $field = "MaintainerUID"; - $q = "UPDATE Packages "; - $q.= "SET ".$field." = 0 "; - $q.= "WHERE ID IN (" . $disown . ") "; - # If a user is a TU or dev they can disown any package - if ($atype == "User") { - $q.= "AND ".$field." = ".uid_from_sid($_COOKIE["AURSID"]); - } - db_query($q, $dbh); - - print "

    \n"; - print __("The selected packages have been disowned."); - print "

    \n"; - } else { - print "

    \n"; - print __("You did not select any packages to disown."); - print "

    \n"; - } - - - } - - + print "

    "; + print pkg_adopt($atype, $ids, False); + print "

    "; } elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) { print "

    "; print pkg_delete($atype, $ids, False); print "

    "; } elseif ($_POST['action'] == "do_Adopt" || isset($_POST['do_Adopt'])) { - if (!$atype) { - print __("You must be logged in before you can adopt packages."); - print "
    \n"; - - } else { - # Adopt the packages in $ids array - # - if (!empty($ids)) { - $dbh = db_connect(); - - # Adopt the packages in $ids array - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if ($first) { - $first = 0; - $adopt = $pid; - } else { - $adopt .= ", ".$pid; - } - } - - $field = "MaintainerUID"; - # NOTE: Only "orphaned" packages can be adopted at a particular - # user class (TU/Dev or User). - # - $q = "UPDATE Packages "; - $q.= "SET ".$field." = ".uid_from_sid($_COOKIE["AURSID"])." "; - $q.= "WHERE ID IN (" . $adopt . ") "; - if ($atype == "User") - { - # Regular users may only adopt orphan packages from unsupported - # FIXME: We assume that LocationID for unsupported is "2" - $q.= "AND ".$field." = 0"; - $q.= " AND LocationID = 2"; - } - db_query($q, $dbh); - - print "

    \n"; - print __("The selected packages have been adopted."); - print "

    \n"; - } else { - print "

    \n"; - print __("You did not select any packages to adopt."); - print "

    \n"; - } - } - - + print "

    "; + print pkg_adopt($atype, $ids, True); + print "

    "; } elseif ($_POST['action'] == "do_Vote" || isset($_POST['do_Vote'])) { if (!$atype) { print __("You must be logged in before you can vote for packages."); diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index c952b85d..415f3e71 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -1131,3 +1131,61 @@ function pkg_delete ($atype, $ids) { return __("The selected packages have been deleted."); } + +function pkg_adopt ($atype, $ids, $action = True) { + if (!$atype) { + if ($action) { + return __("You must be logged in before you can adopt packages."); + } else { + return __("You must be logged in before you can disown packages."); + } + } + + if (empty($ids)) { + if ($action) { + return __("You did not select any packages to adopt."); + } else { + return __("You did not select any packages to disown."); + } + } + + $dbh = db_connect(); + + $first = 1; + foreach ($ids as $pid => $v) { + if ($first) { + $first = 0; + $pkg = $pid; + } else { + $pkg .= ", ".$pid; + } + } + + $field = "MaintainerUID"; + $q = "UPDATE Packages "; + + if ($action) { + $user = uid_from_sid($_COOKIE["AURSID"]); + } else { + $user = 0; + } + + $q.= "SET $field = $user "; + $q.= "WHERE ID IN ($pkg) "; + + if ($action && $atype == "User") { + # Regular users may only adopt orphan packages from unsupported + $q.= "AND $field = 0 "; + $q.= "AND LocationID = 2 "; + } else if ($atype == "User") { + $q.= "AND $field = " . uid_from_sid($_COOKIE["AURSID"]); + } + + db_query($q, $dbh); + + if ($action) { + return __("The selected packages have been adopted."); + } else { + return __("The selected packages have been disowned."); + } +} -- cgit v1.2.3-24-g4f1b From 132fd7cfc791a76f084140b2901018a046160b84 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sun, 5 Oct 2008 02:54:13 +0800 Subject: Convert package voting to a function Signed-off-by: Callan Barrett Signed-off-by: Loui Chang --- web/html/packages.php | 112 +++----------------------------------------------- web/lib/pkgfuncs.inc | 77 ++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 106 deletions(-) (limited to 'web') diff --git a/web/html/packages.php b/web/html/packages.php index 5935ebd3..91b0e6e0 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -61,113 +61,13 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { print pkg_adopt($atype, $ids, True); print "

    "; } elseif ($_POST['action'] == "do_Vote" || isset($_POST['do_Vote'])) { - if (!$atype) { - print __("You must be logged in before you can vote for packages."); - print "
    \n"; - - } else { - # vote on the packages in $ids array. - # - if (!empty($ids)) { - $dbh = db_connect(); - $my_votes = pkgvotes_from_sid($_COOKIE["AURSID"]); - $uid = uid_from_sid($_COOKIE["AURSID"]); - # $vote_ids will contain the string of Package.IDs that - # the visitor hasn't voted for already - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if (!isset($my_votes[$pid])) { - # cast a vote for this package - # - if ($first) { - $first = 0; - $vote_ids = $pid; - $vote_clauses = "(".$uid.", ".$pid.")"; - } else { - $vote_ids .= ", ".$pid; - $vote_clauses .= ", (".$uid.", ".$pid.")"; - } - } - } - # only vote for packages the user hasn't already voted for - # - $q = "UPDATE Packages SET NumVotes = NumVotes + 1 "; - $q.= "WHERE ID IN (".$vote_ids.")"; - db_query($q, $dbh); - - $q = "INSERT INTO PackageVotes (UsersID, PackageID) VALUES "; - $q.= $vote_clauses; - db_query($q, $dbh); - - # Update the LastVoted field for this user - # - $q = "UPDATE Users SET LastVoted = UNIX_TIMESTAMP() "; - $q.= "WHERE ID = ".$uid; - db_query($q, $dbh); - - print "

    \n"; - print __("Your votes have been cast for the selected packages."); - print "

    \n"; - - } else { - print "

    \n"; - print __("You did not select any packages to vote for."); - print "

    \n"; - } - } - - + print "

    "; + print pkg_vote($atype, $ids, True); + print "

    "; } elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) { - if (!$atype) { - print __("You must be logged in before you can un-vote for packages."); - print "
    \n"; - - } else { - # un-vote on the packages in $ids array. - # - if (!empty($ids)) { - $dbh = db_connect(); - $my_votes = pkgvotes_from_sid($_COOKIE["AURSID"]); - $uid = uid_from_sid($_COOKIE["AURSID"]); - # $unvote_ids will contain the string of Package.IDs that - # the visitor has voted for and wants to unvote. - # - $first = 1; - while (list($pid, $v) = each($ids)) { - if (isset($my_votes[$pid])) { - # cast a un-vote for this package - # - if ($first) { - $first = 0; - $unvote_ids = $pid; - } else { - $unvote_ids .= ", ".$pid; - } - } - } - # only un-vote for packages the user has already voted for - # - $q = "UPDATE Packages SET NumVotes = NumVotes - 1 "; - $q.= "WHERE ID IN (".$unvote_ids.")"; - db_query($q, $dbh); - - $q = "DELETE FROM PackageVotes WHERE UsersID = ".$uid." "; - $q.= "AND PackageID IN (".$unvote_ids.")"; - db_query($q, $dbh); - - print "

    \n"; - print __("Your votes have been removed from the selected packages."); - print "

    \n"; - - } else { - print "

    \n"; - print __("You did not select any packages to un-vote for."); - print "

    \n"; - } - } - - + print "

    "; + print pkg_vote($atype, $ids, False); + print "

    "; } elseif (isset($_GET["ID"])) { if (!intval($_GET["ID"])) { diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 415f3e71..7fe3f317 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -1189,3 +1189,80 @@ function pkg_adopt ($atype, $ids, $action = True) { return __("The selected packages have been disowned."); } } + +function pkg_vote ($atype, $ids, $action = True) { + if (!$atype) { + if ($action) { + return __("You must be logged in before you can vote for packages."); + } else { + return __("You must be logged in before you can un-vote for packages."); + } + } + + if (empty($ids)) { + if ($action) { + return __("You did not select any packages to vote for."); + } else { + return __("Your votes have been removed from the selected packages."); + } + } + + $dbh = db_connect(); + $my_votes = pkgvotes_from_sid($_COOKIE["AURSID"]); + $uid = uid_from_sid($_COOKIE["AURSID"]); + + $first = 1; + foreach ($ids as $pid => $v) { + if ($action) { + $check = !isset($my_votes[$pid]); + } else { + $check = isset($my_votes[$pid]); + } + + if ($check) { + if ($first) { + $first = 0; + $vote_ids = $pid; + if ($action) { + $vote_clauses = "($uid, $pid)"; + } + } else { + $vote_ids .= ", $pid"; + if ($action) { + $vote_clauses .= ", ($uid, $pid)"; + } + } + } + } + + # only vote for packages the user hasn't already voted for + # + $op = $action ? "+" : "-"; + $q = "UPDATE Packages SET NumVotes = NumVotes $op 1 "; + $q.= "WHERE ID IN ($vote_ids)"; + + db_query($q, $dbh); + + if ($action) { + $q = "INSERT INTO PackageVotes (UsersID, PackageID) VALUES "; + $q.= $vote_clauses; + } else { + $q = "DELETE FROM PackageVotes WHERE UsersID = $uid "; + $q.= "AND PackageID IN ($vote_ids)"; + } + + db_query($q, $dbh); + + if ($action) { + $q = "UPDATE Users SET LastVoted = UNIX_TIMESTAMP() "; + $q.= "WHERE ID = $uid"; + + db_query($q, $dbh); + } + + if ($action) { + return __("Your votes have been cast for the selected packages."); + } else { + return __("Your votes have been removed from the selected packages."); + } +} -- cgit v1.2.3-24-g4f1b