自定义 CodeIgniter 的 Tank_Auth 表字段名称
我是一名初学者,正在学习 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您列出的这些错误是简单的“未定义变量”错误,就像它所说的那样,我不确定这里有什么令人困惑的。
你看过邮件功能吗?或者用谷歌搜索错误的含义? Tank Auth 的邮件使用数组来发送邮件。
该数据被传递到使用 /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.
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.
由于
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.