1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2007 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | class ktai_do_c_edit_update_c_commu extends OpenPNE_Action |
---|
8 | { |
---|
9 | function handleError($errors) |
---|
10 | { |
---|
11 | ktai_display_error($errors); |
---|
12 | } |
---|
13 | |
---|
14 | function execute($requests) |
---|
15 | { |
---|
16 | $tail = $GLOBALS['KTAI_URL_TAIL']; |
---|
17 | $u = $GLOBALS['KTAI_C_MEMBER_ID']; |
---|
18 | |
---|
19 | // --- リクエスト変数 |
---|
20 | $target_c_commu_id = $requests['target_c_commu_id']; |
---|
21 | $name = $requests['name']; |
---|
22 | $c_commu_category_id = $requests['c_commu_category_id']; |
---|
23 | $info = $requests['info']; |
---|
24 | $public_flag = $requests['public_flag']; |
---|
25 | $topic_authority = $requests['topic_authority']; |
---|
26 | |
---|
27 | if ( db_commu_is_changed_c_commu_name($target_c_commu_id, $name) |
---|
28 | && db_commu_is_commu4c_commu_name($name)) { |
---|
29 | $p = array('msg' => 47); |
---|
30 | openpne_redirect('ktai', 'page_c_edit', $p); |
---|
31 | } |
---|
32 | // ---------- |
---|
33 | |
---|
34 | //--- 権限チェック |
---|
35 | //コミュニティ管理者 |
---|
36 | |
---|
37 | $status = db_common_commu_status($u, $target_c_commu_id); |
---|
38 | if (!$status['is_commu_admin']) { |
---|
39 | handle_kengen_error(); |
---|
40 | } |
---|
41 | //--- |
---|
42 | |
---|
43 | // 承認待ちメンバー登録処理 |
---|
44 | $c_commu = db_commu_c_commu4c_commu_id($target_c_commu_id); |
---|
45 | if ($public_flag == 'public' && $public_flag != $c_commu['public_flag']) { |
---|
46 | $c_commu_member_confirm_list = db_commu_c_commu_member_confirm4c_commu_id($target_c_commu_id); |
---|
47 | foreach ($c_commu_member_confirm_list as $c_commu_member_confirm) { |
---|
48 | db_commu_join_c_commu($target_c_commu_id, $c_commu_member_confirm['c_member_id']); |
---|
49 | do_inc_join_c_commu_send_mail($target_c_commu_id, $c_commu_member_confirm['c_member_id']); |
---|
50 | db_commu_delete_c_commu_member_confirm($c_commu_member_confirm['c_commu_member_confirm_id']); |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | db_commu_update_c_commu($target_c_commu_id, $name, $topic_authority, $c_commu_category_id, $info, $public_flag); |
---|
55 | |
---|
56 | $p = array('target_c_commu_id' => $target_c_commu_id); |
---|
57 | openpne_redirect('ktai', 'page_c_home', $p); |
---|
58 | } |
---|
59 | } |
---|
60 | |
---|
61 | ?> |
---|