original_string: public static function confirm_registration($token, $newtoken, $hubname) {
          global $DB;
  
          $registration = self::get_registration(false);
          if (!$registration || $registration->token !== $token) {
              throw new moodle_exception('wrongtoken', 'hub', new moodle_url('/admin/registration/index.php'));
          }
          $record = ['id' => $registration->id];
          $record['token'] = $newtoken;
          $record['confirmed'] = 1;
          $record['hubname'] = $hubname;
          $record['timemodified'] = time();
          $DB->update_record('registration_hubs', $record);
          self::$registration = null;
      }
code: public static function confirm_registration($token, $newtoken, $hubname) {
          global $DB;
  
          $registration = self::get_registration(false);
          if (!$registration || $registration->token !== $token) {
              throw new moodle_exception('wrongtoken', 'hub', new moodle_url('/admin/registration/index.php'));
          }
          $record = ['id' => $registration->id];
          $record['token'] = $newtoken;
          $record['confirmed'] = 1;
          $record['hubname'] = $hubname;
          $record['timemodified'] = time();
          $DB->update_record('registration_hubs', $record);
          self::$registration = null;
      }
code_tokens: public static function confirm_registration ( $ token , $ newtoken , $ hubname ) { global $ DB ; $ registration = self :: get_registration ( false ) ; if ( ! $ registration || $ registration -> token !== $ token ) { throw new moodle_exception ( 'wrongtoken' , 'hub' , new moodle_url ( '/admin/registration/index.php' ) ) ; } $ record = [ 'id' => $ registration -> id ] ; $ record [ 'token' ] = $ newtoken ; $ record [ 'confirmed' ] = 1 ; $ record [ 'hubname' ] = $ hubname ; $ record [ 'timemodified' ] = time ( ) ; $ DB -> update_record ( 'registration_hubs' , $ record ) ; self :: $ registration = null ; }
docstring: Confirms registration by moodle.net
  
  @param string $token
  @param string $newtoken
  @param string $hubname
  @throws moodle_exception
docstring_tokens: Confirms registration by moodle . net