Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

IMAP login can be restricted to a specific domain name. #15

Merged
merged 3 commits into from
Apr 26, 2017

Conversation

kosli
Copy link
Contributor

@kosli kosli commented Oct 23, 2016

@MariusBluem
Copy link
Member

Opinions? @MorrisJobke @LukasReschke 😅

@MorrisJobke
Copy link
Member

I can't test this now. And I have currently other priorities than setting something up to test this 😢

@ludgerb
Copy link

ludgerb commented Mar 21, 2017

I have kosli's code up and working for almost a year now - originally for oc, now for nextcloud.
It works fine for me.

Just one addition:
The user's created don't have an email address maintained even though it is known.

I added the following code to kosli's immediatelly before returning the $uid to set the email address:

if (filter_var($username, FILTER_VALIDATE_EMAIL)) {
$config = \OC::$server->getConfig();
if ($config->getUserValue($uid, 'settings', 'email')== '') {
$config->setUserValue($uid, 'settings', 'email', $username);
}
}
OCP\Util::writeLog('user_external', 'DEBUG: Created user '.$uid.' with email '.$username, OCP\Util::DEBUG);

@nickvergessen
Copy link
Member

Merging blindly because I trust you guys.

@nickvergessen nickvergessen merged commit ffb8267 into nextcloud:master Apr 26, 2017
@kosli
Copy link
Contributor Author

kosli commented Apr 26, 2017

@ludgerb can you please create a pull request for your change?
@nickvergessen thank you for merging. i run that version for multiple sites quite a while without problems.

@kosli kosli deleted the patch-1 branch May 30, 2017 09:55
@kosli
Copy link
Contributor Author

kosli commented May 30, 2017

@nickvergessen
i tried to use your code in NC12, but it doesn't seem to work correctly. it sets the users email address in the oc_preferences table, but NOT in oc_accounts which seems to be the table and mail value that is used in e.g. the users "personal" settings page, or for sending out emails.
i don't know which is the correct way to change a users email address? as e.g. the function here also sets only the mail address via setUserValue (https://github.com/nextcloud/server/blob/3f201ec7f3ed65ad672da14b55881ad4d678ce29/lib/private/User/User.php#L161)

any thoughts on that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants