SOURCES: eventum-scm-ssl.patch (NEW), eventum-cvs.php - rewritten ...

glen glen at pld-linux.org
Mon Jun 19 14:43:21 CEST 2006


Author: glen                         Date: Mon Jun 19 12:43:21 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- rewritten scm config file which allows simple way of using https scheme

---- Files affected:
SOURCES:
   eventum-scm-ssl.patch (NONE -> 1.1)  (NEW), eventum-cvs.php (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/eventum-scm-ssl.patch
diff -u /dev/null SOURCES/eventum-scm-ssl.patch:1.1
--- /dev/null	Mon Jun 19 14:43:21 2006
+++ SOURCES/eventum-scm-ssl.patch	Mon Jun 19 14:43:16 2006
@@ -0,0 +1,54 @@
+--- eventum-1.7.1/misc/scm/process_cvs_commits.php	2006-06-19 15:32:19.384637639 +0300
++++ eventum-1.7.1/misc/scm/process_cvs_commits.php	2006-06-19 15:31:00.742910000 +0300
+@@ -35,6 +35,21 @@
+ // DO NOT CHANGE ANYTHING AFTER THIS LINE
+ //
+ 
++if (isset($eventum_url)) {
++    $data = parse_url($eventum_url);
++} else {
++    // legacy
++    $data = array();
++    $data['host'] = $eventum_domain;
++    $data['path'] = $eventum_relative_url;
++    $data['port'] = $eventum_port;
++    $data['scheme'] = 'http';
++}
++
++if (!isset($data['port'])) {
++    $data['port'] = $data['scheme'] == 'https' ? 443 : 80;
++}
++
+ if (isset($_SERVER)) {
+     $HTTP_SERVER_VARS = $_SERVER;
+ }
+@@ -76,7 +91,7 @@
+     $username = rawurlencode($username);
+ 
+     // build the GET url to use
+-    $ping_url = $eventum_relative_url . "scm_ping.php?module=$cvs_module&username=$username&commit_msg=$commit_msg";
++    $ping_url = $data['path']. "scm_ping.php?module=$cvs_module&username=$username&commit_msg=$commit_msg";
+     foreach ($matches[1] as $issue_id) {
+         $ping_url .= "&issue[]=$issue_id";
+     }
+@@ -87,13 +102,16 @@
+         $ping_url .= "&new_versions[$i]=" . rawurlencode($modified_files[$i]['new_revision']);
+     }
+ 
+-    $fp = fsockopen($eventum_domain, $eventum_port, $errno, $errstr, 30);
++    $address = $data['host'];
++    if ($data['scheme'] == 'https') {
++        $address = "ssl://$address";
++    }
++    $fp = fsockopen($address, $data['port'], $errno, $errstr, 30);
+     if (!$fp) {
+-        echo "Error: Could not ping the Eventum SCM handler script.\n";
+-        exit();
++        die("Error: Could not ping the Eventum SCM handler script.\n");
+     } else {
+         $msg = "GET $ping_url HTTP/1.1\r\n";
+-        $msg .= "Host: $eventum_domain\r\n";
++        $msg .= "Host: $data[host]\r\n";
+         $msg .= "Connection: Close\r\n\r\n";
+         fwrite($fp, $msg);
+         $buf = fgets($fp, 4096);

================================================================
Index: SOURCES/eventum-cvs.php
diff -u SOURCES/eventum-cvs.php:1.1 SOURCES/eventum-cvs.php:1.2
--- SOURCES/eventum-cvs.php:1.1	Tue Jan 18 15:25:28 2005
+++ SOURCES/eventum-cvs.php	Mon Jun 19 14:43:16 2006
@@ -1,7 +1,6 @@
 <?php
+# $Id$
+# URL to your Eventum installation.
+# https is supported transparently by PHP 5 if you have openssl module enabled.
 
-$eventum_domain = 'localhost';
-$eventum_relative_url = '/eventum/';
-$eventum_port = 80;
-
-?>
+$eventum_url = 'http://localhost/eventum/';
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/eventum-cvs.php?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list