function GoogleAuthenticator::createURL in Google Authenticator login 6
Same name and namespace in other branches
- 7 ga4php.php \GoogleAuthenticator::createURL()
1 call to GoogleAuthenticator::createURL()
- ga_loginGA::createURL in ./ga_login.class.php
1 method overrides GoogleAuthenticator::createURL()
- ga_loginGA::createURL in ./ga_login.class.php
File
- ./ga4php.php, line 272
Class
- GoogleAuthenticator
Code
function createURL($user) {
$data = $this
->internalGetData($user);
$toktype = $data["tokentype"];
$key = $this
->helperhex2b32($data["tokenkey"]);
$counter = $data["tokencounter"] + 1;
$toktype = strtolower($toktype);
if ($toktype == "hotp") {
$url = "otpauth://{$toktype}/{$user}?secret={$key}&counter={$counter}";
}
else {
$url = "otpauth://{$toktype}/{$user}?secret={$key}";
}
return $url;
}