{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/20600","labels_url":"https://api.github.com/repos/owncloud/core/issues/20600/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/20600/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/20600/events","html_url":"https://github.com/owncloud/core/issues/20600","id":117762914,"number":20600,"title":"Quota configuration from LDAP user not used","user":{"login":"blink38","id":1789267,"avatar_url":"https://avatars.githubusercontent.com/u/1789267?v=3","gravatar_id":"","url":"https://api.github.com/users/blink38","html_url":"https://github.com/blink38","followers_url":"https://api.github.com/users/blink38/followers","following_url":"https://api.github.com/users/blink38/following{/other_user}","gists_url":"https://api.github.com/users/blink38/gists{/gist_id}","starred_url":"https://api.github.com/users/blink38/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink38/subscriptions","organizations_url":"https://api.github.com/users/blink38/orgs","repos_url":"https://api.github.com/users/blink38/repos","events_url":"https://api.github.com/users/blink38/events{/privacy}","received_events_url":"https://api.github.com/users/blink38/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/app:user_ldap","name":"app:user_ldap","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/feature:quota","name":"feature:quota","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-19T08:07:23Z","updated_at":"2015-11-19T08:20:49Z","closed_at":null,"body":"### Steps to reproduce\r\n1. Configure your owncloud to use LDAP authentication\r\n2. In LDAP Special Attributes (Advanced Tab), set an attribute for \"Quota Field\"\r\n3. In your LDAP, set a value for this attribute to a user.\r\n4. Login with this user and verify that the LDAP value is in use\r\n\r\n## Expected behaviour\r\nThe LDAP value is used\r\n\r\n## Actual behaviour\r\nThe LDAP value is always ignored\r\n\r\n## Server configuration\r\ndebian 7 / Nginx / MySQL / PHP 5.4.45 / Owncloud 8.2.0 (Updated from 8.1.3)\r\n\r\n## Problem identified :\r\nIn file <b>apps/user_ldap/lib/user/user.php</b>\r\nIn function updateQuota($valueFromLDAP = null)\r\nLine : \r\n<pre><code>    $quota = !is_null($valueFromLDAP)\r\n                        ? $valueFromLDAP\r\n                        : $quotaDefault !== '' ? $quotaDefault : null;</code></pre>\r\nDo not work as expected. Even if $valueFromLDAP is set, $quota use $quotaDefault.\r\n\r\nCorrected Line :\r\n<pre><code>                $quota = !is_null($valueFromLDAP)\r\n                        ? $valueFromLDAP\r\n                        : <b>(</b>$quotaDefault !== '' ? $quotaDefault : null<b>)</b>;</code></pre>\r\n\r\nIf you add parenthesis on the last line, $quota is set to $valueFromLDAP when $valueFromLDAP have a value.\r\n\r\nYou can found below a small php script which will show you the importance of parenthesis.\r\n<pre><code>$quotaDefault = \"2 GB\";\r\n$valueFromLDAP = \"10 GB\";\r\n\r\necho \"1. quota (expected 10 GB) = \" . \r\n\t\t$quota = !is_null($valueFromLDAP)\r\n                        ? $valueFromLDAP\r\n                        : $quotaDefault !== '' ? $quotaDefault : null;\r\n\r\necho \"\\n2. quota (expected 10 GB) = \" . \r\n\t\t$quota = !is_null($valueFromLDAP)\r\n                        ? $valueFromLDAP\r\n                        : ($quotaDefault !== '' ? $quotaDefault : null);\r\n\r\n$valueFromLDAP = null;\r\n\r\necho \"\\n3. quota (expected 2 GB) = \" . \r\n\t\t$quota = !is_null($valueFromLDAP)\r\n                        ? $valueFromLDAP\r\n                        : $quotaDefault !== '' ? $quotaDefault : null;\r\n\r\necho \"\\n4. quota (expected 2 GB) = \" . \r\n\t\t$quota = !is_null($valueFromLDAP)\r\n                        ? $valueFromLDAP\r\n                        : ($quotaDefault !== '' ? $quotaDefault : null);\r\necho \"\\n\";</code></pre>\r\n\r\nResult is :\r\n<pre>1. quota (expected 10 GB) = 2 GB\r\n2. quota (expected 10 GB) = 10 GB\r\n3. quota (expected 2 GB) = 2 GB\r\n4. quota (expected 2 GB) = 2 GB</pre>\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/157986785","html_url":"https://github.com/owncloud/core/issues/20600#issuecomment-157986785","issue_url":"https://api.github.com/repos/owncloud/core/issues/20600","id":157986785,"user":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T08:20:49Z","updated_at":"2015-11-19T08:20:49Z","body":"@blink38 Can you maybe also create a pull request for the proposed changes. This then would speed up the time to fix this. ;)"}}