From 0306a9dd6db620380a4630fc79ad5c66ca609989 Mon Sep 17 00:00:00 2001 From: ale Date: Mon, 26 Apr 2010 14:20:29 +0000 Subject: Update to 0.4-beta release. --- mail/roundcube/Makefile | 18 +-- mail/roundcube/distinfo | 6 +- .../files/patch-program_include_iniset.php | 10 ++ .../files/patch-program_include_rcube_session.php | 159 +++++++++++++++++++++ .../files/patch-program_include_session.inc | 157 -------------------- 5 files changed, 182 insertions(+), 168 deletions(-) create mode 100644 mail/roundcube/files/patch-program_include_iniset.php create mode 100644 mail/roundcube/files/patch-program_include_rcube_session.php delete mode 100644 mail/roundcube/files/patch-program_include_session.inc diff --git a/mail/roundcube/Makefile b/mail/roundcube/Makefile index e92f644d9cac..28afc449542e 100644 --- a/mail/roundcube/Makefile +++ b/mail/roundcube/Makefile @@ -6,10 +6,10 @@ # PORTNAME= roundcube -DISTVERSION= 0.3.1 +DISTVERSION= 0.4-beta PORTEPOCH= 1 CATEGORIES?= mail www -MASTER_SITES= SF/${PORTNAME}mail/${PORTNAME}mail/${PORTVERSION} +MASTER_SITES= SF/${PORTNAME}mail/${PORTNAME}mail-beta/${DISTVERSION} DISTNAME= ${PORTNAME}mail-${DISTVERSION} MAINTAINER?= ale@FreeBSD.org @@ -26,7 +26,7 @@ SCRIPTS_ENV= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} \ WWWDIR=${WWWDIR} WANT_PHP_WEB= yes -USE_PHP= pcre mbstring session iconv dom xml +USE_PHP= pcre mbstring session iconv dom xml json IGNORE_WITH_PHP=4 SUB_FILES= pkg-install @@ -105,17 +105,19 @@ post-patch: ${WRKSRC}/program/include/rcmail.php \ ${WRKSRC}/program/js/editor.js \ ${WRKSRC}/program/localization/*/labels.inc \ - ${WRKSRC}/program/steps/addressbook/mailto.inc + ${WRKSRC}/program/steps/addressbook/mailto.inc \ + ${WRKSRC}/skins/default/functions.js @${REINPLACE_CMD} "s/_task=mail/_task=${MAIL}/g" \ - ${WRKSRC}/program/steps/mail/rss.inc + ${WRKSRC}/program/js/app.js @${REINPLACE_CMD} "s/\"mail\"/\"${MAIL}\"/g" \ ${WRKSRC}/program/js/app.js \ - ${WRKSRC}/skins/default/includes/header.html \ ${WRKSRC}/skins/default/includes/taskbar.html @${REINPLACE_CMD} "s/mail_footer/${MAIL}_footer/g" \ - ${WRKSRC}/skins/default/*.css + ${WRKSRC}/skins/default/*.css \ + ${WRKSRC}/skins/default/templates/login.html @${REINPLACE_CMD} "s/mail_toolbar/${MAIL}_toolbar/g" \ - ${WRKSRC}/skins/default/*.css + ${WRKSRC}/skins/default/*.css \ + ${WRKSRC}/skins/default/templates/login.html @${MV} ${WRKSRC}/program/steps/mail \ ${WRKSRC}/program/steps/${MAIL} @${MV} ${WRKSRC}/skins/default/images/mail_footer.png \ diff --git a/mail/roundcube/distinfo b/mail/roundcube/distinfo index b56f7616c431..c57f2bca745a 100644 --- a/mail/roundcube/distinfo +++ b/mail/roundcube/distinfo @@ -1,3 +1,3 @@ -MD5 (roundcubemail-0.3.1.tar.gz) = 34e8e18772e7eada8769b6c5c20f7c8e -SHA256 (roundcubemail-0.3.1.tar.gz) = 78b7160e58fc3692591e8a909464a858500768e5e7a7c076b496a7caf119ddd1 -SIZE (roundcubemail-0.3.1.tar.gz) = 1917564 +MD5 (roundcubemail-0.4-beta.tar.gz) = ccbae69017c6d0056b12536e5adc52cd +SHA256 (roundcubemail-0.4-beta.tar.gz) = cf9cbaccd09cb164e85a889d929f07fe37b7d5d10a3cad021e0d9ffb5b728941 +SIZE (roundcubemail-0.4-beta.tar.gz) = 2033675 diff --git a/mail/roundcube/files/patch-program_include_iniset.php b/mail/roundcube/files/patch-program_include_iniset.php new file mode 100644 index 000000000000..1a3cde97ce66 --- /dev/null +++ b/mail/roundcube/files/patch-program_include_iniset.php @@ -0,0 +1,10 @@ +--- program/include/iniset.php.orig 2010-04-26 15:54:45.000000000 +0200 ++++ program/include/iniset.php 2010-04-26 15:54:53.000000000 +0200 +@@ -25,7 +25,6 @@ + // an error/warning in the logs later. See (#1486307). + $crit_opts = array( + 'mbstring.func_overload' => 0, +- 'suhosin.session.encrypt' => 0, + 'session.auto_start' => 0, + 'file_uploads' => 1, + ); diff --git a/mail/roundcube/files/patch-program_include_rcube_session.php b/mail/roundcube/files/patch-program_include_rcube_session.php new file mode 100644 index 000000000000..8faaa7188db5 --- /dev/null +++ b/mail/roundcube/files/patch-program_include_rcube_session.php @@ -0,0 +1,159 @@ +--- program/include/rcube_session.php.orig 2010-04-26 14:50:34.000000000 +0200 ++++ program/include/rcube_session.php 2010-04-26 15:02:46.000000000 +0200 +@@ -25,7 +25,6 @@ + private $db; + private $ip; + private $changed; +- private $unsets = array(); + private $gc_handlers = array(); + private $start; + private $vars = false; +@@ -100,13 +99,6 @@ + } + + if ($oldvars !== false) { +- $a_oldvars = $this->unserialize($oldvars); +- foreach ((array)$this->unsets as $k) +- unset($a_oldvars[$k]); +- +- $newvars = $this->serialize(array_merge( +- (array)$a_oldvars, (array)$this->unserialize($vars))); +- + if ($this->keep_alive>0) { + $timeout = min($this->lifetime * 0.5, + $this->lifetime - $this->keep_alive); +@@ -114,11 +106,11 @@ + $timeout = 0; + } + +- if (!($newvars === $oldvars) || ($ts - $this->changed > $timeout)) { ++ if (!($vars === $oldvars) || ($ts - $this->changed > $timeout)) { + $this->db->query( + sprintf("UPDATE %s SET vars = ?, changed = %s WHERE sess_id = ?", + get_table_name('session'), $now), +- $newvars, $key); ++ $vars, $key); + } + } + else { +@@ -129,7 +121,6 @@ + $key, $vars, (string)$_SERVER['REMOTE_ADDR']); + } + +- $this->unsets = array(); + return true; + } + +@@ -199,112 +190,12 @@ + if (empty($var)) + return $this->destroy(session_id()); + +- $this->unsets[] = $var; + unset($_SESSION[$var]); + + return true; + } + + +- // serialize session data +- private function serialize($vars) +- { +- $data = ''; +- if (is_array($vars)) +- foreach ($vars as $var=>$value) +- $data .= $var.'|'.serialize($value); +- else +- $data = 'b:0;'; +- return $data; +- } +- +- +- // unserialize session data +- // http://www.php.net/manual/en/function.session-decode.php#56106 +- private function unserialize($str) +- { +- $str = (string)$str; +- $endptr = strlen($str); +- $p = 0; +- +- $serialized = ''; +- $items = 0; +- $level = 0; +- +- while ($p < $endptr) { +- $q = $p; +- while ($str[$q] != '|') +- if (++$q >= $endptr) break 2; +- +- if ($str[$p] == '!') { +- $p++; +- $has_value = false; +- } else { +- $has_value = true; +- } +- +- $name = substr($str, $p, $q - $p); +- $q++; +- +- $serialized .= 's:' . strlen($name) . ':"' . $name . '";'; +- +- if ($has_value) { +- for (;;) { +- $p = $q; +- switch (strtolower($str[$q])) { +- case 'n': /* null */ +- case 'b': /* boolean */ +- case 'i': /* integer */ +- case 'd': /* decimal */ +- do $q++; +- while ( ($q < $endptr) && ($str[$q] != ';') ); +- $q++; +- $serialized .= substr($str, $p, $q - $p); +- if ($level == 0) break 2; +- break; +- case 'r': /* reference */ +- $q+= 2; +- for ($id = ''; ($q < $endptr) && ($str[$q] != ';'); $q++) $id .= $str[$q]; +- $q++; +- $serialized .= 'R:' . ($id + 1) . ';'; /* increment pointer because of outer array */ +- if ($level == 0) break 2; +- break; +- case 's': /* string */ +- $q+=2; +- for ($length=''; ($q < $endptr) && ($str[$q] != ':'); $q++) $length .= $str[$q]; +- $q+=2; +- $q+= (int)$length + 2; +- $serialized .= substr($str, $p, $q - $p); +- if ($level == 0) break 2; +- break; +- case 'a': /* array */ +- case 'o': /* object */ +- do $q++; +- while ( ($q < $endptr) && ($str[$q] != '{') ); +- $q++; +- $level++; +- $serialized .= substr($str, $p, $q - $p); +- break; +- case '}': /* end of array|object */ +- $q++; +- $serialized .= substr($str, $p, $q - $p); +- if (--$level == 0) break 2; +- break; +- default: +- return false; +- } +- } +- } else { +- $serialized .= 'N;'; +- $q += 2; +- } +- $items++; +- $p = $q; +- } +- +- return unserialize( 'a:' . $items . ':{' . $serialized . '}' ); +- } +- + public function set_keep_alive($keep_alive) + { + $this->keep_alive = $keep_alive; diff --git a/mail/roundcube/files/patch-program_include_session.inc b/mail/roundcube/files/patch-program_include_session.inc deleted file mode 100644 index 5b16f413bf09..000000000000 --- a/mail/roundcube/files/patch-program_include_session.inc +++ /dev/null @@ -1,157 +0,0 @@ ---- program/include/session.inc.orig 2009-09-07 22:22:55.000000000 +0200 -+++ program/include/session.inc 2009-09-07 22:47:29.000000000 +0200 -@@ -19,8 +19,6 @@ - - */ - --$GLOBALS['rcube_session_unsets'] = array(); -- - function rcube_sess_open($save_path, $session_name) - { - return true; -@@ -66,20 +64,15 @@ - $now = $DB->fromunixtime(time()); - - $sql_result = $DB->query( -- "SELECT vars FROM " . get_table_name('session') . " -+ "SELECT 1 FROM " . get_table_name('session') . " - WHERE sess_id=?", $key); - -- if ($sql_arr = $DB->fetch_assoc($sql_result)) { -- -- $a_oldvars = rcube_sess_unserialize($sql_arr['vars']); -- foreach ((array)$GLOBALS['rcube_session_unsets'] as $k) -- unset($a_oldvars[$k]); -- -+ if ($DB->num_rows($sql_result)) { - $DB->query( - "UPDATE " . get_table_name('session') . " - SET vars=?, changed= " . $now . " - WHERE sess_id=?", -- rcube_sess_serialize(array_merge($a_oldvars, rcube_sess_unserialize($vars))), -+ $vars, - $key); - } - else { -@@ -92,7 +85,6 @@ - (string)$_SERVER['REMOTE_ADDR']); - } - -- $GLOBALS['rcube_session_unsets'] = array(); - return true; - } - -@@ -103,113 +95,12 @@ - if (empty($var)) - return rcube_sess_destroy(session_id()); - -- $GLOBALS['rcube_session_unsets'][] = $var; - unset($_SESSION[$var]); - - return true; - } - - --// serialize session data --function rcube_sess_serialize($vars) --{ -- $data = ''; -- if (is_array($vars)) -- foreach ($vars as $var=>$value) -- $data .= $var.'|'.serialize($value); -- else -- $data = 'b:0;'; -- return $data; --} -- -- --// unserialize session data --// http://www.php.net/manual/en/function.session-decode.php#56106 --function rcube_sess_unserialize($str) --{ -- $str = (string)$str; -- $endptr = strlen($str); -- $p = 0; -- -- $serialized = ''; -- $items = 0; -- $level = 0; -- -- while ($p < $endptr) { -- $q = $p; -- while ($str[$q] != '|') -- if (++$q >= $endptr) break 2; -- -- if ($str[$p] == '!') { -- $p++; -- $has_value = false; -- } else { -- $has_value = true; -- } -- -- $name = substr($str, $p, $q - $p); -- $q++; -- -- $serialized .= 's:' . strlen($name) . ':"' . $name . '";'; -- -- if ($has_value) { -- for (;;) { -- $p = $q; -- switch (strtolower($str[$q])) { -- case 'n': /* null */ -- case 'b': /* boolean */ -- case 'i': /* integer */ -- case 'd': /* decimal */ -- do $q++; -- while ( ($q < $endptr) && ($str[$q] != ';') ); -- $q++; -- $serialized .= substr($str, $p, $q - $p); -- if ($level == 0) break 2; -- break; -- case 'r': /* reference */ -- $q+= 2; -- for ($id = ''; ($q < $endptr) && ($str[$q] != ';'); $q++) $id .= $str[$q]; -- $q++; -- $serialized .= 'R:' . ($id + 1) . ';'; /* increment pointer because of outer array */ -- if ($level == 0) break 2; -- break; -- case 's': /* string */ -- $q+=2; -- for ($length=''; ($q < $endptr) && ($str[$q] != ':'); $q++) $length .= $str[$q]; -- $q+=2; -- $q+= (int)$length + 2; -- $serialized .= substr($str, $p, $q - $p); -- if ($level == 0) break 2; -- break; -- case 'a': /* array */ -- case 'o': /* object */ -- do $q++; -- while ( ($q < $endptr) && ($str[$q] != '{') ); -- $q++; -- $level++; -- $serialized .= substr($str, $p, $q - $p); -- break; -- case '}': /* end of array|object */ -- $q++; -- $serialized .= substr($str, $p, $q - $p); -- if (--$level == 0) break 2; -- break; -- default: -- return false; -- } -- } -- } else { -- $serialized .= 'N;'; -- $q+= 2; -- } -- $items++; -- $p = $q; -- } -- -- return unserialize( 'a:' . $items . ':{' . $serialized . '}' ); --} -- -- - // handler for session_destroy() - function rcube_sess_destroy($key) - { -- cgit