Commit Graph

309 Commits

Author SHA1 Message Date
Roeland Jago Douma d9990b09b8
PHP-CS-Fixer green
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-04-16 09:25:17 +02: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 +02: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 +02: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 +02:00
Christoph Wurst a8a06a82d2
Remove trailing whitespaces from comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:09:23 +02:00
Christoph Wurst 44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +02:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02: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 +02: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 +02: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 +02:00
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01: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 +01:00
Christoph Wurst 2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:21:27 +01:00
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Arthur Schiwon f657ded6ec
remove superfluous tests
- user_ldap is not exposed to public api, it is always behind ldap_proxy
- this is too much for a unit test
- integration tests cover userExists implicitly

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-01-08 09:21:22 +01:00
Arthur Schiwon 1068b860ff
adjust tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-01-08 09:21:22 +01:00
Arthur Schiwon 411a47cadb
relax strict getHome behaviour for LDAP users in a shadow state
* simplifies deletion process
* less strange behaviour when looking up home storage (as long as it is local)
* thus could enable transfer ownerships after user went invisible on ldap

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-01-08 09:21:21 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Christoph Wurst cc80339b39
Add typed create user events
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-03 08:03:57 +01:00
Roeland Jago Douma 17a9d5856f
TO REVERT LATER: disable some tests in UserTest
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:28 +01:00
Roeland Jago Douma 3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +01:00
Roeland Jago Douma 8d4346d656
Fix more tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:42 +01:00
Roeland Jago Douma c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +01: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 +01:00
Arthur Schiwon 8d2f712420
Don't process known avatars from LDAP
* avoids useless FS operation
* avoids useless DB writes
* avoids useless addressbook updates
* addendum to #17001

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-04 14:44:48 +02:00
Arthur Schiwon 108227ca6c
invalidates user when plugin reported deletion success
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-06-26 14:18:28 +02:00
blizzz c1eff72bdf
Merge pull request #15964 from nextcloud/enh/noid/user-creation-options
Opt-in for generation userid, requiring email addresses
2019-06-21 11:08:59 +02:00
Arthur Schiwon 660fbd64e3
ensures mapping of chosen userid
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-06-19 17:02:28 +02:00
Arthur Schiwon 8a7b0a68a5
fixes returning the base when multiple are specified
* reading the config directly will return the value with line breaks
* using the proper accessor gives us all bases in an array
* returns the first matching one
* having user id provided for the group base is strange and does not let
  us operate like this. here we return the first one. might change in
  future, a backportable fix won't have an API change however.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-06-19 13:39:15 +02:00
Arthur Schiwon a1f2dbe29c
caches the displayname after an LDAP plugin set it
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-06-18 12:42:03 +02:00
Arthur Schiwon c6c8a41d2f
group display name support (service level + ldap)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-05-27 12:03:05 +02:00
Vinicius Cubas Brand c4dbc428f9
fix user creation using LDAP Plugin
Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
2019-03-21 10:20:46 +01:00
Arthur Schiwon e36cede994
remove unused use statement
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-03-06 00:34:29 +01:00
Arthur Schiwon 5dd2207c95
fix nested group retrieval also for 2 other cases
and also consolidate logic in one method

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-03-05 11:07:40 +01:00
Roland Tapken 459b8a4845
Fixed unit test: groupsMatchFilter will not be called multiple times anymore.
Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
2019-03-05 11:07:40 +01:00
Julius Härtl 6ee7286b41
Fix tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-03-01 20:57:01 +01:00
Arthur Schiwon 792bcb82ae
add LDAP ConfigHandler for external storages and "$home" var
* 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>
2019-02-14 15:22:22 +01:00
Arthur Schiwon 5c10a46445
ensure attribute names are lower cased
otherwise they will be skipped when the results is being formatted and the
lower-cased result keys do not match.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-02-14 14:13:32 +01:00
Arthur Schiwon 925043c60c
ensure db is pristine before starting the tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-01-04 22:10:22 +01:00
Arthur Schiwon fbd4e9e651
add tests for the DUI
as they are interact with the DB they are more integraiton than unit tests

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-12-21 17:24:23 +01:00
Arthur Schiwon deec5a70a0
avoid logging of "Partial search results returned: Sizelimit exceeded at"
LDAP servers respond with that even if a limit was passed with the
request. Having this statement logged causes a lot of confusion.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-11-07 13:15:55 +01:00
Arthur Schiwon 0c5d9127e8
remove app specific IUserTools and consolidate test
Just some house keeping. IUserTools with used in even older days for
easier creation of Access instances…

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-10-30 22:44:50 +01:00
Roeland Jago Douma 8b2b238d86
Merge pull request #12054 from nextcloud/fix/5212/interact-with-userobject
LDAP: announce display name changes so that addressbook picks it up
2018-10-30 13:38:16 +01:00
Arthur Schiwon 49456e42f9
do not run into UniqueConstraintViolationException
… when an unmapped user logs in for the first time when background job
mode is ajax and no memcache was configured.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-10-30 12:12:03 +01:00
Arthur Schiwon d47e1513bc
remove unneeded empty search attribute values, fixes #12086
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-10-29 13:21:02 +01:00
Arthur Schiwon bbe44108b5
only write when the displayname differs, but then announce it
refs #5212 and fixes #9112

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-10-25 23:41:12 +02:00
Arthur Schiwon 7807add02d
[LDAP] The WebUI Wizard also should not assign empty config IDs
With 689df9a843 the behaviour to assign only
non-empty config IDs was introduced. Only, this was only effective for CLI
and OCS API.

Related to #3270.

The web UI creates now also a full configuration on first load. This fixes
#5094.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-08-23 17:58:35 +02:00
Arthur Schiwon 2b903aa267
fix unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-08-15 16:11:07 +02:00
Arthur Schiwon 59e35e3bf7
tests for user storage location
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-08-10 00:28:44 +02:00
Arthur Schiwon b069b13226
convert pagination tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-08-09 23:45:12 +02:00