summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/aur.inc32
-rw-r--r--web/lib/config.inc.proto42
-rw-r--r--web/lib/pkgfuncs.inc5
3 files changed, 41 insertions, 38 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index ce662f7b..380e2b6e 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -12,26 +12,6 @@ include_once("aur_po.inc");
# is using...
#
-# Define global variables
-#
-$LOGIN_TIMEOUT = 7200; # number of idle seconds before timeout
-$SUPPORTED_LANGS = array( # what languages we have translations for
- "en" => "English",
- "pl" => "Polski",
- "it" => "Italiano",
- "ca" => "Català",
- "pt" => "Português",
- # Eventually we will comment these in, when they are ready - PJM - 4/2005
- "es" => "Español",
- "de" => "Deutsch",
- "ru" => "Русский",
- "fr" => "Français",
-);
-
-# debugging variables
-#
-$QBUG = 1; # toggle query logging to /var/tmp/aurq.log
-$DBUG = 1; # use dbug($msg) to log to /var/tmp/aurd.log
# return an array of info for each Trusted user
@@ -268,17 +248,13 @@ function uid_from_sid($sid="") {
# connect to the database
#
function db_connect() {
- global $AUR_db_host;
- global $AUR_db_name;
- global $AUR_db_user;
- global $AUR_db_pass;
- $handle = mysql_pconnect($AUR_db_host, $AUR_db_user, $AUR_db_pass);
+ $handle = mysql_pconnect(AUR_db_host, AUR_db_user, AUR_db_pass);
if (!$handle) {
die("Error connecting to AUR database: " . mysql_error());
}
- mysql_select_db($AUR_db_name, $handle) or
+ mysql_select_db(AUR_db_name, $handle) or
die("Error selecting AUR database: " . mysql_error());
return $handle;
@@ -296,7 +272,7 @@ function db_query($query="", $db_handle="") {
$db_handle = db_connect();
}
if ($QBUG) {
- $fp = fopen("/var/tmp/aurq.log", "a");
+ $fp = fopen(AURQ_LOG, "a");
fwrite($fp, $query . "\n");
fclose($fp);
}
@@ -453,7 +429,7 @@ function html_footer($ver="") {
# debug logging
#
function dbug($msg) {
- $fp = fopen("/var/tmp/aurd.log", "a");
+ $fp = fopen(AURD_LOG, "a");
fwrite($fp, $msg . "\n");
fclose($fp);
return;
diff --git a/web/lib/config.inc.proto b/web/lib/config.inc.proto
index fcb8b3a2..bad94a0c 100644
--- a/web/lib/config.inc.proto
+++ b/web/lib/config.inc.proto
@@ -1,15 +1,43 @@
<?php
# NOTE: modify these variables if your MySQL setup is different
#
-$AUR_db_host = "localhost:/tmp/mysql.sock";
-$AUR_db_name = "aur";
-$AUR_db_user = "aur";
-$AUR_db_pass = "aur";
+define( "AUR_db_host", "localhost:/tmp/mysql.sock" );
+define( "AUR_db_name", "aur" );
+define( "AUR_db_user", "aur" );
+define( "AUR_db_pass", "aur" );
# Configuration of directories where things live
-$UPLOAD_DIR = "/home/aur/unsupported-temp/";
-$INCOMING_DIR = "/home/aur/unsupported/";
-$URL_DIR = "/packages/";
+define( "UPLOAD_DIR", "/home/aur/unsupported-temp/" );
+define( "INCOMING_DIR", "/home/aur/unsupported/" );
+define( "URL_DIR", "/packages/" );
+
+define( "AURQ_LOG", "/home/aur/aurq.log" );
+define( "AURD_LOG", "/home/aur/aurd.log" );
+
+define( "USERNAME_MIN_LEN", 3 );
+define( "USERNAME_MAX_LEN", 16 );
+define( "PASSWD_MIN_LEN", 4 );
+define( "PASSWD_MAX_LEN", 128 );
+
+
+$LOGIN_TIMEOUT = 7200; # number of idle seconds before timeout
+
+# debugging variables
+#
+$QBUG = 1; # toggle query logging to /var/tmp/aurq.log
+$DBUG = 1; # use dbug($msg) to log to /var/tmp/aurd.log
+
+$SUPPORTED_LANGS = array( # what languages we have translations for
+ "en" => "English",
+ "pl" => "Polski",
+ "it" => "Italiano",
+ "ca" => "Català",
+ "pt" => "Português",
+ "es" => "Español",
+ "de" => "Deutsch",
+ "ru" => "Русский",
+ "fr" => "Français"
+);
# vim: ts=2 sw=2 noet ft=php
?>
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 2e5bd4b8..cf872689 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -347,9 +347,8 @@ function package_details($id=0, $SID="") {
echo " <tr><td class='boxSoft' colspan='2'><img src='/images/pad.gif' height='15'></td></tr>\n";
echo " <tr><td class='boxSoft' colspan='2'><span class='f3'>";
if ($row["LocationID"] == 2) {
- global $URL_DIR;
- $urlpath = $URL_DIR.$row["Name"]."/".$row["Name"];
- echo "<a href='$urlpath.tar.gz'>".__("Tarball")."</a> :: <a href='$urlpath'>".__("Files")."</a> :: <a href='$urlpath/PKGBUILD'>PKGBUILD</a></span></td>";
+ $urlpath = URL_DIR.$row["Name"]."/".$row["Name"];
+ print "<a href='$urlpath.tar.gz'>".__("Tarball")."</a> :: <a href='$urlpath'>".__("Files")."</a> :: <a href='$urlpath/PKGBUILD'>PKGBUILD</a></span></td>";
} elseif ($row["LocationID"] == 3) {
echo "<a href='http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/" . $row["Category"] . "/" . $row["Name"] . "/?cvsroot=AUR&only_with_tag=CURRENT'>CVS</td>";
}