Question: How can I re-build my Main.WikiUsers topic?

Answer

ALERT! Under normal circumstances, there should be no need to rebuild your Main.WikiUsers topic.

Sometimes, the Main.WikiUsers topic maintained by System.TopicUserMappingContrib may not reflect the true list of users registered on your Foswiki installation. This most commonly happens when:
  • You deleted or renamed users and forgot to edit the Main.WikiUsers topic, or
  • You migrated a TWiki installation and accumulated new registrations on the new Main.WikiUsers topic before you had a chance to initialise it with the old list from the old TWikiUsers topic.

Assuming your wiki is configured to use System.TopicUserMappingContrib, the script below should refresh your Main.WikiUsers topic with an accurate list of users. It uses the USERINFO macro, which protects user information from ordinary users - so this topic needs to be viewed with admin privileges in order for it to be useful.

Usage Notes:
  • The data is populated by searching for topics in Main containing a UserForm.
  • "User Topics" that are unknown to the password manager will be added, appearing as a line with the WikiName but no username. These lines can be deleted.
    • Ex: BadRegistration - - 02 Mar 2012 - 23:50
  • There must not be any embedded blank lines in the list. The Mapper will detect the first blank line as the end of the list, adding entries after that line.

%STARTSECTION{"WIKIUSERS"}%
%FORMAT{"A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z" 
    type="string" 
    format="   * $item - <a name='$item'>- - - -</a> $percentINCLUDE{
        \"%TOPIC%\"
        section=\"USERS\"
        letter=\"$item\"
    }$percent" 
}% 
%ENDSECTION{"WIKIUSERS"}%

%STARTSECTION{"USERS"}%%SEARCH{
    "name=~'^%letter%.*' AND (form.name~'*UserForm')"
    type="query"
    web="%USERSWEB%"
    nonoise="on"
    separator="$n"
    header="$n"
    format="   * $topic - $percentUSERINFO{
        \"$topic\"
        format=\"$dollarusername\"
    }$percent - $createdate"
}%%ENDSECTION{"USERS"}% 

Back to: FrequentlyAskedQuestion
Related Topics: Foswiki:Support.Faq27, System.TopicUserMappingContrib, Main.WikiUsers, System.AdminDocumentationCategory
Topic revision: r1 - 13 Mar 2015, ProjectContributor

  • User Reference
  • BeginnersStartHere
  • EditingShorthand
  • Macros
  • MacrosQuickReference
  • FormattedSearch
  • QuerySearch
  • DocumentGraphics
  • SkinBrowser
  • InstalledPlugins

  • Admin Maintenance
  • Reference Manual
  • AdminToolsCategory
  • InterWikis
  • ManagingWebs
  • SiteTools
  • DefaultPreferences
  • WebPreferences

This site is powered by FoswikiCopyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Asteroid observations? Send feedback