ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE/trunk/webapp/modules/admin/init.inc @ 7111

Last change on this file since 7111 was 7111, checked in by ebihara, 12 years ago

#2372:delete_c_cmd_confirmが残っていたのを修正

File size: 8.1 KB
Line 
1<?php
2/**
3 * @copyright 2005-2008 OpenPNE Project
4 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
5 */
6
7// admin モジュール initialize 処理
8
9// auth関連設定
10session_name('OpenPNEadmin');
11isset($GLOBALS['OpenPNE']['admin']['session_lifetime'])
12    or $GLOBALS['OpenPNE']['admin']['session_lifetime'] = 0;
13isset($GLOBALS['OpenPNE']['admin']['session_idletime'])
14    or $GLOBALS['OpenPNE']['admin']['session_idletime'] = 0;
15
16// ライブラリ読み込み
17$module_lib_dir = dirname(__FILE__) . '/lib';
18require_once $module_lib_dir . '/db_admin.php';
19require_once $module_lib_dir . '/etc_admin.php';
20require_once $module_lib_dir . '/hash_admin.php';
21
22// 管理画面向け smarty plugins
23$GLOBALS['SMARTY']['plugins_dir'][] = $module_lib_dir . '/smarty_plugins/';
24
25// デフォルトページ
26$GLOBALS['__Framework']['default_page'] = 'top';
27
28// ハッシュから action名を取得
29$hash_tbl =& AdminHashTable::singleton();
30$action = $hash_tbl->action($action, $type);
31
32// ホワイトリスト
33$GLOBALS['_OPENPNE_ADMIN_AUTH_ACTIONS'] = array(
34// SNS設定のみ
35'normal_type' => array(
36
37'page_delete_c_banner_confirm',
38'page_delete_c_free_page_confirm',
39'page_delete_c_profile',
40'page_delete_c_rank_confirm',
41'page_edit_admin_password',
42'page_edit_c_admin_config',
43'page_edit_c_admin_info',
44'page_edit_c_banner',
45'page_edit_c_holiday',
46'page_edit_c_navi',
47'page_edit_c_profile',
48'page_edit_c_sns_config',
49'page_edit_c_sns_config_ktai',
50'page_edit_category',
51'page_edit_entry_point',
52'page_edit_mail_send',
53'page_edit_mail',
54'page_edit_skin_image',
55'page_insert_c_banner',
56'page_insert_c_free_page',
57'page_insert_c_profile',
58'page_insert_html',
59'page_limit_domain',
60'page_list_c_api',
61'page_list_c_cmd',
62'page_list_c_free_page',
63'page_list_c_rank',
64'page_login',
65'page_manage_c_commu',
66'page_top',
67'page_update_c_banner',
68'page_update_c_free_page',
69'page_update_c_profile',
70'page_update_c_rank',
71'page_update_deco',
72'do_delete_c_banner',
73'do_delete_c_cmd',
74'do_delete_c_commu_category_parent',
75'do_delete_c_commu_category',
76'do_delete_c_free_page',
77'do_delete_c_holiday',
78'do_delete_c_navi',
79'do_delete_c_profile_option',
80'do_delete_c_profile',
81'do_delete_c_rank',
82'do_delete_mail',
83'do_delete_skin_image',
84'do_edit_c_admin_info',
85'do_insert_c_banner',
86'do_insert_c_commu_category_parent',
87'do_insert_c_commu_category',
88'do_insert_c_free_page',
89'do_insert_c_holiday',
90'do_insert_c_profile_option',
91'do_insert_c_profile',
92'do_insert_c_rank',
93'do_insert_html',
94'do_login',
95'do_logout',
96'do_update_c_action',
97'do_update_c_admin_config',
98'do_update_c_admin_config_use_ktai_logo',
99'do_update_c_admin_user_password',
100'do_update_c_api',
101'do_update_c_banner',
102'do_update_c_cmd',
103'do_update_c_commu_category_parent',
104'do_update_c_commu_category',
105'do_update_c_commu_is_regist_join',
106'do_update_c_free_page',
107'do_update_c_holiday',
108'do_update_c_navi',
109'do_update_c_profile_option',
110'do_update_c_profile',
111'do_update_c_rank',
112'do_update_c_siteadmin_css',
113'do_update_c_sns_config',
114'do_update_c_sns_config_ktai',
115'do_update_entry_point',
116'do_update_limit_domain',
117'do_update_mail_send',
118'do_update_mail',
119'do_update_profile_sort_order',
120'do_update_side_banner_html',
121'do_update_skin_image',
122'do_update_skin_theme',
123'do_update_top_banner_html',
124'do_update_c_deco',
125),
126
127// メンバーリスト以外
128'_type' => array(
129
130'page_access_analysis_day',
131'page_access_analysis_member',
132'page_access_analysis_month',
133'page_access_analysis_page',
134'page_access_analysis_target_commu',
135'page_access_analysis_target_diary',
136'page_access_analysis_target_member',
137'page_access_analysis_target_topic',
138'page_commu_list',
139'page_delete_c_banner_confirm',
140'page_delete_c_file_confirm',
141'page_delete_c_free_page_confirm',
142'page_delete_c_image_confirm',
143'page_delete_c_profile',
144'page_delete_c_rank_confirm',
145'page_delete_diary_comment',
146'page_delete_diary',
147'page_delete_review',
148'page_delete_topic_comment',
149'page_delete_topic',
150'page_delete_commu',
151'page_diary_comment_list',
152'page_diary_list',
153'page_download_xml',
154'page_edit_admin_password',
155'page_edit_c_admin_config',
156'page_edit_c_admin_info',
157'page_edit_c_banner',
158'page_edit_c_holiday',
159'page_edit_c_image',
160'page_edit_c_navi',
161'page_edit_c_profile',
162'page_edit_c_sns_config',
163'page_edit_c_sns_config_ktai',
164'page_edit_category',
165'page_edit_entry_point',
166'page_edit_mail_send',
167'page_edit_mail',
168'page_edit_skin_image',
169'page_import_c_member',
170'page_insert_c_banner',
171'page_insert_c_free_page',
172'page_insert_c_profile',
173'page_insert_html',
174'page_limit_domain',
175'page_list_c_api',
176'page_list_c_cmd',
177'page_list_c_file',
178'page_list_c_free_page',
179'page_list_c_image',
180'page_list_c_rank',
181'page_login',
182'page_manage_c_commu',
183'page_review_list',
184'page_send_invites_confirm',
185'page_send_invites',
186'page_top',
187'page_topic_comment_list',
188'page_topic_list',
189'page_update_c_banner',
190'page_update_c_free_page',
191'page_update_c_profile',
192'page_update_c_rank',
193'page_user_analysis_date_day',
194'page_user_analysis_date_month',
195'page_user_analysis_generation',
196'page_edit_deco',
197'do_delete_c_banner',
198'do_delete_c_cmd',
199'do_delete_c_commu_category_parent',
200'do_delete_c_commu_category',
201'do_delete_c_file4c_file_id',
202'do_delete_c_free_page',
203'do_delete_c_holiday',
204'do_delete_c_image',
205'do_delete_c_image4c_image_id',
206'do_delete_c_navi',
207'do_delete_c_profile_option',
208'do_delete_c_profile',
209'do_delete_c_rank',
210'do_delete_kakikomi_c_commu_topic_comment',
211'do_delete_kakikomi_c_commu_topic',
212'do_delete_kakikomi_c_commu',
213'do_delete_kakikomi_c_diary_comment',
214'do_delete_kakikomi_c_diary',
215'do_delete_kakikomi_c_review',
216'do_delete_mail',
217'do_delete_skin_image',
218'do_download_xml',
219'do_edit_c_admin_info',
220'do_file_download',
221'do_import_c_member',
222'do_insert_c_banner',
223'do_insert_c_commu_category_parent',
224'do_insert_c_commu_category',
225'do_insert_c_free_page',
226'do_insert_c_holiday',
227'do_insert_c_image',
228'do_insert_c_profile_option',
229'do_insert_c_profile',
230'do_insert_c_rank',
231'do_insert_html',
232'do_login',
233'do_logout',
234'do_send_invites',
235'do_update_c_action',
236'do_update_c_admin_config',
237'do_update_c_admin_config_use_ktai_logo',
238'do_update_c_admin_user_password',
239'do_update_c_api',
240'do_update_c_banner',
241'do_update_c_cmd',
242'do_update_c_commu_category_parent',
243'do_update_c_commu_category',
244'do_update_c_commu_is_regist_join',
245'do_update_c_free_page',
246'do_update_c_holiday',
247'do_update_c_navi',
248'do_update_c_profile_option',
249'do_update_c_profile',
250'do_update_c_rank',
251'do_update_c_siteadmin_css',
252'do_update_c_sns_config',
253'do_update_c_sns_config_ktai',
254'do_update_entry_point',
255'do_update_limit_domain',
256'do_update_mail_send',
257'do_update_mail',
258'do_update_profile_sort_order',
259'do_update_side_banner_html',
260'do_update_skin_image',
261'do_update_skin_theme',
262'do_update_top_banner_html',
263'do_update_c_deco',
264),
265);
266
267function init_admin_page(&$smarty)
268{
269    $is_secure = $GLOBALS['__Framework']['is_secure'];
270    $smarty->assign('inc_header', admin_fetch_inc_header($is_secure));
271    $smarty->assign('inc_footer', admin_fetch_inc_footer($is_secure));
272    $v['module_name'] = ADMIN_MODULE_NAME;
273    $smarty->assign($v);
274    $smarty->assign_by_ref('hash_tbl', AdminHashTable::singleton());
275
276    if ($is_secure) {
277        @session_start();
278        $smarty->assign('PHPSESSID', md5(session_id()));
279
280        $auth_type = admin_get_auth_type();
281        $smarty->assign('auth_type', $auth_type);
282        $act = sprintf('page_%s', $GLOBALS['__Framework']['current_action']);
283        if ($auth_type != 'all' && !in_array($act, $GLOBALS['_OPENPNE_ADMIN_AUTH_ACTIONS'][$auth_type.'_type'])) {
284            admin_client_redirect('top', '指定されたページにはアクセスできません');
285        }
286    }
287}
288
289function init_admin_do()
290{
291    $is_secure = $GLOBALS['__Framework']['is_secure'];
292
293    if ($is_secure) {
294        @session_start();
295        if ($_REQUEST['sessid'] !== md5(session_id())) {
296            openpne_display_error('前の画面を再読み込みして、操作をやり直してください');
297        }
298        $auth_type = admin_get_auth_type();
299        $act = sprintf('do_%s', $GLOBALS['__Framework']['current_action']);
300        if ($auth_type != 'all' && !in_array($act, $GLOBALS['_OPENPNE_ADMIN_AUTH_ACTIONS'][$auth_type.'_type'])) {
301            admin_client_redirect('top', '指定されたページにはアクセスできません');
302        }
303    }
304}
305
306?>
Note: See TracBrowser for help on using the repository browser.