summaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
blob: 07319ad22223da7261ee568ee1f46cbee3d394b7 (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use IkiWiki;
  5. use IkiWiki::UserInfo;
  6. use open qw{:utf8 :std};
  7. use Encode;
  8. package IkiWiki;
  9. sub printheader ($) { #{{{
  10. my $session=shift;
  11. if ($config{sslcookie}) {
  12. print $session->header(-charset => 'utf-8',
  13. -cookie => $session->cookie(-secure => 1));
  14. } else {
  15. print $session->header(-charset => 'utf-8');
  16. }
  17. } #}}}
  18. sub redirect ($$) { #{{{
  19. my $q=shift;
  20. my $url=shift;
  21. if (! $config{w3mmode}) {
  22. print $q->redirect($url);
  23. }
  24. else {
  25. print "Content-type: text/plain\n";
  26. print "W3m-control: GOTO $url\n\n";
  27. }
  28. } #}}}
  29. sub check_canedit ($$$;$) { #{{{
  30. my $page=shift;
  31. my $q=shift;
  32. my $session=shift;
  33. my $nonfatal=shift;
  34. my $canedit;
  35. run_hooks(canedit => sub {
  36. return if defined $canedit;
  37. my $ret=shift->($page, $q, $session);
  38. if (defined $ret && $ret eq "") {
  39. $canedit=1;
  40. }
  41. elsif (defined $ret) {
  42. $canedit=0;
  43. error($ret) unless $nonfatal;
  44. }
  45. });
  46. return $canedit;
  47. } #}}}
  48. sub decode_form_utf8 ($) { #{{{
  49. my $form = shift;
  50. foreach my $f ($form->field) {
  51. next if Encode::is_utf8(scalar $form->field($f));
  52. $form->field(name => $f,
  53. value => decode_utf8($form->field($f)),
  54. force => 1,
  55. );
  56. }
  57. } #}}}
  58. sub cgi_recentchanges ($) { #{{{
  59. my $q=shift;
  60. # Optimisation: building recentchanges means calculating lots of
  61. # links. Memoizing htmllink speeds it up a lot (can't be memoized
  62. # during page builds as the return values may change, but they
  63. # won't here.)
  64. eval q{use Memoize};
  65. error($@) if $@;
  66. memoize("htmllink");
  67. eval q{use Time::Duration};
  68. error($@) if $@;
  69. my $changelog=[rcs_recentchanges(100)];
  70. foreach my $change (@$changelog) {
  71. $change->{when} = concise(ago($change->{when}));
  72. $change->{user} = userlink($change->{user});
  73. my $is_excess = exists $change->{pages}[10]; # limit pages to first 10
  74. delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess;
  75. $change->{pages} = [
  76. map {
  77. $_->{link} = htmllink("", "", $_->{page},
  78. noimageinline => 1,
  79. linktext => pagetitle($_->{page}));
  80. $_;
  81. } @{$change->{pages}}
  82. ];
  83. push @{$change->{pages}}, { link => '...' } if $is_excess;
  84. }
  85. my $template=template("recentchanges.tmpl");
  86. $template->param(
  87. title => "RecentChanges",
  88. indexlink => indexlink(),
  89. wikiname => $config{wikiname},
  90. changelog => $changelog,
  91. baseurl => baseurl(),
  92. );
  93. run_hooks(pagetemplate => sub {
  94. shift->(page => "", destpage => "", template => $template);
  95. });
  96. print $q->header(-charset => 'utf-8'), $template->output;
  97. } #}}}
  98. # Check if the user is signed in. If not, redirect to the signin form and
  99. # save their place to return to later.
  100. sub needsignin ($$) { #{{{
  101. my $q=shift;
  102. my $session=shift;
  103. if (! defined $session->param("name") ||
  104. ! userinfo_get($session->param("name"), "regdate")) {
  105. if (! defined $session->param("postsignin")) {
  106. $session->param(postsignin => $ENV{QUERY_STRING});
  107. }
  108. cgi_signin($q, $session);
  109. cgi_savesession($session);
  110. exit;
  111. }
  112. } #}}}
  113. sub cgi_signin ($$) { #{{{
  114. my $q=shift;
  115. my $session=shift;
  116. eval q{use CGI::FormBuilder};
  117. error($@) if $@;
  118. my $form = CGI::FormBuilder->new(
  119. title => "signin",
  120. name => "signin",
  121. charset => "utf-8",
  122. method => 'POST',
  123. required => 'NONE',
  124. javascript => 0,
  125. params => $q,
  126. action => $config{cgiurl},
  127. header => 0,
  128. template => {type => 'div'},
  129. stylesheet => baseurl()."style.css",
  130. );
  131. my $buttons=["Login"];
  132. if ($q->param("do") ne "signin" && !$form->submitted) {
  133. $form->text(gettext("You need to log in first."));
  134. }
  135. $form->field(name => "do", type => "hidden", value => "signin",
  136. force => 1);
  137. run_hooks(formbuilder_setup => sub {
  138. shift->(form => $form, cgi => $q, session => $session);
  139. });
  140. decode_form_utf8($form);
  141. if (exists $hooks{formbuilder}) {
  142. run_hooks(formbuilder => sub {
  143. shift->(form => $form, cgi => $q, session => $session,
  144. buttons => $buttons);
  145. });
  146. }
  147. else {
  148. if ($form->submitted) {
  149. $form->validate;
  150. }
  151. printheader($session);
  152. print misctemplate($form->title, $form->render(submit => $buttons));
  153. }
  154. } #}}}
  155. sub cgi_postsignin ($$) { #{{{
  156. my $q=shift;
  157. my $session=shift;
  158. # Continue with whatever was being done before the signin process.
  159. if (defined $session->param("postsignin")) {
  160. my $postsignin=CGI->new($session->param("postsignin"));
  161. $session->clear("postsignin");
  162. cgi($postsignin, $session);
  163. cgi_savesession($session);
  164. exit;
  165. }
  166. else {
  167. # This can occur, for example, if a user went to the signin
  168. # url via a bookmark.
  169. redirect($q, $config{url});
  170. }
  171. } #}}}
  172. sub cgi_prefs ($$) { #{{{
  173. my $q=shift;
  174. my $session=shift;
  175. needsignin($q, $session);
  176. eval q{use CGI::FormBuilder};
  177. error($@) if $@;
  178. my $form = CGI::FormBuilder->new(
  179. title => "preferences",
  180. name => "preferences",
  181. header => 0,
  182. charset => "utf-8",
  183. method => 'POST',
  184. validate => {
  185. email => 'EMAIL',
  186. },
  187. required => 'NONE',
  188. javascript => 0,
  189. params => $q,
  190. action => $config{cgiurl},
  191. template => {type => 'div'},
  192. stylesheet => baseurl()."style.css",
  193. fieldsets => [
  194. [login => gettext("Login")],
  195. [preferences => gettext("Preferences")],
  196. [admin => gettext("Admin")]
  197. ],
  198. );
  199. my $buttons=["Save Preferences", "Logout", "Cancel"];
  200. run_hooks(formbuilder_setup => sub {
  201. shift->(form => $form, cgi => $q, session => $session);
  202. });
  203. $form->field(name => "do", type => "hidden");
  204. $form->field(name => "email", size => 50, fieldset => "preferences");
  205. $form->field(name => "subscriptions", size => 50,
  206. fieldset => "preferences",
  207. comment => "(".htmllink("", "", "PageSpec", noimageinline => 1).")");
  208. $form->field(name => "banned_users", size => 50,
  209. fieldset => "admin");
  210. my $user_name=$session->param("name");
  211. if (! is_admin($user_name)) {
  212. $form->field(name => "banned_users", type => "hidden");
  213. }
  214. if (! $form->submitted) {
  215. $form->field(name => "email", force => 1,
  216. value => userinfo_get($user_name, "email"));
  217. $form->field(name => "subscriptions", force => 1,
  218. value => userinfo_get($user_name, "subscriptions"));
  219. if (is_admin($user_name)) {
  220. $form->field(name => "banned_users", force => 1,
  221. value => join(" ", get_banned_users()));
  222. }
  223. }
  224. decode_form_utf8($form);
  225. if ($form->submitted eq 'Logout') {
  226. $session->delete();
  227. redirect($q, $config{url});
  228. return;
  229. }
  230. elsif ($form->submitted eq 'Cancel') {
  231. redirect($q, $config{url});
  232. return;
  233. }
  234. elsif ($form->submitted eq 'Save Preferences' && $form->validate) {
  235. foreach my $field (qw(email subscriptions)) {
  236. if (defined $form->field($field) && length $form->field($field)) {
  237. userinfo_set($user_name, $field, $form->field($field)) ||
  238. error("failed to set $field");
  239. }
  240. }
  241. if (is_admin($user_name)) {
  242. set_banned_users(grep { ! is_admin($_) }
  243. split(' ',
  244. $form->field("banned_users"))) ||
  245. error("failed saving changes");
  246. }
  247. $form->text(gettext("Preferences saved."));
  248. }
  249. if (exists $hooks{formbuilder}) {
  250. run_hooks(formbuilder => sub {
  251. shift->(form => $form, cgi => $q, session => $session,
  252. buttons => $buttons);
  253. });
  254. }
  255. else {
  256. printheader($session);
  257. print misctemplate($form->title, $form->render(submit => $buttons));
  258. }
  259. } #}}}
  260. sub cgi_editpage ($$) { #{{{
  261. my $q=shift;
  262. my $session=shift;
  263. my @fields=qw(do rcsinfo subpage from page type editcontent comments);
  264. my @buttons=("Save Page", "Preview", "Cancel");
  265. eval q{use CGI::FormBuilder};
  266. error($@) if $@;
  267. my $form = CGI::FormBuilder->new(
  268. fields => \@fields,
  269. charset => "utf-8",
  270. method => 'POST',
  271. validate => {
  272. editcontent => '/.+/',
  273. },
  274. required => [qw{editcontent}],
  275. javascript => 0,
  276. params => $q,
  277. action => $config{cgiurl},
  278. header => 0,
  279. table => 0,
  280. template => scalar template_params("editpage.tmpl"),
  281. wikiname => $config{wikiname},
  282. );
  283. run_hooks(formbuilder_setup => sub {
  284. shift->(form => $form, cgi => $q, session => $session);
  285. });
  286. decode_form_utf8($form);
  287. # This untaint is safe because titlepage removes any problematic
  288. # characters.
  289. my ($page)=$form->field('page');
  290. $page=titlepage(possibly_foolish_untaint($page));
  291. if (! defined $page || ! length $page || file_pruned($page, $config{srcdir}) || $page=~/^\//) {
  292. error("bad page name");
  293. }
  294. my $from;
  295. if (defined $form->field('from')) {
  296. ($from)=$form->field('from')=~/$config{wiki_file_regexp}/;
  297. }
  298. my $file;
  299. my $type;
  300. if (exists $pagesources{$page} && $form->field("do") ne "create") {
  301. $file=$pagesources{$page};
  302. $type=pagetype($file);
  303. if (! defined $type) {
  304. error(sprintf(gettext("%s is not an editable page"), $page));
  305. }
  306. if (! $form->submitted) {
  307. $form->field(name => "rcsinfo",
  308. value => rcs_prepedit($file), force => 1);
  309. }
  310. }
  311. else {
  312. $type=$form->param('type');
  313. if (defined $type && length $type && $hooks{htmlize}{$type}) {
  314. $type=possibly_foolish_untaint($type);
  315. }
  316. elsif (defined $from) {
  317. # favor the type of linking page
  318. $type=pagetype($pagesources{$from});
  319. }
  320. $type=$config{default_pageext} unless defined $type;
  321. $file=$page.".".$type;
  322. if (! $form->submitted) {
  323. $form->field(name => "rcsinfo", value => "", force => 1);
  324. }
  325. }
  326. $form->field(name => "do", type => 'hidden');
  327. $form->field(name => "from", type => 'hidden');
  328. $form->field(name => "rcsinfo", type => 'hidden');
  329. $form->field(name => "subpage", type => 'hidden');
  330. $form->field(name => "page", value => pagetitle($page, 1), force => 1);
  331. $form->field(name => "type", value => $type, force => 1);
  332. $form->field(name => "comments", type => "text", size => 80);
  333. $form->field(name => "editcontent", type => "textarea", rows => 20,
  334. cols => 80);
  335. $form->tmpl_param("can_commit", $config{rcs});
  336. $form->tmpl_param("indexlink", indexlink());
  337. $form->tmpl_param("helponformattinglink",
  338. htmllink("", "", "HelpOnFormatting", noimageinline => 1));
  339. $form->tmpl_param("baseurl", baseurl());
  340. if ($form->submitted eq "Cancel") {
  341. if ($form->field("do") eq "create" && defined $from) {
  342. redirect($q, "$config{url}/".htmlpage($from));
  343. }
  344. elsif ($form->field("do") eq "create") {
  345. redirect($q, $config{url});
  346. }
  347. else {
  348. redirect($q, "$config{url}/".htmlpage($page));
  349. }
  350. return;
  351. }
  352. elsif ($form->submitted eq "Preview") {
  353. $form->tmpl_param("page_preview",
  354. htmlize($page, $type,
  355. linkify($page, "",
  356. preprocess($page, $page,
  357. filter($page, $page, $form->field('editcontent')), 0, 1))));
  358. }
  359. else {
  360. $form->tmpl_param("page_preview", "");
  361. }
  362. $form->tmpl_param("page_conflict", "");
  363. if (! $form->submitted || $form->submitted eq "Preview" ||
  364. ! $form->validate) {
  365. if ($form->field("do") eq "create") {
  366. my @page_locs;
  367. my $best_loc;
  368. if (! defined $from || ! length $from ||
  369. $from ne $form->field('from') ||
  370. file_pruned($from, $config{srcdir}) ||
  371. $from=~/^\// ||
  372. $form->submitted eq "Preview") {
  373. @page_locs=$best_loc=$page;
  374. }
  375. else {
  376. my $dir=$from."/";
  377. $dir=~s![^/]+/+$!!;
  378. if ((defined $form->field('subpage') && length $form->field('subpage')) ||
  379. $page eq gettext('discussion')) {
  380. $best_loc="$from/$page";
  381. }
  382. else {
  383. $best_loc=$dir.$page;
  384. }
  385. push @page_locs, $dir.$page;
  386. push @page_locs, "$from/$page";
  387. while (length $dir) {
  388. $dir=~s![^/]+/+$!!;
  389. push @page_locs, $dir.$page;
  390. }
  391. }
  392. push @page_locs, "$config{userdir}/$page"
  393. if length $config{userdir};
  394. @page_locs = grep {
  395. ! exists $pagecase{lc $_}
  396. } @page_locs;
  397. if (! @page_locs) {
  398. # hmm, someone else made the page in the
  399. # meantime?
  400. redirect($q, "$config{url}/".htmlpage($page));
  401. return;
  402. }
  403. my @editable_locs = grep {
  404. check_canedit($_, $q, $session, 1)
  405. } @page_locs;
  406. if (! @editable_locs) {
  407. # let it throw an error this time
  408. map { check_canedit($_, $q, $session) } @page_locs;
  409. }
  410. my @page_types;
  411. if (exists $hooks{htmlize}) {
  412. @page_types=keys %{$hooks{htmlize}};
  413. }
  414. $form->tmpl_param("page_select", 1);
  415. $form->field(name => "page", type => 'select',
  416. options => [ map { pagetitle($_, 1) } @editable_locs ],
  417. value => pagetitle($best_loc, 1));
  418. $form->field(name => "type", type => 'select',
  419. options => \@page_types);
  420. $form->title(sprintf(gettext("creating %s"), pagetitle($page)));
  421. }
  422. elsif ($form->field("do") eq "edit") {
  423. check_canedit($page, $q, $session);
  424. if (! defined $form->field('editcontent') ||
  425. ! length $form->field('editcontent')) {
  426. my $content="";
  427. if (exists $pagesources{$page}) {
  428. $content=readfile(srcfile($pagesources{$page}));
  429. $content=~s/\n/\r\n/g;
  430. }
  431. $form->field(name => "editcontent", value => $content,
  432. force => 1);
  433. }
  434. $form->tmpl_param("page_select", 0);
  435. $form->field(name => "page", type => 'hidden');
  436. $form->field(name => "type", type => 'hidden');
  437. $form->title(sprintf(gettext("editing %s"), pagetitle($page)));
  438. }
  439. printheader($session);
  440. print misctemplate($form->title, $form->render(submit => \@buttons));
  441. }
  442. else {
  443. # save page
  444. check_canedit($page, $q, $session);
  445. my $exists=-e "$config{srcdir}/$file";
  446. if ($form->field("do") ne "create" &&
  447. ! $exists && ! -e "$config{underlaydir}/$file") {
  448. $form->tmpl_param("page_gone", 1);
  449. $form->field(name => "do", value => "create", force => 1);
  450. $form->tmpl_param("page_select", 0);
  451. $form->field(name => "page", type => 'hidden');
  452. $form->field(name => "type", type => 'hidden');
  453. $form->title(sprintf(gettext("editing %s"), $page));
  454. printheader($session);
  455. print misctemplate($form->title, $form->render(submit => \@buttons));
  456. return;
  457. }
  458. elsif ($form->field("do") eq "create" && $exists) {
  459. $form->tmpl_param("creation_conflict", 1);
  460. $form->field(name => "do", value => "edit", force => 1);
  461. $form->tmpl_param("page_select", 0);
  462. $form->field(name => "page", type => 'hidden');
  463. $form->field(name => "type", type => 'hidden');
  464. $form->title(sprintf(gettext("editing %s"), $page));
  465. $form->field("editcontent",
  466. value => readfile("$config{srcdir}/$file").
  467. "\n\n\n".$form->field("editcontent"),
  468. force => 1);
  469. printheader($session);
  470. print misctemplate($form->title, $form->render(submit => \@buttons));
  471. return;
  472. }
  473. my $content=$form->field('editcontent');
  474. $content=~s/\r\n/\n/g;
  475. $content=~s/\r/\n/g;
  476. $config{cgi}=0; # avoid cgi error message
  477. eval { writefile($file, $config{srcdir}, $content) };
  478. $config{cgi}=1;
  479. if ($@) {
  480. $form->field(name => "rcsinfo", value => rcs_prepedit($file),
  481. force => 1);
  482. $form->tmpl_param("failed_save", 1);
  483. $form->tmpl_param("error_message", $@);
  484. $form->field("editcontent", value => $content, force => 1);
  485. $form->tmpl_param("page_select", 0);
  486. $form->field(name => "page", type => 'hidden');
  487. $form->field(name => "type", type => 'hidden');
  488. $form->title(sprintf(gettext("editing %s"), $page));
  489. printheader($session);
  490. print misctemplate($form->title, $form->render(submit => \@buttons));
  491. return;
  492. }
  493. my $conflict;
  494. if ($config{rcs}) {
  495. my $message="";
  496. if (defined $form->field('comments') &&
  497. length $form->field('comments')) {
  498. $message=$form->field('comments');
  499. }
  500. if (! $exists) {
  501. rcs_add($file);
  502. }
  503. # Prevent deadlock with post-commit hook by
  504. # signaling to it that it should not try to
  505. # do anything (except send commit mails).
  506. disable_commit_hook();
  507. $conflict=rcs_commit($file, $message,
  508. $form->field("rcsinfo"),
  509. $session->param("name"), $ENV{REMOTE_ADDR});
  510. enable_commit_hook();
  511. rcs_update();
  512. }
  513. # Refresh even if there was a conflict, since other changes
  514. # may have been committed while the post-commit hook was
  515. # disabled.
  516. require IkiWiki::Render;
  517. refresh();
  518. saveindex();
  519. if (defined $conflict) {
  520. $form->field(name => "rcsinfo", value => rcs_prepedit($file),
  521. force => 1);
  522. $form->tmpl_param("page_conflict", 1);
  523. $form->field("editcontent", value => $conflict, force => 1);
  524. $form->field("do", "edit", force => 1);
  525. $form->tmpl_param("page_select", 0);
  526. $form->field(name => "page", type => 'hidden');
  527. $form->field(name => "type", type => 'hidden');
  528. $form->title(sprintf(gettext("editing %s"), $page));
  529. printheader($session);
  530. print misctemplate($form->title, $form->render(submit => \@buttons));
  531. return;
  532. }
  533. else {
  534. # The trailing question mark tries to avoid broken
  535. # caches and get the most recent version of the page.
  536. redirect($q, "$config{url}/".htmlpage($page)."?updated");
  537. }
  538. }
  539. } #}}}
  540. sub cgi_getsession ($) { #{{{
  541. my $q=shift;
  542. eval q{use CGI::Session};
  543. CGI::Session->name("ikiwiki_session_".encode_utf8($config{wikiname}));
  544. my $oldmask=umask(077);
  545. my $session = CGI::Session->new("driver:DB_File", $q,
  546. { FileName => "$config{wikistatedir}/sessions.db" });
  547. umask($oldmask);
  548. return $session;
  549. } #}}}
  550. sub cgi_savesession ($) { #{{{
  551. my $session=shift;
  552. # Force session flush with safe umask.
  553. my $oldmask=umask(077);
  554. $session->flush;
  555. umask($oldmask);
  556. } #}}}
  557. sub cgi (;$$) { #{{{
  558. my $q=shift;
  559. my $session=shift;
  560. if (! $q) {
  561. eval q{use CGI};
  562. error($@) if $@;
  563. $q=CGI->new;
  564. run_hooks(cgi => sub { shift->($q) });
  565. }
  566. my $do=$q->param('do');
  567. if (! defined $do || ! length $do) {
  568. my $error = $q->cgi_error;
  569. if ($error) {
  570. error("Request not processed: $error");
  571. }
  572. else {
  573. error("\"do\" parameter missing");
  574. }
  575. }
  576. # Things that do not need a session.
  577. if ($do eq 'recentchanges') {
  578. cgi_recentchanges($q);
  579. return;
  580. }
  581. # Need to lock the wiki before getting a session.
  582. lockwiki();
  583. if (! $session) {
  584. $session=cgi_getsession($q);
  585. }
  586. # Auth hooks can sign a user in.
  587. if ($do ne 'signin' && ! defined $session->param("name")) {
  588. run_hooks(auth => sub {
  589. shift->($q, $session)
  590. });
  591. if (defined $session->param("name")) {
  592. # Make sure whatever user was authed is in the
  593. # userinfo db.
  594. if (! userinfo_get($session->param("name"), "regdate")) {
  595. userinfo_setall($session->param("name"), {
  596. email => "",
  597. password => "",
  598. regdate => time,
  599. }) || error("failed adding user");
  600. }
  601. }
  602. }
  603. if (defined $session->param("name") &&
  604. userinfo_get($session->param("name"), "banned")) {
  605. print $q->header(-status => "403 Forbidden");
  606. $session->delete();
  607. print gettext("You are banned.");
  608. cgi_savesession($session);
  609. }
  610. run_hooks(sessioncgi => sub { shift->($q, $session) });
  611. if ($do eq 'signin') {
  612. cgi_signin($q, $session);
  613. cgi_savesession($session);
  614. }
  615. elsif (defined $session->param("postsignin")) {
  616. cgi_postsignin($q, $session);
  617. }
  618. elsif ($do eq 'prefs') {
  619. cgi_prefs($q, $session);
  620. }
  621. elsif ($do eq 'create' || $do eq 'edit') {
  622. cgi_editpage($q, $session);
  623. }
  624. elsif ($do eq 'postsignin') {
  625. error(gettext("login failed, perhaps you need to turn on cookies?"));
  626. }
  627. else {
  628. error("unknown do parameter");
  629. }
  630. } #}}}
  631. sub userlink ($) { #{{{
  632. my $user=shift;
  633. eval q{use CGI 'escapeHTML'};
  634. error($@) if $@;
  635. if ($user =~ m!^https?://! &&
  636. eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
  637. # Munge user-urls, as used by eg, OpenID.
  638. my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
  639. my $display=$oid->display;
  640. # Convert "user.somehost.com" to "user [somehost.com]".
  641. if ($display !~ /\[/) {
  642. $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/;
  643. }
  644. # Convert "http://somehost.com/user" to "user [somehost.com]".
  645. if ($display !~ /\[/) {
  646. $display=~s/^https?:\/\/(.+)\/([^\/]+)$/$2 [$1]/;
  647. }
  648. $display=~s!^https?://!!; # make sure this is removed
  649. return "<a href=\"$user\">".escapeHTML($display)."</a>";
  650. }
  651. else {
  652. return htmllink("", "", escapeHTML(
  653. length $config{userdir} ? $config{userdir}."/".$user : $user
  654. ), noimageinline => 1);
  655. }
  656. } #}}}
  657. 1