在Joomla 3.7中的JOS_USER表上再添加一个列



我正在开发从第三方API中登录的自定义身份验证插件。

当我们使用用户/密码登录任何JOOMLA实例时Joomla数据库上的响应(用户名,fullname,电子邮件)。现在CCMS auth插件工作正常。

我的要求是在API的用户身份验证插件时,在JOS_USERS上保存一列。为此,我在jos_user表中创建了一个lightere_ident

这是我的代码:

$result = $client->call($method, $params);
 [0] => Array
    (
        [login_id] => Frasier.9878
        [email_address] => frabc@gmail.com
        [position_code_type_ident] => 157
        [employee_ident] => 166651
        [position_code_department_abbr_name] => executive_management
        [position_code_title] => Chief Financial Officer
        [hire_date] => 2003-01-20
        [common_name] => Frasier Crane
    )
if($result)
            {       
            $email_address            = isset($result[0][email_address]) ? $result[0][email_address] : $credentials['username']."@test.com"; 
            $response->email          = $email_address;
            $response->fullname       =$result[0][common_name];   
            $response->employee_ident =$result[0][employee_ident];              
            $response->username       =$credentials['username'];
            $response->status        = JAuthentication::STATUS_SUCCESS;
            $response->error_message = '';  
        }

您应该为此创建配置文件插件。默认情况下Joomla!有一个#__user_profiles表可以保存其他用户信息。

有关更多信息,请参见JDOCS的此页面:https://docs.joomla.org/creating_a_profile_plugin/en

另一个示例是核心配置文件插件:https://github.com/joomla/joomla-cms/blob/staging/plugins/plugins/profile/profile.php

最新更新