自定义 CodeIgniter 的 Tank_Auth 表字段名称

发布于 2024-12-09 20:31:46 字数 692 浏览 1 评论 0原文

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

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

上述指定的字段名称更改是在libraries\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“用户”表字段名称的明确文档?

我被这些错误消息困扰,因​​为我不知道在 Tank_auth 中还有哪些字段名称需要更改。

任何帮助表示赞赏。

I am a beginner learning codeigniter to build a website. For authentication feature, i use tank_auth library and it works fine if I dont alter the tank_auth table field names.

Then, to combine the tank_auth's 'users' table with my existing 'users_info' table, I modified the field names 'new_email_key' and 'username' as NewEmailKey and UserName respectively.

The above specified field name changes were done in libraries\Tank_auth.php, models\tank_auth\users.php and controllers\auth.php files.

In the database, the submitted data are stored right in the table. But in the activation email received, i am getting the following errors:

Message: Undefined variable: username

Filename: email/activate-html.php

Message: Undefined variable: new_email_key

Filename: email/activate-html.php

Is it safe to use the tank_auth table field names as it is in our CI projects?

Is there any clear documentation written on how to customize and use the tank_auth 'users' table field names?

I am stuck with these error messages as i dont figure out where else the field names need to be altered in tank_auth.

Any help appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉城 2024-12-16 20:31:46

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

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

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

mail_function_name($data)

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

我不相信有 Tank_Auth 修改文档,因为 PHP 非常直接,并且注释得很好,如果您遇到问题,则意味着您不理解代码,而错误在于您理解内容的能力是在代码中完成的,而不是在 TankAuth 的文档中完成的。文档并不能真正拯救你。

了解错误是什么(即未定义的变量)并尝试一一修复它们。

These errors you are listing are simple "undefined variable" errors, like it says, I'm not sure what is confusing here.

Have you looked at the mailing function? Or googled the error meaning? Tank Auth's mail uses an array for sending mail.

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

mail_function_name($data)

that data is passed to the mail function which uses the /email/activate-html.php view/template.

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.

挽手叙旧 2024-12-16 20:31:46

由于 Tank_auth 的文档似乎没有提及这方面的配置设置,
发送此类错误消息是意外的,可能会被视为错误。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文