protected function addUserLogin(\Gems_Model_JoinModel $model, $loginField, $organizationField)
    {
        $model->addTable(
                'gems__user_logins',
                array($loginField => 'gul_login', $organizationField => 'gul_id_organization'),
                'gul',
                \MUtil_Model_DatabaseModelAbstract::SAVE_MODE_INSERT |
                \MUtil_Model_DatabaseModelAbstract::SAVE_MODE_UPDATE |
                \MUtil_Model_DatabaseModelAbstract::SAVE_MODE_DELETE
                );

        if ($model->has('gul_enable_2factor') && $model->has('gul_two_factor_key')) {
            $model->addColumn(
                    new \Zend_Db_Expr("CASE
                        WHEN gul_enable_2factor IS NULL THEN -1
                        WHEN gul_enable_2factor = 1 AND gul_two_factor_key IS NULL THEN 1
                        WHEN gul_enable_2factor = 1 AND gul_two_factor_key IS NOT NULL THEN 2
                        ELSE 0 END"),
                    'has_2factor'
                    );
        }
    }