From the documentation we can see this entry;
enabled
can be true
or false
; if you don't want to use a specific provider then set it to false
If you open hybridauth/config.php
, you'll see a configuration array, which holds configurations for different authentication methods. Most interestingly, we can see an key named enabled
, which we can manipulate.
Modifying the value directly.
We can modify the value directly, by using the ternary operator. For example;
...
"Facebook" => array (
"enabled" => (condition ? true : false), //Ternary operator modifying `enabled` value.
"keys" => array ( "id" => "", "secret" => "" ),
"trustForwarded" => false
),
....
However, we can do this by modifying it after the configuration has been loaded.
Modifying the value later on.
If you open up examples/social_hub/login.php
, you'll see we load the config file and use it. Here is where we can modify that enabled
key.
The configuration is held within the variable $config
, so;
if( condition ) {
$config['providers']['Facebook']['enabled'] = FALSE;
}