SproutCMS

This is the code documentation for the SproutCMS project

class GoogleAuthenticator

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-16
**/
class NewClassName extends GoogleAuthenticator {
    
    /**
    * Generate a secret key and encode as base32
    * 
    * NOTE: Only cryptographically secure in PHP 7.0 onwards (uses &quot;random_bytes&quot; method)
    * On earlier versions of PHP this method isn't available so rand() is used instead
    **/
    public function generateSecret () {
        // Method code goes here
    }
    
    /**
    * Return a Google Charts url which generates a QR code image from some QR code data
    **/
    public function getQRImageUrl (string $qr_data) {
        // Method code goes here
    }
    
    /**
    * For a given set of details, return the otpauth:// url for use in a QR code
    **/
    public function getQRData (string $issuer, string $user, string $host, string $secret) {
        // Method code goes here
    }
    
    /**
    * Calculate what the code for a given secret/time should be
    **/
    protected function getCode (string $secret, int $time) {
        // Method code goes here
    }
    
    /**
    * Check a given code against a given secret
    * 
    * Does the check three times, for current time, one period before, and one period after
    * This is to allow for clock drift
    **/
    public function checkCode (string $secret, string $code) {
        // Method code goes here
    }
    
}
?>