Arthur Schiwon
659125b395
fix(LDAP): escape DN on check-user
...
the DN has to be escaped differently when used as a base and we were
missing it here in the search method call in the check-user command.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-04-05 16:24:27 +07:00
Faraz Samapoor
e6a4ebcc92
Update apps/user_ldap/lib/Command/Search.php
...
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2024-02-06 10:02:11 +07:00
Faraz Samapoor
f03781b509
Refactors user_ldap app commands.
...
To improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2024-02-06 10:02:11 +07:00
Arthur Schiwon
37237dc183
feat(LDAP): warn about demoting a group while promoting another
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-12-01 12:48:24 +07:00
Arthur Schiwon
18e6c9f5bc
enh(LDAP): add occ command to promote an LDAP group to admin
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-12-01 12:48:24 +07:00
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +07:00
Côme Chilliet
b8a0954f55
Fix check-group --update for deleted groups
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:37 +07:00
Côme Chilliet
1026b2131c
Fix check-group command for new groups
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet
7a14aa748e
Add output to check-group --update command
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet
ce5a4e5b66
Always empty cache before updating a group
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet
f9ed48eab9
Add check-group command
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:33 +07:00
Côme Chilliet
4130a4cbd8
Make sure to use AccessFactory to create Access instances and use DI
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-25 09:52:35 +07:00
Côme Chilliet
91d6e88c2f
Add missing file
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-01 12:18:03 +07:00
Côme Chilliet
9fc00fdb82
Avoid updating _lastChange when nothing is changed in the configuration
...
Had to set at least one var when creating an empty configuration in
order to save the default values.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-31 08:38:05 +07:00
Côme Chilliet
44680b5c3b
Make it explicit that a DN can be used for ldap:check-user
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-17 10:00:25 +07:00
Côme Chilliet
a6ad06f940
Improve typing in apps/user_ldap/lib/Command/CheckUser.php
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-17 09:58:51 +07:00
Côme Chilliet
a4f96c18e9
Remove parenthesis around return in apps/user_ldap/lib/Command/CheckUser.php
...
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-17 09:58:51 +07:00
Côme Chilliet
75ce9a4832
Fix ldap:check-user method for newly created LDAP users
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-17 09:58:28 +07:00
Côme Chilliet
9f2db6e65d
Fix ldap:update-uuid
...
Generators cannot be iterated with while or returned by an other
generator, using foreach instead.
And a few other problems.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-10 10:15:00 +07:00
Arthur Schiwon
45d4c0bf66
add occ command to update UUIDs (incomplete)
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 10:14:59 +07:00
Arthur Schiwon
2bf57cbab8
fix overwriting of SUCCESS and INVALID consts
...
- already defined in Symfony\Component\Console\Command\Command
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-03 23:12:51 +07:00
Côme Chilliet
59862f7175
Improve ldap:test-config occ command
...
Test a search on the base, as the settings wizard is doing.
This is to avoid the wizard saying the base is wrong and the command
saying everything is fine.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-04 12:17:58 +07:00
Côme Chilliet
3446d9c0b2
Ignore cache in occ ldap:check-ldap command
...
This avoids having to wait or reset the cache after deleting a user in
the LDAP.
This also fixes a PHP error when running ldap:check-ldap --update on a
deleted but cached user.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-22 16:44:27 +07:00
Christoph Wurst
bf564e2a5a
Convert command option defaults to strings
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-06-09 13:25:31 +07:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Johannes Leuker
9660a3fa90
Add json, yaml output options to ldap:show-config
...
Signed-off-by: Johannes Leuker <j.leuker@hosting.de>
2021-03-31 12:36:22 +07:00
Arthur Schiwon
1b0355f2c6
adds ldap user:reset command
...
- allows to delete data of existing LDAP users, which otherwise is safe
guarded
- ensures that the user is not being deleted on LDAP through a plugin
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-03-17 11:23:48 +07:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
Joas Schilling
5fba0e562f
Use query builder instead of OC_DB in user_ldap
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 11:25:28 +07:00
Arthur Schiwon
86e5e7d927
LDAP simplify User_Proxy and Group_Proxy signatures
...
- make User_Proxy and Group_Proxy easy to instantiate
- simplify dependent code
- move commands to info.xml
- make UpdateGroups job class non-static
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-10-23 12:25:31 +07:00
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
Christoph Wurst
2a054e6c04
Update the license headers for Nextcloud 20
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00
Daniel Kesselberg
7b68f0f326
Remove unexpected argument
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-08-10 22:36:30 +07:00
Morris Jobke
3203286f52
Do not use custom DI object names for user_ldap
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-13 17:22:19 +07:00
Joas Schilling
d7c0b9cced
Also always return in app commands
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-26 15:12:11 +07:00
Christoph Wurst
cb057829f7
Update license headers for 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +07:00
Arthur Schiwon
84619a5b9c
use serverControls directly with LDAP calls, fixes 19127
...
- adapters for PHP API version to Support PHP < 7.3
- switch to pass only one base per search
- cookie logic is moved from Access to API adapters
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-04-14 12:58:28 +07:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
...
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +07:00
Christoph Wurst
14c996d982
Use elseif instead of else if
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +07:00
Christoph Wurst
41b5e5923a
Use exactly one empty line after the namespace declaration
...
For PSR2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +07:00
Christoph Wurst
2fbad1ed72
Fix (array) indent style to always use one tab
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 10:16:08 +07:00
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +07:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +07:00
Christoph Wurst
5bf3d1bb38
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
...
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +07:00
Arthur Schiwon
40c9a743fa
adds an --update flag to check-user for manual sync of the ldap record
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-07-18 14:30:43 +07:00
Arthur Schiwon
85f14bc591
LDAP: extend remnants output with "detected on" field
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-12-21 17:24:28 +07:00
Arthur Schiwon
feb5366a42
LDAP clear cache on config modification also when done via API or CLI
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-12-17 00:31:27 +07:00
Morris Jobke
c1e4f9f305
Use type casting instead of *val() method
...
It should be up to 6x faster
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 11:35:42 +07:00
Morris Jobke
0eebff152a
Update license headers
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +07:00