2121 */ 
2222namespace  OCA \User_LDAP \Command ;
2323
24- use  OC \ServerNotAvailableException ;
25- use  OCA \User_LDAP \AccessFactory ;
26- use  OCA \User_LDAP \Configuration ;
27- use  OCA \User_LDAP \ConnectionFactory ;
2824use  OCA \User_LDAP \Helper ;
2925use  OCA \User_LDAP \LDAP ;
30- use  OCA \User_LDAP \Mapping \UserMapping ;
31- use  OCA \User_LDAP \User \Manager ;
3226
3327use  OCA \User_LDAP \User_Proxy ;
34- use  OCP \IAvatarManager ;
3528use  OCP \IConfig ;
36- use  OCP \IDBConnection ;
37- use  OCP \IUserManager ;
38- use  OCP \Notification \IManager ;
3929
4030use  Symfony \Component \Console \Command \Command ;
4131use  Symfony \Component \Console \Input \InputArgument ;
4636class  SyncUser extends  Command {
4737	/** @var \OCP\IConfig */ 
4838	protected  $ ocConfig
49- 	/** @var  Manager  */ 
50- 	protected  $ userManager 
51- 	/** @var  IDBConnection  */ 
52- 	protected  $ dbc 
39+ 	/** @var User_Proxy  */ 
40+ 	protected  $ backend 
41+ 	/** @var Helper  */ 
42+ 	protected  $ helper 
5343
54- 	public  function  __construct (IConfig $ ocConfig
44+ 	public  function  __construct (IConfig $ ocConfig,  User_Proxy   $ uBackend ,  Helper   $ helper 
5545		$ this ocConfig  = $ ocConfig
56- 		$ this dbc  = \OC ::$ servergetDatabaseConnection ();
57- 		$ this userManager  = new  \OCA \User_LDAP \User \Manager (
58- 			\OC ::$ servergetConfig (),
59- 			new  \OCA \User_LDAP \FilesystemHelper (),
60- 			new  \OCA \User_LDAP \LogWrapper (),
61- 			\OC ::$ servergetAvatarManager (),
62- 			new  \OCP \Image (),
63- 			\OC ::$ servergetUserManager (),
64- 			\OC ::$ servergetNotificationManager (),
65- 			\OC ::$ servergetShareManager ()
66- 		);
46+ 		$ this backend  = $ uBackend
47+ 		$ this helper  = $ helper
6748
6849		parent ::__construct ();
6950	}
@@ -81,24 +62,13 @@ protected function configure() {
8162	}
8263
8364	protected  function  execute (InputInterface $ inputOutputInterface $ outputint  {
84- 		$ helpernew  Helper ($ this ocConfig , \OC ::$ servergetDatabaseConnection ());
85- 		$ configPrefixes$ helpergetServerConfigurationPrefixes (true );
65+ 		$ configPrefixes$ this helper ->getServerConfigurationPrefixes (true );
8666		$ prefix$ this ocConfig ->getAppValue ('user_ldap ' , 'background_sync_prefix ' , null );
8767		$ ldapWrappernew  LDAP ();
8868
89- 		$ connectionFactorynew  ConnectionFactory ($ ldapWrapper
90- 		$ connection$ connectionFactoryget ($ prefix
91- 
92- 		$ accessFactorynew  AccessFactory (
93- 			$ ldapWrapper
94- 			$ this userManager ,
95- 			$ helper
96- 			$ this ocConfig ,
97- 			\OC ::$ servergetUserManager ()
98- 		);
69+ 		$ access$ this backend ->getLDAPAccess ($ uid
9970
100- 		$ access$ accessFactoryget ($ connection
101- 		$ accesssetUserMapper (new  UserMapping ($ this dbc ));
71+ 		$ connection$ accessgetConnection ();
10272
10373		$ loginName$ accessescapeFilterPart ($ inputgetArgument ('uid ' ));
10474		$ filterstr_replace ('%uid ' , $ loginName$ connectionldapLoginFilter );
0 commit comments