@@ -741,16 +741,18 @@ public function handlePasswordExpiry(array $params): void {
741741 //retrieve relevant user attributes
742742 $ result = $ this ->access ->search ('objectclass=* ' , $ this ->dn , ['pwdpolicysubentry ' , 'pwdgraceusetime ' , 'pwdreset ' , 'pwdchangedtime ' ]);
743743
744- if (array_key_exists ('pwdpolicysubentry ' , $ result [0 ])) {
745- $ pwdPolicySubentry = $ result [0 ]['pwdpolicysubentry ' ];
746- if ($ pwdPolicySubentry && (count ($ pwdPolicySubentry ) > 0 )) {
747- $ ppolicyDN = $ pwdPolicySubentry [0 ];//custom ppolicy DN
744+ if (!empty ($ result )) {
745+ if (array_key_exists ('pwdpolicysubentry ' , $ result [0 ])) {
746+ $ pwdPolicySubentry = $ result [0 ]['pwdpolicysubentry ' ];
747+ if ($ pwdPolicySubentry && (count ($ pwdPolicySubentry ) > 0 )) {
748+ $ ppolicyDN = $ pwdPolicySubentry [0 ];//custom ppolicy DN
749+ }
748750 }
749- }
750751
751- $ pwdGraceUseTime = array_key_exists ('pwdgraceusetime ' , $ result [0 ]) ? $ result [0 ]['pwdgraceusetime ' ] : [];
752- $ pwdReset = array_key_exists ('pwdreset ' , $ result [0 ]) ? $ result [0 ]['pwdreset ' ] : [];
753- $ pwdChangedTime = array_key_exists ('pwdchangedtime ' , $ result [0 ]) ? $ result [0 ]['pwdchangedtime ' ] : [];
752+ $ pwdGraceUseTime = array_key_exists ('pwdgraceusetime ' , $ result [0 ]) ? $ result [0 ]['pwdgraceusetime ' ] : [];
753+ $ pwdReset = array_key_exists ('pwdreset ' , $ result [0 ]) ? $ result [0 ]['pwdreset ' ] : [];
754+ $ pwdChangedTime = array_key_exists ('pwdchangedtime ' , $ result [0 ]) ? $ result [0 ]['pwdchangedtime ' ] : [];
755+ }
754756
755757 //retrieve relevant password policy attributes
756758 $ cacheKey = 'ppolicyAttributes ' . $ ppolicyDN ;
0 commit comments