File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 2828use OC \Files \View ;
2929use OCP \Files \FileInfo ;
3030use OCP \Files \Mount \IMountManager ;
31+ use OCP \IUser ;
3132use OCP \IUserManager ;
3233use OCP \Share \IManager ;
3334use OCP \Share \IShare ;
@@ -92,15 +93,22 @@ protected function configure() {
9293 protected function execute (InputInterface $ input , OutputInterface $ output ) {
9394 $ this ->sourceUser = $ input ->getArgument ('source-user ' );
9495 $ this ->destinationUser = $ input ->getArgument ('destination-user ' );
95- if (!$ this ->userManager ->userExists ($ this ->sourceUser )) {
96+ $ source = $ this ->userManager ->get ($ this ->sourceUser );
97+ $ destination = $ this ->userManager ->get ($ this ->destinationUser );
98+
99+ if (!$ source instanceof IUser) {
96100 $ output ->writeln ("<error>Unknown source user $ this ->sourceUser </error> " );
97101 return ;
98102 }
99- if (!$ this ->userManager ->userExists ($ this ->destinationUser )) {
103+
104+ if (!$ destination instanceof IUser) {
100105 $ output ->writeln ("<error>Unknown destination user $ this ->destinationUser </error> " );
101106 return ;
102107 }
103-
108+
109+ $ this ->sourceUser = $ source ->getUID ();
110+ $ this ->destinationUser = $ destination ->getUID ();
111+
104112 // target user has to be ready
105113 if (!\OC ::$ server ->getEncryptionManager ()->isReadyForUser ($ this ->destinationUser )) {
106114 $ output ->writeln ("<error>The target user is not ready to accept files. The user has at least to be logged in once.</error> " );
You can’t perform that action at this time.
0 commit comments