From dce2f7044384c5a94a5c361e8cb715fa00676ae4 Mon Sep 17 00:00:00 2001 From: swiergot Date: Tue, 22 Aug 2006 14:18:28 +0000 Subject: Applied license patch from dsa (closes #4085). --- support/schema/aur-schema.sql | 1 + web/html/pkgsubmit.php | 6 ++++-- web/lib/pkgfuncs.inc | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index ca63ef3..d3e0fff 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -114,6 +114,7 @@ CREATE TABLE Packages ( DummyPkg TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 1=>dummy FSPath CHAR(255) NOT NULL DEFAULT '', URLPath CHAR(255) NOT NULL DEFAULT '', + License CHAR(40) NOT NULL DEFAULT '', LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, OutOfDate TINYINT UNSIGNED DEFAULT 0, diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 9ae74c7..52e23aa 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -396,7 +396,8 @@ if ($_COOKIE["AURSID"]) { $q.="Version='".mysql_escape_string($new_pkgbuild['pkgver'])."-". mysql_escape_string($new_pkgbuild['pkgrel'])."',"; $q.="CategoryID=".mysql_escape_string($_REQUEST['category']).", "; - $q.="Description='".mysql_escape_string($new_pkgbuild['pkgdesc'])."', "; + $q.="License='".mysql_escape_string($new_pkgbuild['license'])."', "; + $q.="Description='".mysql_escape_string($new_pkgbuild['pkgdesc'])."', "; $q.="URL='".mysql_escape_string($new_pkgbuild['url'])."', "; $q.="LocationID=2, "; if (account_from_sid($_COOKIE["AURSID"]) == "Trusted User" || account_from_sid($_COOKIE["AURSID"]) == "Developer") { @@ -460,13 +461,14 @@ if ($_COOKIE["AURSID"]) { # this is a brand new package # $q = "INSERT INTO Packages "; - $q.= " (Name, Version, CategoryID, Description, URL, LocationID, "; + $q.= " (Name, License, Version, CategoryID, Description, URL, LocationID, "; if (account_from_sid($_COOKIE["AURSID"]) == "Trusted User" || account_from_sid($_COOKIE["AURSID"]) == "Developer") { $q.= "Safe, VerifiedBy,"; } $q.= " SubmittedTS, SubmitterUID, MaintainerUID, FSPath, URLPath) "; $q.= "VALUES ('"; $q.= mysql_escape_string($new_pkgbuild['pkgname'])."', '"; + $q.= mysql_escape_string($new_pkgbuild['license'])."', '"; $q.= mysql_escape_string($new_pkgbuild['pkgver'])."-". mysql_escape_string($new_pkgbuild['pkgrel'])."', "; $q.= mysql_escape_string($_REQUEST['category']).", '"; diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 950de71..96bb1b7 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -333,6 +333,16 @@ function package_details($id=0, $SID="") { print " ".__("Votes").": "; print $row["NumVotes"] . ""; print "\n"; + + # In case of wanting to put a custom message + # Added by: dsa + $msg = "unknown"; + $license = $row["License"] == "" ? $msg : $row["License"]; + + print "\n"; + print "
License: ".$license; + print "\n"; + print "\n"; print "\n"; print " "; -- cgit v1.2.3-70-g09d2