douwan4993 2013-05-29 17:10
浏览 35

在ion_auth配置文件中,“加入”意味着什么

I had Ion_auth working perfectly but then changed the table names:

$config['tables']['users']           = 'users_1';
$config['tables']['groups']          = 'groups_1';
$config['tables']['users_groups']    = 'users_groups_1';
$config['tables']['login_attempts']  = 'login_attempts_1';

Its now not working when I try to sign someone up. I'm getting the following error:

Fatal error: Call to a member function clear() on a non-object in ....application\libraries\Ion_auth.php on line 353

I suspect it has something to do with the following from the ion_auth config file:

/*
 | Users table column and Group table column you want to join WITH.
 |
 | Joins from users.id
 | Joins from groups.id
 */

$config['join']['users']  = 'user_id';
$config['join']['groups'] = 'group_id';

Can someone explain how to set these 2 fields?

update: here is the ion_auth register function:

public function register($username, $password, $email, $additional_data = array(),     $group_name = array()) //need to test email activation
{
    $this->ion_auth_model->trigger_events('pre_account_creation');

    $email_activation = $this->config->item('email_activation', 'ion_auth');

    if (!$email_activation)
    {
        $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_name);
        if ($id !== FALSE)
        {
            $this->set_message('account_creation_successful');
            $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful'));
            return $id;
        }
        else
        {
            $this->set_error('account_creation_unsuccessful');
            $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful'));
            return FALSE;
        }
    }
    else
    {
        $id = $this->ion_auth_model->register($username, $password, $email, $additional_data, $group_name);

        if (!$id)
        {
            $this->set_error('account_creation_unsuccessful');
            return FALSE;
        }

        $deactivate = $this->ion_auth_model->deactivate($id);

        if (!$deactivate)
        {
            $this->set_error('deactivate_unsuccessful');
            $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful'));
            return FALSE;
        }

        $activation_code = $this->ion_auth_model->activation_code;
        $identity        = $this->config->item('identity', 'ion_auth');
        $user            = $this->ion_auth_model->user($id)->row();

        $data = array(
            'identity'   => $user->{$identity},
            'id'         => $user->id,
            'email'      => $email,
            'activation' => $activation_code,
        );
        if(!$this->config->item('use_ci_email', 'ion_auth'))
        {
            $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful'));
            $this->set_message('activation_email_successful');
                return $data;
        }
        else
        {
            $message = $this->load->view($this->config->item('email_templates', 'ion_auth').$this->config->item('email_activate', 'ion_auth'), $data, true);

    line 353:       $this->email->clear();
            $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));
            $this->email->to($email);
            $this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_activation_subject'));
            $this->email->message($message);

            if ($this->email->send() == TRUE)
            {
                $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_successful', 'activation_email_successful'));
                $this->set_message('activation_email_successful');
                return $id;
            }
        }

        $this->ion_auth_model->trigger_events(array('post_account_creation', 'post_account_creation_unsuccessful', 'activation_email_unsuccessful'));
        $this->set_error('activation_email_unsuccessful');
        return FALSE;
    }
}

Addendum 2: ion auth model constructor:

 public function __construct()
{
    parent::__construct();
    $this->load->database();
    $this->load->config('ion_auth', TRUE);
    $this->load->helper('cookie');
    $this->load->helper('date');
    $this->lang->load('ion_auth');
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题