OSDN Git Service

Added pkwk_login() to check administrator password by system
authorhenoheno <henoheno>
Sun, 18 Jul 2004 10:38:54 +0000 (19:38 +0900)
committerhenoheno <henoheno>
Sun, 18 Jul 2004 10:38:54 +0000 (19:38 +0900)
func.php
plugin/diff.inc.php

index 7eae8ed..164ddfc 100644 (file)
--- a/func.php
+++ b/func.php
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: func.php,v 1.67 2004/07/18 09:53:05 henoheno Exp $
+// $Id: func.php,v 1.68 2004/07/18 10:38:54 henoheno Exp $
 //
 
 // Ê¸»úÎó¤¬InterWikiName¤«¤É¤¦¤«
@@ -668,6 +668,18 @@ function csv_implode($glue, $pieces)
        return join($glue, $arr);
 }
 
+function pkwk_login($pass = '')
+{
+       global $adminpass;
+
+       if ($pass != '' && md5($pass) == $adminpass) {
+               return TRUE;
+       } else {
+               sleep (2);      // Blocking brute force attack
+               return FALSE;
+       }
+}
+
 //is_a
 //(PHP 4 >= 4.2.0)
 //
index f3b6528..4911318 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: diff.inc.php,v 1.8 2004/07/18 10:12:40 henoheno Exp $
+// $Id: diff.inc.php,v 1.9 2004/07/18 10:38:54 henoheno Exp $
 //
 
 //¥Ú¡¼¥¸¤Îº¹Ê¬¤òɽ¼¨¤¹¤ë
@@ -87,7 +87,7 @@ function plugin_diff_delete($page)
        if ($body) return array('msg'=>$_title_diff_delete, 'body'=>$body);
 
        if (isset($vars['pass'])) {
-               if (md5($vars['pass']) == $adminpass) {
+               if (pkwk_login($vars['pass'])) {
                        unlink($filename);
                        return array(
                                'msg'  => $_title_diff_delete,
@@ -95,7 +95,6 @@ function plugin_diff_delete($page)
                        );
                } else {
                        $body .= "<p><strong>$_msg_invalidpass</strong></p>\n";
-                       sleep(2); // Blocking brute force attack
                }
        }