* * @package miniOrange OAuth * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php */ class molms_Utility { public static function icr() { $email = get_site_option( 'mo2f_email' ); $customer_key = get_site_option( 'mo2f_customerKey' ); if ( ! $email || ! $customer_key || ! is_numeric( trim( $customer_key ) ) ) { return 0; } else { return 1; } } public static function check_empty_or_null( $value ) { if ( ! isset( $value ) || empty( $value ) ) { return true; } return false; } public static function rand() { $length = wp_rand( 0, 15 ); $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ( $i = 0; $i < $length; $i ++ ) { $randomString .= $characters[ wp_rand( 0, strlen( $characters ) - 1 ) ]; } return $randomString; } public static function getFeatureStatus() { $status = ''; $status .= "#"; if ( get_site_option( 'mo2f_two_factor' ) ) { $status .= "TF1"; } $status .= "R" . rand( 0, 1000 ); return $status; } public static function get_mo2f_db_option( $value, $type ) { if ( $type == 'site_option' ) { $db_value = get_site_option( $value, $GLOBALS[ $value ] ); } else { $db_value = get_site_option( $value, $GLOBALS[ $value ] ); } return $db_value; } public function lockedOutlink() { if ( MOLMS_IS_ONPREM ) { return molms_Constants::OnPremiseLockedOut; } else { return molms_Constants::CloudLockedOut; } } }