git-svn-id: https://192.168.0.254/svn/Proyectos.FundacionLQDVI_WebCongresos/trunk@2 94ccb1af-fd9d-d947-8d90-7f70ea60afc8
59 lines
1.6 KiB
PHP
59 lines
1.6 KiB
PHP
<?php
|
|
define( '_JEXEC', 1 );
|
|
|
|
if (stristr( $_SERVER['SERVER_SOFTWARE'], 'win32' )) {
|
|
define( 'JPATH_BASE', realpath(dirname(__FILE__).'\..\..\..\..' ));
|
|
} else define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../../../..' ));
|
|
|
|
define( 'DS', DIRECTORY_SEPARATOR );
|
|
|
|
require_once ( JPATH_BASE.DS.'includes'.DS.'defines.php' );
|
|
require_once ( JPATH_BASE.DS.'includes'.DS.'framework.php' );
|
|
$mainframe =& JFactory::getApplication('site');
|
|
$mainframe->initialise();
|
|
|
|
jimport( 'joomla.plugin.plugin' );
|
|
|
|
JPlugin::loadLanguage( 'com_alpharegistration' );
|
|
|
|
if(isset($_POST['email']))
|
|
{
|
|
$email = $_POST['email'];
|
|
|
|
$db =& JFactory::getDBO();
|
|
$query = "SELECT id FROM #__users WHERE `email`='".$email."' LIMIT 1";
|
|
$db->setQuery( $query );
|
|
$emailalreadyexist = $db->loadResult();
|
|
|
|
$paramsARG = &JComponentHelper::getParams( 'com_alpharegistration' );
|
|
|
|
$emailreject = '';
|
|
|
|
if ($paramsARG->get('emailfilter') && $paramsARG->get('emaildomainslist')!='')
|
|
{
|
|
// check if email domain is in reject list
|
|
$pos = strrpos($email, '@');
|
|
if ( $pos )
|
|
{
|
|
$domain = substr($email,$pos+1);
|
|
//JError::raiseWarning( 0, $domain );
|
|
$domainslisttext = str_replace(" ", "", $paramsARG->get('emaildomainslist'));
|
|
$domainslist = explode( ",", $domainslisttext);
|
|
$emailreject = in_array( $domain, $domainslist );
|
|
}
|
|
}
|
|
|
|
if( $emailalreadyexist )
|
|
{
|
|
echo '<font color="red">'.JText::_( 'ARG_THIS_EMAIL_IS_ALREADY_IN_USE' ).'</font>';
|
|
}
|
|
elseif ($emailreject)
|
|
{
|
|
echo '<font color="red">'.JText::_( 'ARG_THIS_EMAIL_DOMAIN_IS_NOT_AVAILABLE' ).'</font>';
|
|
}
|
|
else
|
|
{
|
|
echo 'OK';
|
|
}
|
|
}
|
|
?>
|