class MiniorangeUser in Google Authenticator / 2 Factor Authentication - 2FA 8.2
Same name and namespace in other branches
- 8 src/MiniorangeUser.php \Drupal\miniorange_2fa\MiniorangeUser
Hierarchy
- class \Drupal\miniorange_2fa\MiniorangeUser
Expanded class hierarchy of MiniorangeUser
13 files declare their use of MiniorangeUser
- authenticate_user.php in src/
Form/ authenticate_user.php - This is used to authenticate user during login.
- configure_google_authenticator.php in src/
Form/ configure_google_authenticator.php - configure_kba.php in src/
Form/ configure_kba.php - configure_otp_over_sms_and_email.php in src/
Form/ configure_otp_over_sms_and_email.php - configure_qrcode_authentication.php in src/
Form/ configure_qrcode_authentication.php
File
- src/
MiniorangeUser.php, line 5
Namespace
Drupal\miniorange_2faView source
class MiniorangeUser {
private $customerId;
private $username;
private $phone;
private $name;
private $authType;
private $email;
public function __construct($customerId, $username, $phone, $name, $authType, $email = "") {
$this->customerId = $customerId;
$this->username = $username;
$this->phone = $phone;
$this->name = $name;
$this->authType = $authType;
$this->email = $email;
}
public function update() {
$apiKey = self::getApiKey();
if (is_null($this->customerId) || is_null($apiKey)) {
return FALSE;
}
$usersAPIHandler = new UsersAPIHandler($this->customerId, $apiKey);
$response = $usersAPIHandler
->update($this);
}
public function create() {
$apiKey = self::getApiKey();
if (empty($this->customerId) || empty($apiKey)) {
return FALSE;
}
$usersAPIHandler = new UsersAPIHandler($this->customerId, $apiKey);
$response = $usersAPIHandler
->create($this);
}
public function search() {
$apiKey = self::getApiKey();
if (empty($this->customerId) || empty($apiKey)) {
return FALSE;
}
$usersAPIHandler = new UsersAPIHandler($this->customerId, $apiKey);
$response = $usersAPIHandler
->search($this);
}
public function get() {
$apiKey = self::getApiKey();
if (empty($this->customerId) || empty($apiKey)) {
return FALSE;
}
$usersAPIHandler = new UsersAPIHandler($this->customerId, $apiKey);
$response = $usersAPIHandler
->get($this);
}
static function getApiKey() {
$variables_and_values = array(
'mo_auth_customer_api_key',
);
$mo_db_values = MoAuthUtilities::miniOrange_set_get_configurations($variables_and_values, 'GET');
if ($mo_db_values['mo_auth_customer_api_key'] == '') {
return NULL;
}
return $mo_db_values['mo_auth_customer_api_key'];
}
public function getCustomerID() {
return $this->customerId;
}
public function setCustomerID($customerId) {
$this->customerId = $customerId;
}
public function getUsername() {
return $this->username;
}
public function setUsername($username) {
$this->username = $username;
}
public function getEmail() {
return $this->email;
}
public function setEmail($email) {
$this->email = $email;
}
public function getPhone() {
return $this->phone;
}
public function setPhone($phone) {
$this->phone = $phone;
}
public function getName() {
return $this->name;
}
public function setName($name) {
$this->name = $name;
}
public function getAuthType() {
return $this->authType;
}
public function setAuthType($authType) {
$this->authType = $authType;
}
}