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 | class ktai_page_c_sub_admin_request extends OpenPNE_Action |
---|
8 | { |
---|
9 | function execute($requests) |
---|
10 | { |
---|
11 | $u = $GLOBALS['KTAI_C_MEMBER_ID']; |
---|
12 | |
---|
13 | // --- リクエスト変数 |
---|
14 | $target_c_commu_id = $requests['target_c_commu_id']; |
---|
15 | $target_c_member_id = $requests['target_c_member_id']; |
---|
16 | $body = $requests['body']; |
---|
17 | // ---------- |
---|
18 | |
---|
19 | //--- 権限チェック |
---|
20 | // コミュニティ管理者 |
---|
21 | // コミュニティ副管理者ではない |
---|
22 | // 自分自身へのメッセージ送信ではない |
---|
23 | // すでに管理者交代依頼メッセージ送信済みではない |
---|
24 | // すでに副管理者要請メッセージを送信済みでない |
---|
25 | |
---|
26 | if (!db_commu_is_c_commu_admin($target_c_commu_id, $u)) { |
---|
27 | handle_kengen_error(); |
---|
28 | } |
---|
29 | |
---|
30 | if (db_commu_is_c_commu_sub_admin($target_c_commu_id, $u)) { |
---|
31 | handle_kengen_error(); |
---|
32 | } |
---|
33 | |
---|
34 | if ($u == $target_c_member_id) { |
---|
35 | handle_kengen_error(); |
---|
36 | } |
---|
37 | |
---|
38 | $target_c_commu_admin_confirm_list = |
---|
39 | db_commu_anatani_c_commu_admin_confirm_list4c_member_id($target_c_member_id); |
---|
40 | if (!empty($target_c_commu_admin_confirm_list)) { |
---|
41 | foreach ($target_c_commu_admin_confirm_list as $value) { |
---|
42 | if ($value['c_commu_id'] == $target_c_commu_id) { |
---|
43 | handle_kengen_error(); |
---|
44 | } |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | $target_c_commu_sub_admin_confirm_list = |
---|
49 | db_commu_anatani_c_commu_sub_admin_confirm_list4c_member_id($target_c_member_id); |
---|
50 | if (!empty($target_c_commu_sub_admin_confirm_list)) { |
---|
51 | foreach ($target_c_commu_sub_admin_confirm_list as $value) { |
---|
52 | if ($value['c_commu_id'] == $target_c_commu_id) { |
---|
53 | handle_kengen_error(); |
---|
54 | } |
---|
55 | } |
---|
56 | } |
---|
57 | //--- |
---|
58 | |
---|
59 | $this->set('inc_navi', fetch_inc_navi("c", $target_c_commu_id)); |
---|
60 | |
---|
61 | $member = db_member_c_member_with_profile($target_c_member_id); |
---|
62 | $member['last_login'] = p_f_home_last_login4access_date($member['access_date']); |
---|
63 | |
---|
64 | $this->set("member", $member); |
---|
65 | $this->set("c_commu", db_commu_c_commu4c_commu_id($target_c_commu_id)); |
---|
66 | $this->set('body', $body); |
---|
67 | |
---|
68 | return 'success'; |
---|
69 | } |
---|
70 | } |
---|
71 | |
---|
72 | ?> |
---|