From 1f23b0314b3d62e47e49ad22d1fe25672b2792c6 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 29 Jun 2018 20:44:36 +0200 Subject: [PATCH] added auto delete module --- lam-packaging/debian/copyright | 1 + lam/copyright | 1 + lam/graphics/refresh.png | Bin 463 -> 450 bytes lam/lib/baseType.inc | 5 +- lam/lib/lists.inc | 11 +++-- lam/lib/modules/.gitignore | 1 + lam/lib/types/asteriskExt.inc | 12 +++-- lam/lib/types/dhcp.inc | 15 +++--- lam/lib/types/group.inc | 24 +++++----- lam/lib/types/host.inc | 22 +++++---- lam/lib/types/kolabSharedFolderType.inc | 13 +++--- lam/lib/types/mailAlias.inc | 13 +++--- lam/lib/types/netgroup.inc | 17 +++---- lam/lib/types/pykotaBillingCodeType.inc | 16 +++---- lam/lib/types/pykotaPrinterType.inc | 18 ++++---- lam/lib/types/smbDomain.inc | 13 +++--- lam/lib/types/user.inc | 58 ++++++++++++------------ 17 files changed, 132 insertions(+), 108 deletions(-) diff --git a/lam-packaging/debian/copyright b/lam-packaging/debian/copyright index 3d7accda..33e86e13 100644 --- a/lam-packaging/debian/copyright +++ b/lam-packaging/debian/copyright @@ -19,6 +19,7 @@ time. * lib/modules/customFields.inc * lib/modules/customScripts.inc * lib/modules/device.inc +* lib/modules/autoDelete.inc * lib/modules/dynamicList.inc * lib/modules/groupOfNames.inc * lib/modules/groupOfNamesUser.inc diff --git a/lam/copyright b/lam/copyright index c386848d..8686c286 100644 --- a/lam/copyright +++ b/lam/copyright @@ -19,6 +19,7 @@ time. * lib/modules/customFields.inc * lib/modules/customScripts.inc * lib/modules/device.inc +* lib/modules/autoDelete.inc * lib/modules/dynamicList.inc * lib/modules/groupOfNames.inc * lib/modules/groupOfNamesUser.inc diff --git a/lam/graphics/refresh.png b/lam/graphics/refresh.png index e0021413b72bcc3786e1fa3c16be41281e6da806..d0ad6d6ced17a260e7de8e91e994142797efd3e1 100644 GIT binary patch literal 450 zcmV;z0X_bSP)nrhNfH160Z&Op zK~y-)jnhplW^owD@z3qyJ~v57M2$3g8XJie);9La#=M3p8*ju*m}#2DY%HXN)YRNX zN{OtMg(Atq9T^Nh>z%0?>rUICnMetl|QHu$_w= zfdsgXJ!kmzhA*m-T*hD?aFruZ#dc z)6a{}Q5XgA&-pgq86_bpW9LUPOUlAn*(m>mEMz66lvv0gp~=EdrkL!kY$!V`OI9{) z#P|`ThS6g&_s#Xb^VHM#);;IkbDwj+s>)W45f*U+qsjdl6P08ZCmLxtf{iI$Qy-HK z;~aKk4zumMh8K8RRexZZ5c+_1Y->Ggy&o5FGs$R*SXJNg0IMCT??qgPA<4cZ2a_C1 zGE~(X?%`bnFXK(;;%t(I;39Ul``l@#YL+fx1)p#mXWE^g4cOkPt#`J6Rn<~eeXPw1 zKJRcxhc>ZMJMq}$*t>e!4eZE(FP+lKY}Vc+*IK6I+R?;E*a!~bO0ztNw|IriZGEe% zek7T}=|)^lRY`Ilry8*jeh%+(wW>b%zQ;K}#B0;RkFbFIN#>`BRrMQ7c!aMVX)H94 z<2~`ew+cxHJi#8D@vLCEs=oEOslUU&Jn!OhRsGxo<1fBBg}{C&i+un9002ovPDHLk FV1nwa&v*a; diff --git a/lam/lib/baseType.inc b/lam/lib/baseType.inc index fda44d90..3258712d 100644 --- a/lam/lib/baseType.inc +++ b/lam/lib/baseType.inc @@ -102,7 +102,10 @@ class baseType { * @return array list of descriptions */ public function getListAttributeDescriptions() { - return array(); + return array( + 'entryexpiretimestamp' => _('Deletion time'), + "description" => _("Description"), + ); } /** diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 62be1dbb..6c0deed0 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -566,9 +566,14 @@ class lamList { // print all attribute entries seperated by "; " if (isset($entry[$attribute]) && sizeof($entry[$attribute]) > 0) { if (is_array($entry[$attribute])) { - // sort array - sort($entry[$attribute]); - echo htmlspecialchars(implode("; ", $entry[$attribute]), ENT_QUOTES, "UTF-8"); + if (($attribute == 'entryexpiretimestamp') && !empty($entry[$attribute][0])) { + echo formatLDAPTimestamp($entry[$attribute][0]); + } + else { + // sort array + sort($entry[$attribute]); + echo htmlspecialchars(implode("; ", $entry[$attribute]), ENT_QUOTES, "UTF-8"); + } } else { echo htmlspecialchars($entry[$attribute], ENT_QUOTES, "UTF-8"); diff --git a/lam/lib/modules/.gitignore b/lam/lib/modules/.gitignore index c7362b25..a004e671 100644 --- a/lam/lib/modules/.gitignore +++ b/lam/lib/modules/.gitignore @@ -38,3 +38,4 @@ /kopano*.inc /dynamicList.inc /customBaseType.inc +/autoDelete.inc diff --git a/lam/lib/types/asteriskExt.inc b/lam/lib/types/asteriskExt.inc index 14ac145e..8a2ffa8c 100644 --- a/lam/lib/types/asteriskExt.inc +++ b/lam/lib/types/asteriskExt.inc @@ -91,11 +91,13 @@ class asteriskExt extends baseType { * @return array list of descriptions */ function getListAttributeDescriptions() { - return array( - "astextension" => _("Extension name"), - "astcontext" => _("Account context"), - "member" => _("Owner"), - ); + return array_merge( + parent::getListAttributeDescriptions(), + array( + "astextension" => _("Extension name"), + "astcontext" => _("Account context"), + "member" => _("Owner"), + )); } /** diff --git a/lam/lib/types/dhcp.inc b/lam/lib/types/dhcp.inc index e0311712..7d760171 100644 --- a/lam/lib/types/dhcp.inc +++ b/lam/lib/types/dhcp.inc @@ -1,10 +1,9 @@ _("Subnet"), - "dhcprange" => _("Ranges"), - "fixed_ips" => _("IP address") . ' / ' . _('MAC address') . ' / ' . _("Description") - ); + return array_merge( + parent::getListAttributeDescriptions(), + array ( + "cn" => _("Subnet"), + "dhcprange" => _("Ranges"), + "fixed_ips" => _("IP address") . ' / ' . _('MAC address') . ' / ' . _("Description") + )); } /** diff --git a/lam/lib/types/group.inc b/lam/lib/types/group.inc index 03fb000f..d70f1eda 100644 --- a/lam/lib/types/group.inc +++ b/lam/lib/types/group.inc @@ -103,17 +103,19 @@ class group extends baseType { * @return array list of descriptions */ function getListAttributeDescriptions() { - $return = array ( - "cn" => _("Group name"), - "description" => _("Group description"), - "displayName" => _("Display name"), - "gidnumber" => _("GID number"), - "member" => _("Group member DNs"), - "memberuid" => _("Group members"), - "roleOccupant" => _("Role member DNs"), - "uniqueMember" => _("Group member DNs"), - "memberUrl" => _("Entries"), - ); + $return = array_merge( + parent::getListAttributeDescriptions(), + array( + "cn" => _("Group name"), + "description" => _("Group description"), + "displayName" => _("Display name"), + "gidnumber" => _("GID number"), + "member" => _("Group member DNs"), + "memberuid" => _("Group members"), + "roleOccupant" => _("Role member DNs"), + "uniqueMember" => _("Group member DNs"), + "memberUrl" => _("Entries"), + )); if ($this->getType() != null) { $modules = $this->getType()->getModules(); if (in_array('organizationalRole', $modules)) { diff --git a/lam/lib/types/host.inc b/lam/lib/types/host.inc index 7b0292b6..6455e550 100644 --- a/lam/lib/types/host.inc +++ b/lam/lib/types/host.inc @@ -89,16 +89,18 @@ class host extends baseType { * @return array list of descriptions */ function getListAttributeDescriptions() { - return array ( - "uid" => _("Host name"), - "cn" => _("Common name"), - "rid" => _("RID (Windows UID)"), - "description" => _("Host description"), - "uidnumber" => _("UID number"), - "gidnumber" => _("GID number"), - 'location' => _('Location'), - 'serialNumber' => _('Serial number') - ); + return array_merge( + parent::getListAttributeDescriptions(), + array ( + "uid" => _("Host name"), + "cn" => _("Common name"), + "rid" => _("RID (Windows UID)"), + "description" => _("Host description"), + "uidnumber" => _("UID number"), + "gidnumber" => _("GID number"), + 'location' => _('Location'), + 'serialNumber' => _('Serial number') + )); } /** diff --git a/lam/lib/types/kolabSharedFolderType.inc b/lam/lib/types/kolabSharedFolderType.inc index f1524701..4c8cba5a 100644 --- a/lam/lib/types/kolabSharedFolderType.inc +++ b/lam/lib/types/kolabSharedFolderType.inc @@ -1,9 +1,8 @@ _('Delegates'), - 'alias' => _('Email aliases'), - ); + return array_merge( + parent::getListAttributeDescriptions(), + array ( + "kolabDelegate" => _('Delegates'), + 'alias' => _('Email aliases'), + )); } /** diff --git a/lam/lib/types/mailAlias.inc b/lam/lib/types/mailAlias.inc index 5fc43905..6efd47d5 100644 --- a/lam/lib/types/mailAlias.inc +++ b/lam/lib/types/mailAlias.inc @@ -1,9 +1,8 @@ _("Alias name"), - "rfc822mailmember" => _("Recipient list") - ); + return array_merge( + parent::getListAttributeDescriptions(), + array( + "cn" => _("Alias name"), + "rfc822mailmember" => _("Recipient list") + )); } /** diff --git a/lam/lib/types/netgroup.inc b/lam/lib/types/netgroup.inc index b0423ee8..770567a0 100644 --- a/lam/lib/types/netgroup.inc +++ b/lam/lib/types/netgroup.inc @@ -1,9 +1,8 @@ _("Group name"), - 'description' => _('Description'), - 'membernisnetgroup' => _('Subgroups'), - 'nisnetgrouptriple' => _('Members') - ); + return array_merge( + parent::getListAttributeDescriptions(), + array ( + "cn" => _("Group name"), + 'description' => _('Description'), + 'membernisnetgroup' => _('Subgroups'), + 'nisnetgrouptriple' => _('Members') + )); } /** diff --git a/lam/lib/types/pykotaBillingCodeType.inc b/lam/lib/types/pykotaBillingCodeType.inc index f973ce51..825237bb 100644 --- a/lam/lib/types/pykotaBillingCodeType.inc +++ b/lam/lib/types/pykotaBillingCodeType.inc @@ -1,9 +1,8 @@ _('Billing code'), - "description" => _('Description'), - 'pykotaBalance' => _('Balance'), - 'pykotaPageCounter' => _('Page count'), - ); + return array_merge( + parent::getListAttributeDescriptions(), + array( + "cn" => _('Billing code'), + 'pykotaBalance' => _('Balance'), + 'pykotaPageCounter' => _('Page count'), + )); } /** diff --git a/lam/lib/types/pykotaPrinterType.inc b/lam/lib/types/pykotaPrinterType.inc index 4adfba2a..698a9029 100644 --- a/lam/lib/types/pykotaPrinterType.inc +++ b/lam/lib/types/pykotaPrinterType.inc @@ -1,9 +1,8 @@ _('Printer name'), - "description" => _('Description'), - 'pykotaPricePerPage' => _('Price per page'), - 'pykotaPricePerJob' => _('Price per job'), - 'pykotaMaxJobSize' => _('Maximum job size'), - ); + return array_merge( + parent::getListAttributeDescriptions(), + array( + "cn" => _('Printer name'), + 'pykotaPricePerPage' => _('Price per page'), + 'pykotaPricePerJob' => _('Price per job'), + 'pykotaMaxJobSize' => _('Maximum job size'), + )); } /** diff --git a/lam/lib/types/smbDomain.inc b/lam/lib/types/smbDomain.inc index 4af23b69..da8f758e 100644 --- a/lam/lib/types/smbDomain.inc +++ b/lam/lib/types/smbDomain.inc @@ -1,9 +1,8 @@ _("Domain SID"), - "sambadomainname" => _("Domain name") - ); + return array_merge( + parent::getListAttributeDescriptions(), + array( + "sambasid" => _("Domain SID"), + "sambadomainname" => _("Domain name") + )); } /** diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index 0a4a4401..fc98ef09 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -88,34 +88,36 @@ class user extends baseType { * @return array list of descriptions */ function getListAttributeDescriptions() { - return array ( - "cn" => _("Common name"), - 'company' => _('Company'), - 'departmentNumber' => _('Department'), - 'displayName' => _('Display name'), - 'employeeNumber' => _('Employee number'), - "gecos" => _("Description"), - "gidnumber" => _("GID number"), - "givenname" => _("First name"), - "homedirectory" => _("Home directory"), - "host" => _("Allowed hosts"), - "jpegphoto" => _('Photo'), - "loginshell" => _("Login shell"), - "mail" => _("Email"), - 'manager' => _('Manager'), - 'o' => _('Organisation'), - 'ou' => _('Organisational unit'), - 'proxyAddresses' => _('Proxy-Addresses'), - 'sambakickofftime' => _('Account expiration date'), - 'shadowexpire' => _('Password expiration'), - "sn" => _("Last name"), - 'streetAddress' => _('Street'), - 'telephoneNumber' => _('Telephone number'), - 'title' => _('Job title'), - "uid" => _("User name"), - "uidnumber" => _("UID number"), - 'userPrincipalName' => _('User name'), - ); + return array_merge( + parent::getListAttributeDescriptions(), + array( + "cn" => _("Common name"), + 'company' => _('Company'), + 'departmentNumber' => _('Department'), + 'displayName' => _('Display name'), + 'employeeNumber' => _('Employee number'), + "gecos" => _("Description"), + "gidnumber" => _("GID number"), + "givenname" => _("First name"), + "homedirectory" => _("Home directory"), + "host" => _("Allowed hosts"), + "jpegphoto" => _('Photo'), + "loginshell" => _("Login shell"), + "mail" => _("Email"), + 'manager' => _('Manager'), + 'o' => _('Organisation'), + 'ou' => _('Organisational unit'), + 'proxyAddresses' => _('Proxy-Addresses'), + 'sambakickofftime' => _('Account expiration date'), + 'shadowexpire' => _('Password expiration'), + "sn" => _("Last name"), + 'streetAddress' => _('Street'), + 'telephoneNumber' => _('Telephone number'), + 'title' => _('Job title'), + "uid" => _("User name"), + "uidnumber" => _("UID number"), + 'userPrincipalName' => _('User name'), + )); } /**