Instantiate QuickEmailVerification Client with api Key
@return void
505664
public function setClient()
    {
        if(empty($this->apiKey))
        {
            throw new InvalidArgumentException('Api key can not be empty');
        }

        $this->client = new Client($this->apiKey);
    }
1258241
public function boot()
    {
        Validator::extend('email_checker', function ($attribute, $value, $parameters, $validator) {
            $email = new EmailChecker();

            return $email->check($value);
        }, 'Invalid Email Address');
    }
372751
public function setup()
    {
        if (!$this->_checkRequestType('jsonapi')) {
            return;
        }

        $appClass = Configure::read('App.namespace') . '\Application';

        // If `App\Application` class exists it means Cake 3.3's PSR7 middleware
        // implementation is used and it's too late to register new error handler.
        if (!class_exists($appClass, false)) {
            $this->registerExceptionHandler();
        }
    }
660657
public function getEmail()
    {
        $oHttpCodes = Factory::service('HttpCodes');

        if (!userHasPermission('admin:auth:accounts:browse')) {
            throw new ApiException(
                'You are not authorised to browse users',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        }

        $oInput = Factory::service('Input');
        $sEmail = $oInput->get('email');

        if (!valid_email($sEmail)) {
            throw new ApiException(
                '"' . $sEmail . '" is not a valid email',
                $oHttpCodes::STATUS_BAD_REQUEST
            );
        }

        $oUserModel = Factory::model(static::CONFIG_MODEL_NAME, static::CONFIG_MODEL_PROVIDER);
        $oUser      = $oUserModel->getByEmail($sEmail);

        if (empty($oUser)) {
            throw new ApiException(
                'No user found for email "' . $sEmail . '"',
                $oHttpCodes::STATUS_NOT_FOUND
            );
        }

        return Factory::factory('ApiResponse', 'nails/module-api')
            ->setData($this->formatObject($oUser));
    }
531442
private function key_import()
    {
        // Import process
        if ($data = rcube_utils::get_input_value('_keys', rcube_utils::INPUT_POST)) {
            $this->enigma->load_engine();
            $this->enigma->engine->password_handler();

            $result = $this->enigma->engine->import_key($data);

            if (is_array($result)) {
                if (rcube_utils::get_input_value('_generated', rcube_utils::INPUT_POST)) {
                    $this->rc->output->command('enigma_key_create_success');
                    $this->rc->output->show_message('enigma.keygeneratesuccess', 'confirmation');
                }
                else {
                    $this->rc->output->show_message('enigma.keysimportsuccess', 'confirmation',
                        array('new' => $result['imported'], 'old' => $result['unchanged']));

                    if ($result['imported'] && !empty($_POST['_refresh'])) {
                        $this->rc->output->command('enigma_list', 1, false);
                    }
                }
            }
            else {
                $this->rc->output->show_message('enigma.keysimportfailed', 'error');
            }

            $this->rc->output->send();
        }
        else if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'])) {
            $this->enigma->load_engine();
            $result = $this->enigma->engine->import_key($_FILES['_file']['tmp_name'], true);

            if (is_array($result)) {
                // reload list if any keys has been added
                if ($result['imported']) {
                    $this->rc->output->command('parent.enigma_list', 1);
                }
                else {
                    $this->rc->output->command('parent.enigma_loadframe');
                }

                $this->rc->output->show_message('enigma.keysimportsuccess', 'confirmation',
                    array('new' => $result['imported'], 'old' => $result['unchanged']));
            }
            else if ($result instanceof enigma_error && $result->getCode() == enigma_error::BADPASS) {
                $this->password_prompt($result);
            }
            else {
                $this->rc->output->show_message('enigma.keysimportfailed', 'error');
            }

            $this->rc->output->send('iframe');
        }
        else if ($err = $_FILES['_file']['error']) {
            if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
                $this->rc->output->show_message('filesizeerror', 'error',
                    array('size' => $this->rc->show_bytes(rcube_utils::max_upload_size())));
            } else {
                $this->rc->output->show_message('fileuploaderror', 'error');
            }

            $this->rc->output->send('iframe');
        }

        $this->rc->output->add_handlers(array(
            'importform' => array($this, 'tpl_key_import_form'),
        ));

        $this->rc->output->set_pagetitle($this->enigma->gettext('keyimport'));
        $this->rc->output->send('enigma.keyimport');
    }
890884
public static function init() {

		self::$app = Kecik::getInstance();;

		self::$modelUser    = '\\Model\\' . self::$app->config->get( 'auth.model' );
		self::$postUsername = self::$app->config->get( 'auth.post_username' );
		self::$postPassword = self::$app->config->get( 'auth.post_password' );

		self::$fieldUsername   = self::$app->config->get( 'auth.field_username' );
		self::$fieldPassword   = self::$app->config->get( 'auth.field_password' );
		self::$fieldLevel      = self::$app->config->get( 'auth.field_level' );
		self::$loginRoute      = ( self::$app->config->get( 'auth.login_route' ) != '' ) ? self::$app->config->get( 'auth.login_route' ) : self::$loginRoute;
		self::$logoutRoute     = ( self::$app->config->get( 'auth.logout_route' ) != '' ) ? self::$app->config->get( 'auth.logout_route' ) : self::$logoutRoute;
		self::$loginTemplate   = ( self::$app->config->get( 'auth.login_template' ) != '' ) ? self::$app->config->get( 'auth.login_template' ) : self::$loginTemplate;
		self::$encryptFunction = ( self::$app->config->get( 'auth.encrypt_function' ) != '' ) ? self::$app->config->get( 'auth.encrypt_function' ) : self::$encryptFunction;

		if ( ! empty( self::username() ) ) {
			$model = self::$modelUser;
			$users = $model::find( [
				'where' => [
					[ self::$fieldUsername, '=', self::username() ]
				]
			] );

			if ( count( $users ) > 0 ) {
				self::$info = $users[0];
			}
		}

		AuthInit( self::$app );
	}
812150
function user_create($userobject, $plainpass) {
        $extusername = core_text::convert($userobject->username, 'utf-8', $this->config->ldapencoding);
        $extpassword = core_text::convert($plainpass, 'utf-8', $this->config->ldapencoding);

        switch ($this->config->passtype) {
            case 'md5':
                $extpassword = '{MD5}' . base64_encode(pack('H*', md5($extpassword)));
                break;
            case 'sha1':
                $extpassword = '{SHA}' . base64_encode(pack('H*', sha1($extpassword)));
                break;
            case 'plaintext':
            default:
                break; // plaintext
        }

        $ldapconnection = $this->ldap_connect();
        $attrmap = $this->ldap_attributes();

        $newuser = array();

        foreach ($attrmap as $key => $values) {
            if (!is_array($values)) {
                $values = array($values);
            }
            foreach ($values as $value) {
                if (!empty($userobject->$key) ) {
                    $newuser[$value] = core_text::convert($userobject->$key, 'utf-8', $this->config->ldapencoding);
                }
            }
        }

        //Following sets all mandatory and other forced attribute values
        //User should be creted as login disabled untill email confirmation is processed
        //Feel free to add your user type and send patches to paca@sci.fi to add them
        //Moodle distribution

        switch ($this->config->user_type)  {
            case 'edir':
                $newuser['objectClass']   = array('inetOrgPerson', 'organizationalPerson', 'person', 'top');
                $newuser['uniqueId']      = $extusername;
                $newuser['logindisabled'] = 'TRUE';
                $newuser['userpassword']  = $extpassword;
                $uadd = ldap_add($ldapconnection, $this->config->user_attribute.'='.ldap_addslashes($extusername).','.$this->config->create_context, $newuser);
                break;
            case 'rfc2307':
            case 'rfc2307bis':
                // posixAccount object class forces us to specify a uidNumber
                // and a gidNumber. That is quite complicated to generate from
                // Moodle without colliding with existing numbers and without
                // race conditions. As this user is supposed to be only used
                // with Moodle (otherwise the user would exist beforehand) and
                // doesn't need to login into a operating system, we assign the
                // user the uid of user 'nobody' and gid of group 'nogroup'. In
                // addition to that, we need to specify a home directory. We
                // use the root directory ('/') as the home directory, as this
                // is the only one can always be sure exists. Finally, even if
                // it's not mandatory, we specify '/bin/false' as the login
                // shell, to prevent the user from login in at the operating
                // system level (Moodle ignores this).

                $newuser['objectClass']   = array('posixAccount', 'inetOrgPerson', 'organizationalPerson', 'person', 'top');
                $newuser['cn']            = $extusername;
                $newuser['uid']           = $extusername;
                $newuser['uidNumber']     = AUTH_UID_NOBODY;
                $newuser['gidNumber']     = AUTH_GID_NOGROUP;
                $newuser['homeDirectory'] = '/';
                $newuser['loginShell']    = '/bin/false';

                // IMPORTANT:
                // We have to create the account locked, but posixAccount has
                // no attribute to achive this reliably. So we are going to
                // modify the password in a reversable way that we can later
                // revert in user_activate().
                //
                // Beware that this can be defeated by the user if we are not
                // using MD5 or SHA-1 passwords. After all, the source code of
                // Moodle is available, and the user can see the kind of
                // modification we are doing and 'undo' it by hand (but only
                // if we are using plain text passwords).
                //
                // Also bear in mind that you need to use a binding user that
                // can create accounts and has read/write privileges on the
                // 'userPassword' attribute for this to work.

                $newuser['userPassword']  = '*'.$extpassword;
                $uadd = ldap_add($ldapconnection, $this->config->user_attribute.'='.ldap_addslashes($extusername).','.$this->config->create_context, $newuser);
                break;
            case 'ad':
                // User account creation is a two step process with AD. First you
                // create the user object, then you set the password. If you try
                // to set the password while creating the user, the operation
                // fails.

                // Passwords in Active Directory must be encoded as Unicode
                // strings (UCS-2 Little Endian format) and surrounded with
                // double quotes. See http://support.microsoft.com/?kbid=269190
                if (!function_exists('mb_convert_encoding')) {
                    print_error('auth_ldap_no_mbstring', 'auth_ldap');
                }

                // Check for invalid sAMAccountName characters.
                if (preg_match('#[/\\[\]:;|=,+*?<>@"]#', $extusername)) {
                    print_error ('auth_ldap_ad_invalidchars', 'auth_ldap');
                }

                // First create the user account, and mark it as disabled.
                $newuser['objectClass'] = array('top', 'person', 'user', 'organizationalPerson');
                $newuser['sAMAccountName'] = $extusername;
                $newuser['userAccountControl'] = AUTH_AD_NORMAL_ACCOUNT |
                                                 AUTH_AD_ACCOUNTDISABLE;
                $userdn = 'cn='.ldap_addslashes($extusername).','.$this->config->create_context;
                if (!ldap_add($ldapconnection, $userdn, $newuser)) {
                    print_error('auth_ldap_ad_create_req', 'auth_ldap');
                }

                // Now set the password
                unset($newuser);
                $newuser['unicodePwd'] = mb_convert_encoding('"' . $extpassword . '"',
                                                             'UCS-2LE', 'UTF-8');
                if(!ldap_modify($ldapconnection, $userdn, $newuser)) {
                    // Something went wrong: delete the user account and error out
                    ldap_delete ($ldapconnection, $userdn);
                    print_error('auth_ldap_ad_create_req', 'auth_ldap');
                }
                $uadd = true;
                break;
            default:
               print_error('auth_ldap_unsupportedusertype', 'auth_ldap', '', $this->config->user_type_name);
        }
        $this->ldap_close();
        return $uadd;
    }
203298
public function main()
    {
        $this->loadModel('CakeManager.Users');

        $email = $this->in('Enter the e-mailaddress');

        $password = $this->in('Enter the password');

        $data = [
            'email' => $email,
            'password' => $password,
        ];

        $new = $this->Users->newEntity($data);

        $new->set('role_id', 1);
        $new->set('active', 1);

        if ($this->Users->save($new)) {
            $this->out('The user "' . $email . '" has been created.');
            return true;
        }

        $this->out('Someting went wrong. The user could not be saved. We will debug the validation errors...');

        if ($new->errors()) {
            $errors = $new->errors();
            foreach ($errors as $key => $error) {
                foreach ($error as $message) {
                    $this->out($key . ': ' . ($message));
                }
            }
        }

        return false;
    }
501586
public function email(): void
    {
        $oInput     = Factory::service('Input');
        $oUserModel = Factory::model('User', 'nails/module-auth');
        $action     = $oInput->post('action');
        $sEmail     = trim($oInput->post('email'));
        $iId        = (int) $oInput->post('id') ?: null;

        switch ($action) {

            case 'add':
                $bIsPrimary  = (bool) $oInput->post('isPrimary');
                $bIsVerified = (bool) $oInput->post('isVerified');

                if ($oUserModel->emailAdd($sEmail, $iId, $bIsPrimary, $bIsVerified)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was added successfully. ';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to add email. ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            case 'delete':
                if ($oUserModel->emailDelete($sEmail, $iId)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was deleted successfully. ';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to delete email "' . $sEmail . '". ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            case 'makePrimary':
                if ($oUserModel->emailMakePrimary($sEmail, $iId)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was set as the primary email.';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to mark "' . $sEmail . '" as the primary address. ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            case 'verify':
                //  Get the code for this email
                $aUserEmails = $oUserModel->getEmailsForUser($iId);
                $sCode       = '';

                foreach ($aUserEmails as $oUserEmail) {
                    if ($oUserEmail->email == $sEmail) {
                        $sCode = $oUserEmail->code;
                    }
                }

                if (!empty($sCode) && $oUserModel->emailVerify($iId, $sCode)) {
                    $sStatus  = 'success';
                    $sMessage = '"' . $sEmail . '" was verified successfully.';
                } elseif (empty($sCode)) {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to mark "' . $sEmail . '" as verified. ';
                    $sMessage .= 'Could not determine email\'s security code.';
                } else {
                    $sStatus  = 'error';
                    $sMessage = 'Failed to mark "' . $sEmail . '" as verified. ';
                    $sMessage .= $oUserModel->lastError();
                }
                break;

            default:
                $sStatus  = 'error';
                $sMessage = 'Unknown action: "' . $action . '"';
                break;
        }

        $oSession = Factory::service('Session', 'nails/module-auth');
        $oSession->setFlashData($sStatus, $sMessage);
        redirect($oInput->post('return'));
    }
1116395
public function emailVerification()
    {
        $this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
        $this->get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');
        $this->get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
    }
63347
private static function initialize()
    {
        if (self::$initialized) return;

        self::$client = \OpenId::getClient();
        self::$version = config('openid.api-version');
        self::$initialized = TRUE;
    }
1263653
private function createEmail(): self
    {
        $aFields  = $this->getArguments();
        $aCreated = [];

        try {

            $aToCreate = [];
            $aEmails   = array_filter(
                array_map(function ($sEmail) {
                    return implode('/', array_map('ucfirst', explode('/', ucfirst(trim($sEmail)))));
                }, explode(',', $aFields['EMAIL_NAME']))
            );

            sort($aEmails);

            foreach ($aEmails as $sEmail) {

                $sEmail = ucwords($sEmail);
                $sEmail = str_replace(' ', '', $sEmail);

                $aEmailBits = explode('/', $sEmail);
                $aEmailBits = array_map('ucfirst', $aEmailBits);

                $sNamespace       = $this->generateNamespace($aEmailBits);
                $sClassName       = $this->generateClassName($aEmailBits);
                $sClassNameFull   = $sNamespace . '\\' . $sClassName;
                $sClassNameNormal = str_replace('AppFactory', '', str_replace('\\', '', $sClassNameFull));
                $sFilePath        = $this->generateFilePath($aEmailBits);
                $sEmailKey        = $this->generateEmailKey($aEmailBits);
                $sTemplateDir     = $this->generateTemplateDir($aEmailBits);
                $sTemplateHtml    = $this->generateTemplate('HTML', $aEmailBits);
                $sTemplateText    = $this->generateTemplate('TEXT', $aEmailBits);

                //  Test it does not already exist
                if (file_exists($sFilePath)) {
                    throw new ConsoleException(
                        'An email at "' . $sFilePath . '" already exists'
                    );
                }
                try {
                    $oTest = Factory::factory($sClassNameNormal, 'app');
                    throw new ConsoleException(
                        'An email by "' . $sClassNameNormal . '" is already defined'
                    );
                } catch (\Exception $e) {
                    //  No exception? No problem!
                }

                $aToCreate[] = [
                    'NAMESPACE'             => $sNamespace,
                    'CLASS_NAME'            => $sClassName,
                    'CLASS_NAME_FULL'       => $sClassNameFull,
                    'CLASS_NAME_NORMALISED' => $sClassNameNormal,
                    'FILE_PATH'             => $sFilePath,
                    'DIRECTORY'             => dirname($sFilePath) . DIRECTORY_SEPARATOR,
                    'EMAIL_KEY'             => $sEmailKey,
                    'TEMPLATE_DIR'          => $sTemplateDir,
                    'TEMPLATE_HTML'         => $sTemplateHtml,
                    'TEMPLATE_TEXT'         => $sTemplateText,
                ];
            }

            $this->oOutput->writeln('The following email(s) will be created:');
            foreach ($aToCreate as $aConfig) {
                $this->oOutput->writeln('');
                $this->oOutput->writeln('Class:       <info>' . $aConfig['CLASS_NAME_FULL'] . '</info>');
                $this->oOutput->writeln('Key:         <info>' . $aConfig['CLASS_NAME_NORMALISED'] . '</info>');
                $this->oOutput->writeln('Path:        <info>' . $aConfig['FILE_PATH'] . '</info>');
                $this->oOutput->writeln('View (HTML): <info>' . $aConfig['TEMPLATE_HTML'] . '</info>');
                $this->oOutput->writeln('View (TEXT): <info>' . $aConfig['TEMPLATE_TEXT'] . '</info>');
            }
            $this->oOutput->writeln('');

            if ($this->confirm('Continue?', true)) {

                //  Generate emails
                $aServiceDefinitions = [];
                foreach ($aToCreate as $aConfig) {
                    $this->oOutput->writeln('');
                    $this->oOutput->write('Creating email <comment>' . $aConfig['CLASS_NAME_FULL'] . '</comment>... ');
                    $this->createPath($aConfig['DIRECTORY']);
                    $this->createFile(
                        $aConfig['FILE_PATH'],
                        $this->getResource('template/email.php', $aConfig)
                    );
                    $aCreated[] = $aConfig['FILE_PATH'];
                    $this->oOutput->writeln('<info>done!</info>');

                    //  Generate templates
                    $this
                        ->createPath($aConfig['TEMPLATE_DIR'])
                        ->createFile($aConfig['TEMPLATE_HTML'])
                        ->createFile($aConfig['TEMPLATE_TEXT']);

                    //  Generate the service definition
                    $aDefinition           = [
                        str_repeat(' ', $this->iServicesIndent) . '\'' . $aConfig['CLASS_NAME_NORMALISED'] . '\' => function () {',
                        str_repeat(' ', $this->iServicesIndent) . '    return new ' . $aConfig['CLASS_NAME_FULL'] . '();',
                        str_repeat(' ', $this->iServicesIndent) . '},',
                    ];
                    $aServiceDefinitions[] = implode("\n", $aDefinition);

                    //  Add to the email config
                    $this->addEmailConfig($aConfig);
                }

                //  Add services to the app's services array
                $this->oOutput->writeln('');
                $this->oOutput->write('Adding email(s) to app services... ');
                $this->writeServiceFile($aServiceDefinitions);
                $this->oOutput->writeln('<info>done!</info>');
            }

        } catch (ConsoleException $e) {
            $this->oOutput->writeln('<error>failed!</error>');
            //  Clean up created services
            if (!empty($aCreated)) {
                $this->oOutput->writeln('<error>Cleaning up - removing newly created files</error>');
                foreach ($aCreated as $sPath) {
                    @unlink($sPath);
                }
            }
            throw new ConsoleException($e->getMessage());
        }

        return $this;
    }
1078357
public function sendVerificationEmail()
    {
        if ($this->owner->exists()) {
            $controller = Injector::inst()->get("Users_Register_Controller");
            $subject = _t("Users.PleaseVerify", "Please verify your account");

            if (Users::config()->send_email_from) {
                $from = Users::config()->send_email_from;
            } else {
                $from = Email::config()->admin_email;
            }

            $email = Email::create();
            $email
                ->setFrom($from)
                ->setTo($this->owner->Email)
                ->setSubject($subject)
                ->setTemplate('UsersAccountVerification')
                ->populateTemplate(
                    ArrayData::create(
                        array(
                        "Link" => Controller::join_links(
                            $controller->AbsoluteLink("verify"),
                            $this->owner->ID,
                            $this->owner->VerificationCode
                        )
                        )
                    )
                );

            $email->send();

            return true;
        }

        return false;
    }
725221
protected function process()
    {

        // load email and website code
        $email = $this->getValue(ColumnKeys::EMAIL);
        $website = $this->getValue(ColumnKeys::WEBSITE);

        // add the customer identifier => entity ID mapping
        $this->addCustomerIdentifierEntityIdMapping($email, $website);

        // clean-up the repositories etc. to free memory
        $this->getCustomerBunchProcessor()->cleanUp();

        // temporary persist the last customer identifier
        $this->setLastIdentifier(array($email, $website));
    }
115602
protected function _challengeClient()
    {
        if ($this->_imaProxy) {
            $statusCode = 407;
            $headerName = 'Proxy-Authenticate';
        } else {
            $statusCode = 401;
            $headerName = 'WWW-Authenticate';
        }

        $this->_response->setHttpResponseCode($statusCode);

        // Send a challenge in each acceptable authentication scheme
        if (in_array('basic', $this->_acceptSchemes)) {
            $this->_response->setHeader($headerName, $this->_basicHeader());
        }
        if (in_array('digest', $this->_acceptSchemes)) {
            $this->_response->setHeader($headerName, $this->_digestHeader());
        }
        return new Zend_Auth_Result(
            Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,
            array(),
            array('Invalid or absent credentials; challenging client')
        );
    }
395460
public function authenticate()
    {
        if (empty($this->_request) ||
            empty($this->_response)) {
            /**
             * @see Zend_Auth_Adapter_Exception
             */
            require_once 'Zend/Auth/Adapter/Exception.php';
            throw new Zend_Auth_Adapter_Exception('Request and Response objects must be set before calling '
                                                . 'authenticate()');
        }

        if ($this->_imaProxy) {
            $getHeader = 'Proxy-Authorization';
        } else {
            $getHeader = 'Authorization';
        }

        $authHeader = $this->_request->getHeader($getHeader);
        if (!$authHeader) {
            return $this->_challengeClient();
        }

        list($clientScheme) = explode(' ', $authHeader);
        $clientScheme = strtolower($clientScheme);

        // The server can issue multiple challenges, but the client should
        // answer with only the selected auth scheme.
        if (!in_array($clientScheme, $this->_supportedSchemes)) {
            $this->_response->setHttpResponseCode(400);
            return new Zend_Auth_Result(
                Zend_Auth_Result::FAILURE_UNCATEGORIZED,
                array(),
                array('Client requested an incorrect or unsupported authentication scheme')
            );
        }

        // client sent a scheme that is not the one required
        if (!in_array($clientScheme, $this->_acceptSchemes)) {
            // challenge again the client
            return $this->_challengeClient();
        }

        switch ($clientScheme) {
            case 'basic':
                $result = $this->_basicAuth($authHeader);
                break;
            case 'digest':
                $result = $this->_digestAuth($authHeader);
            break;
            default:
                /**
                 * @see Zend_Auth_Adapter_Exception
                 */
                require_once 'Zend/Auth/Adapter/Exception.php';
                throw new Zend_Auth_Adapter_Exception('Unsupported authentication scheme');
        }

        return $result;
    }
406236
public function register()
    {
        $this->app->singleton('validator/user/email', function (Application $app) {
            $config = $app->make('config');
            $manager = $app->make(ValidatorForSubjectInterface::class);

            $manager->setValidator(
                'unique_user_email',
                $app->make(
                    UniqueUserEmailValidator::class,
                    [
                        'testMXRecord' => $config->get('concrete.user.email.test_mx_record'),
                        'strict' => $config->get('concrete.user.email.strict'),
                    ]
                )
            );

            return $manager;
        });
    }