<?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
*\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
\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
}\r
\r
function bm_doAddItem() {\r
- global $member, $manager;\r
+ global $member, $manager, $CONF;\r
\r
$manager->loadClass('ITEM');\r
$result = ITEM::createFromRequest();\r
\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
return $c;\r
}\r
\r
-?>
\ No newline at end of file
+?>\r