diff options
author | Dima Panov <fluffy@FreeBSD.org> | 2020-09-23 16:13:26 +0000 |
---|---|---|
committer | Dima Panov <fluffy@FreeBSD.org> | 2020-09-23 16:13:26 +0000 |
commit | 76d4c272f4c9a23c2d1aadd7b2da8d802c3b5021 (patch) | |
tree | 2531823e29a8e9f8d77d39c13573b740d718d9ba /net/phpldapadmin | |
parent | fe9d06f460e2687c5fe0ee257452c7d1dd75ae5a (diff) |
Notes
Diffstat (limited to 'net/phpldapadmin')
-rw-r--r-- | net/phpldapadmin/Makefile | 19 | ||||
-rw-r--r-- | net/phpldapadmin/distinfo | 5 | ||||
-rw-r--r-- | net/phpldapadmin/files/extra-patch-lib__PageRender.php | 42 | ||||
-rw-r--r-- | net/phpldapadmin/files/patch-config__config.php.example | 20 | ||||
-rw-r--r-- | net/phpldapadmin/files/patch-lib__PageRender.php | 29 | ||||
-rw-r--r-- | net/phpldapadmin/files/patch-lib__TemplateRender.php | 11 | ||||
-rw-r--r-- | net/phpldapadmin/files/patch-lib__ds_ldap.php | 30 | ||||
-rw-r--r-- | net/phpldapadmin/files/patch-lib__ds_ldap_pla.php | 11 | ||||
-rw-r--r-- | net/phpldapadmin/files/patch-lib__functions.php | 124 |
9 files changed, 14 insertions, 277 deletions
diff --git a/net/phpldapadmin/Makefile b/net/phpldapadmin/Makefile index 6597fc14b162..0ed084d7e4d2 100644 --- a/net/phpldapadmin/Makefile +++ b/net/phpldapadmin/Makefile @@ -2,11 +2,8 @@ # $FreeBSD$ PORTNAME= phpldapadmin -PORTVERSION= 1.2.3 -PORTREVISION= 11 -PORTEPOCH= 1 +PORTVERSION= 1.2.6.2 CATEGORIES= net www -MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-php5/${PORTVERSION} PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} MAINTAINER= ports@bsdserwis.com @@ -17,11 +14,21 @@ LICENSE_FILE= ${WRKSRC}/LICENSE USES= cpe php:web,flavors tar:tgz USE_PHP= gettext ldap openssl pcre session xml iconv hash +USE_GITHUB= yes +GH_ACCOUNT= leenooks +GH_PROJECT= phpLDAPadmin NO_ARCH= yes NO_BUILD= yes CPE_VENDOR= deon_george +OPTIONS_DEFINE= MCRYPT + +MCRYPT_DESC= Use pecl-mcrypt for password hashing +MCRYPT_USE= PHP=mcrypt + +.include <bsd.port.options.mk> + GROUPS?= ${WWWGRP} CFGDIR= config CFGFILE= config.php @@ -36,10 +43,6 @@ SUB_FILES+= pkg-message .include <bsd.port.pre.mk> -.if (${PHP_VER} == 73) -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-lib__PageRender.php -.endif - post-patch: cd ${WRKSRC} ; \ ${FIND} . ! -type d ! -name ${CFGFILE}.example ! -name .cvsignore \ diff --git a/net/phpldapadmin/distinfo b/net/phpldapadmin/distinfo index fbbc1a7a855a..e26888cb6dd7 100644 --- a/net/phpldapadmin/distinfo +++ b/net/phpldapadmin/distinfo @@ -1,2 +1,3 @@ -SHA256 (phpldapadmin-1.2.3.tgz) = aecaf8c3ce77ba3899dd31ee5ee183555b2f9349eb8e196dcd33d8a3c485ed58 -SIZE (phpldapadmin-1.2.3.tgz) = 1115707 +TIMESTAMP = 1600872367 +SHA256 (leenooks-phpLDAPadmin-1.2.6.2_GH0.tar.gz) = 49b14019bf611267720b4e9de33f2502b44c526809f17225a4a76ee8296b8d64 +SIZE (leenooks-phpLDAPadmin-1.2.6.2_GH0.tar.gz) = 1128212 diff --git a/net/phpldapadmin/files/extra-patch-lib__PageRender.php b/net/phpldapadmin/files/extra-patch-lib__PageRender.php deleted file mode 100644 index 9343c2c97a77..000000000000 --- a/net/phpldapadmin/files/extra-patch-lib__PageRender.php +++ /dev/null @@ -1,42 +0,0 @@ ---- lib/QueryRender.php.orig 2019-08-07 01:14:46.000000000 +0200 -+++ lib/QueryRender.php 2019-09-02 10:45:44.632080000 +0200 -@@ -284,10 +284,10 @@ class QueryRender extends PageRender { - - # Ignore DN, we've already displayed it. - if ($attr == 'dn') -- continue; -+ continue 2; - - if (! isset($dndetails[$attr])) -- continue; -+ continue 2; - - # Set our object with our values - $afattrs[$attr]->clearValue(); -@@ -321,7 +321,7 @@ class QueryRender extends PageRender { - if (! $results) { - echo _('Search returned no results'); - -- continue; -+ continue 2; - } - - printf('<form action="cmd.php" method="post" id="massform_%s">',$counter); -@@ -374,7 +374,7 @@ class QueryRender extends PageRender { - # If the entry is blank, we'll draw an empty box and continue. - if (! isset($dndetails[$attr])) { - echo '<td> </td>'; -- continue; -+ continue 2; - } - - # Special case for DNs -@@ -384,7 +384,7 @@ class QueryRender extends PageRender { - : htmlspecialchars($dndetails['dn']); - - printf('<td><a href="cmd.php?%s">%s</a></td>',htmlspecialchars($href),$dn_display); -- continue; -+ continue 2; - } - - # Set our object with our values diff --git a/net/phpldapadmin/files/patch-config__config.php.example b/net/phpldapadmin/files/patch-config__config.php.example deleted file mode 100644 index 4a74b855ad7e..000000000000 --- a/net/phpldapadmin/files/patch-config__config.php.example +++ /dev/null @@ -1,20 +0,0 @@ ---- config/config.php.example.orig 2012-10-01 06:54:14 UTC -+++ config/config.php.example -@@ -379,7 +379,7 @@ $servers->setValue('server','name','My L - - /* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5, - blowfish, crypt or leave blank for now default algorithm. */ --// $servers->setValue('appearance','password_hash','md5'); -+// $servers->setValue('appearance','password_hash_custom','md5'); - - /* If you specified 'cookie' or 'session' as the auth_type above, you can - optionally specify here an attribute to use when logging in. If you enter -@@ -546,7 +546,7 @@ $servers->setValue('sasl','authz_id_rege - $servers->setValue('sasl','authz_id_replacement','$1'); - $servers->setValue('sasl','props',null); - --$servers->setValue('appearance','password_hash','md5'); -+$servers->setValue('appearance','password_hash_custom','md5'); - $servers->setValue('login','attr','dn'); - $servers->setValue('login','fallback_dn',false); - $servers->setValue('login','class',null); diff --git a/net/phpldapadmin/files/patch-lib__PageRender.php b/net/phpldapadmin/files/patch-lib__PageRender.php deleted file mode 100644 index b27154aee037..000000000000 --- a/net/phpldapadmin/files/patch-lib__PageRender.php +++ /dev/null @@ -1,29 +0,0 @@ ---- lib/PageRender.php.orig 2012-10-01 06:54:14 UTC -+++ lib/PageRender.php -@@ -287,7 +287,7 @@ class PageRender extends Visitor { - break; - - default: -- $vals[$i] = password_hash($passwordvalue,$enc); -+ $vals[$i] = password_hash_custom($passwordvalue,$enc); - } - - $vals = array_unique($vals); -@@ -957,7 +957,7 @@ class PageRender extends Visitor { - if (trim($val)) - $enc_type = get_enc_type($val); - else -- $enc_type = $server->getValue('appearance','password_hash'); -+ $enc_type = $server->getValue('appearance','password_hash_custom'); - - $obfuscate_password = obfuscate_password_display($enc_type); - -@@ -982,7 +982,7 @@ class PageRender extends Visitor { - if (trim($val)) - $enc_type = get_enc_type($val); - else -- $enc_type = $server->getValue('appearance','password_hash'); -+ $enc_type = $server->getValue('appearance','password_hash_custom'); - - echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">'; - diff --git a/net/phpldapadmin/files/patch-lib__TemplateRender.php b/net/phpldapadmin/files/patch-lib__TemplateRender.php deleted file mode 100644 index 5dc8a263f858..000000000000 --- a/net/phpldapadmin/files/patch-lib__TemplateRender.php +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/TemplateRender.php.orig 2012-10-01 06:54:14 UTC -+++ lib/TemplateRender.php -@@ -2466,7 +2466,7 @@ function deleteAttribute(attrName,friend - if ($val = $attribute->getValue($i)) - $default = get_enc_type($val); - else -- $default = $this->getServer()->getValue('appearance','password_hash'); -+ $default = $this->getServer()->getValue('appearance','password_hash_custom'); - - if (! $attribute->getPostValue()) - printf('<input type="hidden" name="post_value[%s][]" value="%s" />',$attribute->getName(),$i); diff --git a/net/phpldapadmin/files/patch-lib__ds_ldap.php b/net/phpldapadmin/files/patch-lib__ds_ldap.php deleted file mode 100644 index c7debfa14eab..000000000000 --- a/net/phpldapadmin/files/patch-lib__ds_ldap.php +++ /dev/null @@ -1,30 +0,0 @@ ---- lib/ds_ldap.php.orig 2012-10-01 06:54:14 UTC -+++ lib/ds_ldap.php -@@ -1116,13 +1116,24 @@ class ldap extends DS { - - if (is_array($dn)) { - $a = array(); -- foreach ($dn as $key => $rdn) -- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn); -+ foreach ($dn as $key => $rdn) { -+ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $rdn -+ ); -+ } - - return $a; - - } else -- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn); -+ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $dn -+ ); - } - - public function getRootDSE($method=null) { diff --git a/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php b/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php deleted file mode 100644 index de5f2b23f24e..000000000000 --- a/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/ds_ldap_pla.php.orig 2012-10-01 06:54:14 UTC -+++ lib/ds_ldap_pla.php -@@ -16,7 +16,7 @@ class ldap_pla extends ldap { - function __construct($index) { - parent::__construct($index); - -- $this->default->appearance['password_hash'] = array( -+ $this->default->appearance['password_hash_custom'] = array( - 'desc'=>'Default HASH to use for passwords', - 'default'=>'md5'); - diff --git a/net/phpldapadmin/files/patch-lib__functions.php b/net/phpldapadmin/files/patch-lib__functions.php deleted file mode 100644 index 7680a23812ea..000000000000 --- a/net/phpldapadmin/files/patch-lib__functions.php +++ /dev/null @@ -1,124 +0,0 @@ ---- lib/functions.php.orig 2012-10-01 06:54:14 UTC -+++ lib/functions.php -@@ -51,7 +51,7 @@ if (file_exists(LIBDIR.'functions.custom - /** - * Loads class definition - */ --function __autoload($className) { -+function pla_autoloader($className) { - if (file_exists(HOOKSDIR."classes/$className.php")) - require_once(HOOKSDIR."classes/$className.php"); - elseif (file_exists(LIBDIR."$className.php")) -@@ -65,6 +65,7 @@ function __autoload($className) { - __METHOD__,_('Called to load a class that cant be found'),$className), - 'type'=>'error')); - } -+spl_autoload_register('pla_autoloader'); - - /** - * Strips all slashes from the specified array in place (pass by ref). -@@ -745,6 +746,7 @@ function blowfish_encrypt($data,$secret= - if (! trim($secret)) - return $data; - -+/* - if (function_exists('mcrypt_module_open') && ! empty($data)) { - $td = mcrypt_module_open(MCRYPT_BLOWFISH,'',MCRYPT_MODE_ECB,''); - $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),MCRYPT_DEV_URANDOM); -@@ -754,6 +756,7 @@ function blowfish_encrypt($data,$secret= - - return $encrypted_data; - } -+*/ - - if (file_exists(LIBDIR.'blowfish.php')) - require_once LIBDIR.'blowfish.php'; -@@ -801,6 +804,7 @@ function blowfish_decrypt($encdata,$secr - if (! trim($secret)) - return $encdata; - -+/* - if (function_exists('mcrypt_module_open') && ! empty($encdata)) { - $td = mcrypt_module_open(MCRYPT_BLOWFISH,'',MCRYPT_MODE_ECB,''); - $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),MCRYPT_DEV_URANDOM); -@@ -810,6 +814,7 @@ function blowfish_decrypt($encdata,$secr - - return $decrypted_data; - } -+*/ - - if (file_exists(LIBDIR.'blowfish.php')) - require_once LIBDIR.'blowfish.php'; -@@ -1080,7 +1085,7 @@ function masort(&$data,$sortby,$rev=0) { - - $code .= 'return $c;'; - -- $CACHE[$sortby] = create_function('$a, $b',$code); -+ $CACHE[$sortby] = function($a, $b) { global $code; return $code; }; - } - - uasort($data,$CACHE[$sortby]); -@@ -2127,7 +2132,7 @@ function password_types() { - * crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear. - * @return string The hashed password. - */ --function password_hash($password_clear,$enc_type) { -+function password_hash_custom($password_clear,$enc_type) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) - debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); - -@@ -2318,7 +2323,7 @@ function password_check($cryptedpassword - - # SHA crypted passwords - case 'sha': -- if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) -+ if (strcasecmp(password_hash_custom($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) - return true; - else - return false; -@@ -2327,7 +2332,7 @@ function password_check($cryptedpassword - - # MD5 crypted passwords - case 'md5': -- if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) -+ if( strcasecmp(password_hash_custom($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) - return true; - else - return false; -@@ -2392,7 +2397,7 @@ function password_check($cryptedpassword - - # SHA512 crypted passwords - case 'sha512': -- if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) -+ if (strcasecmp(password_hash_custom($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) - return true; - else - return false; -@@ -2564,13 +2569,24 @@ function dn_unescape($dn) { - if (is_array($dn)) { - $a = array(); - -- foreach ($dn as $key => $rdn) -- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn); -+ foreach ($dn as $key => $rdn) { -+ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $rdn -+ ); -+ } - - return $a; - - } else { -- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn); -+ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', -+ function ($m) { -+ return ''.chr(hexdec('\\1')).''; -+ }, -+ $dn -+ ); - } - } - |