Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 什么是';加入';ion_身份验证配置文件中的平均值_Php_Codeigniter_Ion Auth - Fatal编程技术网

Php 什么是';加入';ion_身份验证配置文件中的平均值

Php 什么是';加入';ion_身份验证配置文件中的平均值,php,codeigniter,ion-auth,Php,Codeigniter,Ion Auth,我让Ion_auth工作得很好,但后来更改了表名: $config['tables']['users'] = 'users_1'; $config['tables']['groups'] = 'groups_1'; $config['tables']['users_groups'] = 'users_groups_1'; $config['tables']['login_attempts'] = 'login_attempts_1'; 现在,当我试

我让Ion_auth工作得很好,但后来更改了表名:

$config['tables']['users']           = 'users_1';
$config['tables']['groups']          = 'groups_1';
$config['tables']['users_groups']    = 'users_groups_1';
$config['tables']['login_attempts']  = 'login_attempts_1';
现在,当我试图与某人签约时,它就不起作用了。我得到以下错误:

Fatal error: Call to a member function clear() on a non-object in ....application\libraries\Ion_auth.php on line 353
我怀疑它与ion_auth config文件中的以下内容有关:

/*
 | 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';
有人能解释一下如何设置这两个字段吗

更新:以下是ion_auth register函数:

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;
    }
}
附录2:离子认证模型构造器:

 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');

请显示使用
->clear()
的变量的代码,它应该在
Ion_auth.php
(353)
中,正如您的代码所述。根据您的要求,我已经包含了Ion_auth register函数并标记了第353行。您可以发布这些函数所在类中的任何变量吗?我开始认为,
$this->email
甚至没有设置。你说得对,我测试过,但没有设置。我不明白,我在构造器中加载了它。请演示如何在构造器中加载它。它应该是
$this->email
必须是另一个具有函数
clear
的类/对象。