[Hastymail-cvs] SF.net SVN: hastymail:[2155] trunk/hastymail2
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2013-12-31 21:36:51
|
Revision: 2155 http://sourceforge.net/p/hastymail/code/2155 Author: sailfrog Date: 2013-12-31 21:36:47 +0000 (Tue, 31 Dec 2013) Log Message: ----------- Add a configuration option to strip domains from login names Modified Paths: -------------- trunk/hastymail2/hastymail2.conf.example trunk/hastymail2/lib/utility_classes.php Modified: trunk/hastymail2/hastymail2.conf.example =================================================================== --- trunk/hastymail2/hastymail2.conf.example 2013-10-22 16:03:09 UTC (rev 2154) +++ trunk/hastymail2/hastymail2.conf.example 2013-12-31 21:36:47 UTC (rev 2155) @@ -398,6 +398,13 @@ site_blacklist_ips = + # site_strip_login_domain + # ----------------------- + # If mail users should login without a domain but add one anyway this + # will strip the domain portion from their login username + +site_strip_login_domain = false + # site_append_login_domain # ------------------------ # If your IMAP server requires users to login with their full email Modified: trunk/hastymail2/lib/utility_classes.php =================================================================== --- trunk/hastymail2/lib/utility_classes.php 2013-10-22 16:03:09 UTC (rev 2154) +++ trunk/hastymail2/lib/utility_classes.php 2013-12-31 21:36:47 UTC (rev 2155) @@ -949,6 +949,9 @@ $username = trim($username); $pass = trim($pass); } + if (isset($conf['site_strip_login_domain']) && $conf['site_strip_login_domain']) { + $username = preg_replace("/@.+$/", '', $username); + } if ($this->do_auth($username, $pass, $conf['imap_proxyauth_user'])) { $this->start_session(); $this->logged_in = true; @@ -992,6 +995,9 @@ $username = trim($username); $pass = trim($pass); } + if (isset($conf['site_strip_login_domain']) && $conf['site_strip_login_domain']) { + $username = preg_replace("/@.+$/", '', $username); + } if ($this->do_auth($username, $pass, false)) { $this->start_session(); $this->logged_in = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |