Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 94... Línea 94...
94
            // Connection error.
94
            // Connection error.
95
            throw new moodle_exception('errorconnect', 'hub', '', $curl->error);
95
            throw new moodle_exception('errorconnect', 'hub', '', $curl->error);
96
        } else if (isset($curloutput['exception'])) {
96
        } else if (isset($curloutput['exception'])) {
97
            // Exception occurred on the remote side.
97
            // Exception occurred on the remote side.
98
            self::process_curl_exception($token, $curloutput);
98
            self::process_curl_exception($token, $curloutput);
99
        } else if ($info['http_code'] != 200) {
99
        } else if (!empty($info['http_code']) && $info['http_code'] != 200) {
100
            throw new moodle_exception('errorconnect', 'hub', '', $info['http_code']);
100
            throw new moodle_exception('errorconnect', 'hub', '', $info['http_code']);
101
        } else {
101
        } else {
102
            return $curloutput;
102
            return $curloutput;
103
        }
103
        }
104
    }
104
    }
Línea 163... Línea 163...
163
            ['filetype' => self::HUB_HUBSCREENSHOT_FILE_TYPE]);
163
            ['filetype' => self::HUB_HUBSCREENSHOT_FILE_TYPE]);
164
        return $info;
164
        return $info;
165
    }
165
    }
Línea 166... Línea 166...
166
 
166
 
-
 
167
    /**
-
 
168
     * Checks if current site is registered in hub.
-
 
169
     *
-
 
170
     * @return bool
-
 
171
     */
-
 
172
    public static function is_site_registered_in_hub(): bool {
-
 
173
        global $CFG;
-
 
174
 
-
 
175
        return self::call('hub_site_is_registered', [
-
 
176
            'siteurl' => $CFG->wwwroot,
-
 
177
            'sitesecret' => registration::get_secret(),
-
 
178
        ]);
-
 
179
    }
-
 
180
 
167
    /**
181
    /**
168
     * Calls WS function hub_get_courses
182
     * Calls WS function hub_get_courses
169
     *
183
     *
170
     * @deprecated since Moodle 3.8. Moodle.net has been sunsetted making this function useless.
184
     * @deprecated since Moodle 3.8. Moodle.net has been sunsetted making this function useless.
171
     *
185
     *