<?php

class DefaultController extends Controller
{

    /**
     * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
     * using two-column layout. See 'protected/views/layouts/column2.php'.
     */
    public $layout = '//layouts/column2';

    /**
     * @return array action filters
     */
    public function filters()
    {
        return array(
            'accessControl', // perform access control for CRUD operations
        );
    }

    /**
     * Specifies the access control rules.
     * This method is used by the 'accessControl' filter.
     * @return array access control rules
     */
    public function accessRules()
    {
        return array(
            array('allow', // allow all users to perform 'index' and 'view' actions
                'actions' => array(
                    'index',
                    'create',
                    'update',
                    'delete',
                    'renderAjaxPreview',
                    'renderAssignAttributes',
                    'renderStatus',
                    'renderTranslationTags',
                    'ajaxSetAttributeSelection',
                    'startImport',
                    'ajaxGetNextPage'
                ),
                'expression' => AccessManager::checkSessionPermission($this->module->name),
            ),
            array("allow",
                "actions" => array(
                ),
                'users' => array('*'),
            ),
        );
    }

    /**
     * Lists all models.
     */
    public function actionIndex()
    {
        $model = LdapInterface::model();
        $this->render(
                'index', array(
            'model' => $model,
                )
        );
    }

    public function actionCreate()
    {
        $model = new LdapInterface('create');
        $this->getLdapServerCredentials($model);
    }

    public function actionUpdate($id)
    {
        $model = $this->loadModel($id);
        $this->getLdapServerCredentials($model);
    }

    private function getLdapServerCredentials($ldapInterface)
    {
        $this->performAjaxValidation($ldapInterface);
        if (isset($_REQUEST['LdapInterface'])) {
            $attributes = $_REQUEST['LdapInterface'];
            $this->updateInterfaceModel($ldapInterface, $attributes);
        }

        $this->renderView($ldapInterface);
    }

    /**
     * Performs the AJAX validation.
     * @param CModel the model to be validated
     */
    protected function performAjaxValidation($model)
    {
        if (isset($_POST['ajax']) && $_POST['ajax'] === 'ldap-import-form') {
            echo CActiveForm::validate($model);
            Yii::app()->end();
        }
    }

    private function updateInterfaceModel($ldapInterface, $attributes)
    {
        $this->setAddressScenario($attributes, $ldapInterface);
        $ldapInterface->attributes = $attributes;
        $this->setPreviewData($ldapInterface);
        if ($ldapInterface->save()) {
            $this->redirect($this->createUrl('renderAssignAttributes', array('id' => $ldapInterface->id)));
        }
    }

    private function setPreviewData($ldapInterface)
    {
        $this->removeOldPreviewAttributes($ldapInterface);
        $ldapConnector = new LdapConnecter();
        $ldapConnector->updateInterfacePreviewData($ldapInterface);
    }

    private function setAddressScenario($attributes, $ldapInterface)
    {
        if ($attributes['connectedModel'] == get_class(Addresses::model())) {
            $ldapInterface->scenario = get_class(Addresses::model());
        }
    }

    private function renderView($ldapInterface)
    {
        $this->render(
                'view', array(
            'model' => $ldapInterface,
            'availableAddressBooks' => $this->getAvailableAddressBooks()
                )
        );
    }

    private function getAvailableAddressBooks()
    {
        $user = $this->getUserInstance();
        $addressBooks = $user->getAddressbooks('write');
        return $this->createAvailableAddressBooksList($addressBooks);
    }

    private function getUserInstance()
    {
        $user = app()->user->sudoUserInstance;
        if (!$user) {
            app()->user->logout();
            app()->user->loginRequired();
        }
        return $user;
    }

    private function createAvailableAddressBooksList($addressBooks)
    {
        $addressBookList = $this->createAddressBookListTemplate();
        $keys = array_keys($addressBookList);
        foreach ($addressBooks as $book) {
            if (isset($keys[$book->type])) {
                $addressBookType = $keys[$book->type];
                $addressBookList[$addressBookType][$book->id] = $book->title;
            }
        }
        return $this->sortList($addressBookList, $keys);
    }

    private function createAddressBookListTemplate()
    {
        $keyPrivate = __('ADDRESSBOOK_MODEL_TYPE_PRIVATE');
        $keyGroup = __('ADDRESSBOOK_MODEL_TYPE_GROUP');
        return array(
            "" => __('ADMIN_LDAP_INTERFACE_LDAP_DEFAULT_ADDRESSBOOK_VALUE'),
            $keyPrivate => array(),
            $keyGroup => array()
        );
    }

    public function actionRenderAssignAttributes($id)
    {
        $ldapInterface = $this->loadModel($id);
        $offset = 0;
        $this->render(
                'assignAttributes', array(
            'id' => $id,
            'connectedModel' => $ldapInterface->connectedModel,
            'dataProvider' => $this->getAssignmentDataProvider($ldapInterface, $offset),
            'returnUrl' => url('adminLdapInterface/default/update', array('id' => $id)),
            'offset' => $offset
        ));
    }

    public function getAssignmentDataProvider($ldapInterface, $offset)
    {
        $ldapData = json_decode($ldapInterface->ldapData, true);
        $keys = json_decode($ldapInterface->ldapKeys, true);
        $regEx = json_decode($ldapInterface->regEx, true);


        $data = array();
        foreach ($keys as $id => $key) {
            $data[$id] = array(
                'serverAttributes' => $key,
                'model' => $ldapInterface->connectedModel,
                'id' => 'LDAP_' . $id,
                'offset' => $offset,
                'selectedItems' => $this->getSelectedItem($ldapInterface, $key),
                'regEx' => isset($regEx[$key]) ? $regEx[$key] : array("", ""),
                'example_0' => $this->getRowData($ldapData, $key, $offset),
                'example_1' => $this->getRowData($ldapData, $key, $offset + 1),
            );
        }

        $dataProvider = new CArrayDataProvider($data, array(
            'pagination' => false
        ));

        return $dataProvider;
    }

    private function getSelectedItem($ldapInterface, $key)
    {
        $selectedItem = "default";
        if (!empty($ldapInterface->selectedItems)) {
            $selectedItems = array_flip(json_decode($ldapInterface->selectedItems, true));
            if (isset($selectedItems[$key])) {
                $selectedItem = $selectedItems[$key];
                if ($ldapInterface->connectedModel == get_class(User::model())) {
                    $attributes = array_merge($this->createUserAttributesArray(), $this->getInternAddressAttributes());
                }
                if ($ldapInterface->connectedModel == get_class(Addresses::model())) {
                    $attributes = $this->createAddressesAttributesArray();
                }
                if (!empty($attributes) && array_key_exists($selectedItems[$key], $attributes)) {
                    $selectedItem = $selectedItems[$key];
                }
            }
        }
        return $selectedItem;
    }

    public function actionAjaxGetNextPage()
    {
        $ldapInterface = $this->loadModel($_POST['modelID']);
        $ldapData = json_decode($ldapInterface->ldapData, true);
        $page = (int) $_POST['page'];
        if ($page < 0) {
            $page = 0;
        }

        if ($page + 2 > count($ldapData)) {
            $page = count($ldapData) - 2;
        }

        $keys = json_decode($ldapInterface->ldapKeys, true);
        $result = array(
            'currentPage' => $page,
            'columns' => $this->getContactDataForNextPage($ldapData, $keys, $page),
            'nextPage' => $page + 2
        );

        echo json_encode($result);
        Yii::app()->end();
    }

    private function getContactDataForNextPage($ldapData, $keys, $page)
    {
        $data = array();
        foreach ($keys as $id => $key) {
            $data[0][$id] = $this->getRowData($ldapData, $key, $page);
            $data[1][$id] = $this->getRowData($ldapData, $key, $page + 1);
        }
        return $data;
    }

    private function getRowData($ldapData, $key, $id)
    {
        if (array_key_exists($id, $ldapData) && array_key_exists($key, $ldapData[$id])) {
            return is_array($ldapData[$id][$key]) ? implode(", ", $ldapData[$id][$key]) : $ldapData[$id][$key];
        }
        return "";
    }

    public function renderAttributesDropdown($data, $row)
    {

        $this->renderPartial(
                'attributesDropdown', array(
            'id' => $data['id'],
            'model' => $data['model'],
            'defaultValue' => $data['selectedItems'],
            'row' => $row,
            'dropdownOptions' => $this->getConnectedModelAttributes($data['model'])
                )
        );
    }

    public function renderRegExField($data, $row)
    {
        $this->renderPartial(
                '_regexField', array(
            'row' => $row,
            'data' => $data
                )
        );
    }

    private function getConnectedModelAttributes($modelType)
    {
        $keyUser = __('ADMIN_LDAP_INTERFACE_USER_MODEL');
        $keyAddress = __('ADMIN_LDAP_INTERFACE_ADDRESSES_MODEL');
        $dropdownList = array(
            "default" => __('ADMIN_LDAP_INTERFACE_LDAP_DEFAULT_DROPDOWN_VALUE'),
            "ldapId" => __('ADMIN_LDAP_INTERFACE_LDAP_ID')
        );
        if ($modelType == get_class(User::model())) {
            $dropdownList[$keyUser] = $this->createUserAttributesArray();
            $dropdownList[$keyAddress] = $this->getInternAddressAttributes();
        }
        if ($modelType == get_class(Addresses::model())) {
            $dropdownList[$keyAddress] = $this->createAddressesAttributesArray();
        }
        return $this->sortList($dropdownList, array_keys($dropdownList));
    }

    private function sortList($list, $keys)
    {
        foreach ($keys as $key) {
            if (!empty($list[$key])) {
                if (is_array($list[$key])) {
                    natcasesort($list[$key]);
                }
            } else {
                unset($list[$key]);
            }
        }
        return $list;
    }

    private function createUserAttributesArray()
    {
        $userModel = new User();
        $attributes = $this->getUserAttributes();
        return $this->addModelAttributes($attributes, $userModel);
    }

    private function getUserAttributes()
    {
        return array('extension', 'name', 'firstname', 'lastname', 'email', 'group');
    }

    private function getInternAddressAttributes()
    {
        $addressesAttributes = $this->createAddressesAttributesArray();
        $removeAttributes = array('n_family', 'n_given', 'contact_email', 'tel_work');
        foreach ($removeAttributes as $attribute) {
            unset($addressesAttributes[$attribute]);
        }
        return $addressesAttributes;
    }

    private function createAddressesAttributesArray()
    {
        $addressesModel = new Addresses();
        $attributes = $this->getAddressesAttributes();
        return $this->addModelAttributes($attributes, $addressesModel);
    }

    private function getAddressesAttributes()
    {
        return array('n_family', 'n_given', 'n_middle', 'n_prefix', 'n_suffix', 'org_name',
            'org_unit', 'contact_email', 'contact_email_home', 'adr_one_street', 'adr_one_locality',
            'adr_one_postalcode', 'adr_one_countryname', 'tel_cell_private', 'tel_cell', 'tel_work', 'tel_home',
            'tel_fax_home', 'tel_fax', 'twitter_profile_url', 'linkedin_profile_url', 'facebook_profile_url',
            'contact_note', 'contact_url_home', 'contact_url', 'contact_role'
        );
    }

    private function addModelAttributes($attributes, $model)
    {
        $dropdownElementes = array();
        foreach ($attributes as $attribute) {
            $dropdownElementes[$attribute] = $model->getAttributeLabel($attribute);
        }

        return $dropdownElementes;
    }

    public function actionAjaxSetAttributeSelection()
    {
        if (isset($_POST['modelID']) && isset($_POST['selectedItems'])) {
            $ldapInterface = $this->loadModel($_POST['modelID']);
            $ldapInterface->selectedItems = json_encode($_POST['selectedItems']);
            $ldapInterface->regEx = isset($_POST['regexItems']) ? json_encode($_POST['regexItems']) : "";

            if (!$ldapInterface->save()) {
                Log::e(json_encode($ldapInterface->errors), 'LDAP Interface');
            }
            Yii::app()->end();
        }
    }

    public function actionAjaxRenderPreview($id)
    {
        $ldapInterface = $this->loadModel($id);
        $previewCreator = LdapPreviewFactory::generateImporterOfType($ldapInterface);
        $this->render(
                'preview', array(
            'id' => $id,
            'columnAttributes' => $this->getModelSpecificColumns($ldapInterface->connectedModel),
            'dataProvider' => $previewCreator->getPreviewDataProvider($ldapInterface),
            'returnUrl' => url('adminLdapInterface/default/RenderAssignAttributes', array('id' => $id)),
        ));
    }

    private function getModelSpecificColumns($type)
    {
        $model = new $type();
        $columnAttributes = array();
        $columns = $this->getColumAttributes($type);
        foreach ($columns as $attribute) {
            $columnAttributes[$attribute] = $model->getAttributeLabel($attribute);
        }

        return $columnAttributes;
    }

    private function getColumAttributes($type)
    {
        $userAttributes = $this->getUserAttributes();
        array_push($userAttributes, "group");
        $attributes = array(
            'User' => $userAttributes,
            'Addresses' => array(
                'n_given', 'n_middle', 'n_family', 'tel_work', 'contact_email',
                'adr_one_street', 'adr_one_postalcode', 'adr_one_locality', 'adr_one_countryname'
            )
        );
        return $attributes[$type];
    }

    public function renderPreviewTable($columnAttributes)
    {
        $columns = $this->addStatusColumn();
        foreach ($columnAttributes as $name => $translationTag) {
            $columns[] = array(
                'name' => $name,
                'header' => $translationTag,
                'type' => 'raw',
                'headerHtmlOptions' => array(
                    'data-translation-id' => $translationTag
                ),
            );
        }
        return $columns;
    }

    private function addStatusColumn()
    {
        return [
                [
                'value' => array($this, 'renderStatus'),
                'name' => 'status',
                'header' => __('ADMIN_LDAP_INTERFACE_PREVIEW_STATUS'),
                'type' => 'raw',
                'headerHtmlOptions' => [
                    'style' => 'width: 75px',
                    'data-translation-id' => 'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS'
                ],
            ],
                [
                'name' => 'errors',
                'header' => __('ADMIN_LDAP_INTERFACE_MODEL_ERRORS'),
                'type' => 'raw',
                'headerHtmlOptions' => [
                    'style' => 'width: 250px',
                    'data-translation-id' => 'ADMIN_LDAP_INTERFACE_MODEL_ERRORS'
                ],
            ]
        ];
    }

    public function renderStatus($data, $row, $column)
    {
        $this->renderPartial(
                '_status', array(
            'data' => $data,
            'row' => $row,
            'column' => $column
                )
        );
    }

    public function getLableType($status)
    {
        switch ($status) {
            case ($status == 'created'):
                return 'success';
            case ($status == 'updated'):
                return 'info';
            case ($status == 'invalid'):
                return 'warning';
            case ($status == 'deleted'):
                return 'important';
        }
    }

    public function getHumanReadableStatus($status)
    {
        switch ($status) {
            case ($status == 'created'):
                return __('ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_CREATED');
            case ($status == 'updated'):
                return __('ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_UPDATED');
            case ($status == 'upToDate'):
                return __('ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_UP_TO_DATE');
            case ($status == 'invalid'):
                return __('ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_INVALID');
            case ($status == 'deleted'):
                return __('ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_DELETED');
        }
    }

    public function actionAjaxImport($id)
    {
        $ldapInterface = $this->loadModel($id);
        $this->removeOldPreviewAttributes($ldapInterface);
        $ldapInterface->scenario = '';
        if ($ldapInterface->save()) {
            $this->createImportJob($ldapInterface->id);
        } else {
            Log::e(json_encode($ldapInterface->errors), 'LDAP Interface');
        }
        Yii::app()->end();
    }

    private function removeOldPreviewAttributes($ldapInterface)
    {
        $attributes = array('ldapData', 'ldapKeys', 'connected', 'positivSearchResult');
        foreach ($attributes as $attribute) {
            $ldapInterface->$attribute = '';
        }
    }

    /**
     * Deletes a particular model.
     * If deletion is successful, the browser will be redirected to the 'admin' page.
     * @param integer $id the ID of the model to be deleted
     */
    public function actionDelete($id)
    {
        if (Yii::app()->request->isPostRequest) {
            //we only allow deletion via POST request
            $this->loadModel($id)->delete();
            //if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
            if (!isset($_GET['ajax'])) {
                $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));
            }
        } else {
            throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
        }
    }

    public function actionStartImport($id)
    {
        $this->createImportJob($id);
        $this->redirect(url('adminLdapInterface/default/index'));
    }

    private function createImportJob($ldapInterfceId)
    {
        if (!$this->hasRunningJob($ldapInterfceId)) {
            $job = new Job();
            $this->setJobAttributes($job, $ldapInterfceId);
            if (!$job->save()) {
                $this->createJobErrorLogMessage($job);
            }
        }
    }

    private function setJobAttributes($job, $ldapInterfceId)
    {
        $job->type = Job::LDAPImport;
        $job->progress = 1;
        $job->meta = json_encode(array('LdapInterfaceId' => $ldapInterfceId));
        $job->status = Job::Inserted;
    }

    private function hasRunningJob($ldapInterfaceId)
    {
        $ldapMeta = json_encode(array('LdapInterfaceId' => $ldapInterfaceId));
        $jobs = Job::model()->findAllByAttributes(array('type' => Job::LDAPImport, 'meta' => $ldapMeta));
        if (empty($jobs)) {
            Log::d("Creating Job for LDAP-Interface ID: $ldapInterfaceId", "LdapInterface");
            return false;
        } else {
            Log::d("Job for LDAP-Interface ID: $ldapInterfaceId is already running.", "LdapInterface");
            return true;
        }
    }

    private function createJobErrorLogMessage($job)
    {
        Log::e("An error has occurred in Job:  ID $job->id", 'LdapInterface');
        Log::e("User-ID: $job->user_id", 'LdapInterface');
        Log::e('Status: ' . $job->status, 'LdapInterface');
        Log::e('Error Text : ' . json_encode($job->errors), 'LdapInterface');
    }

    /**
     * Returns the data model based on the primary key given in the GET variable.
     * If the data model is not found, an HTTP exception will be raised.
     * @param integer the ID of the model to be loaded
     */
    public function loadModel($id)
    {
        $model = LdapInterface::model()->findByPk($id);
        if ($model === null) {
            throw new CHttpException(404, 'The requested model does not exist.');
        }
        return $model;
    }

    public function createTranslationModeBtn()
    {
        $button = array();
        if (app()->user->translateMode) {
            $button = array(
                'label' => __('ADMIN_LDAP_INTERFACE_NAVBAR_TRANSLATION'),
                'url' => $this->createUrl('renderTranslationTags'),
                'position' => 'right',
                'icon' => 'book',
                'linkOptions' => array(
                    'id' => 'translateModeBtn',
                    'data-translation-id' => 'ADMIN_LDAP_INTERFACE_NAVBAR_TRANSLATION'
                )
            );
        }
        return $button;
    }

    public function actionRenderTranslationTags()
    {
        $this->render(
                'translateMode', array(
            'dataProvider' => $this->getTranslationTagsDataProvider(),
            'returnUrl' => $this->createUrl('index'),
        ));
    }

    private function getTranslationTagsDataProvider()
    {
        $translationTags = $this->getTranslationTags();

        $data = array();
        $id = 0;
        foreach ($translationTags as $tag) {
            $data[$id]['id'] = 'translationTags_' . $id;
            $data[$id]['translationTags'] = $tag;
            $data[$id]['content'] = "<i data-translation-target=$tag data-translation-id=$tag >" . __($tag) . "</i>";
            $id++;
        }

        $dataProvider = new CArrayDataProvider($data, array(
            'pagination' => false
        ));
        return $dataProvider;
    }

    private function getTranslationTags()
    {
        return array(
            'TRANSLATE_MODE',
            'TRANSLATE_MODE_TRANSLATION_TAG',
            'TRANSLATE_MODE_TRANSLATION_TAG_ENTRY',
            'ADMIN_LDAP_INTERFACE_MODEL_ATTRIBUTES',
            'ADMIN_LDAP_INTERFACE_MODEL_HEADER_CREATE',
            'ADMIN_LDAP_INTERFACE_MODEL_HEADER_UPDATE',
            'ADMIN_LDAP_INTERFACE_ERROR_INVALID_USER_PWD',
            'ADMIN_LDAP_INTERFACE_ERROR_SERVER_BIND',
            'ADMIN_LDAP_INTERFACE_ERROR_SERVER_FILTER',
            'ADMIN_LDAP_INTERFACE_DIALOGE_MISSING_ARGUMENTS',
            'ADMIN_LDAP_INTERFACE_DIALOGE_NO_EXTENSION',
            'ADMIN_LDAP_INTERFACE_DIALOGE_NO_USERNAME',
            'ADMIN_LDAP_INTERFACE_DIALOGE_NO_GIVEN_OR_FAMILYNAME',
            'ADMIN_LDAP_INTERFACE_DIALOGE_NO_LDAP_ID',
            'ADMIN_LDAP_INTERFACE_DIALOGE_HEADER',
            'ADMIN_LDAP_INTERFACE_NAVBAR_TRANSLATION',
            'ADMIN_LDAP_INTERFACE_SECTION_TITLE',
            'ADMIN_LDAP_INTERFACE_SECTION_DESCRIPTION',
            'ADMIN_LDAP_INTERFACE_ADD_BTN',
            'ADMIN_LDAP_INTERFACE_SERVER',
            'ADMIN_LDAP_INTERFACE_BASE_DN',
            'ADMIN_LDAP_INTERFACE_USERNAME',
            'ADMIN_LDAP_INTERFACE_PASSWORD',
            'ADMIN_LDAP_INTERFACE_FILTER',
            'ADMIN_LDAP_INTERFACE_IMPORT_DATA',
            'ADMIN_LDAP_INTERFACE_CONNECTED_MODEL',
            'ADMIN_LDAP_INTERFACE_USER_MODEL',
            'ADMIN_LDAP_INTERFACE_ADDRESSES_MODEL',
            'ADMIN_LDAP_INTERFACE_PREVIEW_BTN',
            'ADMIN_LDAP_INTERFACE_SELECT_ATTRIBUTES_BTN',
            'ADMIN_LDAP_INTERFACE_LDAP_DEFAULT_DROPDOWN_VALUE',
            'ADMIN_LDAP_INTERFACE_ADDRESS_BOOK_ID',
            'ADMIN_LDAP_INTERFACE_LDAP_DEFAULT_ADDRESSBOOK_VALUE',
            'ADMIN_LDAP_INTERFACE_PREVIOUS_BTN',
            'ADMIN_LDAP_INTERFACE_IMPORT_BTN',
            'ADMIN_LDAP_INTERFACE_NEXT_BTN',
            'ADMIN_LDAP_INTERFACE_ATTRIBUTES',
            'ADMIN_LDAP_INTERFACE_EXAMPLE',
            'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS',
            'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_CREATED',
            'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_UPDATED',
            'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_INVALID',
            'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_DELETED',
            'ADMIN_LDAP_INTERFACE_PREVIEW_STATUS_UP_TO_DATE',
            'ADMIN_LDAP_INTERFACE_PREVIEW_HIDE_CREATED',
            'ADMIN_LDAP_INTERFACE_PREVIEW_HIDE_UPDATED',
            'ADMIN_LDAP_INTERFACE_PREVIEW_HIDE_UP_TO_DATE',
            'ADMIN_LDAP_INTERFACE_PREVIEW_HIDE_INVALID',
            'ADMIN_LDAP_INTERFACE_PREVIEW_HIDE_DELETED',
            'ADMIN_LDAP_INTERFACE_LDAP_CRON_JOB_ENABLED',
            'ADMIN_LDAP_INTERFACE_LDAP_CRON_RULE',
            'JOB_TYPE_LDAP_IMPORT',
            'USER_TYPE_LDAP_IMPORT',
            'USER_MODEL_LDAP_ID',
            'USER_MODEL_LDAP_INTERFACE',
            'USER_TYPE_UNDEFINED',
            'ADDRESS_SOURCE_TYPE_LDAP',
            'ADMIN_LDAP_INTERFACE_FILTER_CHANGED_MESSAGE',
            'ADMIN_LDAP_INTERFACE_FILTER_DIALOGE_HEADER',
            'GLOBAL_CONTINUE_BUTTON',
            'ADDRESSESS_MODEL_LDAP_ID',
            'ADDRESSESS_MODEL_LDAP_INTERFACE',
            'ADMIN_LDAP_INTERFACE_REGEX_PLACEHOLDER',
            'ADMIN_LDAP_INTERFACE_REGEX',
            'USER_LDAP_INTERFACE'
        );
    }
}
