[2] | 1 | <?php |
---|
| 2 | /** |
---|
[4933] | 3 | * @copyright 2005-2008 OpenPNE Project |
---|
[2] | 4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | class ktai_page_h_diary_edit extends OpenPNE_Action |
---|
| 8 | { |
---|
| 9 | function execute($requests) |
---|
| 10 | { |
---|
| 11 | $u = $GLOBALS['KTAI_C_MEMBER_ID']; |
---|
| 12 | |
---|
| 13 | // --- リクエスト変数 |
---|
| 14 | $target_c_diary_id = $requests['target_c_diary_id']; |
---|
[11346] | 15 | $public_flag = $requests['public_flag']; |
---|
[2] | 16 | // ---------- |
---|
| 17 | |
---|
[1268] | 18 | $c_member = db_member_c_member4c_member_id($u); |
---|
[2] | 19 | if ($target_c_diary_id) { |
---|
| 20 | $c_diary = db_diary_get_c_diary4id($target_c_diary_id); |
---|
| 21 | |
---|
| 22 | if ($c_diary['c_member_id'] != $u) { |
---|
| 23 | handle_kengen_error(); |
---|
| 24 | } |
---|
[11346] | 25 | if (array_key_exists('subject', $requests)) { |
---|
| 26 | $c_diary['subject'] = $subject; |
---|
| 27 | } |
---|
| 28 | if (array_key_exists('body', $requests)) { |
---|
| 29 | $c_diary['body'] = $body; |
---|
| 30 | } |
---|
| 31 | if ($public_flag) { |
---|
| 32 | $c_diary['pulic_flag'] = $public_flag; |
---|
| 33 | } |
---|
| 34 | $this->set('target_c_diary', $c_diary); |
---|
[243] | 35 | } else { |
---|
[11346] | 36 | $c_diary['public_flag'] = $public_flag ? $public_flag : $c_member['public_flag_diary']; |
---|
[243] | 37 | $this->set('target_c_diary', $c_diary); |
---|
[2] | 38 | } |
---|
| 39 | |
---|
| 40 | if (MAIL_ADDRESS_HASHED) { |
---|
| 41 | $mail_address = "b{$u}-".t_get_user_hash($u)."@".MAIL_SERVER_DOMAIN; |
---|
| 42 | } else { |
---|
| 43 | $mail_address = "blog"."@".MAIL_SERVER_DOMAIN;; |
---|
| 44 | } |
---|
[13] | 45 | $mail_address = MAIL_ADDRESS_PREFIX . $mail_address; |
---|
[2] | 46 | $this->set('blog_address', $mail_address); |
---|
| 47 | |
---|
[2641] | 48 | //メンバー情報 |
---|
[260] | 49 | $this->set('member', $c_member); |
---|
[243] | 50 | |
---|
| 51 | |
---|
[2] | 52 | return 'success'; |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | ?> |
---|