public static function create(array $params = array()) { $password = $params['password']; $params['password'] = ''; $user_id = parent::create($params); $password_hash = \lib\token::generate($password, $user_id, 0, 0); parent::update(array('id' => $user_id, 'password' => $password_hash)); // send out email to user $time = time(); $token = \lib\token::generate('createuser', $params['email'], $time, 0); $domain = \lib\conf\constants::$domain; $url = "http://{$domain}/#/confirmuser/{$token}/{$time}/{$params['email']}"; \lib\mail::send('*****@*****.**', 'nobody', array($params['email']), 'Please confirm your email', $url); }