Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
64f0b055
Commit
64f0b055
authored
Jan 06, 2015
by
Arthur Schiwon
Browse files
inject IDateTimeFormatter to show-remnants command
parent
40ecd30f
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/user_ldap/appinfo/register_command.php
View file @
64f0b055
...
...
@@ -31,7 +31,9 @@ $application->add(new OCA\user_ldap\Command\TestConfig());
$application
->
add
(
new
OCA\user_ldap\Command\CreateEmptyConfig
());
$application
->
add
(
new
OCA\user_ldap\Command\DeleteConfig
());
$application
->
add
(
new
OCA\user_ldap\Command\Search
(
$ocConfig
));
$application
->
add
(
new
OCA\user_ldap\Command\ShowRemnants
(
$deletedUsersIndex
));
$application
->
add
(
new
OCA\user_ldap\Command\ShowRemnants
(
$deletedUsersIndex
,
\
OC
::
$server
->
getDateTimeFormatter
())
);
$application
->
add
(
new
OCA\user_ldap\Command\CheckUser
(
$uBackend
,
$helper
,
$deletedUsersIndex
,
$userMapping
)
);
apps/user_ldap/command/showremnants.php
View file @
64f0b055
...
...
@@ -17,16 +17,21 @@ use Symfony\Component\Console\Output\OutputInterface;
use
OCA\user_ldap
\
lib\user\DeletedUsersIndex
;
use
OCA\User_LDAP
\
lib\Connection
;
use
OCA\User_LDAP
\
Mapping\UserMapping
;
use
OCP\IDateTimeFormatter
;
class
ShowRemnants
extends
Command
{
/** @var
use
OCA\User_LDAP\lib\User\DeletedUsersIndex
;
*/
/** @var OCA\User_LDAP\lib\User\DeletedUsersIndex */
protected
$dui
;
/** @var OCP\IDateTimeFormatter */
protected
$dateFormatter
;
/**
* @param OCA\user_ldap\lib\user\DeletedUsersIndex $dui
*/
public
function
__construct
(
DeletedUsersIndex
$dui
)
{
public
function
__construct
(
DeletedUsersIndex
$dui
,
IDateTimeFormatter
$dateFormatter
)
{
$this
->
dui
=
$dui
;
$this
->
dateFormatter
=
$dateFormatter
;
parent
::
__construct
();
}
...
...
@@ -53,7 +58,7 @@ class ShowRemnants extends Command {
foreach
(
$resultSet
as
$user
)
{
$hAS
=
$user
->
getHasActiveShares
()
?
'Y'
:
'N'
;
$lastLogin
=
(
$user
->
getLastLogin
()
>
0
)
?
\
OCP\Util
::
formatDate
(
$user
->
getLastLogin
())
:
'-'
;
$this
->
dateFormatter
->
formatDate
(
$user
->
getLastLogin
())
:
'-'
;
$rows
[]
=
array
(
$user
->
getOCName
(),
$user
->
getDisplayName
(),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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