OSDN Git Service

added 'white-space: nowrap' to th tag
[nucleus-jp/nucleus-jp-ancient.git] / euc / nucleus / bookmarklet.php
index f1c11f0..4ab4d61 100755 (executable)
@@ -1,7 +1,7 @@
 <?php\r
 /**\r
   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) \r
-  * Copyright (C) 2002-2004 The Nucleus Group\r
+  * Copyright (C) 2002-2005 The Nucleus Group\r
   *\r
   * This program is free software; you can redistribute it and/or\r
   * modify it under the terms of the GNU General Public License\r
@@ -11,6 +11,9 @@
   *\r
   * This script allows adding items to Nucleus through bookmarklets. The member must be logged in\r
   * in order to use this.\r
+  *\r
+  * $Id: bookmarklet.php,v 1.3 2005-03-16 08:04:14 kimitake Exp $\r
+  * $NucleusJP: bookmarklet.php,v 1.4 2005/03/15 08:24:16 kimitake Exp $\r
   */\r
 \r
 // bookmarklet is part of admin area (might need XML-RPC)\r
@@ -40,6 +43,16 @@ if ($action == '')
        \r
 sendContentType('application/xhtml+xml', 'bookmarklet-'.$action);      \r
 \r
+// check ticket\r
+$action = strtolower($action);\r
+$aActionsNotToCheck = array('login', 'add', 'edit');\r
+if (!in_array($action, $aActionsNotToCheck))\r
+{\r
+       if (!$manager->checkTicket())\r
+               bm_doError(_ERROR_BADTICKET);\r
+} \r
+\r
+\r
 // find out what to do\r
 switch ($action) {\r
        case 'additem':\r
@@ -61,7 +74,7 @@ switch ($action) {
 }\r
        \r
 function bm_doAddItem() {\r
-       global $member, $manager;\r
+       global $member, $manager, $CONF;\r
        \r
        $manager->loadClass('ITEM');\r
        $result = ITEM::createFromRequest();\r
@@ -291,7 +304,7 @@ wingm.focus();
 \r
 function uniDecode($str,$charcode){\r
   $text = preg_replace_callback("/%u[0-9A-Za-z]{4}/",toUtf8,$str);\r
-  return mb_convert_encoding($text, $charcode, 'utf-8');\r
+  return mb_convert_encoding($text, $charcode, 'UTF-8');\r
 }\r
 function toUtf8($ar){\r
   foreach($ar as $val){\r
@@ -310,4 +323,4 @@ function toUtf8($ar){
   return $c;\r
 }\r
 \r
-?>
\ No newline at end of file
+?>\r