Subversion Repositories ALCASAR

Rev

Rev 3183 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3183 Rev 3324
Line 164... Line 164...
164
	}
164
	}
165
	
165
	
166
	// Retrieve the domainName of the new user
166
	// Retrieve the domainName of the new user
167
	list($user, $domain) = explode('@', $Fmail);
167
	list($user, $domain) = explode('@', $Fmail);
168
 
168
 
-
 
169
	// Extract main domain  (allows sub_domains)
-
 
170
	$domainParts = explode('.', $domain);
-
 
171
	if (count($domainParts) >= 2) {
-
 
172
		$mainDomain = implode('.', array_slice($domainParts, -2));
-
 
173
	} else {
-
 
174
		$mainDomain = $domain; // Cas où le domaine n'a pas de sous-domaine (ex: exemple.com)
-
 
175
	}
-
 
176
 
169
	// check if the domainName is in the whitelist
177
	// check if the domainName is in the whitelist
170
	if (!empty($whiteDomain)){
178
	if (!empty($whiteDomain)){
171
		if (!in_array($domain, $whiteDomain)){
179
		if (!in_array($mainDomain, $whiteDomain)){
172
			echo "$l_domain $domain $l_not_authorized";
180
			echo "$l_domain $domain $l_not_authorized";
173
			exit();
181
			exit();
174
		}
182
		}
175
	}
183
	}
176
	$login  = $Fmail;
184
	$login  = $Fmail;