Add EAS version configuration per user via perms system#74
Add EAS version configuration per user via perms system#74TDannhauer merged 1 commit intoFRAMEWORK_6_0from
Conversation
Refactor authentication method to ensure username is set correctly. Added logging for fallback username when registry auth is empty.
ralflang
left a comment
There was a problem hiding this comment.
Generally good. The globals topics are all not blocking but can be refactored later. On the delegation to parent constructor you need to decide, I am not the expert on ActiveSync.
| } | ||
| } | ||
|
|
||
| return parent::authenticate($username, $password, $domain); |
There was a problem hiding this comment.
This sets your user's username and password as parameters in the base driver. The third parameter domain is never used.
Where does your new code populate this?
I think it is risky not to do it.
public function authenticate($username, $password, $domain = null)
{
$this->_authUser = $username;
$this->_authPass = $password;
return true;
}
| $authUsername = (string)$get['User']; | ||
| } | ||
| } | ||
| if ($authUsername === null && !empty($GLOBALS['registry']->getAuth())) { |
There was a problem hiding this comment.
This is not needed in combination with #75 - The registry is now injected as a dependency and you can use it without accessing the global.
| } | ||
| } | ||
| if ($authUsername === null && !empty($GLOBALS['registry']->getAuth())) { | ||
| $authUsername = (string)$GLOBALS['registry']->getAuth(); |
There was a problem hiding this comment.
This flattens a null or false ("Not authenticated") to an empty string. (which might be what you want)
| if ($authUsername === null && !empty($GLOBALS['registry']->getAuth())) { | ||
| $authUsername = (string)$GLOBALS['registry']->getAuth(); | ||
| } | ||
| if ($authUsername === null) { |
| return; | ||
| } | ||
|
|
||
| $mode = !empty($GLOBALS['conf']['activesync']['version_mode']) |
There was a problem hiding this comment.
This should be a LegacyMergedConfig object in the constructor
| if ($mode === 'device') { | ||
| $allowed = $this->_getDeviceScopedVersionPermission($server, $username); | ||
| } else { | ||
| $perms = $GLOBALS['injector']->getInstance('Horde_Perms'); |
There was a problem hiding this comment.
This should be constructor injected
Add EAS version configuration per user via perms system