diff --git a/AUTHORS b/AUTHORS index 502438bb..89a41017 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,16 +2,17 @@ Current Contributors -------------------- Callan Barrett (wizzo) Loui Chang (louipc) -Eli Janssen (eliott/cactus) Simo Leone (simo) Contributors -------------------- Jason Chu (jchu) Joerie de Gram (Thralas) +Eli Janssen (eliott/cactus) Eric Johnson (eric) http://www.coding-zone.com Michael Klier Paul Mattal (pjmattal) +Andrea Scarpino Douglas Soares de Andrade (dsa) Jaroslaw Swierczynski (swiergot) Sebastian Nowicki (Xilon) @@ -20,15 +21,48 @@ dusty dp Translations --------------------- +==================== + +Català +------ +Sergio Jovani Guzman + +Deutsch +------- Gerhard Brauer Matthias Gorissen -Mateusz Herych -Morgan Lefieux -Cilyan Olowen -Sergej Pupykin -Víctor Martínez Romanos -Giovanni Scafora -Pierre Schmitz -voidnull +Lukas Kropatschek +Niclas Pfeifer + +Español +------- +Víctor Martínez Romanos + +Français +-------- +Morgan Lefieux +Cilyan Olowen + +Italiano +-------- +Pierluigi Picciau +Giovanni Scafora (voidnull) +Andrea Scarpino + +Polski +------ +Mateusz Herych +Jaroslaw Swierczynski + +Português +--------- + +Русский +------- +Sergej Pupykin +Pierre Schmitz + +Türkçe +------ +H.Gökhan SARI diff --git a/HACKING b/HACKING index eef0be14..e1c881ba 100644 --- a/HACKING +++ b/HACKING @@ -18,7 +18,13 @@ Consider creating templates for HTML. MySQL queries should generally go into functions. +Submitting patches +------------------ Please submit uncompressed git-formatted patches to aur-dev@archlinux.org. +Base your patches on the testing branch as forward development is done there. When writing patches please keep unnecessary changes to a minimum. -Smaller patches are much easier to review thus have a better chance of being +Smaller patches are much easier to review and have a better chance of being pushed more quickly into the main repo. + +Try to make your commit messages brief and descriptive. + diff --git a/TODO b/TODO new file mode 100644 index 00000000..d71efb8f --- /dev/null +++ b/TODO @@ -0,0 +1,26 @@ +TODO + +Here's a list of things that currently need doing in the AUR which aren't bugs +that need investigation, they just need some time to fix. Don't forget to remove +anything from this list that gets fixed if you can and feel free to add to it. + +Todo List +--------- +* HTML basically needs a complete rewrite, rife with broken html +* Use mod_rewrite for urls, allows for nicer looking urls and no more + deciphering of those insane variables +* Rename those insane variables (the url variables on the search page), + probably make them more verbose and actually relate to what they are +* Set up redirects for useless pages (like the "you've done action to X" + package pages), FS#10674, FS#3542 +* Add support for the license field in tupkg scripts, FS#8138 +* Add confirmation for TUs deleting packages, FS#6515 +* Ownership of packages should turn notify on (adopt, create, etc.), FS#10480 +* Bad hyphens in RSS feed, FS#10706 +* Add "package download counters", for tarballs and PKGBUILDs, FS#7780, FS#3094 +- Shuffle around secondary nav links (does every page really need + bugs/discuss/etc? front page material?) +- search page formattting (squashed columns) +- improve package searching (fulltext is nifty, needs discussion) +- [community] scripts should handle -arch suffixes (FS#9449) + diff --git a/tupkg/client/communitypkg b/tupkg/client/communitypkg index 5073dcc7..8579273d 100644 --- a/tupkg/client/communitypkg +++ b/tupkg/client/communitypkg @@ -1,85 +1,132 @@ #!/bin/bash -source /etc/makepkg.conf +# Source makepkg.conf; fail if it is not found +if [ -r "/etc/makepkg.conf" ]; then + source "/etc/makepkg.conf" +else + echo "/etc/makepkg.conf not found!" + exit 1 +fi -#cmd=`basename $0` +# Source user-specific makepkg.conf overrides +if [ -r ~/.makepkg.conf ]; then + source ~/.makepkg.conf +fi -#if echo *.pkg.tar.gz | grep ' ' >/dev/null 2>&1; then -# echo "Too many packages in current dir" -# exit 1 -#fi -# -#if [ ! -f *.pkg.tar.gz ]; then -# echo "No package file" -# exit 1 -#fi -# -#pkgfile=`echo *.pkg.tar.gz` -#pkg=`echo *.pkg.tar.gz | rev | cut -d- -f 3- | rev` -#ver=`echo *.pkg.tar.gz | rev | cut -d- -f -2 | rev | sed 's/\.pkg\.tar\.gz//'` +cmd=`basename $0` if [ ! -f PKGBUILD ]; then - echo "No PKGBUILD file" - exit 1 + echo "No PKGBUILD file" + exit 1 +fi + +# define tags and staging areas based on architecture +if [ "$CARCH" = "i686" ]; then + currenttag='CURRENT' + testingtag='TESTING' + suffix='' +elif [ "$CARCH" = "x86_64" ]; then + currenttag='CURRENT-64' + testingtag='TESTING-64' + suffix='64' +else + echo "CARCH must be set to a recognized value!" + exit 1 fi source PKGBUILD -pkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz +pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz +oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz if [ ! -f $pkgfile ]; then - echo "File $pkgfile doesn't exist" - exit 1 + if [ -f $PKGDEST/$pkgfile ]; then + pkgfile=$PKGDEST/$pkgfile + oldstylepkgfile=$PKGDEST/$oldstylepkgfile + elif [ -f $oldstylepkgfile ]; then + pkgfile=$oldstylepkgfile + elif [ -f $PKGDEST/$oldstylepkgfile ]; then + pkgfile=$PKGDEST/$oldstylepkgfile + else + echo "File $pkgfile doesn't exist" + exit 1 + fi fi -repo="community" -tag="CURRENT" -#if [ "$cmd" == "extrapkg" ]; then -# repo="extra" -# tag="CURRENT" -#elif [ "$cmd" == "currentpkg" ]; then -# repo="current" -# tag="CURRENT" -#elif [ "$cmd" == "testingpkg" ]; then -# repo="testing" -# tag="TESTING" -#elif [ "$cmd" == "unstablepkg" ]; then -# repo="unstable" -# tag="CURRENT" -#fi - -#scp $pkgfile archlinux.org:/home/ftp/$repo/os/$CARCH -if [ ! -f ~/.tupkg ]; then - echo "Must configure tupkg via ~/.tupkg, cancelled" - exit 1 +if [ "$cmd" == "extrapkg" ]; then + repo="extra" + tag="$currenttag" +elif [ "$cmd" == "corepkg" ]; then + repo="core" + tag="$currenttag" +elif [ "$cmd" == "testingpkg" ]; then + repo="testing" + tag="$testingtag" +elif [ "$cmd" == "unstablepkg" ]; then + repo="unstable" + tag="$currenttag" +elif [ "$cmd" == "communitypkg" ]; then + repo="community" + tag="$currenttag" +fi + +# see if any limit options were passed, we'll send them to SCP +unset scpopts +if [ "$1" = "-l" ]; then + scpopts="$1 $2" + shift 2 +fi + +if [ "$repo" != "community" ]; then + # combine what we know into a variable (suffix defined based on $CARCH) + uploadto="staging/${repo}${suffix}/add/$(basename ${pkgfile})" + scp ${scpopts} "${pkgfile}" "archlinux.org:${uploadto}" + if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh archlinux.org md5sum "${uploadto}" | cut -d' ' -f1)" ]; then + echo "File got corrupted during upload, cancelled." + exit 1 + else + echo "File integrity okay." + fi +else + if [ ! -f ~/.tupkg ]; then + echo "Must configure tupkg via ~/.tupkg, cancelled" + exit 1 + fi + if [ "$(basename $pkgfile)" != "$(basename $oldstylepkgfile)" ]; then + echo "Renaming makepkg3 package for compatability" + mv $pkgfile $oldstylepkgfile + pkgfile=$oldstylepkgfile + fi + tupkg $pkgfile fi -tupkg $pkgfile if [ $? -ne 0 ]; then - echo "Cancelled" - exit 1 + echo "Cancelled" + exit 1 fi echo "===> Uploaded $pkgfile" if [ "$1" != "" ]; then -cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel -$1" > /dev/null -if [ $? -ne 0 ]; then - echo "Cancelled" - exit 1 -fi -echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel -$1\" message" + cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel + $1" > /dev/null + if [ $? -ne 0 ]; then + echo "Cancelled" + exit 1 + fi + echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel + $1\" message" else -cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null -if [ $? -ne 0 ]; then - echo "Cancelled" - exit 1 -fi -echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message" + cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null + if [ $? -ne 0 ]; then + echo "Cancelled" + exit 1 + fi + echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message" fi cvs tag -c -F -R $tag > /dev/null if [ $? -ne 0 ]; then - echo "Cancelled" - exit 1 + echo "Cancelled" + exit 1 fi echo "===> Tagged as $tag" + +# vim:ft=sh:ts=4:sw=4:et: diff --git a/web/README.txt b/web/README similarity index 95% rename from web/README.txt rename to web/README index 69bec044..b0e6c39f 100644 --- a/web/README.txt +++ b/web/README @@ -55,6 +55,9 @@ Setup on Arch Linux: 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 @@ -74,8 +77,8 @@ Setup on Arch Linux: (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 + # cd ~/aur/web/lib/ + # cp config.inc.profo config.inc 8) Point your browser to http://aur @@ -92,6 +95,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/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); 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/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.

- diff --git a/web/html/index.php b/web/html/index.php index 7a95abfc..c7847f25 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(); ?> @@ -73,167 +20,64 @@ if (!empty($user)) { 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!', + '', '', + '', + '' ); ?>

- -
- + +
+

-
- -
- - - - - - - - - - - - - -
- -
-"> - - + - + '; +} -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); ?> - -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - -
- - - -

+
'; +echo __('Unsupported PKGBUILDs are user produced content. Any use of files is at your own risk.'); +?>
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
-
-
+ diff --git a/web/html/packages.php b/web/html/packages.php index 4cfe9c48..91b0e6e0 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 # @@ -37,396 +37,37 @@ 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."); - 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'])) { - 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."); - 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."); - 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/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"; diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index abd66140..c38e224d 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -12,25 +12,14 @@ include("pkgfuncs.inc"); # package functions set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in -html_header("Submit"); - -?> - -
-
- -
-
- -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 @@ -121,7 +110,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; @@ -136,13 +125,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]); @@ -163,20 +152,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) { @@ -185,7 +174,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. # @@ -208,9 +197,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."); } @@ -226,18 +215,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, ""); } } @@ -248,16 +233,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); @@ -265,13 +250,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); @@ -286,53 +271,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; } - - $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']); - $q .= $pdata["ID"] . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; + $depcondition = str_replace($deppkgname, "", $dep); - db_query($q, $dbh); + if ($deppkgname == "#") { + break; + } + + $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']); + $q .= $pdata["ID"] . ", " . $deppkgid . ", '" . mysql_real_escape_string($depcondition) . "')"; + + db_query($q, $dbh); } # Insert sources @@ -341,24 +325,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); @@ -369,12 +354,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); } @@ -384,15 +371,29 @@ 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); + } } chdir($_SERVER['DOCUMENT_ROOT']); } +# Logic over, let's do some output +html_header("Submit"); + +?> + +
+
+ +
+
+ + -

-
- - @@ -461,17 +454,6 @@ if ($_COOKIE["AURSID"]): - -
-
- -
- + -
+
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/html/tu.php b/web/html/tu.php index 524e14d8..67ac3f2f 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -2,50 +2,36 @@ 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(); 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); - - print "\n"; - - if (mysql_num_rows($result)) { - $sort = htmlentities($sort, ENT_QUOTES); - $by = htmlentities($by, ENT_QUOTES); - - print "\n"; - print "\n"; - - 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"; + 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"; - # stop notices, ythanku Xilon - if (empty($_REQUEST['sort'])) { $_REQUEST['sort'] = ""; } - if (empty($_REQUEST['by'])) { $_REQUEST['by'] = ""; } - if (empty($_REQUEST['off'])) { $_REQUEST['off'] = ""; } + $prev_Len = 100; - gen_results(0, 0, $_REQUEST['sort'], $_REQUEST['by'], "new"); - print "
Add

"; - gen_results($_REQUEST['off'], $pp, $_REQUEST['sort'], $_REQUEST['by'], "old"); + $q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order; + $result = db_query($q, $dbh); + $type = __("Current Votes"); + include("tu_list.php"); +?> + +
+ +

+ + + + + + + + + +
+ + + + + + + +
+ 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/ca/index_po.inc b/web/lang/ca/index_po.inc index cd930a29..ca6c1ac3 100644 --- a/web/lang/ca/index_po.inc +++ b/web/lang/ca/index_po.inc @@ -39,7 +39,7 @@ $_t["ca"]["Error trying to generate session id."] = "S'ha produït un error en i $_t["ca"]["Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information."] = "Benvingut a l'AUR! Si us plau llegiu la %hGuia d'usuari de l'AUR%h i la %hGuia de TU de l'AUR%h per a més informació."; -$_t["ca"]["Contributed PKGBUILDs 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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 f1e54eb4..17704706 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."; @@ -29,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."; @@ -47,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"; @@ -57,16 +53,26 @@ $_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"; +$_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."; @@ -77,22 +83,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"]["DISCLAIMER"] = "AVVISO"; -$_t["it"]["Flagged as safe by me"] = "Pacchetti verificati"; +$_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"]["Flagged as safe"] = "Considerato sicuro"; +$_t["it"]["Login failure: Bad user or pass."] = "Autenticazione fallita: nome utente o password errata. "; -$_t["it"]["My Statistics"] = "Le mie statistiche"; - -$_t["it"]["Home"] = "Inizio"; - -$_t["it"]["DISCLAIMER"] = "Avviso: i PKGBUILD presenti in unsupported sono stati inviati dagli utenti e, scaricandoli, accetti di usarli a tuo rischio e pericolo."; - -?> \ 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"]["You are not allowed to access this area."] = "Non disponi dei permessi necessari per accedere."; - -$_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"]["Status"] = "Stato"; -$_t["it"]["This package has been flagged out of date."] = "Questo pacchetto è stato contrassegnato come non aggiornato."; +$_t["it"]["License"] = "Licenza"; -$_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"]["unknown"] = "sconosciuta"; $_t["it"]["Required by"] = "Richiesto da"; -$_t["it"]["Out of Date"] = "Non aggiornati"; +$_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"]["This package has been flagged out of date."] = "Questo pacchetto è stato contrassegnato come non aggiornato."; + +$_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."; + 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/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/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/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/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/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/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/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/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 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/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/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/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/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 @@ + \ No newline at end of file diff --git a/web/lang/tr/index_po.inc b/web/lang/tr/index_po.inc new file mode 100644 index 00000000..dd85b91b --- /dev/null +++ b/web/lang/tr/index_po.inc @@ -0,0 +1,91 @@ + \ No newline at end of file diff --git a/web/lang/tr/pkgedit_po.inc b/web/lang/tr/pkgedit_po.inc new file mode 100644 index 00000000..1406dcb1 --- /dev/null +++ b/web/lang/tr/pkgedit_po.inc @@ -0,0 +1,35 @@ + \ No newline at end of file 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 @@ +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; } @@ -410,4 +400,3 @@ function uid_from_username($username="") return $row[0]; } -?> 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'); } } } -?> + diff --git a/web/lib/config.inc.proto b/web/lib/config.inc.proto index 7a0a155d..7248b930 100644 --- a/web/lib/config.inc.proto +++ b/web/lib/config.inc.proto @@ -16,18 +16,24 @@ 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 - "en" => "English", - "pl" => "Polski", - "it" => "Italiano", +# Languages we have translations for +$SUPPORTED_LANGS = array( "ca" => "Català", - "pt" => "Português", - "es" => "Español", "de" => "Deutsch", + "en" => "English", + "es" => "Español", + "fr" => "Français", + "it" => "Italiano", + "pl" => "Polski", + "pt" => "Português", "ru" => "Русский", - "fr" => "Français" + "tr" => "Türkçe" ); -?> +# Idle seconds before timeout +$LOGIN_TIMEOUT = 7200; + diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 77b0ab11..7fe3f317 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)) { @@ -512,14 +513,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") { @@ -986,4 +985,284 @@ 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."); + } +} + +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."); +} + +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."); + } +} + +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."); + } +} diff --git a/web/lib/stats.inc b/web/lib/stats.inc new file mode 100644 index 00000000..6fbc0334 --- /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/lib/translator.inc b/web/lib/translator.inc index 41ece89b..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; @@ -37,14 +36,20 @@ 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}_"; } + $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])) { @@ -60,7 +65,7 @@ function __() { $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1); } } + return $translated; } -?> 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"; } ?>
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"]), "")); +?> +
    +" /> + " /> 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..ec719996 --- /dev/null +++ b/web/template/stats/user_table.php @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + +
    + + + +
    + diff --git a/web/html/template.php b/web/template/template.phps similarity index 81% rename from web/html/template.php rename to web/template/template.phps index 11e05e0b..7a866861 100644 --- a/web/html/template.php +++ b/web/template/template.phps @@ -1,5 +1,7 @@ \n"; html_footer(AUR_VERSION); -?> 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"; + } + ?> + + + + + + + + + +
    +
    +
    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 $* 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.