3 class User
extends ActiveMongo
10 function password_filter(&$value, $old_value)
12 if (strlen($value) < 5) {
13 throw new ActiveMongo_FilterException("Password is too short");
15 $value = sha1($value);
18 function after_update($document)
20 if (isset($GLOBALS['debug'])) {
21 var_dump(array(get_class($this) => $document));
25 function username_filter($value, $old_value)
27 if ($old_value!=null && $value != $old_value) {
28 throw new ActiveMongo_FilterException("The username can't be changed");
31 if (!preg_match("/[a-z][a-z0-9\-\_]+/", $value)) {
32 throw new ActiveMongo_FilterException("The username is not valid");
35 if (strlen($value) < 5) {
36 throw new ActiveMongo_FilterException("Username too short");
41 function add_service(Service
$obj)
43 $this->services
[] = $obj;