function get_access_control_info(&$controller, &$request, &$user) { $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_contents_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D41')); $bbs_contents_row['trusted_community_row_array'] = ACSCommunity::get_contents_trusted_community_row_array($community_id, $bbs_contents_row['contents_type_code'], $bbs_contents_row['open_level_code']); $access_control_info = array('role_array' => ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row), 'contents_row_array' => array($bbs_contents_row)); return $access_control_info; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $community_row = $request->getAttribute('community_row'); $bbs_row_array = $request->getAttribute('bbs_row_array'); $term = $request->getAttribute('term'); // ユーザ情報 $community_row['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']; $community_row['image_url'] = ACSCommunity::get_image_url($community_row['community_id']); if ($community_row['file_id'] != '') { $community_file_info_row = ACSFileInfoModel::select_file_info_row($community_row['file_id']); $community_row['image_title'] = $community_file_info_row['display_file_name']; } else { // コミュニティ写真はありません $community_row['image_title'] = ACSMsg::get_msg('Community', ' BBSRSSSuccessView.class.php', 'M001'); } // 加工 foreach ($bbs_row_array as $index => $bbs_row) { // 親記事の投稿者 トップページURL $bbs_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $bbs_row['community_id']; // 返信画面URL $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; // ファイルの画像URL if ($bbs_row['file_id'] != "") { $bbs_row_array[$index]['file_url'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'rss'); } } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array); //----------------------// // ACSBBS::print_bbs_rss()で使用するパラメータをセットする $params = array(); // ベースURL if ($acs_user_info_row['is_acs_user']) { $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL'); } else { $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL'); } // 自身のURL $params['rss_syndication_url'] = $params['base_url'] . $this->getControllerPath('Community', 'BBSRSS') . '&id=' . $community_row['community_id'] . '&term=' . $term; // RSS出力部 ACSBBS::print_bbs_rss($community_row, $bbs_row_array, $params); // 終了 exit; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $community_row = $request->getAttribute('community_row'); $bbs_row_array = $request->getAttribute('bbs_row_array'); // コミュニティトップページのURL $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']; // BBS URL $bbs_top_page_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_row['community_id']; // 加工 foreach ($bbs_row_array as $index => $bbs_row) { // 親記事の投稿者 トップページURL $bbs_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_row['user_community_id']; // 投稿日時 $bbs_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['post_date']); // 返信画面URL $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array); //----------------------// // set $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('bbs_top_page_url', $bbs_top_page_url); $this->setAttribute('community_row', $request->getAttribute('community_row')); $this->setAttribute('bbs_row_array', $bbs_row_array); // テンプレート $this->setScreenId("0001"); $this->setTemplate('BBSThreadList.tpl.php'); return parent::execute(); }
/** * フォルダにアクセス権があるか * * @param $target_community_row 表示対象コミュニティ情報 * @return true / false */ function has_privilege($target_community_row) { $ret_folder_obj_array = array(); /* role_array 取得 */ $role_array = ACSAccessControl::get_community_role_array($this->get_acs_user_info_row(), $target_community_row); $folder_obj = $this->get_folder_obj(); $ret_folder_obj = ACSAccessControl::get_valid_obj_row_array_for_community($this->get_acs_user_info_row(), $role_array, array($folder_obj)); if ($ret_folder_obj) { return true; // ない場合は、アクセス不可 } else { return false; } }
function execute() { $context =& $this->getContext(); $user = $context->getUser(); $request = $context->getRequest(); $controller = $context->getController(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $community_row = $request->getAttribute('community_row'); $sub_community_row_array = $request->getAttribute('sub_community_row_array'); $parent_community_row_array = $request->getAttribute('parent_community_row_array'); $community_member_user_info_row_array = $request->getAttribute('community_member_user_info_row_array'); $community_admin_user_info_row_array = $request->getAttribute('community_admin_user_info_row_array'); $community_id = $community_row['community_id']; $bbs_row_array = $request->getAttribute('bbs_row_array'); // コミュニティメンバ数 $community_member_display_max = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D03'), 'COMMUNITY_MEMBER_DISPLAY_MAX_COUNT'); $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_id); $is_community_admin = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_id); // 掲示板新着記事数 $bbs_display_max = 10; // URL $bbs_url = $this->getControllerPath("Community", 'BBS') . '&community_id=' . $community_id; $community_folder_url = $this->getControllerPath("Community", 'Folder') . '&community_id=' . $community_id; if (!$is_community_member && $acs_user_info_row['is_acs_user']) { $join_community_url = $this->getControllerPath("Community", 'JoinCommunity') . '&community_id=' . $community_id; } if ($is_community_admin) { //コミュニティ プロフィールの編集 $community_change_url = $this->getControllerPath("Community", 'EditCommunity') . '&community_id=' . $community_id; } // コミュニティ退会URL // コミュニティメンバで、管理者でない場合は表示 if ($is_community_member and !$is_community_admin) { $leave_community_url = $this->getControllerPath("Community", 'LeaveCommunity') . '&community_id=' . $community_id; } // RSS出力ページのURL $PressRelease_community_url = $this->getControllerPath("Community", 'PressReleaseRSS') . '&community_id=' . $community_id; // 加工 // $community_row['register_date'] = ACSLib::convert_pg_date_to_str($community_row['register_date'], 0, 0, 0); // 登録日 $community_row['community_member_num'] = count($community_member_user_info_row_array); // メンバー数 // 画像ファイルのパスを設定 $community_row['image_url'] = ACSCommunity::get_image_url($community_id); if ($is_community_admin) { $edit_profile_image_url = $this->getControllerPath("Community", 'EditProfileImage') . '&community_id=' . $community_id; } // 参加資格の自由参加可能コミュニティ foreach ($community_row['join_trusted_community_row_array'] as $index => $join_trusted_community_row) { $community_row['join_trusted_community_row_array'][$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $join_trusted_community_row['community_id']; } // 掲示板の公開コミュニティ foreach ($community_row['contents_row_array']['bbs']['trusted_community_row_array'] as $index => $trusted_community_row) { $community_row['contents_row_array']['bbs']['trusted_community_row_array'][$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id']; } // コミュニティフォルダの公開コミュニティ foreach ($community_row['contents_row_array']['community_folder']['trusted_community_row_array'] as $index => $trusted_community_row) { $community_row['contents_row_array']['community_folder']['trusted_community_row_array'][$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id']; } // コミュニティメンバ $community_member_display_user_info_row_array = array(); $array_count = 0; foreach ($community_member_user_info_row_array as $index => $community_member_user_info_row) { $array_count++; $_community_member_row = array(); $_community_member_row['community_name'] = $community_member_user_info_row['community_name']; $_community_member_row['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $community_member_user_info_row['user_community_id']; $_community_member_row['image_url'] = ACSUser::get_image_url($community_member_user_info_row['user_community_id'], 'thumb'); $_community_member_row['friends_row_array_num'] = ACSUser::get_friends_row_array_num($community_member_user_info_row['user_community_id']); array_push($community_member_display_user_info_row_array, $_community_member_row); if ($array_count == $community_member_display_max) { break; } } // コミュニティ管理者 foreach ($community_admin_user_info_row_array as $index => $community_admin_user_info_row) { $community_admin_user_info_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $community_admin_user_info_row['user_community_id']; } // 親コミュニティ foreach ($parent_community_row_array as $index => $parent_community_row) { $parent_community_row_array[$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $parent_community_row['community_id']; } // サブコミュニティ foreach ($sub_community_row_array as $index => $sub_community_row) { $sub_community_row_array[$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $sub_community_row['community_id']; } // URL // コミュニティ間リンク設定 if ($is_community_admin) { $community_link_url = $this->getControllerPath("Community", 'CommunityLink') . '&community_id=' . $community_row['community_id']; } // コミュニティメンバ一覧 $community_member_list_url = $this->getControllerPath("Community", 'CommunityMemberList') . '&community_id=' . $community_row['community_id']; // メンバ削除 $delete_community_member_list_url = ""; if ($is_community_admin) { $delete_community_member_list_url = $this->getControllerPath("Community", 'DeleteCommunityMemberList'); $delete_community_member_list_url .= '&community_id=' . $community_row['community_id']; } // コミュニティ削除 $delete_community_url = ""; if ($is_community_admin) { $delete_community_url = $this->getControllerPath("Community", 'DeleteCommunity'); $delete_community_url .= '&community_id=' . $community_row['community_id']; } // コミュニティ招待 URL if ($is_community_admin) { $invite_to_community_url = $this->getControllerPath("Community", 'InviteToCommunity') . '&community_id=' . $community_row['community_id']; } // コミュニティスケジュール URL if ($is_community_member) { $community_schedule_url = $this->getControllerPath("Community", 'Schedule') . '&community_id=' . $community_id; } // コミュニティ管理者設定 if ($is_community_admin) { $edit_community_admin_url = $this->getControllerPath("Community", 'EditCommunityAdmin') . '&community_id=' . $community_row['community_id']; } // 外部RSS自動取り込み設定 if ($is_community_admin) { $edit_external_rss_url = $this->getControllerPath("Community", 'EditExternalRSS') . '&community_id=' . $community_row['community_id']; } if ($is_community_admin) { // 待機: コミュニティ参加 承認待ち $waiting_for_join_community_row_array = $request->getAttribute('waiting_for_join_community_row_array'); $waiting_for_join_community_row_array_num = count($waiting_for_join_community_row_array); if ($waiting_for_join_community_row_array_num) { // マイフレンズ追加 承認待ち URL $waiting_for_join_community_url = $this->getControllerPath("Community", 'WaitingList') . '&community_id=' . $community_id . '&waiting_type_code=' . $waiting_for_join_community_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_join_community_row_array[0]['waiting_status_code']; } // 待機: 親コミュニティ追加 $waiting_for_parent_community_link_row_array = $request->getAttribute('waiting_for_parent_community_link_row_array'); $waiting_for_parent_community_link_row_array_num = count($waiting_for_parent_community_link_row_array); if ($waiting_for_parent_community_link_row_array_num) { // 親コミュニティ追加 承認待ち URL $waiting_for_parent_community_link_url = $this->getControllerPath("Community", 'WaitingList') . '&community_id=' . $community_id . '&waiting_type_code=' . $waiting_for_parent_community_link_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_parent_community_link_row_array[0]['waiting_status_code']; } // 待機: サブコミュニティ追加 $waiting_for_sub_community_link_row_array = $request->getAttribute('waiting_for_sub_community_link_row_array'); $waiting_for_sub_community_link_row_array_num = count($waiting_for_sub_community_link_row_array); if ($waiting_for_sub_community_link_row_array_num) { // サブコミュニティ追加 承認待ち URL $waiting_for_sub_community_link_url = $this->getControllerPath("Community", 'WaitingList') . '&community_id=' . $community_id . '&waiting_type_code=' . $waiting_for_sub_community_link_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_sub_community_link_row_array[0]['waiting_status_code']; } } // 掲示板に対するアクセス権 $bbs_contents_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D41')); $bbs_contents_row['trusted_community_row_array'] = ACSCommunity::get_contents_trusted_community_row_array($community_id, $bbs_contents_row['contents_type_code'], $bbs_contents_row['open_level_code']); $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_contents_row); if ($ret) { // 掲示版最新情報 foreach ($bbs_row_array as $index => $bbs_row) { // 返信画面URL $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath("Community", 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; $bbs_row_array[$index]['bbs_last_post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['bbs_last_post_date'], true, false, false); } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array); //----------------------// $bbs_row_array = array_slice($bbs_row_array, 0, $bbs_display_max); } else { $bbs_row_array = array(); } // set $this->setAttribute('community_row', $community_row); $this->setAttribute('parent_community_row_array', $parent_community_row_array); $this->setAttribute('sub_community_row_array', $sub_community_row_array); $this->setAttribute('community_member_display_user_info_row_array', $community_member_display_user_info_row_array); $this->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array); $this->setAttribute('bbs_row_array', $bbs_row_array); $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('is_community_admin', $is_community_admin); $this->setAttribute('bbs_url', $bbs_url); $this->setAttribute('community_folder_url', $community_folder_url); $this->setAttribute('create_sub_community_url', $create_sub_community_url); $this->setAttribute('join_community_url', $join_community_url); $this->setAttribute('leave_community_url', $leave_community_url); $this->setAttribute('community_change_url', $community_change_url); $this->setAttribute('community_schedule_url', $community_schedule_url); $this->setAttribute('community_link_url', $community_link_url); $this->setAttribute('delete_community_url', $delete_community_url); $this->setAttribute('edit_community_admin_url', $edit_community_admin_url); $this->setAttribute('invite_to_community_url', $invite_to_community_url); $this->setAttribute('edit_community_profile_url', $edit_community_profile_url); $this->setAttribute('edit_external_rss_url', $edit_external_rss_url); $this->setAttribute('community_member_list_url', $community_member_list_url); $this->setAttribute('delete_community_member_list_url', $delete_community_member_list_url); $this->setAttribute('PressRelease_community_url', $PressRelease_community_url); //画像 $this->setAttribute('edit_profile_image_url', $edit_profile_image_url); // 待機 $this->setAttribute('waiting_for_join_community_row_array_num', $waiting_for_join_community_row_array_num); $this->setAttribute('waiting_for_join_community_url', $waiting_for_join_community_url); $this->setAttribute('waiting_for_parent_community_link_row_array_num', $waiting_for_parent_community_link_row_array_num); $this->setAttribute('waiting_for_parent_community_link_url', $waiting_for_parent_community_link_url); $this->setAttribute('waiting_for_sub_community_link_row_array_num', $waiting_for_sub_community_link_row_array_num); $this->setAttribute('waiting_for_sub_community_link_url', $waiting_for_sub_community_link_url); // テンプレート $this->setScreenId("0001"); $this->setTemplate('Index.tpl.php'); return parent::execute(); }
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'); // get // ユーザ情報一覧 $community_row = $request->getAttribute('community_row'); $form = $request->getAttribute('form'); $folder_row_array = $request->getAttribute('folder_row_array'); $put_folder_row_array = $request->getAttribute('put_folder_row_array'); $file_info_row_array = $request->getAttribute('file_info_row_array'); $put_file_info_row_array = $request->getAttribute('put_file_info_row_array'); // 加工 if (is_array($folder_row_array)) { foreach ($folder_row_array as $index => $folder_row) { $folder_row_array[$index]['path'] = '/' . implode('/', $folder_row['path_array']); $folder_row_array[$index]['folder_url'] = $this->getControllerPath('Community', 'Folder') . '&community_id=' . $community_row['community_id'] . '&folder_id=' . $folder_row['folder_id']; } } if (is_array($put_folder_row_array)) { foreach ($put_folder_row_array as $index => $folder_row) { $put_folder_row_array[$index]['path'] = '/' . implode('/', $folder_row['path_array']); $put_folder_row_array[$index]['folder_url'] = $this->getControllerPath('Community', 'Folder') . '&community_id=' . $community_row['community_id'] . '&folder_id=' . $folder_row['folder_id']; } } if (is_array($file_info_row_array)) { foreach ($file_info_row_array as $index => $file_info_row) { $file_info_row_array[$index]['path'] = '/' . implode('/', $file_info_row['path_array']); $file_info_row_array[$index]['download_file_url'] = $this->getControllerPath('Community', 'DownloadFile') . '&community_id=' . $community_row['community_id'] . '&file_id=' . $file_info_row['file_id'] . '&folder_id=' . $file_info_row['folder_id']; } } if (is_array($put_file_info_row_array)) { foreach ($put_file_info_row_array as $index => $file_info_row) { $put_file_info_row_array[$index]['path'] = '/' . implode('/', $file_info_row['path_array']); $put_file_info_row_array[$index]['download_file_url'] = $this->getControllerPath('Community', 'DownloadFile') . '&community_id=' . $community_row['community_id'] . '&file_id=' . $file_info_row['file_id'] . '&folder_id=' . $file_info_row['folder_id']; } } // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']); // URL $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']; $folder_url = $this->getControllerPath('Community', 'Folder') . '&community_id=' . $community_row['community_id']; $action_url = $this->getControllerPath(); //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); if (is_array($folder_row_array)) { $folder_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $folder_row_array); } if (is_array($put_folder_row_array)) { $put_folder_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $put_folder_row_array); } if (is_array($file_info_row_array)) { $file_info_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $file_info_row_array); // 本人以外はis_root_folderのファイルを閲覧できない $_file_info_row_array = array(); foreach ($file_info_row_array as $index => $file_info_row) { if (!$is_community_member && $file_info_row['is_root_folder']) { continue; } else { array_push($_file_info_row_array, $file_info_row); } } $file_info_row_array = $_file_info_row_array; } if (is_array($put_file_info_row_array)) { $put_file_info_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $put_file_info_row_array); } //----------------------// // テンプレート $this->setScreenId("0001"); $this->setTemplate('SearchFolder.tpl.php'); // set $this->setAttribute('community_row', $community_row); $this->setAttribute('form', $form); $this->setAttribute('folder_row_array', $folder_row_array); $this->setAttribute('put_folder_row_array', $put_folder_row_array); $this->setAttribute('file_info_row_array', $file_info_row_array); $this->setAttribute('put_file_info_row_array', $put_file_info_row_array); $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('folder_url', $folder_url); $this->setAttribute('action_url', $action_url); $this->setAttribute('module', 'Community'); $this->setAttribute('action', 'SearchFolder'); return parent::execute(); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $community_row = $request->getAttribute('community_row'); $bbs_row_array = $request->getAttribute('bbs_row_array'); // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']); //コミュニティ管理者かどうか $is_community_admin = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id']); // form action 確認画面への遷移 $action_url = $this->getControllerPath('Community', 'BBSPre') . '&community_id=' . $community_row['community_id'] . '&move_id=1'; // コミュニティトップページのURL $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']; // BBSスレッド一覧URL $bbs_thread_list_url = $this->getControllerPath('Community', 'BBSThreadList') . '&community_id=' . $community_row['community_id']; // 信頼済みコミュニティ選択ページのURL $select_trusted_community_url = $this->getControllerPath('Community', 'SelectTrustedCommunity') . '&form_name=bbs_form'; //検索画面url $search_bbs_url = $this->getControllerPath('Community', 'SearchBBS') . '&community_id=' . $community_row['community_id'] . '&move_id=1'; //外部RSS取り込み実行 if ($community_row['contents_row_array']['external_rss_url']['contents_value'] != '') { $get_external_rss_url = $this->getControllerPath('Community', 'GetExternalRSS') . '&community_id=' . $community_row['community_id']; } // 掲示板RSS URL $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D03'), 'BBS_RSS_TERM'); $bbs_rss_url = $this->getControllerPath('Community', 'BBSRSS') . '&community_id=' . $community_row['community_id'] . '&term=' . $term; // 加工 foreach ($bbs_row_array as $index => $bbs_row) { // 親記事の投稿者 トップページURL $bbs_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_row['user_community_id']; // 写真URL $bbs_row_array[$index]['image_url'] = ACSUser::get_image_url($bbs_row['user_community_id'], 'thumb'); // 投稿日時 $bbs_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['post_date']); // 返信画面URL $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; // 編集画面URL if ($bbs_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin) { $bbs_row_array[$index]['edit_bbs_url'] = $this->getControllerPath('Community', 'EditBBS') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; } // 削除画面URL $bbs_row_array[$index]['bbs_delete_url'] = $this->getControllerPath('Community', 'DeleteBBS') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; //削除権限フラグ (自分が投稿したもの 又は コミュニティ管理者) if ($bbs_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin == 1) { $bbs_row_array[$index]['bbs_set_delete_flag'] = true; } else { $bbs_row_array[$index]['bbs_set_delete_flag'] = false; } //ファイルの画像URL $bbs_row_array[$index]['file_url'] = ""; if ($bbs_row['file_id'] != "") { $bbs_row_array[$index]['file_url'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'thumb'); //投稿内表示用 $bbs_row_array[$index]['file_url_alink'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], ''); //ポップアップ用 } // パブリックリリース 掲載終了日 2/21add @akitsu $bbs_row_array[$index]['expire_date'] = ""; if ($bbs_row['expire_date'] != "") { $bbs_row_array[$index]['expire_date'] = ACSLib::convert_pg_date_to_str($bbs_row['expire_date'], true, false, false); } if ($bbs_row['bbs_delete_flag'] != 't') { // 返信記事 $bbs_res_display_max = 10; $bbs_row_array[$index]['bbs_res_row_array_num'] = count($bbs_row_array[$index]['bbs_res_row_array']); if ($bbs_row_array[$index]['bbs_res_row_array_num'] > $bbs_res_display_max) { // 最新の10件のみslice $bbs_row_array[$index]['bbs_res_row_array'] = array_slice($bbs_row_array[$index]['bbs_res_row_array'], -1 * $bbs_res_display_max); // 省略件数を算出 $bbs_row_array[$index]['omission_num'] = $bbs_row_array[$index]['bbs_res_row_array_num'] - $bbs_res_display_max; } foreach ($bbs_row_array[$index]['bbs_res_row_array'] as $res_index => $bbs_res_row) { // 返信記事の投稿者 トップページURL $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_res_row['user_community_id']; // 写真URL $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['image_url'] = ACSUser::get_image_url($bbs_res_row['user_community_id'], 'thumb'); // 投稿日時 $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_res_row['post_date']); //削除情報 $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['delete_flag'] = ACSLib::get_boolean($bbs_res_row['res_delete_flag']); } } } // 親コミュニティ / サブコミュニティの情報を取得する $parent_community_row_array = ACSCommunity::get_parent_community_row_array($community_row['community_id']); foreach ($parent_community_row_array as $index => $parent_community_row) { $parent_community_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $parent_community_row['community_id']; } $sub_community_row_array = ACSCommunity::get_sub_community_row_array($community_row['community_id']); foreach ($sub_community_row_array as $index => $sub_community_row) { $sub_community_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $sub_community_row['community_id']; } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array); //----------------------// // 外部RSS情報 foreach ($bbs_row_array as $index => $bbs_row) { $external_rss_row = ACSExternalRSS::get_external_rss_row($bbs_row['bbs_id']); if ($external_rss_row) { if ($external_rss_row['rss_item_date'] != '') { // YYYY/MM/DD H:MM $external_rss_row['rss_item_date'] = ACSLib::convert_pg_date_to_str($external_rss_row['rss_item_date'], 0, 1, 0); } $bbs_row_array[$index]['external_rss_row'] = $external_rss_row; } } // ページング設定 $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'NEW_INFO_LIST_DISPLAY_MAX_COUNT'); $paging_info = $this->getPagingInfo($controller, $request, $bbs_row_array, $display_count); // set $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('is_community_admin', $is_community_admin); $this->setAttribute('action_url', $action_url); $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('bbs_thread_list_url', $bbs_thread_list_url); $this->setAttribute('select_trusted_community_url', $select_trusted_community_url); $this->setAttribute('search_bbs_url', $search_bbs_url); $this->setAttribute('get_external_rss_url', $get_external_rss_url); $this->setAttribute('bbs_rss_url', $bbs_rss_url); $this->setAttribute('community_row', $request->getAttribute('community_row')); $this->setAttribute('bbs_row_array', $bbs_row_array); $this->setAttribute('paging_info', $paging_info); $this->setAttribute('open_level_master_row_array', $request->getAttribute('open_level_master_row_array')); $this->setAttribute('parent_community_row_array', $parent_community_row_array); $this->setAttribute('sub_community_row_array', $sub_community_row_array); // ML送信チェック表示設定 if ($community_row['contents_row_array']['ml_status']['contents_value'] == 'ACTIVE') { $this->setAttribute('is_ml_active', TRUE); } // テンプレート $this->setScreenId("0001"); $this->setTemplate('BBS.tpl.php'); // エラーメッセージ $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); if ($request->getParameter('move_id') == 3) { //ユーザ入力情報 $form = $user->getAttribute('new_form_obj'); // パブリックリリース 掲載終了日 $form['expire_date'] = ""; if ($form['expire_date'] != "") { $form['expire_date'] = ACSLib::convert_pg_date_to_str($form['expire_date'], false, false, false); } $this->setAttribute('form', $form); $this->setAttribute('move_id', $request->getParameter('move_id')); } return parent::execute(); }
function execute() { $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'); // get $community_row = $request->getAttribute('community_row'); $bbs_row_array = $request->getAttribute('bbs_row_array_result'); $open_level_master_row_array = $request->getAttribute('open_level_master_row_array'); $err_str = $request->getAttribute('err_str'); $form_pre = $request->getAttribute('form_pre'); // トップページURL $link_page_url['top_page_url'] = $this->getControllerPath('Community', 'Index') . '&id=' . '&community_id=' . $community_id; // BBS URL $link_page_url['bbs_page_url'] = $this->getControllerPath('Community', 'BBS') . '&id=' . '&community_id=' . $community_id; //検索画面url $link_page_url['search_bbs_url'] = SCRIPT_PATH; // get でサブミットするための、遷移先情報 $module = 'Community'; $action = 'SearchResultBBS'; $community_id = $community_id; $move_id = '2'; // 加工 if ($bbs_row_array) { foreach ($bbs_row_array as $index => $bbs_row) { // ユーザ画像URL $bbs_row_array[$index]['image_url'] = ACSUser::get_image_url($bbs_row['user_community_id'], 'thumb'); //ユーザページ $user_row = ACSUser::get_user_profile_row($bbs_row['user_community_id']); $bbs_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_row['user_community_id']; $bbs_row_array[$index]['community_name'] = $user_row['community_name']; // 投稿日時 $bbs_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['post_date']); // コメントページURL $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $bbs_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか if ($bbs_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { if (count($bbs_row['trusted_community_row_array']) && $bbs_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('contents_type_master', 'D11')) { $bbs_row_array[$index]['trusted_community_flag'] = 0; } else { $bbs_row_array[$index]['trusted_community_flag'] = 1; } } } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array); //特別::全件検索の場合 ターゲットが自分のままになってしまうことを回避 $bbs_row_array_result = array(); foreach ($bbs_row_array as $index => $bbs_row) { $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $bbs_row); $is_valid_user = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_row); if ($is_valid_user) { //アクセス権がある // 表示する掲示板のコミュニティ名を取得 $bbs_community_name = ACSCommunity::get_community_row($bbs_row['community_id']); $bbs_row['bbs_community_name'] = $bbs_community_name['community_name']; $bbs_row['bbs_community_page_url'] = $this->getControllerPath('Community', 'Index') . '&community_id=' . $bbs_row['community_id']; array_push($bbs_row_array_result, $bbs_row); } } //----------------------// } // 本人のページかどうか if ($community_id == $acs_user_info_row['user_community_id']) { $is_self_page = 1; } else { $is_self_page = 0; } // set $this->setAttribute('community_row', $community_row); $this->setAttribute('bbs_row_array_result', $bbs_row_array_result); $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('link_page_url', $link_page_url); $this->setAttribute('open_level_master_row_array', $open_level_master_row_array); $this->setAttribute('friends_group_row_array', $friends_group_row_array); $this->setAttribute('err_str', $err_str); $this->setAttribute('form_pre', $form_pre); $this->setAttribute('module', $module); $this->setAttribute('action', $action); $this->setAttribute('community_id', $community_id); $this->setAttribute('move_id', $move_id); // テンプレート $this->setScreenId("0001"); $this->setTemplate('SearchResultBBS.tpl.php'); return parent::execute(); }
/** * フォルダリストゲット (コミュニティ用) * アクセス者がアクセス可能なフォルダのみ返す * * @param $acs_user_info_row * @param $target_community_row */ function get_display_folder_obj_array_for_community($acs_user_info_row, $target_community_row) { $ret_folder_obj_array = array(); /* role_array 取得 */ $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $target_community_row); if ($this->get_is_root_folder()) { /* 表示可能オブジェクト取得 */ $all_folder_obj_array = $this->get_folder_obj_array(); $ret_folder_obj_array = ACSAccessControl::get_valid_obj_row_array_for_community($acs_user_info_row, $role_array, $all_folder_obj_array); } else { $ret_folder_obj_array = $this->get_folder_obj_array(); } // アクセス可能なフォルダのみ返す //return $this->folder_obj_array; return $ret_folder_obj_array; }
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; }