Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
64f9fda6
Commit
64f9fda6
authored
Mar 03, 2015
by
Côme Bernigaud
Committed by
Benoit Mortier
Mar 03, 2015
Browse files
Fixes
#3622
Dashboard users tab code is now generic
parent
aacf3911
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/addons/dashboard/class_dashBoardUsers.inc
View file @
64f9fda6
...
...
@@ -89,9 +89,9 @@ class dashboardUsers extends simplePlugin
while
(
$attrs
=
$ldap
->
fetch
())
{
// Test if account is expired now
if
(
$attrs
[
'shadowExpire'
][
0
]
<=
$today
)
{
$expired_accounts
[]
=
$this
->
get_user_infos
(
$attrs
);
$expired_accounts
[]
=
self
::
get_user_infos
(
$attrs
);
}
elseif
(
$attrs
[
'shadowExpire'
][
0
]
<=
$next_expired_date
)
{
$next_expired_accounts
[]
=
$this
->
get_user_infos
(
$attrs
);
$next_expired_accounts
[]
=
self
::
get_user_infos
(
$attrs
);
}
}
...
...
@@ -102,31 +102,32 @@ class dashboardUsers extends simplePlugin
);
}
function
get_user_infos
(
$attrs
)
static
function
get_user_infos
(
$attrs
)
{
if
(
isset
(
$attrs
[
"manager"
][
0
]))
{
$ldap_manager
=
$this
->
config
->
get_ldap_link
();
$ldap_manager
->
cd
(
$this
->
config
->
current
[
'BASE'
]);
$manager_cn
=
$ldap_manager
->
get_attribute
(
$attrs
[
"manager"
][
0
],
"cn"
);
$manager_mail
=
$ldap_manager
->
get_attribute
(
$attrs
[
"manager"
][
0
],
"mail"
);
$manager_phone
=
$ldap_manager
->
get_attribute
(
$attrs
[
"manager"
][
0
],
"telephoneNumber"
);
global
$config
;
if
(
isset
(
$attrs
[
'manager'
][
0
]))
{
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$manager_cn
=
$ldap
->
get_attribute
(
$attrs
[
'manager'
][
0
],
'cn'
);
$manager_mail
=
$ldap
->
get_attribute
(
$attrs
[
'manager'
][
0
],
'mail'
);
$manager_phone
=
$ldap
->
get_attribute
(
$attrs
[
'manager'
][
0
],
'telephoneNumber'
);
}
else
{
$manager_cn
=
""
;
$manager_mail
=
""
;
$manager_phone
=
""
;
$manager_cn
=
''
;
$manager_mail
=
''
;
$manager_phone
=
''
;
}
$human_shadowExpire
=
date
(
'd.m.Y'
,
$attrs
[
"
shadowExpire
"
][
0
]
*
86400
);
// 24 * 60 * 60
$human_shadowExpire
=
date
(
'd.m.Y'
,
$attrs
[
'
shadowExpire
'
][
0
]
*
86400
);
// 24 * 60 * 60
return
array
(
'uid'
=>
$attrs
[
"
uid
"
][
0
],
'cn'
=>
$attrs
[
"
cn
"
][
0
],
'telephoneNumber'
=>
(
isset
(
$attrs
[
"
telephoneNumber
"
][
0
])
?
$attrs
[
"
telephoneNumber
"
][
0
]
:
""
),
'mail'
=>
(
isset
(
$attrs
[
"
mail
"
][
0
])
?
$attrs
[
"
mail
"
][
0
]
:
""
),
'manager_cn'
=>
$manager_cn
,
'manager_mail'
=>
$manager_mail
,
'manager_phone'
=>
$manager_phone
,
'shadowExpire'
=>
$human_shadowExpire
,
'uid'
=>
$attrs
[
'
uid
'
][
0
],
'cn'
=>
$attrs
[
'
cn
'
][
0
],
'telephoneNumber'
=>
(
isset
(
$attrs
[
'
telephoneNumber
'
][
0
])
?
$attrs
[
'
telephoneNumber
'
][
0
]
:
''
),
'mail'
=>
(
isset
(
$attrs
[
'
mail
'
][
0
])
?
$attrs
[
'
mail
'
][
0
]
:
''
),
'manager_cn'
=>
$manager_cn
,
'manager_mail'
=>
$manager_mail
,
'manager_phone'
=>
$manager_phone
,
'shadowExpire'
=>
$human_shadowExpire
,
);
}
...
...
Côme Chilliet
@cchilliet
mentioned in issue
#1206 (closed)
·
Sep 02, 2017
mentioned in issue
#1206 (closed)
mentioned in issue #1206
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment