03.03
php
saved
ullumski
Note
This is my usermodel - i am trying to find out how to hash password AFTER validation (because, if validation fails - i dont want the hash sent back to the form). My (not working) approach ist commente out.
This is my usermodel - i am trying to find out how to hash password AFTER validation (because, if validation fails - i dont want the hash sent back to the form). My (not working) approach ist commente out.
- <?php
- class User extends AppModel {
- var $name = 'User';
- 'myuser'=>array(
- 'required' => true,
- 'message' => 'Nur Buchstaben und Zahlen erlaubt'
- ),
- 'message' => 'Benutzername muss zwischen 5 und 15 Zeichen haben'
- ),
- 'message' => 'Benutzername leider schon vergeben',
- 'last' => 'true'
- )
- ),
- 'message' => 'Passwort muss mindestens 6 Zeichen haben'
- ),
- 'message' => 'Passwort wiederholen muss mindestens 6 Zeichen haben'
- ),
- 'message' => 'Passwörter stimmen nicht überein',
- 'last' => 'true'
- )
- ),
- 'message' => 'E-Mail ist ein Pflichtfeld'
- )
- );
- // THIS DOES NOT WORK AN RESULTS IN NOT SAVING THE NEW USER
- // function beforeSave(){
- // $this->data[$this->name]['passwort'] = md5($this->data[$this->name]['passwort']);
- // }
- function myMatchPasswords($check, $fieldName){
- return ($check['passwort2'] == $this->data[$this->name][$fieldName]);
- }
- //The Associations below have been created with all possible keys, those that are not needed can be removed
- 'foreignKey' => 'user_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- )
- );
- }
- ?>
Parsed in 0.167 seconds, using GeSHi 1.0.7.14