aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-23 15:36:21 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-23 15:36:21 -0700
commit4c2fbc81a043eabb984bf2da56081102dda64b70 (patch)
treeeddbd7dac0ec9c2aacc502a995595d91e381317b /boot.php
parentaedae07af63ff72b288b165e3263275285dc3c71 (diff)
downloadvolse-hubzilla-4c2fbc81a043eabb984bf2da56081102dda64b70.tar.gz
volse-hubzilla-4c2fbc81a043eabb984bf2da56081102dda64b70.tar.bz2
volse-hubzilla-4c2fbc81a043eabb984bf2da56081102dda64b70.zip
for corp and edu sites, allow registration only to certain email addrs
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 05ec44462..83828a0df 100644
--- a/boot.php
+++ b/boot.php
@@ -848,6 +848,36 @@ function allowed_url($url) {
return $found;
}}
+if(! function_exists('allowed_email')) {
+function allowed_email($email) {
+
+
+ $domain = strtolower(substr($email,strpos($email,'@') + 1));
+ if(! $domain)
+ return false;
+
+ $str_allowed = get_config('system','allowed_email');
+ if(! $str_allowed)
+ return true;
+
+ $found = false;
+
+ $fnmatch = function_exists('fnmatch');
+ $allowed = explode(',',$str_allowed);
+
+ if(count($allowed)) {
+ foreach($allowed as $a) {
+ $pat = strtolower(trim($a));
+ if(($fnmatch && fnmatch($pat,$host)) || ($pat == $host)) {
+ $found = true;
+ break;
+ }
+ }
+ }
+ return $found;
+}}
+
+
if(! function_exists('format_like')) {
function format_like($cnt,$arr,$type,$id) {
if($cnt == 1)