Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
468fc675
Commit
468fc675
authored
Mar 23, 2015
by
Arthur Schiwon
Browse files
fix PHP warnings when using occ with some LDAP commands
parent
a9b4f0d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
apps/user_ldap/appinfo/register_command.php
View file @
468fc675
...
...
@@ -25,11 +25,11 @@ $deletedUsersIndex = new DeletedUsersIndex(
$ocConfig
,
$dbConnection
,
$userMapping
);
$application
->
add
(
new
OCA\user_ldap\Command\ShowConfig
());
$application
->
add
(
new
OCA\user_ldap\Command\ShowConfig
(
$helper
));
$application
->
add
(
new
OCA\user_ldap\Command\SetConfig
());
$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\CreateEmptyConfig
(
$helper
));
$application
->
add
(
new
OCA\user_ldap\Command\DeleteConfig
(
$helper
));
$application
->
add
(
new
OCA\user_ldap\Command\Search
(
$ocConfig
));
$application
->
add
(
new
OCA\user_ldap\Command\ShowRemnants
(
$deletedUsersIndex
,
\
OC
::
$server
->
getDateTimeFormatter
())
...
...
apps/user_ldap/command/createemptyconfig.php
View file @
468fc675
...
...
@@ -17,6 +17,16 @@ use \OCA\user_ldap\lib\Helper;
use
\
OCA\user_ldap\lib\Configuration
;
class
CreateEmptyConfig
extends
Command
{
/** @var \OCA\User_LDAP\lib\Helper */
protected
$helper
;
/**
* @param Helper $helper
*/
public
function
__construct
(
Helper
$helper
)
{
$this
->
helper
=
$helper
;
parent
::
__construct
();
}
protected
function
configure
()
{
$this
...
...
@@ -25,7 +35,6 @@ class CreateEmptyConfig extends Command {
;
}
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$configPrefix
=
$this
->
getNewConfigurationPrefix
();
$output
->
writeln
(
"Created new configuration with configID '
{
$configPrefix
}
'"
);
...
...
@@ -35,7 +44,7 @@ class CreateEmptyConfig extends Command {
}
protected
function
getNewConfigurationPrefix
()
{
$serverConnections
=
H
elper
::
getServerConfigurationPrefixes
();
$serverConnections
=
$this
->
h
elper
->
getServerConfigurationPrefixes
();
// first connection uses no prefix
if
(
sizeof
(
$serverConnections
)
==
0
)
{
...
...
apps/user_ldap/command/deleteconfig.php
View file @
468fc675
...
...
@@ -11,11 +11,20 @@ namespace OCA\user_ldap\Command;
use
Symfony\Component\Console\Command\Command
;
use
Symfony\Component\Console\Input\InputArgument
;
use
Symfony\Component\Console\Input\InputInterface
;
use
Symfony\Component\Console\Input\InputOption
;
use
Symfony\Component\Console\Output\OutputInterface
;
use
\
OCA\user_ldap\lib\Helper
;
class
DeleteConfig
extends
Command
{
/** @var \OCA\User_LDAP\lib\Helper */
protected
$helper
;
/**
* @param Helper $helper
*/
public
function
__construct
(
Helper
$helper
)
{
$this
->
helper
=
$helper
;
parent
::
__construct
();
}
protected
function
configure
()
{
$this
...
...
@@ -31,9 +40,9 @@ class DeleteConfig extends Command {
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$configPrefix
=
$input
->
getArgument
(
'configID'
);
;
$configPrefix
=
$input
->
getArgument
(
'configID'
);
$success
=
H
elper
::
deleteServerConfiguration
(
$configPrefix
);
$success
=
$this
->
h
elper
->
deleteServerConfiguration
(
$configPrefix
);
if
(
$success
)
{
$output
->
writeln
(
"Deleted configuration with configID '
{
$configPrefix
}
'"
);
...
...
apps/user_ldap/command/showconfig.php
View file @
468fc675
...
...
@@ -17,6 +17,16 @@ use \OCA\user_ldap\lib\Helper;
use
\
OCA\user_ldap\lib\Configuration
;
class
ShowConfig
extends
Command
{
/** @var \OCA\User_LDAP\lib\Helper */
protected
$helper
;
/**
* @param Helper $helper
*/
public
function
__construct
(
Helper
$helper
)
{
$this
->
helper
=
$helper
;
parent
::
__construct
();
}
protected
function
configure
()
{
$this
...
...
@@ -37,8 +47,7 @@ class ShowConfig extends Command {
}
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$helper
=
new
Helper
();
$availableConfigs
=
$helper
->
getServerConfigurationPrefixes
();
$availableConfigs
=
$this
->
helper
->
getServerConfigurationPrefixes
();
$configID
=
$input
->
getArgument
(
'configID'
);
if
(
!
is_null
(
$configID
))
{
$configIDs
[]
=
$configID
;
...
...
Write
Preview
Markdown
is supported
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