Conditions | 3 |
Paths | 4 |
Total Lines | 40 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
36 | public function start(): bool |
||
37 | { |
||
38 | $cursor = $this->db->user->find([ |
||
39 | '$or' => [ |
||
40 | ['groups' => ['$exists' => true]], |
||
41 | ['ldapdn' => ['$exists' => true]], |
||
42 | ['last_share_sync' => ['$exists' => true]], |
||
43 | ], |
||
44 | ]); |
||
45 | |||
46 | foreach ($cursor as $user) { |
||
47 | $this->db->user->updateOne( |
||
48 | ['_id' => $user['_id']], |
||
49 | [ |
||
50 | '$unset' => [ |
||
51 | 'groups' => true, |
||
52 | 'ldapdn' => true, |
||
53 | 'last_share_sync' => true, |
||
54 | ], |
||
55 | ] |
||
56 | ); |
||
57 | } |
||
58 | |||
59 | $cursor = $this->db->storage->find([ |
||
60 | ['migration' => ['$exists' => true]], |
||
61 | ]); |
||
62 | |||
63 | foreach ($cursor as $node) { |
||
64 | $this->db->storage->updateOne( |
||
65 | ['_id' => $node['_id']], |
||
66 | [ |
||
67 | '$unset' => [ |
||
68 | 'migration' => true, |
||
69 | ], |
||
70 | ] |
||
71 | ); |
||
72 | } |
||
73 | |||
74 | return true; |
||
75 | } |
||
76 | } |
||
77 |