Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2006 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | /** |
---|
8 | * コミュニティトピック削除 |
---|
9 | */ |
---|
10 | class pc_do_c_bbs_delete_c_commu_topic extends OpenPNE_Action |
---|
11 | { |
---|
12 | function execute($requests) |
---|
13 | { |
---|
14 | $u = $GLOBALS['AUTH']->uid(); |
---|
15 | |
---|
16 | $target_c_commu_topic_id = $requests['target_c_commu_topic_id']; |
---|
17 | |
---|
18 | //--- 権限チェック |
---|
19 | //コミュニティ管理者 or トピック作成者 |
---|
20 | |
---|
21 | $c_commu_topic = _do_c_bbs_c_commu_topic4c_commu_topic_id($target_c_commu_topic_id); |
---|
22 | |
---|
23 | $c_commu_id = $c_commu_topic['c_commu_id']; |
---|
24 | |
---|
25 | $status = db_common_commu_status($u, $c_commu_id); |
---|
26 | if (!$status['is_commu_admin'] |
---|
27 | && $c_commu_topic['c_member_id'] != $u) { |
---|
28 | handle_kengen_error(); |
---|
29 | } |
---|
30 | $c_commu = db_commu_c_commu4c_commu_id2($c_commu_id); |
---|
31 | if ($c_commu['topic_authority'] == 'admin_only' && |
---|
32 | !db_commu_is_c_commu_admin($c_commu_id, $u)) { |
---|
33 | handle_kengen_error(); |
---|
34 | } |
---|
35 | //--- |
---|
36 | |
---|
37 | db_commu_delete_c_commu_topic($target_c_commu_topic_id); |
---|
38 | |
---|
39 | $p = array('target_c_commu_id' => $c_commu_topic['c_commu_id']); |
---|
40 | if ($c_commu_topic['event_flag']) { |
---|
41 | openpne_redirect('pc', 'page_c_event_list', $p); |
---|
42 | } else { |
---|
43 | openpne_redirect('pc', 'page_c_topic_list', $p); |
---|
44 | } |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.