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

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

Last change on this file since 6563 was 6563, checked in by ogawa, 12 years ago

#2210:CSVインポートでプロフィール項目も登録できるようにする変更を取り込み

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