OSDN Git Service

BugTrack2/384 Support LDAP Group - Security Group of Active Directory
[pukiwiki/pukiwiki.git] / lib / pukiwiki.php
index 36f0f86..62f6d52 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 // PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: pukiwiki.php,v 1.7 2005/04/10 04:48:42 henoheno Exp $
+// $Id: pukiwiki.php,v 1.23 2011/01/25 15:01:01 henoheno Exp $
 //
 // PukiWiki 1.4.*
-//  Copyright (C) 2002-2005 by PukiWiki Developers Team
-//  http://pukiwiki.org/
+//  Copyright (C) 2002-2005 by PukiWiki Development Team
+//  http://pukiwiki.osdn.jp/
 //
 // PukiWiki 1.3.*
-//  Copyright (C) 2002-2004 by PukiWiki Developers Team
-//  http://pukiwiki.org/
+//  Copyright (C) 2002-2004 by PukiWiki Development Team
+//  http://pukiwiki.osdn.jp/
 //
 // PukiWiki 1.3 (Base)
 //  Copyright (C) 2001-2002 by yu-ji <sng@factage.com>
@@ -46,17 +46,23 @@ require(LIB_DIR . 'make_link.php');
 require(LIB_DIR . 'diff.php');
 require(LIB_DIR . 'config.php');
 require(LIB_DIR . 'link.php');
-require(LIB_DIR . 'trackback.php');
 require(LIB_DIR . 'auth.php');
 require(LIB_DIR . 'proxy.php');
-require(LIB_DIR . 'mail.php');
 if (! extension_loaded('mbstring')) {
        require(LIB_DIR . 'mbstring.php');
 }
 
+// Defaults
+$notify = 0;
+
 // Load *.ini.php files and init PukiWiki
 require(LIB_DIR . 'init.php');
 
+// Load optional libraries
+if ($notify) {
+       require(LIB_DIR . 'mail.php'); // Mail notification
+}
+
 /////////////////////////////////////////////////
 // Main
 
@@ -71,6 +77,7 @@ if (isset($vars['cmd'])) {
        $plugin = '';
 }
 if ($plugin != '') {
+       ensure_valid_auth_user();
        if (exist_plugin_action($plugin)) {
                // Found and exec
                $retvars = do_plugin_action($plugin);
@@ -83,14 +90,14 @@ if ($plugin != '') {
                }
        } else {
                // Not found
-               $msg = 'plugin=' . htmlspecialchars($plugin) .
+               $msg = 'plugin=' . htmlsc($plugin) .
                        ' is not implemented.';
                $retvars = array('msg'=>$msg,'body'=>$msg);
                $base    = & $defaultpage;
        }
 }
 
-$title = htmlspecialchars(strip_bracket($base));
+$title = htmlsc(strip_bracket($base));
 $page  = make_search($base);
 if (isset($retvars['msg']) && $retvars['msg'] != '') {
        $title = str_replace('$1', $title, $retvars['msg']);
@@ -102,7 +109,7 @@ if (isset($retvars['body']) && $retvars['body'] != '') {
 } else {
        if ($base == '' || ! is_page($base)) {
                $base  = & $defaultpage;
-               $title = htmlspecialchars(strip_bracket($base));
+               $title = htmlsc(strip_bracket($base));
                $page  = make_search($base);
        }
 
@@ -110,11 +117,8 @@ if (isset($retvars['body']) && $retvars['body'] != '') {
        $vars['page'] = & $base;
 
        $body  = convert_html(get_source($base));
-       $body .= tb_get_rdf($base);
-       ref_save($base);
 }
 
 // Output
 catbody($title, $page, $body);
 exit;
-?>