且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何扩展kohana用户身份验证模块

更新时间:2023-12-05 22:06:34

只需在 application/classes/model 文件夹下创建 user.php 文件,并将其放入: /p>

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
   }
}

检查寄存器功能后,这里是其他字段的位置(第22-27行):

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',
                        ));

当然,您的表中必须存在other_fieldother_field2.

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