aboutsummaryrefslogtreecommitdiffstats
path: root/community/phpldapadmin
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-28 13:54:43 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-03-28 18:38:20 +0200
commit4272e802a1be191657becb739e6a248c1d0411a7 (patch)
treea07a25b7c99d7da326957a88173ba49583cf6b2a /community/phpldapadmin
parent3e272105092cd9804a5a022a188db929ebf440da (diff)
community/*: move php5 and dependent pkgs from main
There two main reasons for this change: * Active support of PHP 5.x ended on January 2017, security support will end on December 2018. Packages in the main repository should be supported for at least 2 years, this means until first quarter of 2019 for the upcoming v3.6. * php7 and its extensions are currently in the community repository, so we can't use single abuild for both php5-* and php7-* packages (as we do for Python and Lua packages). This change was suggested by @vakartel, approved by @ncopa, @kaniini, and @jirutka.
Diffstat (limited to 'community/phpldapadmin')
-rw-r--r--community/phpldapadmin/APKBUILD77
-rw-r--r--community/phpldapadmin/phpldapadmin-1.2.3-force-ssha512.patch11
-rw-r--r--community/phpldapadmin/phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch49
-rw-r--r--community/phpldapadmin/phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch38
-rw-r--r--community/phpldapadmin/phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch23
-rw-r--r--community/phpldapadmin/phpldapadmin-1.2.3_use-preg_replace_callback.patch34
-rw-r--r--community/phpldapadmin/phpldapadmin.additional-template41
7 files changed, 273 insertions, 0 deletions
diff --git a/community/phpldapadmin/APKBUILD b/community/phpldapadmin/APKBUILD
new file mode 100644
index 00000000000..2e01e165f31
--- /dev/null
+++ b/community/phpldapadmin/APKBUILD
@@ -0,0 +1,77 @@
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+_php=php5
+pkgname=phpldapadmin
+pkgver=1.2.3
+pkgrel=3
+pkgdesc="Web front-end for managing OpenLDAP"
+url="http://phpldapadmin.sourceforge.net"
+arch="noarch"
+license="GPL2"
+depends="${_php} ${_php}-ldap ${_php}-gettext ${_php}-xml"
+depends_dev=
+makedepends="$depends_dev"
+install=
+subpackages=
+source="http://downloads.sourceforge.net/project/$pkgname/$pkgname-php5/$pkgver/$pkgname-$pkgver.tgz
+ $pkgname.additional-template
+ phpldapadmin-1.2.3-force-ssha512.patch
+ phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch
+ phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch
+ phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch
+ phpldapadmin-1.2.3_use-preg_replace_callback.patch
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+prepare() {
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch)
+ msg "Applying $i..."
+ if ! patch -s -p1 -N -i "$srcdir"/$i; then
+ echo $i >>failed
+ _patch_failed=1
+ fi
+ ;;
+ esac
+ done
+
+}
+
+build() {
+ cd "$_builddir"
+}
+
+package() {
+ cd "$_builddir"
+ mkdir -p "$pkgdir"/usr/share/webapps/phpldapadmin
+ mkdir -p "$pkgdir"/etc
+ mv * "$pkgdir"/usr/share/webapps/phpldapadmin
+ mv "$pkgdir"/usr/share/webapps/phpldapadmin/config "$pkgdir"/etc/phpldapadmin
+ ln -s /etc/phpldapadmin "$pkgdir"/usr/share/webapps/phpldapadmin/config || return 1
+ install -Dm644 ../$pkgname.additional-template \
+ "$pkgdir"/usr/share/webapps/phpldapadmin/templates/creation/groupOfNames.xml || return 1
+}
+
+md5sums="59a49054039ceb852c2da377d8742360 phpldapadmin-1.2.3.tgz
+3ca4fbf9e16f192b441b51b2d25ecf14 phpldapadmin.additional-template
+34e36e414f59c6ed4946efa1f277f962 phpldapadmin-1.2.3-force-ssha512.patch
+ac802d139e867ecae7e64923ced54741 phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch
+4037d598cec4261a840e90beda478e35 phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch
+231b82f76e2d2359fa3f98079571830b phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch
+445cf7143613f48918972bc9a5fab06f phpldapadmin-1.2.3_use-preg_replace_callback.patch"
+sha256sums="aecaf8c3ce77ba3899dd31ee5ee183555b2f9349eb8e196dcd33d8a3c485ed58 phpldapadmin-1.2.3.tgz
+85e931a84f3fd5e398da24403425b58711c48196ed9692f7a312883a0ed9fae0 phpldapadmin.additional-template
+0cd1d8195ecdc53cde9667bf256d2243d67675ac92547d163a707659df5a3d9a phpldapadmin-1.2.3-force-ssha512.patch
+a5befd05b3332ba37b8778df1505b370c3c84c1494ce9184f3f2ea4cbe99235b phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch
+d4a8d75f76c8f865caddfe6ded6d9a9a8ee9b9828da021520ffa516a713ac941 phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch
+375571b4471cd39173d16bf54417f8ba2b8c66103d652b4a2ab1eaa9e36b8046 phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch
+a9ad83216edde85f5c44514cf152b3532766f6981e17da6b00c7c267b28dd89b phpldapadmin-1.2.3_use-preg_replace_callback.patch"
+sha512sums="58a57ca577586685ebd0d7fde7e299b8945d1693018c7803e19239b79f4b9d72a4d207d53c9f284268e32398108038efafcdb434e634619bfe87db3524d267b6 phpldapadmin-1.2.3.tgz
+913cc89bfba3a24064865f091a3bcc6ec88db0824d750e8b3b1f6497b5ac1a1e158ced895f1f85f93607402e9353798b3dd4ccdbb1454713f96937c884456eb7 phpldapadmin.additional-template
+aecbf3699af4ae39426c6c81edd45a738cdd91f9cfc1e8062ade4b6fa11e7530a8d8b4c2730cd648749b87381dbcca1bbe8681b8e45ec7af50b6b74137f89331 phpldapadmin-1.2.3-force-ssha512.patch
+71a0bc987e526401c72b77b36843868099040654c3435e9c2f5b266a49a27b75b007fd949e9981bcd4b9a678f0edd74e988e66647984c882c57fe8dc99a26849 phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch
+d238e27ed89e400f467ab8282a67920cd1e72e5f52709d086f6b31708960dc65acafc0fe683887ceff0b78b3aa9631e91e2c57f722d9f7e0f057e0f872ae73a2 phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch
+0524112c7a3c591eaf4b3e64de26282a786a2c0fa73f1047084f14c4f9093cf31e1b9a36b7b1736d6c6ae89f9940916d42cbbab7081249abf1a963de588aac63 phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch
+57e1d8d861f84f0934a2275d7ba37621c2c19c71bf2c04db918ccbc6df36eaca60986db2ba6b543356ad55eab8d7850267db1d30677d77c96238821c29b99ac9 phpldapadmin-1.2.3_use-preg_replace_callback.patch"
diff --git a/community/phpldapadmin/phpldapadmin-1.2.3-force-ssha512.patch b/community/phpldapadmin/phpldapadmin-1.2.3-force-ssha512.patch
new file mode 100644
index 00000000000..c69096e7fcb
--- /dev/null
+++ b/community/phpldapadmin/phpldapadmin-1.2.3-force-ssha512.patch
@@ -0,0 +1,11 @@
+--- a/lib/functions.php
++++ b/lib/functions.php
+@@ -2147,7 +2147,7 @@
+ if ($_SESSION[APPCONFIG]->getValue('password', 'no_random_crypt_salt'))
+ $new_value = sprintf('{CRYPT}%s',crypt($password_clear,substr($password_clear,0,2)));
+ else
+- $new_value = sprintf('{CRYPT}%s',crypt($password_clear,random_salt(2)));
++ $new_value = sprintf('{CRYPT}%s',crypt($password_clear,'$6$'.random_salt(2)));
+
+ break;
+
diff --git a/community/phpldapadmin/phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch b/community/phpldapadmin/phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch
new file mode 100644
index 00000000000..1408c13184f
--- /dev/null
+++ b/community/phpldapadmin/phpldapadmin-1.2.3_changed-password_hash-to-pla_password_hash.patch
@@ -0,0 +1,49 @@
+From e673df3ba8d690afbbba28f9ec368e475933efe8 Mon Sep 17 00:00:00 2001
+From: Mohamad Elrashidin Bin Sajeli <archayl@gmail.com>
+Date: Thu, 8 May 2014 20:22:30 +0800
+Subject: [PATCH] Changed password_hash to pla_password_hash
+
+---
+ lib/functions.php | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/functions.php b/lib/functions.php
+index 56d8bf3..ad9ee9f 100644
+--- a/lib/functions.php
++++ b/lib/functions.php
+@@ -2127,7 +2127,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 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);
+
+@@ -2318,7 +2318,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword
+
+ # SHA crypted passwords
+ case 'sha':
+- if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
++ if (strcasecmp(pla_password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
+ return true;
+ else
+ return false;
+@@ -2327,7 +2327,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword
+
+ # MD5 crypted passwords
+ case 'md5':
+- if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
++ if( strcasecmp(pla_password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
+ return true;
+ else
+ return false;
+@@ -2392,7 +2392,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword
+
+ # SHA512 crypted passwords
+ case 'sha512':
+- if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0)
++ if (strcasecmp(pla_password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0)
+ return true;
+ else
+ return false;
diff --git a/community/phpldapadmin/phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch b/community/phpldapadmin/phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch
new file mode 100644
index 00000000000..d2fa12a477b
--- /dev/null
+++ b/community/phpldapadmin/phpldapadmin-1.2.3_changed-preg_replace-to-preg_replace-callback.patch
@@ -0,0 +1,38 @@
+From b082cf1742b2310d69b2f278f33f6025e2544acb Mon Sep 17 00:00:00 2001
+From: Mohamad Elrashidin Bin Sajeli <archayl@gmail.com>
+Date: Thu, 8 May 2014 20:40:57 +0800
+Subject: [PATCH] Changed preg_replace to preg_replace callback
+
+---
+ lib/functions.php | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/lib/functions.php b/lib/functions.php
+index ad9ee9f..d31e0c1 100644
+--- a/lib/functions.php
++++ b/lib/functions.php
+@@ -2565,12 +2565,22 @@ function dn_unescape($dn) {
+ $a = array();
+
+ foreach ($dn as $key => $rdn)
+- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
++ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
++ function ($r) {
++ return "''.chr(hexdec('$r[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 ($r) {
++ return "''.chr(hexdec('$r[1]')).''";
++ },
++ $dn
++ );
+ }
+ }
+
diff --git a/community/phpldapadmin/phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch b/community/phpldapadmin/phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch
new file mode 100644
index 00000000000..af9e73b4817
--- /dev/null
+++ b/community/phpldapadmin/phpldapadmin-1.2.3_fixed-call-to-renamed-function-pla_password_hash.patch
@@ -0,0 +1,23 @@
+From c736ecd8c26b360e4764fbd3a472e2fa4b1b3db6 Mon Sep 17 00:00:00 2001
+From: Ivo van der Meer <ivo@crewtty.ath.cx>
+Date: Wed, 4 Jun 2014 10:48:06 +0200
+Subject: [PATCH] Bugfix: fixed call to renamed function pla_password_hash.
+
+---
+ lib/PageRender.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/PageRender.php b/lib/PageRender.php
+index 7d86a54..6cc571e 100644
+--- a/lib/PageRender.php
++++ b/lib/PageRender.php
+@@ -287,7 +287,7 @@ protected function getPostAttribute($attribute,$i) {
+ break;
+
+ default:
+- $vals[$i] = password_hash($passwordvalue,$enc);
++ $vals[$i] = pla_password_hash($passwordvalue,$enc);
+ }
+
+ $vals = array_unique($vals);
+
diff --git a/community/phpldapadmin/phpldapadmin-1.2.3_use-preg_replace_callback.patch b/community/phpldapadmin/phpldapadmin-1.2.3_use-preg_replace_callback.patch
new file mode 100644
index 00000000000..60c086d1971
--- /dev/null
+++ b/community/phpldapadmin/phpldapadmin-1.2.3_use-preg_replace_callback.patch
@@ -0,0 +1,34 @@
+From 5a7edc892f1b3cccab74ed150f9d6843912a39ee Mon Sep 17 00:00:00 2001
+From: Ben Chavet <ben@chavet.net>
+Date: Thu, 29 May 2014 18:57:44 +0000
+Subject: [PATCH] Use preg_replace_callback instead of /e in preg_replace to
+ fix E_DEPRECATED warnings
+
+---
+ lib/ds_ldap.php | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/lib/ds_ldap.php b/lib/ds_ldap.php
+index c346660..8bc1ef8 100644
+--- a/lib/ds_ldap.php
++++ b/lib/ds_ldap.php
+@@ -1116,13 +1116,14 @@ private function unescapeDN($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('${m[1]}')).''"; }, $rdn);
++ }
+ return $a;
+
+- } else
+- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
++ } else {
++ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function($m) { return "''.chr(hexdec('${m[1]}')).''"; }, $dn);
++ }
+ }
+
+ public function getRootDSE($method=null) {
diff --git a/community/phpldapadmin/phpldapadmin.additional-template b/community/phpldapadmin/phpldapadmin.additional-template
new file mode 100644
index 00000000000..1a1b3a8f50b
--- /dev/null
+++ b/community/phpldapadmin/phpldapadmin.additional-template
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE template SYSTEM "template.dtd">
+<template>
+<title>User Group</title>
+<!-- <regexp>^ou=.*,</regexp> -->
+<icon>images/ou.png</icon>
+<description>New groupOfNames</description>
+<askcontainer>1</askcontainer>
+<rdn>cn</rdn>
+<visible>1</visible>
+
+<objectClasses>
+<objectClass id="groupOfNames"></objectClass>
+</objectClasses>
+
+<attributes>
+<attribute id="cn">
+ <display>Group</display>
+ <order>1</order>
+ <page>1</page>
+</attribute>
+<attribute id="member">
+ <display>member</display>
+ <hint></hint>
+ <order>2</order>
+ <page>1</page>
+ <spacer>1</spacer>
+</attribute>
+<attribute id="memberUid">
+ <array>10</array>
+ <display>Users</display>
+ <helper>
+ <location>side</location>
+<!-- <value>=php.DrawChooserLink(memberUid,0)</value> -->
+ </helper>
+ <hidden>0</hidden>
+ <order>3</order>
+ <page>1</page>
+</attribute>
+</attributes>
+</template>