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

Changeset 2906


Ignore:
Timestamp:
May 15, 2007, 8:09:52 PM (12 years ago)
Author:
ogawa
Message:

#758:日記登録・編集で公開範囲の指定されていない日記を作成できてしまう

Location:
OpenPNE/branches/2.8.x/webapp
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/2.8.x/webapp/lib/db/diary.php

    r2853 r2906  
    980980        'subject' => $subject,
    981981        'body' => $body,
    982         'public_flag' => $public_flag,
     982        'public_flag' => util_cast_public_flag_diary($public_flag),
    983983        'r_datetime' => db_now(),
    984984        'r_date' => db_now(),
     
    10011001        'subject' => $subject,
    10021002        'body' => $body,
    1003         'public_flag' => $public_flag,
     1003        'public_flag' => util_cast_public_flag_diary($public_flag),
    10041004    );
    10051005    if ($image_filename_1) $data['image_filename_1'] = $image_filename_1;
     
    11551155{
    11561156    $data = array(
    1157         'public_flag' => $public_flag,
     1157        'public_flag' => util_cast_public_flag_diary($public_flag),
    11581158    );
    11591159
  • OpenPNE/branches/2.8.x/webapp/lib/db/member.php

    r2904 r2906  
    10401040        'ashiato_mail_num' => intval($ashiato_mail_num),
    10411041        'c_password_query_id' => intval($c_password_query_id),
    1042         'public_flag_diary' => $public_flag_diary,
     1042        'public_flag_diary' => util_cast_public_flag_diary($public_flag_diary),
    10431043        'is_shinobiashi' => $is_shinobiashi,
    10441044        'schedule_start_day' => $schedule_start_day,
     
    14501450function db_member_update_public_flag_diary($c_member_id, $public_flag_diary)
    14511451{
    1452     $data = array('public_flag_diary' => strval($public_flag_diary));
     1452    $data = array('public_flag_diary' => util_cast_public_flag_diary($public_flag_diary));
    14531453    $where = array('c_member_id' => intval($c_member_id));
    14541454    db_update('c_member', $data, $where);
  • OpenPNE/branches/2.8.x/webapp/lib/util/util.php

    r2811 r2906  
    522522}
    523523
     524function util_cast_public_flag_diary($public_flag, $default = 'public')
     525{
     526    switch ($public_flag) {
     527    case 'public':
     528    case 'friend':
     529    case 'private':
     530        break;
     531    default:
     532        $public_flag = $default;
     533        break;
     534    }
     535    return $public_flag;
     536}
     537
    524538?>
  • OpenPNE/branches/2.8.x/webapp/modules/ktai/do/h_config_public_flag_diary.php

    r1856 r2906  
    1111        $tail = $GLOBALS['KTAI_URL_TAIL'];
    1212        $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     13        $public_flag = util_cast_public_flag_diary($requests['public_flag_diary']);
    1314
    14         db_member_update_public_flag_diary($u, $requests['public_flag_diary']);
     15        db_member_update_public_flag_diary($u, $public_flag);
    1516
    1617        $p = array('msg' => 35);
  • OpenPNE/branches/2.8.x/webapp/modules/ktai/do/h_diary_edit_insert_c_diary.php

    r2839 r2906  
    1818        $subject = $requests['subject'];
    1919        $body = $requests['body'];
    20         $public_flag = $requests['public_flag'];
     20        $public_flag = util_cast_public_flag_diary($requests['public_flag']);
    2121        $target_c_diary_id = $requests['target_c_diary_id'];
    2222        // ----------
  • OpenPNE/branches/2.8.x/webapp/modules/ktai/do/h_set_public_flag_all.php

    r2863 r2906  
    1515        $u = $GLOBALS['KTAI_C_MEMBER_ID'];
    1616
    17         switch ($requests['public_flag_diary_all']) {
    18         case 'public':
    19         default:
    20             $public_flag = 'public';
    21             break;
    22         case 'friend':
    23             $public_flag = 'friend';
    24             break;
    25         case 'private':
    26             $public_flag = 'private';
    27             break;
    28         }
     17        $public_flag = util_cast_public_flag_diary($requests['public_flag_diary_all']);
    2918       
    3019        db_diary_update_public_flag_diary_all($u, $public_flag);
  • OpenPNE/branches/2.8.x/webapp/modules/ktai/page/h_set_public_flag_all_confirm.php

    r2863 r2906  
    1111        $u = $GLOBALS['KTAI_C_MEMBER_ID'];
    1212
    13         switch ($requests['public_flag_diary_all']) {
    14             case 'public':
    15             default:
    16                 $public_flag = 'public';
    17                 break;
    18             case 'friend':
    19                 $public_flag = 'friend';
    20                 break;
    21             case 'private':
    22                 $public_flag = 'private';
    23                 break;
    24         }
     13        $public_flag = util_cast_public_flag_diary($requests['public_flag_diary_all']);
    2514
    2615        $this->set('public_flag_diary_all', $public_flag);
  • OpenPNE/branches/2.8.x/webapp/modules/pc/do/h_config_3.php

    r2904 r2906  
    2929        $c_password_query_id = $requests['c_password_query_id'];
    3030        $c_password_query_answer = $requests['c_password_query_answer'];
    31         $public_flag_diary = $requests['public_flag_diary'];
     31        $public_flag_diary = util_cast_public_flag_diary($requests['public_flag_diary']);
    3232        $is_shinobiashi = $requests['is_shinobiashi'];
    3333        $schedule_start_day = $requests['schedule_start_day'];
  • OpenPNE/branches/2.8.x/webapp/modules/pc/do/h_diary_add_insert_c_diary.php

    r2839 r2906  
    2626        $subject = $requests['subject'];
    2727        $body = $requests['body'];
    28         $public_flag = $requests['public_flag'];
     28        $public_flag = util_cast_public_flag_diary($requests['public_flag']);
    2929        $tmpfile_1 = $requests['tmpfile_1'];
    3030        $tmpfile_2 = $requests['tmpfile_2'];
  • OpenPNE/branches/2.8.x/webapp/modules/pc/do/h_diary_edit_insert_c_diary.php

    r2828 r2906  
    2727        $subject = $requests['subject'];
    2828        $body = $requests['body'];
    29         $public_flag = $requests['public_flag'];
     29        $public_flag = util_cast_public_flag_diary($requests['public_flag']);
    3030        $tmpfile_1 = $requests['tmpfile_1'];
    3131        $tmpfile_2 = $requests['tmpfile_2'];
  • OpenPNE/branches/2.8.x/webapp/modules/pc/do/h_set_public_flag_all.php

    r2862 r2906  
    1414        $u = $GLOBALS['AUTH']->uid();
    1515
    16         switch ($requests['public_flag_diary_all']) {
    17         case 'public':
    18         default:
    19             $public_flag = 'public';
    20             break;
    21         case 'friend':
    22             $public_flag = 'friend';
    23             break;
    24         case 'private':
    25             $public_flag = 'private';
    26             break;
    27         }
     16        $public_flag = util_cast_public_flag_diary($requests['public_flag_diary_all']);
    2817       
    2918        if ($requests['ok']) {
  • OpenPNE/branches/2.8.x/webapp/modules/pc/page/h_diary_add_confirm.php

    r2828 r2906  
    2323        $subject = $requests['subject'];
    2424        $body = $requests['body'];
    25         $public_flag = $requests['public_flag'];
     25        $public_flag = util_cast_public_flag_diary($requests['public_flag']);
    2626        $category = $requests['category'];
    2727        // ----------
  • OpenPNE/branches/2.8.x/webapp/modules/pc/page/h_diary_edit_confirm.php

    r2828 r2906  
    2222        $subject = $requests['subject'];
    2323        $body = $requests['body'];
    24         $public_flag = $requests['public_flag'];
     24        $public_flag = util_cast_public_flag_diary($requests['public_flag']);
    2525        $category = $requests['category'];
    2626        // ----------
  • OpenPNE/branches/2.8.x/webapp/modules/pc/page/h_set_public_flag_all_confirm.php

    r2862 r2906  
    1111        $u = $GLOBALS['AUTH']->uid();
    1212
    13         switch ($requests['public_flag_diary_all']) {
    14             case 'public':
    15             default:
    16                 $public_flag = 'public';
    17                 break;
    18             case 'friend':
    19                 $public_flag = 'friend';
    20                 break;
    21             case 'private':
    22                 $public_flag = 'private';
    23                 break;
    24         }
     13        $public_flag = util_cast_public_flag_diary($requests['public_flag_diary_all']);
    2514
    2615        $this->set('public_flag_diary_all', $public_flag);
Note: See TracChangeset for help on using the changeset viewer.