OSDN Git Service

BugTrack2/225: POST => post (patched by g@kko)
[pukiwiki/pukiwiki.git] / plugin / links.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: links.inc.php,v 1.24 2007/04/08 10:29:24 henoheno Exp $
4 // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team
5 // License: GPL v2 or (at your option) any later version
6 //
7 // Update link cache plugin
8
9 // Message setting
10 function plugin_links_init()
11 {
12         $messages = array(
13                 '_links_messages'=>array(
14                         'title_update'  => '¥­¥ã¥Ã¥·¥å¹¹¿·',
15                         'msg_adminpass' => '´ÉÍý¼Ô¥Ñ¥¹¥ï¡¼¥É',
16                         'btn_submit'    => '¼Â¹Ô',
17                         'msg_done'      => '¥­¥ã¥Ã¥·¥å¤Î¹¹¿·¤¬´°Î»¤·¤Þ¤·¤¿¡£',
18                         'msg_usage'     => "
19 * ½èÍýÆâÍÆ
20
21 :¥­¥ã¥Ã¥·¥å¤ò¹¹¿·|
22 Á´¤Æ¤Î¥Ú¡¼¥¸¤ò¥¹¥­¥ã¥ó¤·¡¢¤¢¤ë¥Ú¡¼¥¸¤¬¤É¤Î¥Ú¡¼¥¸¤«¤é¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¤«¤òÄ´ºº¤·¤Æ¡¢¥­¥ã¥Ã¥·¥å¤Ëµ­Ï¿¤·¤Þ¤¹¡£
23
24 * Ãí°Õ
25 ¼Â¹Ô¤Ë¤Ï¿ôʬ¤«¤«¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£¼Â¹Ô¥Ü¥¿¥ó¤ò²¡¤·¤¿¤¢¤È¡¢¤·¤Ð¤é¤¯¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£
26
27 * ¼Â¹Ô
28 ´ÉÍý¼Ô¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¤Æ¡¢[¼Â¹Ô]¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
29 "
30                 )
31         );
32         set_plugin_messages($messages);
33 }
34
35 function plugin_links_action()
36 {
37         global $script, $post, $vars, $foot_explain;
38         global $_links_messages;
39
40         if (PKWK_READONLY) die_message('PKWK_READONLY prohibits this');
41
42         $msg = $body = '';
43         if (empty($vars['action']) || empty($post['adminpass']) || ! pkwk_login($post['adminpass'])) {
44                 $msg   = & $_links_messages['title_update'];
45                 $body  = convert_html($_links_messages['msg_usage']);
46                 $body .= <<<EOD
47 <form method="post" action="$script">
48  <div>
49   <input type="hidden" name="plugin" value="links" />
50   <input type="hidden" name="action" value="update" />
51   <label for="_p_links_adminpass">{$_links_messages['msg_adminpass']}</label>
52   <input type="password" name="adminpass" id="_p_links_adminpass" size="20" value="" />
53   <input type="submit" value="{$_links_messages['btn_submit']}" />
54  </div>
55 </form>
56 EOD;
57
58         } else if ($vars['action'] == 'update') {
59                 links_init();
60                 $foot_explain = array(); // Exhaust footnotes
61                 $msg  = & $_links_messages['title_update'];
62                 $body = & $_links_messages['msg_done'    ];
63         } else {
64                 $msg  = & $_links_messages['title_update'];
65                 $body = & $_links_messages['err_invalid' ];
66         }
67         return array('msg'=>$msg, 'body'=>$body);
68 }
69 ?>