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

Changeset 2904


Ignore:
Timestamp:
May 15, 2007, 6:06:04 PM (12 years ago)
Author:
maruyama
Message:

#691:外部Blog・アクセスブロック設定時にエラーメッセージが出ない

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

Legend:

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

    r2853 r2904  
    14051405{
    14061406    // 存在するIDのみを抽出
    1407     $c_member_id_block = array_unique(array_map('intval', $c_member_id_block));
    1408     if (!$c_member_id_block) {
    1409         return false;
    1410     }
    1411     $ids = implode(',', $c_member_id_block);
    1412     $sql = 'SELECT c_member_id FROM c_member WHERE c_member_id IN ('.$ids.')';
    1413     $c_member_id_block = db_get_col($sql);
     1407    $c_member_id_block = db_member_filter_c_access_block_id($c_member_id, $c_member_id_block);
    14141408
    14151409    $sql = 'DELETE FROM c_access_block WHERE c_member_id = ?';
     
    14181412
    14191413    foreach ($c_member_id_block as $id) {
    1420         if ($id == $c_member_id) continue;
    1421 
    14221414        $data = array(
    14231415            'c_member_id' => intval($c_member_id),
     
    14271419        db_insert('c_access_block', $data);
    14281420    }
     1421}
     1422
     1423function db_member_filter_c_access_block_id($c_member_id, $c_member_id_block)
     1424{
     1425    $c_member_id_block = array_unique(array_map('intval', $c_member_id_block));
     1426    if (!$c_member_id_block) {
     1427        return array();
     1428    }
     1429    $ids = implode(',', $c_member_id_block);
     1430    $sql = 'SELECT c_member_id FROM c_member WHERE (c_member_id IN ('.$ids.')) AND (c_member_id <> ?) ';
     1431    return db_get_col($sql, array($c_member_id));
    14291432}
    14301433
  • OpenPNE/branches/2.8.x/webapp/lib/util/ktai.php

    r2863 r2904  
    5555        39  => "この個体識別番号はすでに登録されています",
    5656        40  => "日記の公開範囲を一括変更しました",
     57        41  => "IDが有効な値ではありません",
    5758    );
    5859
  • OpenPNE/branches/2.8.x/webapp/modules/ktai/do/h_config_access_block_update.php

    r1856 r2904  
    1717        $u = $GLOBALS['KTAI_C_MEMBER_ID'];
    1818
     19        $filtered_id = db_member_filter_c_access_block_id($u, $requests['c_member_id_block']);
     20        foreach ($requests['c_member_id_block'] as $each_id) {
     21            if (!in_array($each_id,$filtered_id)) {
     22                $p = array('msg' => 41);
     23                openpne_redirect('ktai', 'page_h_config_access_block', $p);
     24            }
     25        }
    1926        db_member_insert_c_access_block($u, $requests['c_member_id_block']);
    2027
  • OpenPNE/branches/2.8.x/webapp/modules/ktai/templates/h_config_access_block.tpl

    r2634 r2904  
    66アクセスをブロックするメンバーのIDを指定します。<br>
    77<br>
    8 
     8({if $msg})
     9<font color="red">({$msg})</font><br>
     10<br>
     11({/if})
    912({t_form m=ktai a=do_h_config_access_block_update})
    1013<input type="hidden" name="ksid" value="({$PHPSESSID})">
  • OpenPNE/branches/2.8.x/webapp/modules/pc/do/h_config_3.php

    r1856 r2904  
    3535
    3636        include_once 'OpenPNE/RSS.php';
    37 
    38         if ($rss_url = OpenPNE_RSS::auto_discovery($rss)) {
     37       
     38        $rss_url = OpenPNE_RSS::auto_discovery($rss);
     39       
     40        $msg_list = array();
     41        if ($rss && !$rss_url) $msg_list[] = "BlogのURLが有効な値ではありません";
     42        $filtered_id = db_member_filter_c_access_block_id($u, $c_member_id_block);
     43        foreach ($c_member_id_block as $each_id) {
     44            if (!in_array($each_id,$filtered_id)) {
     45                $msg_list[] = "アクセスブロックIDが有効な値ではありません";
     46                break;
     47            }
     48        }
     49       
     50        // error
     51        if ($msg_list) {
     52            $_REQUEST['msg'] = array_shift($msg_list);
     53            openpne_forward('pc', 'page', "h_config");
     54            exit;
     55        }
     56       
     57        if ($rss_url) {
    3958            $c_member = db_member_c_member4c_member_id($u);
    4059            if ($rss_url != $c_member['rss']) {
Note: See TracChangeset for help on using the changeset viewer.