• R/O
  • SSH
  • HTTPS

bullet: 提交


Commit MetaInfo

修訂60 (tree)
時間2013-09-09 13:56:15
作者tsugehara

Log Message

setup.phpのチェック追加、apiにcontent-type指定を追加(ちょっと格好悪いかも)

Change Summary

差異

--- trunk/setup.php (revision 59)
+++ trunk/setup.php (revision 60)
@@ -140,11 +140,39 @@
140140
141141 $c[$i] = array(
142142 'name' => 'BASE_URL',
143- 'desc' => 'config.inc.phpで、正しいサーバのURLを設定してください。'
143+ 'desc' => 'config.inc.phpで、正しいサーバのURLを設定してください。現在 http:// から指定してしまうと問題が出るので、http://host/yukisuke/ というURLであれば、/yukisuke/ という形で指定してください。'
144144 );
145145 $c[$i++]['ret'] = BASE_URL. ' ('._url(BASE_URL).')';
146146
147+ require_once(LIB.'Skin.class.php');
148+ $skin = new Skin();
147149 $c[$i] = array(
150+ 'name' => 'スキンフォルダ',
151+ 'desc' => $skin->target_dir.'フォルダに書き込み権限を与えてください。'
152+ );
153+ $c[$i++]['ret'] = is_writable($skin->target_dir);
154+ $c[$i] = array(
155+ 'name' => 'admin.css',
156+ 'desc' => $skin->target_dir.'admin.cssに書き込み権限を与えてください。'
157+ );
158+ $c[$i++]['ret'] = is_writable($skin->target_dir.'admin.css');
159+ $c[$i] = array(
160+ 'name' => 'bullet-gethtml.css',
161+ 'desc' => $skin->target_dir.'bullet-gethtml.cssに書き込み権限を与えてください。'
162+ );
163+ $c[$i++]['ret'] = is_writable($skin->target_dir.'bullet-gethtml.css');
164+ $c[$i] = array(
165+ 'name' => 'main.css',
166+ 'desc' => $skin->target_dir.'main.cssに書き込み権限を与えてください。'
167+ );
168+ $c[$i++]['ret'] = is_writable($skin->target_dir.'main.css');
169+ $c[$i] = array(
170+ 'name' => 'url.css',
171+ 'desc' => $skin->target_dir.'url.cssに書き込み権限を与えてください。'
172+ );
173+ $c[$i++]['ret'] = is_writable($skin->target_dir.'url.css');
174+
175+ $c[$i] = array(
148176 'name' => 'TIMEZONE',
149177 'desc' => 'config.inc.phpを設定してください。日本ならAsia/Tokyoになります。'
150178 );
--- trunk/api/getnew.php (revision 59)
+++ trunk/api/getnew.php (revision 60)
@@ -5,6 +5,7 @@
55 try_update_session();
66 require_once(LIB.'Post.class.php');
77 $post = new Post();
8+ header('Content-type: application/json; charset=utf8');
89 echo json_encode($post->getNew(@$_GET['id'], $_GET));
910 }
1011 ?>
\ No newline at end of file
--- trunk/api/get_favorite_item.php (revision 59)
+++ trunk/api/get_favorite_item.php (revision 60)
@@ -19,5 +19,6 @@
1919 }
2020 $ret['count'] = $post->countFavorite($_GET['t'], @$_GET['key']);
2121
22+header('Content-type: application/json; charset=utf8');
2223 echo json_encode($ret);
2324 ?>
\ No newline at end of file
--- trunk/api/regist.php (revision 59)
+++ trunk/api/regist.php (revision 60)
@@ -32,7 +32,7 @@
3232 @$_POST['password'],
3333 @$_POST['display_name'],
3434 @$_POST['user_type_id'],
35- //TODO: 本当はメールバリデーションくらいやった方がいいけど。
35+ //TODO: 譛ャ蠖薙?繝。繝シ繝ォ繝舌Μ繝??繧キ繝ァ繝ウ縺上i縺?d縺」縺滓婿縺後>縺?¢縺ゥ縲
3636 isset($_POST['is_active']) ? $_POST['is_active'] : 1
3737 );
3838 if ($ret === FALSE)
@@ -52,5 +52,6 @@
5252 }
5353 $ret = new stdClass;
5454 $ret->ret = TRUE;
55+header('Content-type: application/json; charset=utf8');
5556 echo json_encode($ret);
5657 ?>
\ No newline at end of file
--- trunk/api/get_recent_theme.php (revision 59)
+++ trunk/api/get_recent_theme.php (revision 60)
@@ -5,6 +5,7 @@
55 header('Access-Control-Allow-Origin: *');
66 $post = new Post();
77 $n = @$_GET['name'];
8+header('Content-type: application/json; charset=utf8');
89 if (empty($n)) {
910 echo json_encode($post->getRecentTheme(@$_GET['limit']=='none' ? NULL : 10));
1011 } else {
--- trunk/api/save_keyword.php (revision 59)
+++ trunk/api/save_keyword.php (revision 60)
@@ -32,6 +32,7 @@
3232 if (! empty($_POST['no_ajax'])) {
3333 header('Location: '.BASE_URL);
3434 } else {
35+ header('Content-type: application/json; charset=utf8');
3536 echo json_encode($ret);
3637 }
3738 ?>
\ No newline at end of file
--- trunk/api/get_images.php (revision 59)
+++ trunk/api/get_images.php (revision 60)
@@ -4,6 +4,7 @@
44 if (can_action('operation')) {
55 require_once(LIB.'TImage.class.php');
66 $imgManager = new TImage();
7+ header('Content-type: application/json; charset=utf8');
78 echo json_encode($imgManager->listImage($_GET['d']));
89 }
910 ?>
\ No newline at end of file
--- trunk/api/edit_profile.php (revision 59)
+++ trunk/api/edit_profile.php (revision 60)
@@ -46,6 +46,7 @@
4646 $ret->message = $ex->getMessage();
4747 $ret->field = $ex->field;
4848 $ret->reason = $ex->reason;
49+ header('Content-type: application/json; charset=utf8');
4950 echo json_encode($ret);
5051 die;
5152 }
@@ -54,5 +55,6 @@
5455 $ret->ret = TRUE;
5556
5657
58+header('Content-type: application/json; charset=utf8');
5759 echo json_encode($ret);
5860 ?>
\ No newline at end of file
--- trunk/api/add_favorite_item.php (revision 59)
+++ trunk/api/add_favorite_item.php (revision 60)
@@ -32,6 +32,7 @@
3232 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
3333
3434 if ($ret === FALSE) {
35+ header('Content-type: application/json; charset=utf8');
3536 echo json_encode($ret);
3637 } else {
3738 echo json_encode(array(
--- trunk/api/del_image.php (revision 59)
+++ trunk/api/del_image.php (revision 60)
@@ -17,6 +17,7 @@
1717 if ($log_ret) {
1818 $ret = $imgManager->delete($_POST['d'], @$_POST['with_post']);
1919 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
20+ header('Content-type: application/json; charset=utf8');
2021 echo json_encode($ret);
2122 } else {
2223 echo json_encode(FALSE);
--- trunk/api/del_keyword.php (revision 59)
+++ trunk/api/del_keyword.php (revision 60)
@@ -15,6 +15,7 @@
1515 if ($log_ret) {
1616 $ret = $post->deleteKeyword($_POST['id']);
1717 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
18+ header('Content-type: application/json; charset=utf8');
1819 echo json_encode($ret);
1920 } else {
2021 echo json_encode(FALSE);
--- trunk/api/change_skin.php (revision 59)
+++ trunk/api/change_skin.php (revision 60)
@@ -18,6 +18,7 @@
1818 if ($log_ret) {
1919 $ret = $skin->generate();
2020 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
21+ header('Content-type: application/json; charset=utf8');
2122 echo json_encode($ret);
2223 if ($ret) {
2324 Setting::Set('skin', $_POST['skin']);
--- trunk/api/conversation.php (revision 59)
+++ trunk/api/conversation.php (revision 60)
@@ -7,6 +7,7 @@
77
88 require_once(LIB.'Post.class.php');
99 $post = new Post();
10+ header('Content-type: application/json; charset=utf8');
1011 echo json_encode($post->get($_GET, NULL));
1112 }
1213 ?>
\ No newline at end of file
--- trunk/api/get_hot_url.php (revision 59)
+++ trunk/api/get_hot_url.php (revision 60)
@@ -5,5 +5,6 @@
55 header('Access-Control-Allow-Origin: *');
66 $post = new Post();
77 $recents = $post->getRecentUrlUrls();
8+header('Content-type: application/json; charset=utf8');
89 echo json_encode($post->getHotUrl(@$_GET['limit']=='none' ? NULL : 3, $recents));
910 ?>
\ No newline at end of file
--- trunk/api/get_active_keyword.php (revision 59)
+++ trunk/api/get_active_keyword.php (revision 60)
@@ -4,5 +4,6 @@
44 require_once(LIB.'Post.class.php');
55 header('Access-Control-Allow-Origin: *');
66 $post = new Post();
7+header('Content-type: application/json; charset=utf8');
78 echo json_encode($post->getActiveKeyword(@$_GET['limit']=='none' ? NULL : 10));
89 ?>
\ No newline at end of file
--- trunk/api/get_favorite.php (revision 59)
+++ trunk/api/get_favorite.php (revision 60)
@@ -8,5 +8,6 @@
88 die;
99 }
1010
11+header('Content-type: application/json; charset=utf8');
1112 echo json_encode($post->getFavorites(@$_SESSION['user']['id'], @$_GET['ni']));
1213 ?>
\ No newline at end of file
--- trunk/api/getold.php (revision 59)
+++ trunk/api/getold.php (revision 60)
@@ -4,6 +4,7 @@
44 if (can_action('view')) {
55 require_once(LIB.'Post.class.php');
66 $post = new Post();
7+ header('Content-type: application/json; charset=utf8');
78 echo json_encode($post->getOld(@$_GET['id'], $_GET));
89 }
910 ?>
\ No newline at end of file
--- trunk/api/get.php (revision 59)
+++ trunk/api/get.php (revision 60)
@@ -5,6 +5,7 @@
55 try_update_session();
66 require_once(LIB.'Post.class.php');
77 $post = new Post();
8+ header('Content-type: application/json; charset=utf8');
89 if (empty($_GET['format'])) {
910 echo json_encode($post->get($_GET));
1011 } else {
--- trunk/api/get_favorite_items.php (revision 59)
+++ trunk/api/get_favorite_items.php (revision 60)
@@ -8,6 +8,7 @@
88 die;
99 }
1010
11+header('Content-type: application/json; charset=utf8');
1112 if (empty($_GET['id'])) {
1213 echo json_encode($post->getFavoriteItems());
1314 die;
--- trunk/api/read_box.php (revision 59)
+++ trunk/api/read_box.php (revision 60)
@@ -8,5 +8,6 @@
88 die;
99 }
1010
11+header('Content-type: application/json; charset=utf8');
1112 echo json_encode($box->readBox(@$_GET['name']));
1213 ?>
\ No newline at end of file
--- trunk/api/post.php (revision 59)
+++ trunk/api/post.php (revision 60)
@@ -67,6 +67,7 @@
6767 $user->tryUpdateSetting();
6868
6969 $content = $post->readBasic($ret);
70+ header('Content-type: application/json; charset=utf8');
7071 echo json_encode($content);
7172 } else {
7273 header('HTTP/1.0 500 Internal Server Error');
--- trunk/api/del_url.php (revision 59)
+++ trunk/api/del_url.php (revision 60)
@@ -15,6 +15,7 @@
1515 if ($log_ret) {
1616 $ret = $post->deleteUrl($_POST['id']);
1717 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
18+ header('Content-type: application/json; charset=utf8');
1819 echo json_encode($ret);
1920 } else {
2021 echo json_encode(FALSE);
--- trunk/api/new_favorite.php (revision 59)
+++ trunk/api/new_favorite.php (revision 60)
@@ -15,6 +15,7 @@
1515 'target_key' => @$_POST['name']
1616 ));
1717
18+header('Content-type: application/json; charset=utf8');
1819 if ($log_ret) {
1920 $ret = $post->addFavorite(
2021 empty($_POST['name']) ? date('Y/m/d H:i:s') : $_POST['name'],
--- trunk/api/profile.php (revision 59)
+++ trunk/api/profile.php (revision 60)
@@ -18,5 +18,6 @@
1818 $user = $userObj->readDetail($_GET['id']);
1919 }
2020
21+header('Content-type: application/json; charset=utf8');
2122 echo json_encode($user);
2223 ?>
\ No newline at end of file
--- trunk/api/get_recent_url.php (revision 59)
+++ trunk/api/get_recent_url.php (revision 60)
@@ -5,6 +5,7 @@
55 header('Access-Control-Allow-Origin: *');
66 $post = new Post();
77 $n = @$_GET['name'];
8+header('Content-type: application/json; charset=utf8');
89 if (empty($n)) {
910 echo json_encode($post->getRecentUrl(@$_GET['limit']=='none' ? NULL : 3));
1011 } else {
--- trunk/api/del_favorite.php (revision 59)
+++ trunk/api/del_favorite.php (revision 60)
@@ -19,6 +19,7 @@
1919 $ret = $post->deleteFavorite($_POST['id']);
2020 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
2121
22+ header('Content-type: application/json; charset=utf8');
2223 echo json_encode($ret);
2324 } else {
2425 echo json_encode(FALSE);
--- trunk/api/save_box.php (revision 59)
+++ trunk/api/save_box.php (revision 60)
@@ -30,6 +30,7 @@
3030 @$_POST['script']
3131 );
3232 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
33+ header('Content-type: application/json; charset=utf8');
3334 echo json_encode($ret);
3435 } else {
3536 echo json_encode(FALSE);
--- trunk/api/change_auth.php (revision 59)
+++ trunk/api/change_auth.php (revision 60)
@@ -21,6 +21,7 @@
2121 if ($log_ret) {
2222 $ret = $user->updateAuth($_POST['auth_name'], $_POST['user_type_id'], $_POST['auth']);
2323 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
24+ header('Content-type: application/json; charset=utf8');
2425 echo json_encode($ret);
2526 $user->saveAuthCache();
2627 } else {
--- trunk/api/copy_layout.php (revision 59)
+++ trunk/api/copy_layout.php (revision 60)
@@ -18,6 +18,7 @@
1818 $ret = $box->copyLayouts($_POST['src'], $_POST['dist']);
1919 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
2020 $box->updateLayoutCache();
21+ header('Content-type: application/json; charset=utf8');
2122 echo json_encode($ret);
2223 } else {
2324 echo json_encode(FALSE);
--- trunk/api/restore_skin.php (revision 59)
+++ trunk/api/restore_skin.php (revision 60)
@@ -1,6 +1,7 @@
11 <?php
22 include '../env.php';
33 require_once(LIB.'common.inc.php');
4+header('Content-type: application/json; charset=utf8');
45 if (can_action('admin')) {
56 require_once(LIB.'Skin.class.php');
67 $skin = new Skin();
--- trunk/api/del_post.php (revision 59)
+++ trunk/api/del_post.php (revision 60)
@@ -15,6 +15,7 @@
1515 if ($log_ret) {
1616 $ret = $post->deletePost($_POST['id']);
1717 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
18+ header('Content-type: application/json; charset=utf8');
1819 echo json_encode($ret);
1920 } else {
2021 echo json_encode(FALSE);
--- trunk/api/del_box.php (revision 59)
+++ trunk/api/del_box.php (revision 60)
@@ -15,6 +15,7 @@
1515 if ($log_ret) {
1616 $ret = $box->deleteBox($_POST['old_name']);
1717 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
18+ header('Content-type: application/json; charset=utf8');
1819 echo json_encode($ret);
1920 } else {
2021 echo json_encode(FALSE);
--- trunk/api/save_theme.php (revision 59)
+++ trunk/api/save_theme.php (revision 60)
@@ -49,6 +49,7 @@
4949 if (! empty($_POST['no_ajax'])) {
5050 header('Location: '.BASE_URL.'theme/'.@$_POST['name']);
5151 } else {
52+ header('Content-type: application/json; charset=utf8');
5253 echo json_encode($ret);
5354 }
5455 ?>
\ No newline at end of file
--- trunk/api/del_favorite_item.php (revision 59)
+++ trunk/api/del_favorite_item.php (revision 60)
@@ -29,6 +29,7 @@
2929 $ret = $post->deleteFavoriteItem($favo['id']);
3030 }
3131 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
32+ header('Content-type: application/json; charset=utf8');
3233 if ($ret === FALSE) {
3334 echo json_encode($ret);
3435 } else {
--- trunk/api/update_favorite.php (revision 59)
+++ trunk/api/update_favorite.php (revision 60)
@@ -24,6 +24,7 @@
2424 if ($ret === FALSE) {
2525 //echo json_encode($ret);
2626 } else {
27+ header('Content-type: application/json; charset=utf8');
2728 echo json_encode($post->readFavoriteCache($_POST['id']));
2829 }
2930 } else {
--- trunk/api/change_layout.php (revision 59)
+++ trunk/api/change_layout.php (revision 60)
@@ -18,6 +18,7 @@
1818 $ret = $box->updateLayout($_POST['page_name'], $_POST['box_name'], $_POST['has'], @$_POST['sort']);
1919 $box->updateLayoutCache();
2020 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
21+ header('Content-type: application/json; charset=utf8');
2122 echo json_encode($ret);
2223 } else {
2324 echo json_encode(FALSE);
--- trunk/api/del_theme.php (revision 59)
+++ trunk/api/del_theme.php (revision 60)
@@ -15,6 +15,7 @@
1515 if ($log_ret) {
1616 $ret = $post->deleteTheme($_POST['id']);
1717 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
18+ header('Content-type: application/json; charset=utf8');
1819 echo json_encode($ret);
1920 } else {
2021 echo json_encode(FALSE);
--- trunk/api/get_theme_cloud.php (revision 59)
+++ trunk/api/get_theme_cloud.php (revision 60)
@@ -5,5 +5,6 @@
55 $post = new Post();
66 $tmp_ret = $post->getThemeCloud(30, TRUE);
77 shuffle($tmp_ret);
8+header('Content-type: application/json; charset=utf8');
89 echo json_encode($tmp_ret);
910 ?>
\ No newline at end of file
--- trunk/api/del_favorite_item_by_id.php (revision 59)
+++ trunk/api/del_favorite_item_by_id.php (revision 60)
@@ -23,6 +23,7 @@
2323 $ret = $post->deleteFavoriteItem($favo['id']);
2424 }
2525 _a_log_write($log_ret, array('success' => $ret === FALSE ? '0' : '1'));
26+ header('Content-type: application/json; charset=utf8');
2627 if ($ret === FALSE) {
2728 echo json_encode($ret);
2829 } else {
Show on old repository browser