From nobody Mon Dec 12 10:36:40 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NVyjP2QmDz4k5Jh; Mon, 12 Dec 2022 10:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NVyjP1nG1z3xRl; Mon, 12 Dec 2022 10:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670841401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MNMqI07ldx2bAK8aN/BR4CADpB8EnipNJuWYZRO+CME=; b=bjuIDTTOUVeb/mL3j74rD/yMC7jNEchfB2Px0Sie6paYU4JQhxxMMJ+3c6I7PH7C/ljPBY d80cCFTwXTVgGHrNLJjHgpxQUw9EBaf/Pyvz7f4m/7L3EqiYllHDIcImtEDmar9B7g20nW A4GiJS/Pq93EmDouassknhCyDc1jR0cyP/oxbkVY139KzMl2A+i8nvxUNEzvHNHDVEB3Uh YH8OL7/iNRF7nn6xORkAILrw3YAodc1pf+9cGTuM7Cl3pOIlPUCMdJSi36lxZ/al3bTsMZ PfKGOHvS52rHX5NgEdZix669t+7d5tkhkaxlOz5FBPzcN7hxwobfg5AufZr64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670841401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MNMqI07ldx2bAK8aN/BR4CADpB8EnipNJuWYZRO+CME=; b=m4V3YI6a9uDP80KxwJPW9OK0HM96TRimdHJqq/ul13YyH5Kh5Dg/oa8tQwsQdWQKYtwawa YbtbkK+ovU0L90tL+vToPz99dC1AJmLxjdZMbyRfEQ4OC/YbifVCdD1+JHJor7gRtN1STP JEDkVeTIseQR/wOobGu1bPk0MrE0ZjHBodUOF/EY6SfrwY7FwS6t1tojrQtHSZjZtbXgua SQf+JAJMCjCYy4gx62iJe3a3HKu6g+V9kBLa8aq4afVL3WPIA62OaVgnzdSVFTgD/AJ2Xs T/+STN5A52nOpkwsixuI+t7cpnCMMGiIQ5Yml9Mxj0s7yBThhID686NUDc84yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670841401; a=rsa-sha256; cv=none; b=RA9hKlrdRt2deDb623UiC/7EbPy1v+3DJZRy5QIC1pTYHY0K2+m7eOBxzVebi2QRaw2hzJ DSiLeYZFNTkYE0PaUvmx9dGUtVTp5dHdWy2zKhJgTv02XqilC3vFzTF5kiYH02z6RdzNNT uxC+Y7wYSk0lWJYzdORsCsMoPNyeuDw5yW/HutKg2CK7ju6olRcqKtGgumV/1A0bjpK9wV Xn2bGAyXypOPGvJknqnli5bLWppVyGligUyUrmpscVyIiH/9OzFcebCsUWz9IAi9gnSI8j cNKEM2JYs9QoOAGf56SryauVAL72a1uom7wf/e1krQB6huZIG/oI2YZXOqU6tA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NVyjP0ZbkzWby; Mon, 12 Dec 2022 10:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BCAaegm026559; Mon, 12 Dec 2022 10:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BCAaeVq026558; Mon, 12 Dec 2022 10:36:40 GMT (envelope-from git) Date: Mon, 12 Dec 2022 10:36:40 GMT Message-Id: <202212121036.2BCAaeVq026558@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Ronald Klop Subject: git: 05adb0bbb787 - main - net/phpldapadmin: additional fix to support for php81+ List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ronald X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05adb0bbb787e824fd84aa7aed170182a55268e7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ronald: URL: https://cgit.FreeBSD.org/ports/commit/?id=05adb0bbb787e824fd84aa7aed170182a55268e7 commit 05adb0bbb787e824fd84aa7aed170182a55268e7 Author: Krzysztof AuthorDate: 2022-12-08 09:23:03 +0000 Commit: Ronald Klop CommitDate: 2022-12-12 10:36:10 +0000 net/phpldapadmin: additional fix to support for php81+ PR: 266678 268135 264672 Approved by: rene (mentor) Differential Revision: https://reviews.freebsd.org/D37633 --- net/phpldapadmin/Makefile | 2 +- .../files/patch-lib_AttributeFactory.php | 7 ++++- net/phpldapadmin/files/patch-lib_PageRender.php | 29 ++++++++++++++++++ net/phpldapadmin/files/patch-lib_Tree.php | 9 ++++++ net/phpldapadmin/files/patch-lib_common.php | 11 +++++++ net/phpldapadmin/files/patch-lib_ds__ldap.php | 35 ++++++++++++++++++++-- net/phpldapadmin/files/patch-lib_ds__ldap__pla.php | 27 +++++++++++++++++ net/phpldapadmin/files/patch-lib_functions.php | 29 ++++++++++++++++++ net/phpldapadmin/files/patch-lib_xmlTemplates.php | 9 ++++++ 9 files changed, 154 insertions(+), 4 deletions(-) diff --git a/net/phpldapadmin/Makefile b/net/phpldapadmin/Makefile index 62831744b9d2..140a93c19f30 100644 --- a/net/phpldapadmin/Makefile +++ b/net/phpldapadmin/Makefile @@ -1,6 +1,6 @@ PORTNAME= phpldapadmin PORTVERSION= 1.2.6.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net www PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} diff --git a/net/phpldapadmin/files/patch-lib_AttributeFactory.php b/net/phpldapadmin/files/patch-lib_AttributeFactory.php index 12488014c85c..7f53c65e6b79 100644 --- a/net/phpldapadmin/files/patch-lib_AttributeFactory.php +++ b/net/phpldapadmin/files/patch-lib_AttributeFactory.php @@ -39,7 +39,7 @@ return $this->newShadowAttribute($name,$values,$server_id,$source); } elseif ($app['server']->isAttrBoolean($name)) { -@@ -129,7 +129,7 @@ class AttributeFactory { +@@ -129,11 +129,11 @@ class AttributeFactory { } elseif ($app['server']->isMultiLineAttr($name)) { return $this->newMultiLineAttribute($name,$values,$server_id,$source); @@ -48,3 +48,8 @@ return $this->newGidAttribute($name,$values,$server_id,$source); } else { +- return new Attribute($name,$values,$server_id,$source); ++ return new PLAAttribute($name,$values,$server_id,$source); + } + } + diff --git a/net/phpldapadmin/files/patch-lib_PageRender.php b/net/phpldapadmin/files/patch-lib_PageRender.php index f97df7e2ebaf..eaafb0cfc1f6 100644 --- a/net/phpldapadmin/files/patch-lib_PageRender.php +++ b/net/phpldapadmin/files/patch-lib_PageRender.php @@ -59,6 +59,35 @@ return sprintf('%s', _('Note'),$friendly_name,_('is an alias for'),$attribute->getName(false),_('alias')); else +@@ -827,7 +827,7 @@ class PageRender extends Visitor { + if (! $attribute->getOldValue($i)) + return; + +- draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false); ++ draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false); + } + + /** +@@ -844,16 +844,16 @@ class PageRender extends Visitor { + # If the attribute is modified, the new value needs to be stored in a session variable for the draw_jpeg_photo callback. + if ($attribute->hasBeenModified()) { + $_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i); +- draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false); ++ draw_jpeg_photo(null,$this->template->getDN(),$i,$attribute->getName(),false,false); + } else +- draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false); ++ draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false); + } + + protected function drawFormReadOnlyValueJpegAttribute($attribute,$i) { + $this->draw('HiddenValue',$attribute,$i); + $_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i); + +- draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false); ++ draw_jpeg_photo(null,$this->template->getDN(),$i,$attribute->getName(),false,false); + } + + protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) { @@ -954,7 +954,7 @@ class PageRender extends Visitor { $server = $this->getServer(); $val = $attribute->getValue($i); diff --git a/net/phpldapadmin/files/patch-lib_Tree.php b/net/phpldapadmin/files/patch-lib_Tree.php index 17113e51bee1..59e1ecbdcc1e 100644 --- a/net/phpldapadmin/files/patch-lib_Tree.php +++ b/net/phpldapadmin/files/patch-lib_Tree.php @@ -1,5 +1,14 @@ --- lib/Tree.php.orig 2021-12-12 02:35:51 UTC +++ lib/Tree.php +@@ -68,7 +68,7 @@ abstract class Tree { + } + } + +- set_cached_item($server_id,'tree','null',$tree); ++ set_cached_item($server_id,$tree,'tree','null'); + } + + return $tree; @@ -132,7 +132,7 @@ abstract class Tree { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs); diff --git a/net/phpldapadmin/files/patch-lib_common.php b/net/phpldapadmin/files/patch-lib_common.php index 9e464a0fd2a1..33b76dae081a 100644 --- a/net/phpldapadmin/files/patch-lib_common.php +++ b/net/phpldapadmin/files/patch-lib_common.php @@ -12,3 +12,14 @@ } $app['lang_http'] = array_unique($app['lang_http']); +@@ -296,7 +296,9 @@ if ($app['language'] == 'auto') { + * Strip slashes from GET, POST, and COOKIE variables if this + * PHP install is configured to automatically addslashes() + */ +-if (@get_magic_quotes_gpc() && (! isset($slashes_stripped) || ! $slashes_stripped)) { ++if (@version_compare(phpversion(), '5.4.0', '<') && ++ @get_magic_quotes_gpc() && ++ (!isset($slashes_stripped) || !$slashes_stripped)) { + array_stripslashes($_REQUEST); + array_stripslashes($_GET); + array_stripslashes($_POST); diff --git a/net/phpldapadmin/files/patch-lib_ds__ldap.php b/net/phpldapadmin/files/patch-lib_ds__ldap.php index 8ed7f9831b50..389cf1128878 100644 --- a/net/phpldapadmin/files/patch-lib_ds__ldap.php +++ b/net/phpldapadmin/files/patch-lib_ds__ldap.php @@ -182,7 +182,7 @@ continue; $object_class = new ObjectClass($line,$this); -@@ -1762,8 +1765,8 @@ class ldap extends DS { +@@ -1762,13 +1765,13 @@ class ldap extends DS { # Now go through and reference the parent/child relationships foreach ($return as $oclass) foreach ($oclass->getSupClasses() as $parent_name) @@ -193,6 +193,12 @@ ksort($return); + # cache the schema to prevent multiple schema fetches from LDAP server +- set_cached_item($this->index,'schema','objectclasses',$return); ++ set_cached_item($this->index,$return,'schema','objectclasses'); + } + + if (DEBUG_ENABLED) @@ -1816,7 +1819,7 @@ class ldap extends DS { */ $attrs_oid = array(); @@ -241,7 +247,7 @@ /* Since this attribute's superior attribute does not have another superior * attribute, clone its properties for this attribute. Then, replace -@@ -1936,18 +1939,18 @@ class ldap extends DS { +@@ -1936,24 +1939,24 @@ class ldap extends DS { # Add Used In. foreach ($oclass_attrs as $attr_name) @@ -266,6 +272,13 @@ } $return = $attrs; + + # cache the schema to prevent multiple schema fetches from LDAP server +- set_cached_item($this->index,'schema','attributes',$return); ++ set_cached_item($this->index,$return,'schema','attributes'); + } + + if (DEBUG_ENABLED) @@ -1987,7 +1990,7 @@ class ldap extends DS { $rules = array(); @@ -293,6 +306,15 @@ if (isset($rules[$rule_key])) $rules[$rule_key]->addUsedByAttr($attr->getName(false)); +@@ -2029,7 +2032,7 @@ class ldap extends DS { + $return = $rules; + + # cache the schema to prevent multiple schema fetches from LDAP server +- set_cached_item($this->index,'schema','matchingrules',$return); ++ set_cached_item($this->index,$return,'schema','matchingrules'); + } + + if (DEBUG_ENABLED) @@ -2063,11 +2066,11 @@ class ldap extends DS { $return = array(); @@ -307,6 +329,15 @@ if (! $key) continue; +@@ -2078,7 +2081,7 @@ class ldap extends DS { + ksort($return); + + # cache the schema to prevent multiple schema fetches from LDAP server +- set_cached_item($this->index,'schema','syntaxes',$return); ++ set_cached_item($this->index,$return,'schema','syntaxes'); + } + + if (DEBUG_ENABLED) @@ -2097,7 +2100,7 @@ class ldap extends DS { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); diff --git a/net/phpldapadmin/files/patch-lib_ds__ldap__pla.php b/net/phpldapadmin/files/patch-lib_ds__ldap__pla.php index 2de761e9e9c4..fc33585335fc 100644 --- a/net/phpldapadmin/files/patch-lib_ds__ldap__pla.php +++ b/net/phpldapadmin/files/patch-lib_ds__ldap__pla.php @@ -29,6 +29,33 @@ return true; return false; +@@ -371,7 +371,7 @@ class ldap_pla extends ldap { + + $tree->addEntry($dn); + +- set_cached_item($this->index,'tree','null',$tree); ++ set_cached_item($this->index,$tree,'tree','null'); + + run_hook('post_entry_create',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'attrs'=>$entry_array)); + +@@ -403,7 +403,7 @@ class ldap_pla extends ldap { + $tree = get_cached_item($this->index,'tree'); + $tree->delEntry($dn); + +- set_cached_item($this->index,'tree','null',$tree); ++ set_cached_item($this->index,$tree,'tree','null'); + + run_hook('post_entry_delete',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn)); + } +@@ -430,7 +430,7 @@ class ldap_pla extends ldap { + $newdn = sprintf('%s,%s',$new_rdn,$container); + $tree->renameEntry($dn,$newdn); + +- set_cached_item($this->index,'tree','null',$tree); ++ set_cached_item($this->index,$tree,'tree','null'); + + run_hook('post_entry_rename',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'rdn'=>$new_rdn,'container'=>$container)); + } @@ -674,7 +674,7 @@ class ldap_pla extends ldap { if ($this->getValue('appearance', 'show_authz') && function_exists('ldap_exop_whoami')) { $result = @ldap_exop_whoami($this->connect($method)); diff --git a/net/phpldapadmin/files/patch-lib_functions.php b/net/phpldapadmin/files/patch-lib_functions.php index d97a5febf06e..91951e3ca8b5 100644 --- a/net/phpldapadmin/files/patch-lib_functions.php +++ b/net/phpldapadmin/files/patch-lib_functions.php @@ -113,6 +113,15 @@ if ($length > 0) { // str_repeat doesn't like negatives if ($pad_type == STR_PAD_RIGHT) { // STR_PAD_RIGHT == 1 +@@ -928,7 +929,7 @@ function get_cached_item($index,$item,$subitem='null') + * + * Returns true on success of false on failure. + */ +-function set_cached_item($index,$item,$subitem='null',$data) { ++function set_cached_item($index,$data,$item,$subitem='null') { + if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); + @@ -1090,7 +1091,7 @@ function masort(&$data,$sortby,$rev=0) { $code .= " \$a = array_change_key_case(\$a);\n"; $code .= " \$b = array_change_key_case(\$b);\n"; @@ -254,6 +263,26 @@ } } } +@@ -2032,8 +2033,8 @@ function ldap_error_msg($msg,$errnum) { + * + * Usage Examples: + * +- * draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',"jpegPhoto",0,true,array('img_opts'=>"border: 1px; width: 150px")); +- * draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',null,1); ++ * draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',0,"jpegPhoto",true,array('img_opts'=>"border: 1px; width: 150px")); ++ * draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',1,null); + * + * + * @param object The Server to get the image from. +@@ -2046,7 +2047,7 @@ function ldap_error_msg($msg,$errnum) { + * @param array Specifies optional image and CSS style attributes for the table tag. Supported keys are + * fixed_width, fixed_height, img_opts. + */ +-function draw_jpeg_photo($server,$dn,$attr_name='jpegphoto',$index,$draw_delete_buttons=false,$options=array()) { ++function draw_jpeg_photo($server,$dn,$index,$attr_name='jpegphoto',$draw_delete_buttons=false,$options=array()) { + if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); + @@ -2164,7 +2165,7 @@ function pla_password_hash($password_clear,$enc_type) if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); diff --git a/net/phpldapadmin/files/patch-lib_xmlTemplates.php b/net/phpldapadmin/files/patch-lib_xmlTemplates.php index 9088d3297f1e..64602daf25fe 100644 --- a/net/phpldapadmin/files/patch-lib_xmlTemplates.php +++ b/net/phpldapadmin/files/patch-lib_xmlTemplates.php @@ -18,6 +18,15 @@ $this->templates[$counter] = new $class['name']($this->server_id,$templatename,$filename,$type,$counter); $counter++; } +@@ -140,7 +140,7 @@ abstract class xmlTemplates { + + if ($changed) { + masort($this->templates,'title'); +- set_cached_item($server_id,$class['item'],'null',$this->templates); ++ set_cached_item($server_id,$this->templates,$class['item'],'null'); + } + } + @@ -304,7 +304,7 @@ abstract class xmlTemplate { debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);