1

我是一个初学者学习codeigniter来建立一个网站。对于身份验证功能,我使用 tank_auth 库,如果我不更改 tank_auth 表字段名称,它可以正常工作。

然后,为了将 tank_auth 的 'users' 表与我现有的 'users_info' 表结合起来,我将字段名称 'new_email_key' 和 'username' 分别修改为 NewEmailKey 和 UserName。

上述指定的字段名称更改是在 library\Tank_auth.php、models\tank_auth\users.php 和 controllers\auth.php 文件中完成的。

在数据库中,提交的数据直接存储在表中。但在收到的激活电子邮件中,我收到以下错误:

消息:未定义变量:用户名

文件名:email/activate-html.php

消息:未定义变量:new_email_key

文件名:email/activate-html.php

在我们的 CI 项目中使用 tank_auth 表字段名称是否安全?

是否有任何关于如何自定义和使用 tank_auth 'users' 表字段名称的明确文档?

我被这些错误消息困住了,因为我不知道在 tank_auth 中还需要在哪里更改字段名称。

任何帮助表示赞赏。

4

2 回答 2

0

您列出的这些错误是简单的“未定义变量”错误,就像它说的那样,我不确定这里有什么令人困惑的地方。

你看过邮件功能吗?或者用谷歌搜索错误的含义?Tank Auth 的邮件使用一个数组来发送邮件。

$data['username'] = "Bob";
$data['new_email_key'] = "1249ufasiojlk215ifasdy243jhaslkjhasjkghasd";

mail_function_name($data)

该数据被传递给使用 /email/activate-html.php 视图/模板的邮件功能。

I don't believe there is Tank_Auth modification documentation as the PHP is VERY straight forward, and well commented, if you are having trouble with it, it means you don't understand the code, and the fault lies in your ability to understand WHAT is being done in the code, not in the documentation of TankAuth. Documentation won't really save you here.

Learn what the errors are (ie, undefined variable) and try to fix them one by one.

于 2011-10-14T14:19:09.543 回答
0

Since Tank_auth's documentation does not seem to mention config setting for this, sending such an error message is unexpected and may be taken as a bug.

于 2012-09-07T14:02:31.737 回答