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

Changeset 2903


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

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

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

Legend:

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

    r2854 r2903  
    13981398{
    13991399    // 存在するIDのみを抽出
    1400     $c_member_id_block = array_unique(array_map('intval', $c_member_id_block));
    1401     if (!$c_member_id_block) {
    1402         return false;
    1403     }
    1404     $ids = implode(',', $c_member_id_block);
    1405     $sql = 'SELECT c_member_id FROM c_member WHERE c_member_id IN ('.$ids.')';
    1406     $c_member_id_block = db_get_col($sql);
     1400    $c_member_id_block = db_member_filter_c_access_block_id($c_member_id, $c_member_id_block);
    14071401
    14081402    $sql = 'DELETE FROM c_access_block WHERE c_member_id = ?';
     
    14111405
    14121406    foreach ($c_member_id_block as $id) {
    1413         if ($id == $c_member_id) continue;
    1414 
    14151407        $data = array(
    14161408            'c_member_id' => intval($c_member_id),
     
    14201412        db_insert('c_access_block', $data);
    14211413    }
     1414}
     1415
     1416function db_member_filter_c_access_block_id($c_member_id, $c_member_id_block)
     1417{
     1418    $c_member_id_block = array_unique(array_map('intval', $c_member_id_block));
     1419    if (!$c_member_id_block) {
     1420        return array();
     1421    }
     1422    $ids = implode(',', $c_member_id_block);
     1423    $sql = 'SELECT c_member_id FROM c_member WHERE (c_member_id IN ('.$ids.')) AND (c_member_id <> ?) ';
     1424    return db_get_col($sql, array($c_member_id));
    14221425}
    14231426
  • OpenPNE/branches/2.6.x/webapp/lib/util/ktai.php

    r2769 r2903  
    5353        37  => "このアドレスでは登録できません",
    5454        38  => "この個体識別番号はすでに登録されています",
     55        41  => "IDが有効な値ではありません",
    5556    );
    5657
  • OpenPNE/branches/2.6.x/webapp/modules/ktai/do/h_config_access_block_update.php

    r1276 r2903  
    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.6.x/webapp/modules/ktai/templates/h_config_access_block.tpl

    r2637 r2903  
    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.6.x/webapp/modules/pc/do/h_config_3.php

    r1271 r2903  
    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.