Commit 5c1efebb authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor formatting and readability changes as requested by Jay.

parent 0025e057
This is your TWiki home page. Feel free to customize it! If you are
not familiar with the %WIKITOOLNAME% collaboration platform, please
visit %TWIKIWEB%.WelcomeGuest first. See the links at your left for
more information on how to write and create TWiki pages.
This is your TWiki home page. If you are not familiar with the
%WIKITOOLNAME% collaboration platform, please visit
%TWIKIWEB%.WelcomeGuest first. See the links at your left for more
information on how to write and create TWiki pages.
__These are your Projects/Groups:__
__These are your Projects:__
<!-- Please leave this line here. Thanks! --!>
<br><br>
<font size=-2 color=grey>
__Permissions (leave these alone unless you know what you are doing, or ask us)__
* Set ALLOWTOPICVIEW =
* Set ALLOWTOPICCHANGE =
......@@ -21,4 +25,4 @@ __Personal Preferences (details in %TWIKIWEB%.TWikiVariables)__
* Set EDITBOXHEIGHT = 17
* Default state of the __link__ check box in the attach file page:
* Set ATTACHLINKBOX =
</font>
......@@ -11,14 +11,14 @@ information on how to write and create TWiki pages.
__This project wiki can be accessed externally as:__ [[%SCRIPTURL%/view/%WEB%][%SCRIPTURL%/view/%WEB%]]
%INCLUDE{"Emulab.GroupPermNotes"}%
__TWiki groups that are relevant to your Project/Group__
* Other members of your project: [[%MAINWEB%.%WEB%Group][%WEB%Group]]
* Members with project root privs: [[%MAINWEB%.%WEB%RootGroup][%WEB%RootGroup]]
%INCLUDE{"Emulab.GroupPermNotes"}%
__Site Tools of the <nop>%WEB% Web__
%INCLUDE{"%TWIKIWEB%.WebSiteTools"}%
......
......@@ -112,6 +112,9 @@ elsif ($action eq "remap") {
elsif ($action eq "fixproject") {
exit(FixWikiProject(@ARGV));
}
elsif ($action eq "fixuser") {
exit(FixWikiUser(@ARGV));
}
else {
die("*** $0:\n".
" Do not know what to do with '$action'!\n");
......@@ -549,6 +552,61 @@ sub FixWikiProject(@)
return 0;
}
#
# Fix a wiki user home page,
#
sub FixWikiUser(@)
{
usage()
if (@_ != 2);
my ($user, $wikiname, $passwd) = @_;
chdir("$WIKIUSERDIR") or
fatal("Could not chdir to $WIKIUSERDIR");
if (! system("egrep -q -s ".
"'<!-- Please leave this line here' ${wikiname}.txt")) {
return 0;
}
system("cp -p ${USERTEMPLATE} ${wikiname}.txt") == 0
or fatal("Could not copy ${USERTEMPLATE} to ${wikiname}.txt");
#
# Set the initial groups list to the user.
#
open(PREFS, "${wikiname}.txt") or
fatal("Could not open ${wikiname}.txt for reading");
while (<PREFS>) {
if ($_ =~ /^(.* Set ALLOWTOPIC.*)\r$/ ||
$_ =~ /^(.* Set ALLOWTOPIC.*)$/) {
$data .= $1 . "%MAINWEB%.${wikiname}\n";
}
else {
$data .= $_;
}
}
close(PREFS);
#
# Now write the file out.
#
open(PREFS, "> ${wikiname}.txt") or
fatal("Could not open ${wikiname}.txt for writing");
print PREFS $data;
close(PREFS);
#
# Check it in (locked).
#
CI("${wikiname}.txt", "FixWikiUser $user $wikiname") == 0
or fatal("Could not ci ${wikiname}.txt");
return 0;
}
#
# Fix a wiki group.
#
......@@ -740,19 +798,16 @@ sub SetWikiGroups(@)
fatal("Could not open ${wikiuser}.txt for reading");
while (<PREFS>) {
if ($_ =~ /^(__These are your Projects\/Groups:__).*$/) {
$data .= $1 . "\n";
if ($_ =~ /^__These are your Projects.*$/) {
$data .= "__These are your Projects:__\n";
#
# Add a list of groups.
# Add a list of just the Projects.
#
foreach my $group (@groups) {
if (-d "../$group") {
$data .= "\t* [[${group}.WebHome][${group}]]\n";
}
else {
$data .= "\t* [[%MAINWEB%.${group}Group][${group}Group]]\n";
}
}
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment