how to extend kohana user auth module

一个人想着一个人 提交于 2019-12-06 14:58:23

Just create user.php file under application/classes/model folder and put this inside:

<?php

defined('SYSPATH') or die('No direct access allowed.');

class Model_User extends Model_Auth_User
{
   public function create_user($values, $expected)
   {
      // Your definition of the function
   }
}

After checking the register function, here is the place for other fields (line 22-27):

$user->create_user($fields, array(
                                'username',
                                'password',
                                'email',
                                'user_type',
                                'other field',
                                'other field2',
                        ));

Of course you'll need to have other_field and other_field2 exist in your table.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!