Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 196... Línea 196...
196
     * Get the registration ID for the given set of credentials.
196
     * Get the registration ID for the given set of credentials.
197
     * @param   null|string $apikey The API key to use for the registration attempt
197
     * @param   null|string $apikey The API key to use for the registration attempt
198
     * @param   null|string $secretkey The secret key to use
198
     * @param   null|string $secretkey The secret key to use
199
     * @return  null|string The registration ID if registration was successful, or null if not
199
     * @return  null|string The registration ID if registration was successful, or null if not
200
     */
200
     */
201
    protected function get_registration_id_for_credentials(string $apikey = null, string $secretkey = null): string {
201
    protected function get_registration_id_for_credentials(?string $apikey = null, ?string $secretkey = null): string {
202
        $headers = $this->get_common_headers();
202
        $headers = $this->get_common_headers();
203
        if ($apikey || $secretkey) {
203
        if ($apikey || $secretkey) {
204
            $headers['secret'] = $apikey;
204
            $headers['secret'] = $apikey;
205
            $headers['userhash'] = $secretkey;
205
            $headers['userhash'] = $secretkey;
206
        } else if (!$this->has_registration_key()) {
206
        } else if (!$this->has_registration_key()) {