summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Connection.php
Commit message (Collapse)AuthorAgeFilesLines
* enh(LDAP): implement IIsAdmin interfaceArthur Schiwon2023-12-051-0/+1
| | | | | | | | - add configuration to specify one LDAP group acting as admin group (CLI) - implement `isAdmin()` method, basically relying on inGroup against the configured group Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* fix(ldap): store last known user groupsArthur Schiwon2023-10-301-0/+4
| | | | | | - for LDAP user life cycle management Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* nice up the code handling AccountManagerMarc Hefter2023-04-061-1/+0
| | | | | | | | | | | merging defaultScopes from DEFAULT_SCOPES and account_manager.default_property_scope removing unneccessary profileScope setting (using config.php instead) honoring admin choice 'profile.enabled'=>false in config.php moved checking for empty array to updateProfile function corrected some typos and cleaned some comments Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Marc Hefter <marchefter@gmail.com>
* refined code, to be independend from OCP\IUserMarc Hefter2023-04-061-1/+1
| | | | | | | | | rework updateProfile in user_ldap/lib/User/User.php some cleanup at processAttributes in user_ldap/lib/User/User.php rearranged Fediverse attribute, to match profile layout Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Marc Hefter <marchefter@gmail.com>
* handling updateProfile with array of valuesMarc Hefter2023-04-061-0/+1
| | | | | | | | | using an array to buffer profile updates, like suggested by @come-nc clean some code and remove unneccessary redundancy added the Fediverse profile property Co-Authored-By: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Marc Hefter <marchefter@gmail.com>
* added user profile scope settingMarc Hefter2023-04-061-0/+1
| | | | | Signed-off-by: Marc Hefter <marchefter@march42.net> Signed-off-by: Marc Hefter <marchefter@gmail.com>
* feature addition: [user_ldap] update user profile from LDAP; WIP; fixing ↵Marc Hefter2023-04-061-0/+1
| | | | | | | some uggly copy-and-paste errors; testing functionality; preparing and editing the documentation Signed-off-by: Marc Hefter <marchefter@march42.net> Signed-off-by: Marc Hefter <marchefter@gmail.com>
* feature addition: [user_ldap] update user profile from LDAP; WIP ↵Marc Hefter2023-04-061-0/+7
| | | | | | work-in-progress; TODO update profile Signed-off-by: Marc Hefter <marchefter@march42.net>
* Apply a longer TTL of 15min to falling back on backup serverCôme Chilliet2022-12-201-4/+5
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fixed backup host logicCôme Chilliet2022-12-191-26/+24
| | | | | | | Now forcing backup host applies to both main and background. And background will fallback to backup if not responding. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Make code clearer for background hostCôme Chilliet2022-12-191-8/+8
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Use a dedicated LDAP host and port for background jobs if configuredCôme Chilliet2022-12-191-3/+9
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #24574 from zenlord/ldapi-unix-socket-supportCôme Chilliet2022-12-081-1/+8
|\ | | | | Ldapi unix socket support
| * Add ldap-unix-socket support - squashed commits to files Connection.php, ↵Vincent Van Houtte2022-09-091-1/+8
| | | | | | | | | | | | Configuration.php, Wizard.php, LDAP.php and view.js Signed-off-by: Vincent Van Houtte <vvh@aplusv.be>
* | Merge pull request #35355 from nextcloud/artonge/feat/ldap_connection_timeoutblizzz2022-11-301-0/+4
|\ \ | | | | | | Allow to set a custom timeout for ldap connections
| * | Allow to set a custom timeout for ldap connectionsLouis Chemineau2022-11-231-0/+4
| |/ | | | | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* | Improve a bit codestyleCôme Chilliet2022-11-221-3/+2
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Log as warning instead of info when main LDAP server is unreachableCôme Chilliet2022-11-211-1/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Log switching to LDAP backup host because main one is not availableCôme Chilliet2022-11-171-5/+11
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Don't use slow hashing to check the LDAP bindingCarl Schwan2022-05-051-8/+3
| | | | | | | | | Using password_hash is expensive and should be used for hashing passwords when saving them in the database. Here we just want to see if the bind was already done with the given password, so use a fast hashing algorythm. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix unit testsCôme Chilliet2022-03-031-7/+31
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix types in OCA\User_LDAP\ConfigurationCôme Chilliet2022-03-031-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Improve typing in OCA\User_LDAP\Access and reduce psalm errorsCôme Chilliet2022-02-081-1/+1
| | | | | | | This should avoid some PHP warning using PHP 8.1 and help detecting type trouble early in the future. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix PHP 8.1 support for user_ldap applicationCôme Chilliet2021-12-161-3/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Use Psr\Log\LoggerInterface where it can easily be used in user_ldapCôme Chilliet2021-10-141-34/+36
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Add return type for writeToCacheDaniel Kesselberg2021-06-151-4/+2
| | | | | | writeToCache does not return a string. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* do not die after LDAP auth failed with expired accArthur Schiwon2021-03-011-3/+6
| | | | | | - some servers return error code 53 Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Use query builder instead of OC_DB in user_ldapJoas Schilling2020-11-061-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* tame psalm. why does it ignore '@property'?Arthur Schiwon2020-10-191-5/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* do not flip available state to unavailable, allow empty resultsArthur Schiwon2020-08-111-0/+1
| | | | | | | | | - the detection relies that the first, requested result is not empty - it might be empty though – groups without members - protect switching from available to unavailable - switching the other way around was also not envisaged either Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* tidy up Group_LDAPArthur Schiwon2020-06-081-0/+5
| | | | | | | | | | * remove unused method * resolve code duplication * remove usage of deprectad Util::writeLog * phpDoc updates * signature updates Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Format code according to PSR2Christoph Wurst2020-04-101-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-58/+55
| | | | | | | | | | | | | | | 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>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-10/+10
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* treat LDAP error 50 as auth issue, prevents lost server connection errorsArthur Schiwon2019-10-181-1/+2
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* group display name support (service level + ldap)Arthur Schiwon2019-05-271-0/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* fix nested group retrieval also for 2 other casesArthur Schiwon2019-03-051-0/+3
| | | | | | and also consolidate logic in one method Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* add LDAP ConfigHandler for external storages and "$home" varArthur Schiwon2019-02-141-0/+2
| | | | | | | | * handler registered upon OCA\\Files_External::loadAdditionalBackends event as user_ldap is loaded before files_external * new configuration field "ldapExtStorageHomeAttribute" (not in GUI yet) Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* functions that were checked for are present since PHP 5.4, supported is >=/Arthur Schiwon2018-10-251-9/+0
| | | | | | | * so the check from older days is really not necessary anymore * resolves #10923 Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Only bind if configuration for the first server is availableJulius Härtl2018-07-131-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* allow admin to disable fetching of avatars as well as a specific attributeArthur Schiwon2018-07-051-0/+10
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #10034 from nextcloud/fix/noid/ldap-silence-quota-logmsgsblizzz2018-06-281-0/+3
|\ | | | | lower log level for quota manipulation cases
| * lower log level for quota manipulation casesArthur Schiwon2018-06-281-0/+3
| | | | | | | | | | | | and simplify the forest of ifs a little bit Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | LDAP backup server should not be queried when auth failsArthur Schiwon2018-06-271-8/+4
|/ | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>