tazbug view web/bugs.cgi @ rev 48

Add online signup, well tested with TinyCM
author Christophe Lincoln <pankso@slitaz.org>
date Sat Jan 04 21:46:07 2014 +0100 (2014-01-04)
parents bba8b666cc0e
children bb625b6de902
line source
1 #!/bin/sh
2 #
3 # TazBug Web interface
4 #
5 # Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
6 #
7 . /usr/lib/slitaz/httphelper
8 [ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf
9 #. bugs.conf
11 # Internal variable
12 bugdir="$TAZBUG/bug"
13 plugins="plugins"
14 sessions="/tmp/bugs/sessions"
15 script="$SCRIPT_NAME"
16 po=""
18 # Content negotiation for Gettext
19 IFS=","
20 for lang in $HTTP_ACCEPT_LANGUAGE
21 do
22 lang=${lang%;*} lang=${lang# } lang=${lang%-*}
23 case "$lang" in
24 en) LANG="C" ;;
25 de) LANG="de_DE" ;;
26 es) LANG="es_ES" ;;
27 fr) LANG="fr_FR" ;;
28 it) LANG="it_IT" ;;
29 pt) LANG="pt_BR" ;;
30 ru) LANG="ru_RU" ;;
31 zh) LANG="zh_TW" ;;
32 esac
33 if echo "$po" | fgrep -q "$lang"; then
34 break
35 fi
36 done
37 unset IFS
38 export LANG LC_ALL=$LANG
40 # Internationalization: $(gettext "")
41 . /usr/bin/gettext.sh
42 TEXTDOMAIN='tazbug'
43 export TEXTDOMAIN
45 #
46 # Functions
47 #
49 # HTML 5 header.
50 html_header() {
51 cat lib/header.html
52 }
54 # HTML 5 footer.
55 html_footer() {
56 cat << EOT
57 </div>
59 <div id="footer">
60 <a href="$WEB_URL">SliTaz Bugs</a> -
61 <a href="$WEB_URL?README">README</a>
62 </div>
64 </body>
65 </html>
66 EOT
67 }
69 GETfiltered()
70 {
71 GET $1 | sed -e "s/'/\&#39;/g; s|\n|<br/>|g; s/\t/\&#09;/g;s/\%22/\"/g"
72 }
74 js_redirection_to()
75 {
76 js_log "Redirecting to $1"
77 echo "<script type=\"text/javascript\"> document.location = \"$1\"; </script>"
78 }
80 js_log()
81 {
82 echo "<script type=\"text/javascript\">console.log('$1')</script>";
83 }
85 js_set_cookie()
86 {
87 name=$1
88 value=$2
90 js_log 'Setting cookie.'
91 echo "<script type=\"text/javascript\">"
92 echo "document.cookie = \"$name=$value; expires=0; path=/\"";
93 echo "</script>"
94 }
96 js_unset_cookie()
97 {
98 name=$1
100 js_log 'Unsetting cookie.'
101 echo "<script type=\"text/javascript\">"
102 echo "document.cookie = \"$1=\"\"; expires=-1; path=/";
103 echo "</script>"
104 }
106 # Check if user is auth
107 check_auth() {
108 auth="$(COOKIE auth)"
109 user="$(echo $auth | cut -d ":" -f 1)"
110 md5cookie="$(echo $auth | cut -d ":" -f 2)"
111 [ -f "$sessions/$user" ] && md5session="$(cat $sessions/$user)"
112 if [ "$md5cookie" == "$md5session" ] && [ "$auth" ]; then
113 return 0
114 else
115 return 1
116 fi
117 }
120 # Authentified or not
121 user_box() {
123 IDLOC=""
124 if [[ "$(GET id)" ]] ;then
125 IDLOC="&id=$(GET id)"
126 fi
128 if check_auth; then
129 . $PEOPLE/$user/account.conf
130 cat << EOT
131 <div id="user">
132 <a href="?user=$user">$(get_gravatar $MAIL 20)</a>
133 <a href="?logout">$(gettext 'Logout')</a>
134 </div>
135 EOT
136 else
137 cat << EOT
138 <div id="user">
139 <a href="?login$IDLOC"><img src="images/avatar.png" alt="[ User ]" /></a>
140 <a href="?login$IDLOC">$(gettext 'Log in')</a>
141 </div>
142 EOT
143 fi
144 cat << EOT
146 <div id="search">
147 <form method="get" action="$WEB_URL">
148 <input type="text" name="search" placeholder="$(gettext 'Search')" />
149 <!-- <input type="submit" value="$(gettext 'Search')" /> -->
150 </form>
151 </div>
153 <!-- Content -->
154 <div id="content">
156 EOT
157 }
159 # Signup page
160 signup_page() {
161 cat << EOT
163 <div id="signup">
164 <form method="post" name="signup" action="$SCRIPT_NAME" onsubmit="return checkSignup();">
165 <input type="hidden" name="signup" value="new" />
166 <input type="text" name="name" placeholder="$(gettext "Real name")" />
167 <input type="text" name="user" placeholder="$(gettext "User name")" />
168 <input type="text" name="mail" placeholder="$(gettext "Email")" />
169 <input type="password" name="pass" placeholder="$(gettext "Password")" />
170 <div>
171 <input type="submit" value="$(gettext "Create new account")" />
172 </div>
173 </form>
174 </div>
176 EOT
177 }
179 # Link for online signup if enabled.
180 online_signup() {
181 if [ "$ONLINE_SIGNUP" == "yes" ]; then
182 echo -n "<p>" && gettext "Or:"; echo -n " "
183 echo -n "<a href='$script?signup&amp;online'>"
184 gettext "Sign Up Online"
185 echo '</a></p>'
186 fi
187 }
189 # Login page
190 login_page() {
191 IDLOC=""
192 if [[ "$(GET id)" ]] ;then
193 IDLOC="?id=$(GET id)"
194 fi
196 cat << EOT
197 <h2>$(gettext 'Login')</h2>
199 <div id="account-info">
200 <p>$(gettext "No account yet? You can signup using the SliTaz Bugs reporter \
201 on your SliTaz system.")</p>
202 $(online_signup)
203 <p>$(gettext "Tip: to attach big files or images, you can use SliTaz Paste \
204 services:") <a href="http://paste.slitaz.org/">paste.slitaz.org</a></p>
205 </div>
207 <div id="login">
208 <form method="post" action="$SCRIPT_NAME">
209 <input type="text" name="auth" placeholder="$(gettext 'User name')" />
210 <input type="password" name="pass" placeholder="$(gettext 'Password')" />
211 <div>
212 <input type="submit" value="$(gettext 'Log in')" />
213 $error
214 </div>
215 </form>
216 </div>
218 <div style="clear: both;"></div>
219 EOT
220 }
222 # Display user public profile.
223 public_people() {
224 cat << EOT
225 <pre>
226 $(eval_gettext 'Real name : $NAME')
227 </pre>
228 EOT
229 }
231 # Display authentified user profile. TODO: change password
232 auth_people() {
233 cat << EOT
234 <pre>
235 $(eval_gettext 'Real name : $NAME')
236 $(eval_gettext 'Email : $MAIL')
237 $(eval_gettext 'Secure key : $KEY')
238 </pre>
239 EOT
240 }
242 # Usage: list_bugs STATUS
243 list_bugs() {
244 bug="$1"
245 echo "<h3>$(eval_gettext '$bug Bug')</h3>"
246 for pr in critical standard
247 do
248 for bug in $(fgrep -H "$1" $bugdir/*/bug.conf | cut -d ":" -f 1)
249 do
250 . $bug
251 id=$(basename $(dirname $bug))
252 if [ "$PRIORITY" == "$pr" ]; then
253 cat << EOT
254 <pre>
255 $(gettext 'Bug title :') <strong>$BUG</strong> <a href="?id=$id">$(gettext 'Show')</a>
256 $(gettext 'ID - Date :') $id - $DATE
257 $(gettext 'Creator :') <a href="?user=$CREATOR">$CREATOR</a>
258 </pre>
259 EOT
260 fi
261 done
262 done
263 }
266 # Stripped down Wiki parser for bug desc and messages which are simply
267 # displayed in <pre>
268 wiki_parser() {
269 sed \
270 -e s"#http://\([^']*\).png#<img src='\0' alt='[ Image ]' />#"g \
271 -e s"#http://\([^']*\).*# <a href='\0'>\1</a>#"g \
272 -e 's#\\\\n#\n#g;s#%22#"#g;s#%21#!#g'
273 }
276 # Bug page
277 bug_page() {
278 if [ -f "$PEOPLE/$CREATOR/account.conf" ]; then
279 . $PEOPLE/$CREATOR/account.conf
280 else
281 MAIL="default"
282 fi
283 cat << EOT
284 <h2>$(eval_gettext 'Bug $id')</h2>
285 <form method="get" action="$WEB_URL">
287 <p>
288 $(get_gravatar $MAIL 32)
289 <strong>$STATUS</strong>
290 $BUG - $DATE -
291 $(eval_gettext 'Priority $PRIORITY') -
292 $(eval_ngettext '$msgs message' '$msgs messages' $msgs)
293 </p>
295 <pre>
296 $(echo "$DESC" | wiki_parser)
297 </pre>
299 <div id="tools">
300 EOT
301 if check_auth; then
302 if [ "$STATUS" == "OPEN" ]; then
303 cat << EOT
304 <a href="?id=$id&amp;close">$(gettext "Close bug")</a>
305 <a href="?edit=$id">$(gettext "Edit bug")</a>
306 EOT
307 else
308 cat << EOT
309 <a href="?id=$id&amp;open">$(gettext "Re open bug")</a>
310 EOT
311 fi
312 fi
313 cat << EOT
314 </div>
316 <h3>$(gettext "Messages")</h3>
317 EOT
318 [ "$msgs" == "0" ] && gettext "No messages"
319 for msg in $(ls -1tr $bugdir/$id/msg.*)
320 do
321 . $msg
322 if [ "$MSG" ]; then
323 msgid=$(echo $msg | cut -d "." -f 2)
324 del=""
325 # User can delete his post.
326 [ "$user" == "$USER" ] && \
327 del="<a href=\"?id=$id&amp;delmsg=$msgid\">delete</a>"
328 cat << EOT
329 <p><strong>$USER</strong> $DATE $del</p>
330 <pre>
331 $(echo "$MSG" | wiki_parser)
332 </pre>
333 EOT
334 fi
335 unset NAME DATE MSG
336 done
337 if check_auth; then
338 cat << EOT
339 <div>
340 <h3>$(gettext "New message")</h3>
342 <input type="hidden" name="id" value="$id" />
343 <textarea name="msg" rows="8"></textarea>
344 <p><input type="submit" value="$(gettext 'Send message')" /></p>
345 </form>
346 </div>
347 EOT
348 fi
349 }
352 # Write a new message
353 new_msg() {
354 date=$(date "+%Y-%m-%d %H:%M")
355 msgs=$(ls -1 $bugdir/$id/msg.* | wc -l)
356 count=$(($msgs + 1))
357 if check_auth; then
358 USER="$user"
359 fi
360 js_log "Will write message in $bugdir/$id/msg.$count "
361 sed "s/$(echo -en '\r') /\n/g" > $bugdir/$id/msg.$count << EOT
362 USER="$USER"
363 DATE="$date"
364 MSG="$(GETfiltered msg)"
365 EOT
366 }
369 # Create a new Bug
370 new_bug() {
371 count=$(ls -1 $bugdir | wc -l)
372 date=$(date "+%Y-%m-%d %H:%M")
373 # Sanity check, JS may be disabled.
374 [ ! "$(GET bug)" ] && echo "Missing bug title" && exit 1
375 [ ! "$(GET desc)" ] && echo "Missing bug description" && exit 1
376 if check_auth; then
377 USER="$user"
378 fi
379 mkdir -p $bugdir/$count
380 sed "s/$(echo -en '\r') /\n/g" > $bugdir/$count/bug.conf << EOT
381 # SliTaz Bug configuration
383 BUG="$(GETfiltered bug)"
384 STATUS="OPEN"
385 PRIORITY="$(GET priority)"
386 CREATOR="$USER"
387 DATE="$date"
388 PKGS="$(GETfiltered pkgs)"
390 DESC="$(GETfiltered desc)"
391 EOT
392 }
395 # New bug page for the web interface
396 new_bug_page() {
397 cat << EOT
398 <h2>$(gettext "New Bug")</h2>
399 <div id="newbug">
401 <form method="get" action="$WEB_URL" onsubmit="return checkNewBug();">
402 <input type="hidden" name="addbug" />
403 <table>
404 <tbody>
405 <tr>
406 <td>$(gettext "Bug title")*</td>
407 <td><input type="text" name="bug" /></td>
408 </tr>
409 <tr>
410 <td>$(gettext "Description")*</td>
411 <td><textarea name="desc"></textarea></td>
412 </tr>
413 <tr>
414 <td>$(gettext "Packages")</td>
415 <td><input type="text" name="pkgs" /></td>
416 </tr>
417 <tr>
418 <td>$(gettext "Priority")</td>
419 <td>
420 <select name="priority">
421 <option value="standard">$(gettext "Standard")</option>
422 <option value="critical">$(gettext "Critical")</option>
423 </select>
424 <input type="submit" value="$(gettext "Create Bug")" />
425 </td>
426 </tr>
427 </tbody>
428 </table>
429 </form>
431 <p>
432 $(gettext "* field is obligatory. You can also specify affected packages.")
433 </p>
435 </div>
436 EOT
437 }
440 # Edit/Save a bug configuration file
441 edit_bug() {
442 cat << EOT
443 <h2>$(eval_gettext 'Edit Bug $bug')</h2>
444 <div id="edit">
446 <form method="get" action="$WEB_URL">
447 <textarea name="bugconf">$(cat $bugdir/$bug/bug.conf)</textarea>
448 <input type="hidden" name="bug" value="$bug" />
449 <input type="submit" value="$(gettext 'Save configuration')" />
450 </form>
452 </div>
453 EOT
454 }
457 save_bug() {
458 bug="$(GET bug)"
459 content="$(GET bugconf)"
460 sed "s|\"|'|" | sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.conf << EOT
461 $content
462 EOT
463 }
466 # Close a fixed bug
467 close_bug() {
468 sed -i s'/OPEN/CLOSED/' $bugdir/$id/bug.conf
469 }
472 # Re open an old bug
473 open_bug() {
474 sed -i s'/CLOSED/OPEN/' $bugdir/$id/bug.conf
475 }
478 # Get and display Gravatar image: get_gravatar email size
479 # Link to profile: <a href="http://www.gravatar.com/$md5">...</a>
480 get_gravatar() {
481 email=$1
482 size=$2
483 [ "$size" ] || size=48
484 url="http://www.gravatar.com/avatar"
485 md5=$(md5crypt $email)
486 echo "<img src=\"$url/$md5?d=identicon&amp;s=$size\" alt=\"\" />"
487 }
490 # Create a new user in AUTH_FILE and PEOPLE
491 new_user_config() {
492 if [ ! "$online" ]; then
493 name="$(GET name)"
494 mail="$(GET mail)"
495 pass="$(GET pass)"
496 echo "Creating Server Key..."
497 fi
498 key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}')
499 echo "$user:$pass" >> $AUTH_FILE
500 mkdir -pm0700 $PEOPLE/$user/
501 cat > $PEOPLE/$user/account.conf << EOT
502 # SliTaz user configuration
503 #
505 NAME="$name"
506 USER="$user"
507 MAIL="$mail"
508 KEY="$key"
510 COMMUNITY="$(GET scn)"
511 LOCATION="$(GET location)"
512 RELEASES="$(GET releases)"
513 PACKAGES="$(GET packages)"
514 EOT
515 chmod 0600 $PEOPLE/$user/account.conf
516 if [ ! -f $PEOPLE/$user/account.conf ]; then
517 echo "ERROR: User creation failed!"
518 fi
519 }
521 ########################################################################
522 # POST actions #
523 ########################################################################
525 case " $(POST) " in
526 *\ auth\ *)
527 header
528 html_header
529 # Authenticate user. Create a session file in $sessions to be used
530 # by check_auth. We have the user login name and a peer session
531 # md5 string in the COOKIE.
532 user="$(POST auth)"
533 pass="$(echo -n "$(POST pass)" | md5sum | awk '{print $1}')"
535 IDLOC=""
536 if [[ "$(GET id)" ]] ;then
537 IDLOC="&id=$(GET id)"
538 fi
540 if [ ! -f $AUTH_FILE ] ; then
541 js_log "$AUTH_FILE (defined in \$AUTH_FILE) have not been found."
542 js_redirection_to "$WEB_URL?login$IDLOC"
543 fi;
545 valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2)
546 if [ "$pass" == "$valid" ] && [ "$pass" != "" ]; then
547 if [[ "$(GET id)" ]] ;then
548 IDLOC="?id=$(GET id)"
549 fi
550 md5session=$(echo -n "$$:$user:$pass:$$" | md5sum | awk '{print $1}')
551 mkdir -p $sessions
552 echo "$md5session" > $sessions/$user
553 js_set_cookie 'auth' "$user:$md5session"
554 js_log "Login authentification have been executed & accepted :)"
555 js_redirection_to "$WEB_URL$IDLOC"
556 else
557 js_log "Login authentification have been executed & refused"
558 js_redirection_to "$WEB_URL?login&error$IDLOC"
559 fi
560 html_footer ;;
561 *\ signup\ *)
562 # POST action for online signup
563 name="$(POST name)"
564 user="$(POST user)"
565 mail="$(POST mail)"
566 pass="$(md5crypt "$(POST pass)")"
567 if ! grep "^${user}:" $AUTH_FILE; then
568 online="yes"
569 new_user_config
570 header "Location: $SCRIPT_NAME?login"
571 else
572 header
573 html_header
574 user_box
575 echo "<h2>gettext "User already exists: $user"</h2>"
576 html_footer && exit 0
577 fi ;;
578 esac
581 ########################################################################
582 # GET actions #
583 ########################################################################
585 case " $(GET) " in
586 *\ README\ *)
587 header
588 html_header
589 user_box
590 echo '<h2>README</h2>'
591 echo '<pre>'
592 cat /usr/share/doc/tazbug/README
593 echo '</pre>'
594 html_footer ;;
595 *\ closed\ *)
596 # Show all closed bugs.
597 header
598 html_header
599 user_box
600 list_bugs CLOSED
601 html_footer ;;
602 *\ login\ *)
603 # The login page
604 [ "$(GET error)" ] && \
605 error="<span class='error'>$(gettext 'Bad login or pass')</span>"
606 header
607 html_header
608 user_box
609 login_page
610 html_footer ;;
611 *\ logout\ *)
612 header
613 html_header
614 if check_auth; then
615 rm -f "$sessions/$user"
616 js_unset_cookie 'auth'
617 js_redirection_to "$WEB_URL"
619 fi ;;
620 *\ user\ *)
621 # User profile
622 header
623 html_header
624 user_box
625 . $PEOPLE/"$(GET user)"/account.conf
626 echo "<h2>$(get_gravatar $MAIL) $(GET user)</h2>"
627 if check_auth && [ "$(GET user)" == "$user" ]; then
628 auth_people
629 else
630 public_people
631 fi
632 html_footer ;;
633 *\ newbug\ *)
634 # Add a bug from web interface.
635 header
636 html_header
637 user_box
638 if check_auth; then
639 new_bug_page
640 else
641 echo "<p>$(gettext 'You must be logged in to post a new bug')</p>"
642 fi
643 html_footer ;;
644 *\ addbug\ *)
645 # Add a bug from web interface.
646 header
647 html_header
648 if check_auth; then
649 new_bug
650 js_redirection_to "$WEB_URL?id=$count"
651 fi ;;
652 *\ edit\ *)
653 bug="$(GET edit)"
654 header
655 html_header
656 user_box
657 edit_bug
658 html_footer ;;
659 *\ bugconf\ *)
660 header
661 html_header
662 if check_auth; then
663 save_bug
664 js_redirection_to "$WEB_URL?id=$bug"
665 fi ;;
666 *\ id\ *)
667 # Empty deleted messages to keep msg count working.
668 header
669 html_header
670 id="$(GET id)"
671 [ "$(GET close)" ] && close_bug
672 [ "$(GET open)" ] && open_bug
673 [ "$(GET msg)" ] && new_msg
674 [ "$(GET delmsg)" ] && rm -f $bugdir/$id/msg.$(GET delmsg) && \
675 touch $bugdir/$id/msg.$(GET delmsg)
676 msgs=$(fgrep MSG= $bugdir/$id/msg.* | wc -l)
677 user_box
678 . $bugdir/$id/bug.conf
679 bug_page
680 html_footer ;;
681 *\ signup\ *)
682 # Signup
683 if [ "$(GET online)" ];then
684 header
685 html_header
686 user_box
687 echo "<h2>$(gettext "Sign Up")</h2>"
688 if [ "$ONLINE_SIGNUP" == "yes" ]; then
689 signup_page
690 else
691 gettext "Online registration is disabled"
692 fi
693 html_footer && exit 0
694 else
695 header "Content-type: text/plain;"
696 user="$(GET signup)"
697 echo "Requested user login : $user"
698 if fgrep -q "$user:" $AUTH_FILE; then
699 echo "ERROR: User already exists" && exit 1
700 else
701 echo "Creating account for : $(GET name)"
702 new_user_config
703 fi
704 fi ;;
705 *\ key\ *)
706 # Let user post new bug or message with crypted key (no gettext)
707 #
708 # Testing only and is security acceptable ?
709 #
710 key="$(GET key)"
711 id="$(GET bug)"
712 header "Content-type: text/plain;"
713 echo "Checking secure key..."
714 if fgrep -qH $key $PEOPLE/*/account.conf; then
715 conf=$(fgrep -H $key $PEOPLE/*/account.conf | cut -d ":" -f 1)
716 . $conf
717 echo "Authentified: $NAME ($USER)"
718 case " $(GET) " in
719 *\ msg\ *)
720 [ ! "$id" ] && echo "Missing bug ID" && exit 0
721 echo "Posting new message to bug: $id"
722 echo "Message: $(GET msg)"
723 new_msg ;;
724 *\ bug\ *)
725 echo "Adding new bug: $(GET bug)"
726 echo "Description: $(GET desc)"
727 new_bug ;;
728 esac
729 else
730 echo "Not a valid SliTaz user key"
731 exit 0
732 fi ;;
733 *\ search\ *)
734 header
735 html_header
736 user_box
737 cat << EOT
738 <h2>$(gettext "Search")</h2>
739 <form method="get" action="$WEB_URL">
740 <input type="text" name="search" />
741 <input type="submit" value="$(gettext 'Search')" />
742 </form>
743 <div>
744 EOT
746 #found=0 JS to notify or write results nb under the search box.
747 for bug in $bugdir/*
748 do
749 result=$(fgrep -i "$(GET search)" $bug/*)
750 if [ "$result" ]; then
751 #found=$(($found + 1))
752 id=${bug#bug/}
753 echo "<p><strong>Bug $id</strong> <a href=\"?id=$id\">"$(gettext 'Show')"</a></p>"
754 echo '<pre>'
755 fgrep -i "$(GET search)" $bugdir/$id/* | \
756 sed s"/$(GET search)/<span class='ok'>$(GET search)<\/span>/"g
757 echo '</pre>'
758 else
759 get_search=$(GET search)
760 echo "<p>$(eval_gettext 'No result found for: $get_search')</p>"
761 fi
762 done
763 echo '</div>'
764 html_footer ;;
765 *)
766 # Default page.
767 bugs=$(ls -1 $bugdir | wc -l)
768 close=$(fgrep "CLOSED" $bugdir/*/bug.conf | wc -l)
769 fixme=$(fgrep "OPEN" $bugdir/*/bug.conf | wc -l)
770 msgs=$(find $bugdir -name msg.* ! -size 0 | wc -l)
771 pct=0
772 [ $bugs -gt 0 ] && pct=$(( ($close * 100) / $bugs ))
773 header
774 html_header
775 user_box
776 cat << EOT
778 <h2>$(gettext "Summary")</h2>
780 <p>
781 $(eval_ngettext 'Bug: $bugs in total -' 'Bugs: $bugs in total -' $bugs)
782 $(eval_ngettext '$close fixed -' '$close fixed -' $close)
783 $(eval_ngettext '$fixme to fix -' '$fixme to fix -' $fixme)
784 $(eval_ngettext '$msgs message' '$msgs messages' $msgs)
785 </p>
787 <div class="pctbar">
788 <div class="pct" style="width: ${pct}%;">${pct}%</div>
789 </div>
791 <p>$(gettext "Please read the <a href=\"?README\">README</a> for help and more \
792 information. You may also be interested by the SliTaz \
793 <a href=\"http://roadmap.slitaz.org/\">Roadmap</a> and the packages \
794 <a href=\"http://cook.slitaz.org/\">Cooker</a>. To perform a search \
795 enter your term and press ENTER.")
796 </p>
798 <div id="tools">
799 <a href="?closed">$(gettext 'View closed bugs')</a>
800 EOT
801 if check_auth; then
802 echo "<a href='?newbug'>$(gettext 'Create a new bug')</a>"
803 fi
804 cat << EOT
805 </div>
806 EOT
807 list_bugs OPEN
808 html_footer ;;
809 esac
812 ########################################################################
813 # Plugins #
814 ########################################################################
816 for p in $(ls -1 $plugins)
817 do
818 [ -f "$plugins/$p/$p.conf" ] && . $plugins/$p/$p.conf
819 [ -x "$plugins/$p/$p.cgi" ] && . $plugins/$p/$p.cgi
820 done
823 exit 0