View Issue Details

IDProjectCategoryView StatusLast Update
0001067Main CAcert Websitemiscpublic2013-07-16 17:14
ReporterJonathanL Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformDefaultOSanyOS Versionany
Summary0001067: White screen error during forms generation with partially installed system (test jig setup, fix attached)
DescriptionIf for any reason you don't have FPDF installed (for making PDF files) and you try to make a CAP form, you get white screen instead of correct error message.
Steps To ReproduceRemove (or omit) the files /usr/share/fpdf/ and /usr/share/ufpdf/

Click on "CAP Forms" and then any form eg A4 WoT Form

Blank page results.
Correct behaviour would be an error message

In a fully installed system, you get Save/View incoming PDF, per browser choice.
Additional InformationI'm documenting bugs which stop you setting up a test jig.

The log should help you find the correct solution, which is to install the appropriate FPDF variants

At least for test purposes you can do
 sudo apt-get install php-fpdf
 cd /usr/share/
 sudo ln -s fpdf ufpdf

Proper installation requires something like these
wget http://acko.net/files/ufpdf/ufpdf.zip
wget http://www.fpdf.org/download/japanese.zip
TagsNo tags attached.
Attached Files
cap.php.PATCH (1,005 bytes)   
diff --git a/www/cap.php b/www/cap.php
index 73380e1..573968f 100644
--- a/www/cap.php
+++ b/www/cap.php
@@ -15,14 +15,29 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
+	function existsordie($path) {
+		if (file_exists($path)) {
+			return;
+		}
+		trigger_error("required file missing ($path)", E_USER_WARNING);
+		include("../includes/account.php");
+		showheader(_("CAcert.org Error"));
+		printf(_("Sorry, forms generation is temporarily unavailable"));
+		showfooter();
+		exit;
+	}
+
 	if($_SESSION['_config']['language'] != "ja")
 	{
 		define('FPDF_FONTPATH','/usr/share/fpdf/font/');
+		existsordie(FPDF_FONTPATH);
+		existsordie('/usr/share/ufpdf/fpdf.php');
 		require_once('/usr/share/ufpdf/fpdf.php');
 		class PDF2 extends FPDF
 		{
 		}
 	} else {
+		existsordie('/usr/share/fpdf/japanese.php');
 		require('/usr/share/fpdf/japanese.php');
 		class PDF2 extends PDF_Japanese
 		{
cap.php.PATCH (1,005 bytes)   
Reviewed by
Test Instructions

Relationships

related to 0000883 new Special Character not properly displayed in CAP 
related to 0001097 closedNEOatNHNG Special characters which have no HTML-entities are not properly escaped 

Activities

Issue History

Date Modified Username Field Change
2012-06-02 12:25 JonathanL New Issue
2012-06-02 12:25 JonathanL File Added: cap.php.PATCH
2012-06-02 12:29 JonathanL Additional Information Updated
2012-12-23 10:07 Werner Dworak Relationship added related to 0001097
2013-05-01 09:23 INOPIAE Relationship added related to 0000883
2013-07-16 17:14 NEOatNHNG Project bugs.cacert.org => Main CAcert Website