e107inc / twofactorauth

Two-Factor Authenthication (2FA) for e107
2 stars 2 forks source link

2FA code displays in e107_admin/users.php?mode=main&action=list as UEF #5

Closed Moc closed 3 years ago

Moc commented 3 years ago

@CaMer0n How can I prevent the 2FA UEF showing up as a column to select?

image

It's using the e_user.php addon.

CaMer0n commented 3 years ago

Did you try adding "nolist" => true to the field?

Moc commented 3 years ago

@CaMer0n In e_user.php? Just tried it, but doesn't work. The field still displays in the selection.

$fields['secret_key'] = array(
            'title'     => LAN_PLUGIN_2FA_NAME_FULL,  
            'read'      => e_UC_NOBODY, 
            'write'     => e_UC_MEMBER,
            'fieldType' => 'varchar(255)',       
            'type'      => 'method', 
            'data'      => 'str', 
            'required'  => false,
            'nolist'    => true,
        ); 

I uninstalled the plugin, cleared caches, re-installed. No change.

CaMer0n commented 3 years ago

Does this fix it?

function settings()
    {
        $fields = array();
        $fields['secret_key'] = array(
            'title'     => '_system_',
            'read'      => e_UC_NOBODY, 
            'write'     => e_UC_MEMBER,
            'fieldType' => 'varchar(255)',       
            'type'      => 'method', 
            'data'      => 'str', 
            'required'  => false,
        ); 

        return $fields;

    }