function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_row($community_id);
     $community_row['community_profile'] = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D07'));
     // 取得期間
     $term = intval($request->ACSgetParameter('term'));
     if (!$term) {
         // システム設定: コミュニティ: 掲示板RSS取得期間
         $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D03'), 'BBS_RSS_TERM');
     }
     // 最新の掲示板RSS
     $bbs_row_array = ACSBBS::get_new_bbs_rss_row_array($community_id, $term);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('term', $term);
     return View::SUCCESS;
 }
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $community_id = $request->getParameter('community_id');
     $bbs_id = $request->getParameter('bbs_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_row($community_id);
     // BBS記事一覧
     $bbs_row = ACSBBS::get_bbs_row($bbs_id);
     // 信頼済みコミュニティ一覧
     $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row', $bbs_row);
     // (投稿者本人 or コミュニティ管理者)のみがアクセスできる
     if ($acs_user_info_row['user_community_id'] != $bbs_row['user_community_id'] && !ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id'])) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     return View::INPUT;
 }
Beispiel #3
0
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     $community_row = ACSExternalRSS::add_contents_row_array($community_row);
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
         // 返信記事
         $bbs_row_array[$index]['bbs_res_row_array'] = ACSBBS::get_bbs_res_row_array($bbs_row['bbs_id']);
     }
     if ($community_row['contents_row_array']['self']['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03')) {
         // 非公開コミュニティ
         $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D43'));
     } else {
         // 公開範囲
         $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     return View::INPUT;
 }
 function execute()
 {
     $context =& $this->getContext();
     $controller = $context->getController();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSGetParameter('community_id');
     // コミュニティ存在チェック
     $community_row = ACSCommunity::get_community_row($community_id);
     if (!$community_row || $community_row['community_type_name'] != ACSMsg::get_mst('community_type_master', 'D40')) {
         return View::ERROR;
     }
     // 権限チェック
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // サブコミュニティ情報の一覧
     $sub_community_row_array = ACSCommunity::get_sub_community_row_array($community_id);
     // 親コミュニティ情報の一覧
     $parent_community_row_array = ACSCommunity::get_parent_community_row_array($community_id);
     // コミュニティメンバ, コミュニティ管理者
     $community_member_user_info_row_array = ACSCommunity::get_community_member_user_info_row_array($community_id);
     $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_id);
     // 待機: コミュニティ参加 承認待ち
     $waiting_for_join_community_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     // 待機: 親コミュニティ追加, サブコミュニティ追加
     $waiting_for_parent_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     $waiting_for_sub_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     // 最新情報: BBS
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('sub_community_row_array', $sub_community_row_array);
     $request->setAttribute('parent_community_row_array', $parent_community_row_array);
     $request->setAttribute('community_member_user_info_row_array', $community_member_user_info_row_array);
     $request->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array);
     $request->setAttribute('waiting_for_join_community_row_array', $waiting_for_join_community_row_array);
     $request->setAttribute('waiting_for_parent_community_link_row_array', $waiting_for_parent_community_link_row_array);
     $request->setAttribute('waiting_for_sub_community_link_row_array', $waiting_for_sub_community_link_row_array);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     return View::SUCCESS;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     return View::SUCCESS;
 }
 function get_execute_privilege()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // 公開範囲情報取得
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $bbs_row = ACSBBS::get_bbs_row($request->ACSGetParameter('id'));
     if (!$bbs_row) {
         return false;
     }
     // パブリックリリース
     if ($bbs_row['open_level_code'] == '06') {
         return true;
     }
     $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     $target_community_row = ACSCommunity::get_community_profile_row($bbs_row['bbs_community_id']);
     // スレッドごとのアクセス制御判定
     $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $target_community_row);
     $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_row);
     return $ret;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 画面上のフォーム情報を取得する
     if ($move_id == 1) {
         $form = $request->getParameters('search_form_default');
     } else {
         if ($move_id == 2) {
             $form = $request->getParameters('search_form_new');
         }
     }
     // formの情報に従い検索を行う
     if ($move_id > 0) {
         $err_str = "";
         /*	Array
         			    [id] => 1000
         			    [move_id] => 2
         			    [q_text] => 検索条件					//条件(※必須)
         			    [search_title] => title_in_serch		//件名を選択
         			    [search_all] => subject_in_serch		//本文を選択
         			    [open_level_code] => 00					//公開範囲(00は選択なし)(※必須)
         			    [search_all_about] => all_in_serch		//すべてのBBSを選択
         			*/
         // ------------ 検索情報の取得(注意!バイト単位で処理)
         for ($i = 1; $i < 3; $i++) {
             $str_where_create[$i] = ACSBBS::set_bbs_where_list($form, $i);
             if ($str_where_create[$i]['err_str']) {
                 $err_str = $str_where_create[$i]['err_str'];
                 //where句の一部が作成できないオペレータミス
                 if ($err_str != '') {
                     break;
                 }
             } else {
                 $str_where[$i] = $str_where_create[$i]['like_sql'];
             }
         }
         //公開範囲は別指定
         $str_open_level_code = '00';
         if ($form['open_level_code'] != '00') {
             //公開範囲を選択している場合
             $str_open_level_code = $form['open_level_code'];
         }
         // ------------
         //db検索処理 and or 2回行う
         if (!$err_str) {
             $bbs_row_array_result = ACSBBS::get_bbs_where_array($str_where[1], $str_open_level_code, array());
             //複合条件のサマリ
             //and完全一致を省いた日記からor部分一致を検索する
             if ($str_where_create[1]['str_count'] == 2 || $str_where_create[2]['str_count'] == 2) {
                 $str_where_create['not_id'] = array();
                 foreach ($bbs_row_array_result as $index => $bbs_row) {
                     array_push($str_where_create['not_id'], $bbs_row['bbs_id']);
                 }
                 $bbs_row_array_not = ACSBBS::get_bbs_where_array($str_where[2], $str_open_level_code, $str_where_create['not_id']);
                 foreach ($bbs_row_array_not as $index => $bbs_row) {
                     array_push($bbs_row_array_result, $bbs_row);
                 }
             }
             if (!$bbs_row_array_result) {
                 $err_str = ACSMsg::get_msg('Community', 'SearchResultBBSAction.class.php', 'M001');
             } else {
                 // 信頼済みコミュニティ情報
                 foreach ($bbs_row_array_result as $index => $bbs_row) {
                     // 信頼済みコミュニティ一覧
                     $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
                 }
             }
         }
     }
     $request->setAttribute('bbs_row_array_result', $bbs_row_array_result);
     $request->setAttribute('err_str', $err_str);
     $request->setAttribute('form_pre', $form);
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // set
     $user->setAttribute('acs_user_info_row', $acs_user_info_row);
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     //		$request->setAttribute('friends_group_row_array', $friends_group_row_array);
     return View::SUCCESS;
 }
 function get_execute_privilege(&$controller, &$request, &$user)
 {
     // 公開範囲情報取得
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $target_community_row = ACSCommunity::get_community_profile_row($request->getParameter('community_id'));
     $bbs_row = ACSBBS::get_bbs_row($request->getParameter('bbs_id'));
     if (!$bbs_row) {
         return false;
     }
     $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     // アクセス制御判定
     $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $target_community_row);
     $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_row);
     return $ret;
 }