khanat-opennel-code/code/web/public_php/webtt/app/models/user.php

89 lines
2.3 KiB
PHP
Raw Normal View History

<?php
2011-08-21 00:54:22 +00:00
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class User extends AppModel {
var $name = 'User';
var $displayField = 'name';
2011-07-14 14:49:25 +00:00
2011-08-21 00:54:22 +00:00
var $actsAs = array('Null' => array('confirm_hash'));
var $recursive = 0;
2011-07-14 14:49:25 +00:00
var $validate = array(
'username' => array(
'alphaNumeric',
2011-08-21 00:54:22 +00:00
'uniqueCheck' => array(
2011-07-14 14:49:25 +00:00
'rule' => 'isUnique',
'message' => 'That username has already been taken.',
2011-08-21 00:54:22 +00:00
),
2011-07-14 14:49:25 +00:00
),
'email' => array('rule' => 'email', 'message' => 'Wrong format'),
'name' => array('rule' => 'notEmpty'),
// 'password' => array('rule' => 'notEmpty'),
'passwd' => array('rule' => 'notEmpty'),
);
var $scaffoldForbiddenActions = array("add", "edit", "delete");
2011-08-21 00:54:22 +00:00
var $scaffoldForbiddenFields = array("" => array("activated","password","confirm_hash","created","modified"),/* "admin_" => array("password")*/);
var $hasMany = array(
'Translation' => array(
'className' => 'Translation',
'foreignKey' => 'user_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
'Vote' => array(
'className' => 'Vote',
'foreignKey' => 'user_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
2011-08-21 00:54:22 +00:00
),
'Comment' => array(
'className' => 'Comment',
'foreignKey' => 'user_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
);
}