original_string: public static function reset_site_identifier($token) {
          global $DB, $CFG;
  
          $registration = self::get_registration(false);
          if (!$registration || $registration->token != $token) {
              throw new moodle_exception('wrongtoken', 'hub',
                 new moodle_url('/admin/registration/index.php'));
          }
  
          $DB->delete_records('registration_hubs', array('id' => $registration->id));
          self::$registration = null;
  
          $CFG->siteidentifier = null;
          get_site_identifier();
      }
code: public static function reset_site_identifier($token) {
          global $DB, $CFG;
  
          $registration = self::get_registration(false);
          if (!$registration || $registration->token != $token) {
              throw new moodle_exception('wrongtoken', 'hub',
                 new moodle_url('/admin/registration/index.php'));
          }
  
          $DB->delete_records('registration_hubs', array('id' => $registration->id));
          self::$registration = null;
  
          $CFG->siteidentifier = null;
          get_site_identifier();
      }
code_tokens: public static function reset_site_identifier ( $ token ) { global $ DB , $ CFG ; $ registration = self :: get_registration ( false ) ; if ( ! $ registration || $ registration -> token != $ token ) { throw new moodle_exception ( 'wrongtoken' , 'hub' , new moodle_url ( '/admin/registration/index.php' ) ) ; } $ DB -> delete_records ( 'registration_hubs' , array ( 'id' => $ registration -> id ) ) ; self :: $ registration = null ; $ CFG -> siteidentifier = null ; get_site_identifier ( ) ; }
docstring: Generate a new token for the site that is not registered
  
  @param string $token
  @throws moodle_exception
docstring_tokens: Generate a new token for the site that is not registered