public static function create_username($consumerkey, $ltiuserid) {
        if (!empty($ltiuserid) && !empty($consumerkey)) {
            $userkey = $consumerkey . ':' . $ltiuserid;
        } else {
            $userkey = false;
        }

        return 'enrol_lti' . sha1($consumerkey . '::' . $userkey);
    }
public static function create_username($consumerkey, $ltiuserid) {
        if (!empty($ltiuserid) && !empty($consumerkey)) {
            $userkey = $consumerkey . ':' . $ltiuserid;
        } else {
            $userkey = false;
        }

        return 'enrol_lti' . sha1($consumerkey . '::' . $userkey);
    }
public static function create_username ( $ consumerkey , $ ltiuserid ) { if ( ! empty ( $ ltiuserid ) && ! empty ( $ consumerkey ) ) { $ userkey = $ consumerkey . ':' . $ ltiuserid ; } else { $ userkey = false ; } return 'enrol_lti' . sha1 ( $ consumerkey . '::' . $ userkey ) ; }
Creates a unique username.

@param string $consumerkey Consumer key
@param string $ltiuserid External tool user id
@return string The new username
Creates a unique username .