Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable adding of own accounts #5759

Closed
kroerig opened this issue Nov 30, 2021 · 3 comments
Closed

Disable adding of own accounts #5759

kroerig opened this issue Nov 30, 2021 · 3 comments
Labels
enhancement enterprise Features and bugs relevant for enterprise installations mostly help wanted

Comments

@kroerig
Copy link

kroerig commented Nov 30, 2021

Feature Request

From https://help.nextcloud.com/t/disable-setting-add-new-mail-account/106160

Users can add their own accounts. It should be possible to disable this function globally.

Summary

Adding external accounts could break data protecion rules.

@ChristophWurst ChristophWurst added the enterprise Features and bugs relevant for enterprise installations mostly label Nov 30, 2021
@mrAceT
Copy link

mrAceT commented Jul 6, 2022

I really needed this functionality so i performed this hack in my config.php:

$user = !empty($_COOKIE['nc_username']) ? $_COOKIE['nc_username'] : '';
if (empty($user) && !empty($_SERVER['PHP_AUTH_USER']) ) {
  $user = $_SERVER['PHP_AUTH_USER'];
}
else if (empty($user) && !empty($_SERVER['REQUEST_URI']) && preg_match('/\/(dav\/files|users?)\/([^\/]+)/',$_SERVER['REQUEST_URI'],$matches) ) {
  $user = $matches[2];
}
else if (empty($user) && strpos($_SERVER['PHP_SELF'],'/cron.php') > 0 ) {
  $user = '> CRON call <';
}
if ( !empty($user) && $user != '> CRON call <'
############### exclude your users here that do get access #
 && ($user != 'admin_user' && $user != 'another_admin_user')
############################################################
 && strpos($_SERVER['PHP_SELF'],'/mail/') > 0 # or put 'mail/setup' here if you want to disable the ability to create/add a mail account
) {
 die('you have no access to this part of the site'); 
}

@the-djmaze
Copy link

the-djmaze commented Sep 17, 2024

Disable autoconfig and manual login screen should be the best option.
But it also requires error messages (not allowed) and domain settings management.

I came here due to discussion
the-djmaze/snappymail#1738 (reply in thread)

@ChristophWurst
Copy link
Member

Delivered via #7358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enterprise Features and bugs relevant for enterprise installations mostly help wanted
Projects
None yet
Development

No branches or pull requests

5 participants