Ergebnis 1 bis 2 von 2

Thema: Mitgliedernamen Zeichen beschränken

  1. #1
    Contao-Nutzer
    Registriert seit
    27.03.2011.
    Beiträge
    42

    Standard Mitgliedernamen Zeichen beschränken

    Hallo,

    Ich möchte das bei der Registrierung über das Contao Standard Registrierungsformular bei Username nur bestimmte Zeichenverwendet werden können.
    (Buchstaben und Zahlen, keine Sonderzeichen)

    Wie setzt man das am besten um? In die PHP Dateien eingreifen? oder geht das auch einfacher?

    gruß Nehes

  2. #2
    Contao-Nutzer
    Registriert seit
    24.06.2009.
    Beiträge
    165

    Standard

    Hi nehes

    Am Beispiel company:

    PHP-Code:
    $GLOBALS['TL_DCA']['tl_member']['tl_fields']['tl_company']['eval']['rgxp'] = 'alnum'
    Du musst das entsprechende Feld (also statt tl_company das was du geändert haben willst) raussuchen und dann diese Codezeile in der /system/config/dcaconfig.php updatesicher reinkopieren!

    Also müsste deine dcaconfig-Datei dann so aussehen:

    PHP-Code:
    <?php if (!defined('TL_ROOT')) die('You can not access this file directly!');

    /**
     * Contao Open Source CMS
     * Copyright (C) 2005-2010 Leo Feyer
     *
     * Formerly known as TYPOlight Open Source CMS.
     *
     * This program is free software: you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation, either
     * version 3 of the License, or (at your option) any later version.
     * 
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     * Lesser General Public License for more details.
     * 
     * You should have received a copy of the GNU Lesser General Public
     * License along with this program. If not, please visit the Free
     * Software Foundation website at <http://www.gnu.org/licenses/>.
     *
     * PHP version 5
     * @copyright  Leo Feyer 2005-2010
     * @author     Leo Feyer <http://www.contao.org>
     * @package    Config
     * @license    LGPL
     * @filesource
     */


    /**
     * -------------------------------------------------------------------------
     * DATA CONTAINER SETTINGS
     * -------------------------------------------------------------------------
     *
     * If you want to modify a data container file, you do not have to edit it
     * directly. You can save your changes in this configuration file instead.
     * Thus, you can update or replace the original files without having to
     * worry about your modifications.
     * 
     * Usage example:
     * 
     *   $GLOBALS['TL_DCA']['tl_article']['config']['doNotCopyRecords'] = true;
     * 
     * This line would prevent articles from being duplicated when you duplicate
     * a page in module site structure.
     */

    $GLOBALS['TL_DCA']['tl_member']['tl_fields']['tl_company']['eval']['rgxp'] = 'alnum';


    ?>

    Dementsprechend müsstest du für jedes Mitgliederfeld dann eine weitere Zeile mit dem entsprechenden Mitgliederfeld einfügen... Das müsste dann klappen. Hoffe dir geholfen zu haben
    Geändert von murphyslaw (28.06.2011 um 21:08 Uhr)

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •