public static function instance() { if (self::$instance === null) { self::$instance = new iclicker_registration_users(); } return self::$instance; }
// // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Internal library of functions for module iclickerregistration * * All the iclickerregistration specific functions, needed to implement the module * logic, should go here. Never include this file from your lib.php! * * @package mod_iclickerregistration * @copyright 2015 Joey Andres <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once dirname(__FILE__) . '/../../config.php'; require_once dirname(__FILE__) . '/classes/iclicker_registration_user.php'; $iru = iclicker_registration_users::instance(); function get_user_by_idnumber($idnumber) { global $DB; return $DB->get_record('user', array("idnumber" => $idnumber)); } function is_current_user($idnumber) { global $USER; return "{$idnumber}" === "current_user" || $idnumber === $USER->idnumber; } /** * @param string $booleanstring "true" or "false" string. * @return If parameter is "true", returns true. false otherwise. */ function boolean_string_to_boolean($booleanstring)