public static function update_manual() {
        global $DB;

        if (!$registration = self::get_registration()) {
            return false;
        }

        $siteinfo = self::get_site_info();
        try {
            api::update_registration($siteinfo);
        } catch (moodle_exception $e) {
            if (!self::is_registered()) {
                // Token was rejected during registration update and site and locally stored token was reset,
                // proceed to site registration. This method will redirect away.
                self::register('');
            }
            \core\notification::add(get_string('errorregistrationupdate', 'hub', $e->getMessage()),
                \core\output\notification::NOTIFY_ERROR);
            return false;
        }
        $DB->update_record('registration_hubs', ['id' => $registration->id, 'timemodified' => time()]);
        \core\notification::add(get_string('siteregistrationupdated', 'hub'),
            \core\output\notification::NOTIFY_SUCCESS);
        self::$registration = null;
        return true;
    }
public static function update_manual() {
        global $DB;

        if (!$registration = self::get_registration()) {
            return false;
        }

        $siteinfo = self::get_site_info();
        try {
            api::update_registration($siteinfo);
        } catch (moodle_exception $e) {
            if (!self::is_registered()) {
                // Token was rejected during registration update and site and locally stored token was reset,
                // proceed to site registration. This method will redirect away.
                self::register('');
            }
            \core\notification::add(get_string('errorregistrationupdate', 'hub', $e->getMessage()),
                \core\output\notification::NOTIFY_ERROR);
            return false;
        }
        $DB->update_record('registration_hubs', ['id' => $registration->id, 'timemodified' => time()]);
        \core\notification::add(get_string('siteregistrationupdated', 'hub'),
            \core\output\notification::NOTIFY_SUCCESS);
        self::$registration = null;
        return true;
    }
public static function update_manual ( ) { global $ DB ; if ( ! $ registration = self :: get_registration ( ) ) { return false ; } $ siteinfo = self :: get_site_info ( ) ; try { api :: update_registration ( $ siteinfo ) ; } catch ( moodle_exception $ e ) { if ( ! self :: is_registered ( ) ) { // Token was rejected during registration update and site and locally stored token was reset, // proceed to site registration. This method will redirect away. self :: register ( '' ) ; } \ core \ notification :: add ( get_string ( 'errorregistrationupdate' , 'hub' , $ e -> getMessage ( ) ) , \ core \ output \ notification :: NOTIFY_ERROR ) ; return false ; } $ DB -> update_record ( 'registration_hubs' , [ 'id' => $ registration -> id , 'timemodified' => time ( ) ] ) ; \ core \ notification :: add ( get_string ( 'siteregistrationupdated' , 'hub' ) , \ core \ output \ notification :: NOTIFY_SUCCESS ) ; self :: $ registration = null ; return true ; }
Updates site registration when "Update reigstration" button is clicked by admin
Updates site registration when Update reigstration button is clicked by admin