开发者

Customizing Tank_Auth table field names for CodeIgniter

开发者 https://www.devze.com 2023-04-13 01:04 出处:网络
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.

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: ema开发者_Python百科il/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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号