[thirdparty-commits] jpeeler: mantis/trunk r54 - in /mantis/trunk: ./ core/

SVN commits to the Digium third-party software repository thirdparty-commits at lists.digium.com
Thu Jan 15 17:55:35 CST 2009


Author: jpeeler
Date: Thu Jan 15 17:55:34 2009
New Revision: 54

URL: http://svn.digium.com/svn-view/thirdparty?view=rev&rev=54
Log:
Fix a problem with code submissions not showing up as having a license due to the version of the license not being recorded in the database.


Modified:
    mantis/trunk/config_license.php
    mantis/trunk/core/license_api.php

Modified: mantis/trunk/config_license.php
URL: http://svn.digium.com/svn-view/thirdparty/mantis/trunk/config_license.php?view=diff&rev=54&r1=53&r2=54
==============================================================================
--- mantis/trunk/config_license.php (original)
+++ mantis/trunk/config_license.php Thu Jan 15 17:55:34 2009
@@ -30,6 +30,7 @@
 $g_license_title = "Digium Open Source Software Project Submission Agreement";
 
 $g_license = array(
+    "1.0" => "stub",
 	"3.0" => "<p>*****************************************************************************************************************************</p>
 IMPORTANT - PLEASE READ CAREFULLY: <br />
 <p style=\"text-index: 25px;\">This document (\"Agreement\") constitutes a legal agreement. By signing this Agreement below, You, either an individual or the 

Modified: mantis/trunk/core/license_api.php
URL: http://svn.digium.com/svn-view/thirdparty/mantis/trunk/core/license_api.php?view=diff&rev=54&r1=53&r2=54
==============================================================================
--- mantis/trunk/core/license_api.php (original)
+++ mantis/trunk/core/license_api.php Thu Jan 15 17:55:34 2009
@@ -26,6 +26,21 @@
 	}
 
 	function license_on_file_for_time( $p_timestamp , $p_user_id, $p_license_ver) {
+
+		// Since multiple license versions were not originally supported, the license that 
+		// a file was uploaded under was not recorded in the situation of an upload being marked
+		// as code after the fact previous to 2009-01-08. So if the version information is not
+		// available we must determine the version based on the timestamp.
+		if (!$p_license_ver) {
+			// Magic date is in database, but might as well save the lookup.
+			if ($p_timestamp < '2007-06-28 10:26:46')
+				$p_license_ver = '1.0';
+			else {
+				// Since versions are now being recorded and the version has not yet been bumped,
+				// this should be valid for anything after the magic date.
+				$p_license_ver = '3.0';
+			}
+		}
 		$sql = sprintf("SELECT * FROM mantis_license_table WHERE (date_expired IS NULL OR date_expired > '%s') " .
 					   "AND user_id = '%d' AND license_ver = '%s' AND pending=0",
 					   db_prepare_string($p_timestamp),




More information about the thirdparty-commits mailing list