function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); //get $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); //ユーザ入力情報 $form = $user->getAttribute('new_form_obj'); $bbs_id = $request->getParameter('bbs_id'); // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']); // form action $action_url = $this->getControllerPath('Community', 'BBSResPre') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_id . '&move_id=2'; // action URL 確認画面のキャンセルボタン $back_url = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_id . '&move_id=3'; // コミュニティトップページのURL $community_top_page_url = $this->getControllerPath('Community', 'Index') . '&community_id=' . $community_row['community_id']; //bbs_top_page_url 掲示板TOP画面 $back_bbs_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_row['community_id']; // set $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('action_url', $action_url); $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('back_url', $back_url); $this->setAttribute('back_bbs_url', $back_bbs_url); $this->setAttribute('select_trusted_community_url', $select_trusted_community_url); $this->setAttribute('form', $form); $this->setAttribute('community_row', $community_row); // エラーメッセージ $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); // テンプレート $this->setScreenId("0001"); $this->setTemplate('BBSResPre.tpl.php'); 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'); // 対象となるユーザコミュニティIDを取得 $user_community_id = $request->ACSgetParameter('id'); // ユーザ情報 $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id); // マイコミュニティ $community_row_array = ACSUser::get_community_row_array($user_community_id); // コミュニティ全体の公開範囲をセットする foreach ($community_row_array as $index => $community_row) { $community_row_array[$index]['contents_row_array']['self'] = ACSCommunity::get_contents_row($community_row['community_id'], ACSMsg::get_mst('contents_type_master', 'D00')); $community_row_array[$index]['is_community_member'] = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']); } // set $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('community_row_array', $community_row_array); return View::SUCCESS; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); // get $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_user_info_row = $request->getAttribute('target_user_info_row'); $user_folder_obj = $request->getAttribute('user_folder_obj'); // フォルダの所有者 $target_user_community_id = $target_user_info_row['user_community_id']; $target_user_community_info_row['community_name'] = $target_user_info_row['community_name']; $target_user_community_info_row['top_page_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $target_user_community_info_row['top_page_url'] .= '&id=' . $target_user_community_id; // 対象のフォルダ $folder_obj = $user_folder_obj->get_folder_obj(); // 本人のページかどうか $is_self_page = false; if ($target_user_community_id == $acs_user_info_row['user_community_id']) { $is_self_page = true; } // 対象のフォルダ情報 $folder_info_row = array(); $folder_info_row['folder_name'] = $folder_obj->get_folder_name(); $folder_info_row['folder_url'] = $this->getControllerPath('User', 'Folder'); $folder_info_row['folder_url'] .= '&id=' . $target_user_community_id; // フォルダへ戻るURL $back_url = $folder_info_row['folder_url']; // プット先コミュニティ取得 $org_put_community_row_array = $folder_obj->get_put_community_row_array(); // プット先コミュニティを表示用に加工 $put_community_row_array = array(); // テンプレートに渡すプット先コミュニティ情報 foreach ($org_put_community_row_array as $put_community_row) { // メンバでない非公開コミュニティは表示対象にしない $_is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $put_community_row['community_id']); if ($put_community_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03') && !$_is_community_member) { continue; } $_put_community_row = array(); // ---------------------- // プット先コミュニティ加工 // コミュニティ名 $_put_community_row['community_name'] = $put_community_row['community_name']; // コミュニティトップページURL $_put_community_row['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION); $_put_community_row['top_page_url'] .= '&community_id=' . $put_community_row['community_id']; // ---------------------- // プット先フォルダ加工 // ACSFolder インスタンス生成 // プット先フォルダのパス情報を取得するため $put_folder_obj = new ACSCommunityFolder($put_community_row['community_id'], $acs_user_info_row, $put_community_row['put_community_folder_id']); // プット先フォルダ名(コミュニティフォルダのパス) $put_folder_path = $put_folder_obj->get_path_folder_obj_array(); $folder_path_str = ""; foreach ($put_folder_path as $_folder_obj) { // ルートフォルダは追加しない if ($_folder_obj->is_root_folder) { continue; } $folder_path_str .= $_folder_obj->get_folder_name(); $folder_path_str .= "/"; } $_put_community_row['put_folder_name'] = $folder_path_str; // プット先フォルダURL $put_folder_url = $this->getControllerPath('Community', 'Folder'); $put_folder_url .= '&community_id=' . $put_community_row['community_id']; $put_folder_url .= '&folder_id=' . $put_community_row['put_community_folder_id']; $_put_community_row['put_folder_url'] = $put_folder_url; array_push($put_community_row_array, $_put_community_row); } // テンプレート $this->setScreenId("0001"); $this->setTemplate('PutCommunity.tpl.php'); // set $this->setAttribute('target_user_community_info_row', $target_user_community_info_row); $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('folder_info_row', $folder_info_row); $this->setAttribute('back_url', $back_url); $this->setAttribute('put_community_row_array', $put_community_row_array); 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 = $request->getAttribute('bbs_row'); //ユーザ入力情報 $form = $user->getAttribute('new_form_obj'); // コミュニティメンバかどうか $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']); // 加工 if ($bbs_row['bbs_res_delete_flag'] != 't') { // 親記事の投稿者 トップページURL $bbs_row['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_row['user_community_id']; // 写真URL $bbs_row['image_url'] = ACSUser::get_image_url($bbs_row['user_community_id'], 'thumb'); // 投稿日時 $bbs_row['post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['post_date']); //ファイルの画像URL $bbs_row['file_url'] = ""; if ($bbs_row['file_id'] != "") { $bbs_row['file_url'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'thumb'); //投稿内表示用 $bbs_row['file_url_alink'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], ''); //ポップアップ用 } // パブリックリリース 掲載終了日 if ($bbs_row['expire_date'] != "") { $bbs_row['expire_date'] = ACSLib::convert_pg_date_to_str($bbs_row['expire_date'], true, false, false); } // 外部RSS情報 $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['external_rss_row'] = $external_rss_row; } // 返信記事 foreach ($bbs_row['bbs_res_row_array'] as $res_index => $bbs_res_row) { // 返信記事の投稿者 トップページURL $bbs_row['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['bbs_res_row_array'][$res_index]['image_url'] = ACSUser::get_image_url($bbs_res_row['user_community_id'], 'thumb'); // 投稿日時 $bbs_row['bbs_res_row_array'][$res_index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_res_row['post_date']); // 返信の削除URL $bbs_row['bbs_res_row_array'][$res_index]['delete_bbs_res_url'] = $this->getControllerPath('Community', 'DeleteBBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_res_id=' . $bbs_row['bbs_res_row_array'][$res_index]['bbs_res_id'] . '&bbs_id=' . $bbs_row['bbs_id']; // 編集URL if (!ACSLib::get_boolean($bbs_res_row['bbs_res_delete_flag']) && ($bbs_res_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin)) { $bbs_row['bbs_res_row_array'][$res_index]['edit_bbs_res_url'] = $this->getControllerPath('Community', 'EditBBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_res_row['bbs_id'] . '&bbs_res_id=' . $bbs_res_row['bbs_res_id']; } //削除権限フラグ (自分が投稿したもの 又は コミュニティ管理者) if ($bbs_res_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin == 1) { $bbs_row['bbs_res_row_array'][$res_index]['bbs_set_delete_flag'] = true; } else { $bbs_row['bbs_res_row_array'][$res_index]['bbs_set_delete_flag'] = false; } } } // form action 確認画面への遷移 $action_url = $this->getControllerPath('Community', 'BBSResPre') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'] . '&move_id=1'; // コミュニティトップページの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']; // set $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('community_row', $request->getAttribute('community_row')); $this->setAttribute('bbs_row', $bbs_row); $this->setAttribute('action_url', $action_url); $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('bbs_top_page_url', $bbs_top_page_url); // テンプレート $this->setScreenId("0001"); $this->setTemplate('BBSRes.tpl.php'); if ($request->getParameter('move_id') == 3) { //ユーザ入力情報 $form = $user->getAttribute('new_form_obj'); $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'); $target_community_row = $request->getAttribute('target_community_row'); $target_community_member_info_row_array = $request->getAttribute('target_community_member_info_row_array'); // 選択されているユーザ $delete_user_community_id_array = $request->getParameter('delete_user_community_id_array'); // URL に付加する target_community $target_community_info = '&community_id=' . $target_community_row['community_id']; // コミュニティのURL $community_top_page_url = $this->getControllerPath('Community', 'Index'); $community_top_page_url .= $target_community_info; // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $target_community_row['community_id']); // 削除確認画面アクションURL $confirm_action_url = $this->getControllerPath('Community', 'DeleteCommunityMemberList'); $confirm_action_url .= $target_community_info; // メンバリスト $community_member_info_row_array = array(); foreach ($target_community_member_info_row_array as $target_community_member_info_row) { $a_community_member_info_row = array(); $top_page_url = ""; $is_selected = false; $is_disabled = false; $top_page_url = $this->getControllerPath('User', DEFAULT_ACTION); $top_page_url .= "&id=" . $target_community_member_info_row['user_community_id']; if ($delete_user_community_id_array) { $is_selected = in_array($target_community_member_info_row['user_community_id'], $delete_user_community_id_array); } // 本人の場合は、選択不可 if ($target_community_member_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) { $is_disabled = true; } $a_community_member_info_row['community_id'] = $target_community_member_info_row['user_community_id']; $a_community_member_info_row['name'] = $target_community_member_info_row['community_name']; $a_community_member_info_row['top_page_url'] = $top_page_url; $a_community_member_info_row['image_url'] = ACSUser::get_image_url($target_community_member_info_row['user_community_id'], 'thumb'); $a_community_member_info_row['is_selected'] = $is_selected; $a_community_member_info_row['is_disabled'] = $is_disabled; array_push($community_member_info_row_array, $a_community_member_info_row); } // エラーメッセージ設定 $error_msg_array = array(); $error_row = $request->getErrors(); if ($error_row) { foreach ($error_row as $key => $msg) { array_push($error_msg_array, $msg); } } $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('target_community_name', $target_community_row['community_name']); $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('confirm_action_url', $confirm_action_url); $this->setAttribute('community_member_info_row_array', $community_member_info_row_array); $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); // テンプレート $this->setScreenId("0001"); $this->setTemplate('DeleteCommunityMemberList_input.tpl.php'); return parent::execute(); }
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 execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); // get $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_community_info_row = $request->getAttribute('target_community_info_row'); $community_folder_obj = $request->getAttribute('community_folder_obj'); $detail_community_folder_obj = $request->getAttribute('detail_community_folder_obj'); $target_community_id = $target_community_info_row['community_id']; // URL付加情報(表示するユーザ情報) $target_community_info = '&community_id=' . $target_community_id; $folder_info = '&folder_id=' . $community_folder_obj->folder_obj->get_folder_id(); // フォルダの所有者 $_target_community_info_row['community_name'] = $target_community_info_row['community_name']; $_target_community_info_row['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION); $_target_community_info_row['top_page_url'] .= $target_community_info; // メンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $target_community_id); // プットフォルダかどうか $is_put_folder = $detail_community_folder_obj->folder_obj->is_put_folder($target_community_info_row['community_id']); // フォルダパス情報 $path_folder_obj_array = $community_folder_obj->get_path_folder_obj_array(); $path_folder_row_array = array(); foreach ($path_folder_obj_array as $path_folder_obj) { $path_folder_row = array(); // フォルダ名 if ($path_folder_obj->get_is_root_folder()) { $folder_name = $target_community_info_row['community_name']; //$folder_name .= "のフォルダ"; $folder_name = ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'FolderDetailSuccessView.class.php', 'FOLDER_NM'), array("{COMMUNITY_NAME}" => $target_community_info_row['community_name'])); } else { $folder_name = $path_folder_obj->get_folder_name(); } // フォルダURL $link_url = $this->getControllerPath('Community', 'Folder'); $link_url .= $target_community_info; $link_url .= "&folder_id=" . $path_folder_obj->get_folder_id(); // set $path_folder_row['folder_name'] = $folder_name; $path_folder_row['link_url'] = $link_url; array_push($path_folder_row_array, $path_folder_row); } /* ---------------- */ /* フォルダ詳細情報 */ /* ---------------- */ $detail_folder_obj = $detail_community_folder_obj->get_folder_obj(); $detail_folder_row = array(); $detail_folder_row['folder_name'] = $detail_folder_obj->get_folder_name(); $detail_folder_row['comment'] = $detail_folder_obj->get_comment(); $detail_folder_row['open_level_name'] = $detail_folder_obj->get_open_level_name(); // 閲覧許可コミュニティ名作成 $detail_folder_row['trusted_community_row_array'] = array(); $trusted_community_row_array = $detail_folder_obj->get_trusted_community_row_array(); foreach ($trusted_community_row_array as $trusted_community_row) { $_trusted_community_row = array(); $_trusted_community_row['community_name'] = $trusted_community_row['community_name']; $_trusted_community_row['community_top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id']; array_push($detail_folder_row['trusted_community_row_array'], $_trusted_community_row); } // 登録者 $detail_folder_row['entry_user_community_name'] = $detail_folder_obj->get_entry_user_community_name(); $detail_folder_row['entry_user_community_link_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $detail_folder_row['entry_user_community_link_url'] .= '&id=' . $detail_folder_obj->get_entry_user_community_id(); $detail_folder_row['entry_date'] = $detail_folder_obj->get_entry_date_yyyymmddhmi(); // 更新者 $detail_folder_row['update_user_community_name'] = $detail_folder_obj->get_update_user_community_name(); $detail_folder_row['update_user_community_link_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $detail_folder_row['update_user_community_link_url'] .= '&id=' . $detail_folder_obj->get_update_user_community_id(); $detail_folder_row['update_date'] = $detail_folder_obj->get_update_date_yyyymmddhmi(); // メニュー if ($is_community_member && !$is_put_folder) { // フォルダ情報編集メニュー $edit_folder_url = $this->getControllerPath('Community', 'EditFolder'); $edit_folder_url .= $target_community_info; $edit_folder_url .= $folder_info; $edit_folder_url .= '&edit_folder_id=' . $detail_community_folder_obj->folder_obj->get_folder_id(); $menu['edit_folder_url'] = $edit_folder_url; // フォルダ削除メニュー $delete_folder_url = $this->getControllerPath('Community', 'DeleteFolder'); $delete_folder_url .= $target_community_info; $delete_folder_url .= $folder_info; $delete_folder_url .= '&action_type=confirm'; $delete_folder_url .= '&selected_folder[]=' . $detail_community_folder_obj->folder_obj->get_folder_id(); $menu['delete_folder_url'] = $delete_folder_url; // フォルダ移動メニュー $move_folder_url = $this->getControllerPath('Community', 'MoveFolderList'); $move_folder_url .= $target_community_info; $move_folder_url .= $folder_info; $move_folder_url .= '&selected_folder[]=' . $detail_community_folder_obj->folder_obj->get_folder_id(); $menu['move_folder_url'] = $move_folder_url; } // 戻り先URL(フォルダ一覧) $back_url = ""; $back_url = $this->getControllerPath('Community', 'Folder'); $back_url .= $target_community_info; $back_url .= $folder_info; // テンプレート $this->setScreenId("0001"); $this->setTemplate('FolderDetail.tpl.php'); // set $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('is_put_folder', $is_put_folder); $this->setAttribute('target_community_info_row', $_target_community_info_row); $this->setAttribute('path_folder_row_array', $path_folder_row_array); $this->setAttribute('detail_folder_row', $detail_folder_row); $this->setAttribute('menu', $menu); $this->setAttribute('back_url', $back_url); 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'); $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(); }
/** * 初期処理 * @access public * @param Object $context context * @return boolean 処理結果 */ public function initialize($context) { parent::initialize($context); // アクションの共通処理を実装する /* 初期値をセットする */ $this->controller = $context->getController(); $this->request = $context->getRequest(); $this->user = $context->getUser(); $this->moduleName = $context->getModuleName(); $this->actionName = $context->getActionName(); $this->messages =& CommonMessages::getInstance(); /* requestオブジェクトにフォーム登録リストをセットする */ $this->request->setAttributeByRef('formList', $this->formList); $request =& $context->getRequest(); $user =& $context->getUser(); // セッションからユーザIDが取得できず、POSTでユーザIDが取得可能な場合 $user_id = $user->getAttribute('login_user_id'); $justLogin = false; if (($user_id == NULL || $user_id == "") && ($_POST['userid'] != NULL && $_POST['userid'] != "")) { $input_user_id = $_POST['userid']; $input_passwd = $_POST['passwd']; // エラーチェック(.htpasswd、LDAPの順) $user_id = ACSSystem::check_passwd($input_user_id, $input_passwd); if ($user_id) { $justLogin = true; $getLogoutDateEverytime = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D08'), 'GET_LOGOUT_DATE_EVERYTIME'); $user->setAttribute('getLogoutDateEverytime', $getLogoutDateEverytime); } } // 言語設定の実行 if ($request->getparameter('acsmsg')) { ACSMsg::set_lang($request->getparameter('acsmsg')); ACSMsg::set_lang_cookie($request->getparameter('acsmsg')); } // 権限クリア $user->clearCredentials(); // 認証済みを登録 $user->setAuthenticated(true); // $acs_user_info_rowを設定する // $acs_user_info_row = array(); if ($user_id) { $acs_user_info_row = ACSUser::get_user_info_row_by_user_id($user_id); // ユーザ情報が無い if ($user_id && !$acs_user_info_row['user_id']) { $acs_user_info_row['user_id'] = $user_id; $acs_user_info_row['user_community_id'] = ACS_PUBLIC_USER_COMMUNITY_ID; $acs_user_info_row['is_acs_user'] = false; } else { $acs_user_info_row['is_acs_user'] = true; // 権限登録 $user->addCredential('ACS_USER'); } // ログインユーザ(認証を通過したユーザ)かどうか $acs_user_info_row['is_login_user'] = true; // システム管理者かどうか if ($acs_user_info_row['administrator_flag'] == 't') { // 権限登録 $user->addCredential('SYSTEM_ADMIN_USER'); } // LDAPユーザかどうか (ファイル認証ユーザでなければLDAPユーザとみなす) $acs_user_info_row['is_ldap_user'] = !ACSSystem::is_htpasswd_user($user_id); // LDAP認証以外の場合、パスワード変更権限を付与 if ($acs_user_info_row['is_ldap_user']) { $user->addCredential('LDAP_USER'); } else { $user->addCredential('NOT_LDAP_USER'); } // 未登録のLDAPユーザの場合は氏名を調べる if (!$acs_user_info_row['is_acs_user'] && $acs_user_info_row['is_ldap_user']) { $ldap_user_info_row = ACSLDAP::get_ldap_user_info_row($acs_user_info_row['user_id']); $acs_user_info_row['user_name'] = $ldap_user_info_row['user_name']; } // フレンズIDの配列を取得する $acs_user_info_row['friends_id_array'] = ACSUser::get_friends_id_array($acs_user_info_row['user_community_id']); // 各機能ごとで必要な権限を判別・設定する // マイページ所有者、コミュニティ管理者、メンバの設定など if ($this->moduleName == 'User') { $id = $request->getParameter('id'); if (!$id) { $id = $acs_user_info_row['user_community_id']; } // マイページ所有者かどうか if ($acs_user_info_row['user_community_id'] == $request->getParameter('id')) { $user->addCredential('USER_PAGE_OWNER'); // 友人かどうか } elseif (!ACSUser::is_friends($id, $acs_user_info_row['user_community_id'])) { $user->addCredential('NOT_FRIENDS'); } } elseif ($this->moduleName == 'Community') { $community_id = $request->getParameter('community_id'); // コミュニティIDの指定がある場合のみ、権限設定を行う if ($community_id) { $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); // コミュニティメンバかどうか if ($is_community_member) { $user->addCredential('COMMUNITY_MEMBER'); // コミュニティ管理者かどうか if ($is_community_admin) { $user->addCredential('COMMUNITY_ADMIN'); } // コミュニティメンバではない } else { $user->addCredential('NOT_COMMUNITY_MEMBER'); } } } $user->setAttribute('login_user_id', $user_id); } else { $acs_user_info_row['user_name'] = ACS_PUBLIC_USER_NAME; $acs_user_info_row['user_community_id'] = ACS_PUBLIC_USER_COMMUNITY_ID; $acs_user_info_row['is_acs_user'] = false; $acs_user_info_row['is_login_user'] = false; // 権限設定 $user->addCredential('PUBLIC_USER'); } $user->setAttribute('acs_user_info_row', $acs_user_info_row); // ログイン情報作成 if ($justLogin) { ACSUser::set_login_date($user); } // アクセス毎のログアウト時間更新 $getLogoutDateEverytime = $user->getAttribute('getLogoutDateEverytime'); if ($getLogoutDateEverytime != NULL && $getLogoutDateEverytime == "1") { ACSUser::acs_login_date($user); } if ($acs_user_info_row['is_acs_user'] && $acs_user_info_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D01')) { // OK } elseif ($acs_user_info_row['is_acs_user'] && $acs_user_info_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03') || !$acs_user_info_row['is_acs_user'] && $acs_user_info_row['is_ldap_user']) { // マイページ全体が非公開のユーザ or 未登録のLDAPユーザ // マイページのプロフィール編集可能な権限を付与する $user->addCredential('USER_PAGE_OWNER'); if ($this->moduleName == DEFAULT_MODULE && ($this->actionName == 'EditProfile' || $this->actionName == 'SetOpenLevelForProfile')) { // 未登録のLDAPユーザの場合、プロフィール設定画面へのアクセスを許可 } else { $edit_profile_url = $this->getControllerPath(DEFAULT_MODULE, 'EditProfile'); header("Location: {$edit_profile_url}"); } } elseif (!$acs_user_info_row['is_acs_user'] && $acs_user_info_row['is_login_user'] && !$acs_user_info_row['is_ldap_user']) { echo "Forbidden"; exit; } // form で enctype="multipart/form-data" の指定が合った場合の対処 // エンコーディングを変換する if (count($_FILES) && !ini_get('mbstring.encoding_translation')) { $request->params = ACSLib::convert_post_data_encoding($request->params); } // 共通アクセス制御 // $access_control_info = $this->get_access_control_info($controller, $request, $user); $valid_flag = true; if ($access_control_info) { $valid_flag = false; if ($access_control_info['role_array'] && $access_control_info['contents_row_array']) { foreach ($access_control_info['contents_row_array'] as $contents_row) { if ($contents_row['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D40')) { if (ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $access_control_info['role_array'], $contents_row)) { $valid_flag = true; } else { $valid_flag = false; break; } } elseif ($contents_row['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D10')) { if (ACSAccessControl::is_valid_user_for_user_community($acs_user_info_row, $access_control_info['role_array'], $contents_row)) { $valid_flag = true; } else { $valid_flag = false; break; } } } } } if (!$valid_flag) { $this->controller->forward(SECURE_MODULE, SECURE_ACTION); exit; } // 各機能固有の権限判別を取得 if ($this->get_execute_privilege($controller, $request, $user)) { $user->addCredential('EXECUTE'); } //return parent::initialize($controller); return true; }
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(); $user = $context->getUser(); $request = $context->getRequest(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 表示対象となるユーザコミュニティIDを取得 $user_community_id = $request->ACSgetParameter('id'); if (empty($user_community_id)) { $user_community_id = $acs_user_info_row['user_community_id']; } // 表示対象のユーザが存在しない場合は、エラーを表示 if (!ACSUser::get_user_info_row_by_user_community_id($user_community_id)) { // 未ログインの時はPublic/Indexに遷移 header("Location: ./index.php?module=Public&action=Index"); // return View::ERROR; } // 自身のページか if ($acs_user_info_row['user_community_id'] == $user_community_id) { $is_self_page = 1; } else { $is_self_page = 0; } // プロフィール $target_user_info_row = ACSUser::get_user_profile_row($user_community_id); // マイフレンズ $friends_row_array = ACSUser::get_simple_friends_row_array($user_community_id); // マイコミュニティ $community_row_array = ACSUser::get_community_row_array($user_community_id); // 最終ログイン // ログイン済みの場合 if ($acs_user_info_row['is_login_user']) { $last_login_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D52')); } // マイページデザインを取得する $selection_css_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D53')); $selection_css = $selection_css_row['contents_value'] == '' ? ACS_DEFAULT_SELECTION_CSS_FILE : $selection_css_row['contents_value']; $waiting_for_join_community_row_array_array = array(); $waiting_for_parent_community_link_row_array_array = array(); $waiting_for_sub_community_link_row_array_array = array(); foreach ($community_row_array as $index => $community_row) { $community_row_array[$index]['contents_row_array']['self'] = ACSCommunity::get_contents_row($community_row['community_id'], ACSMsg::get_mst('contents_type_master', 'D00')); $community_row_array[$index]['is_community_admin'] = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id']); $community_row_array[$index]['is_community_member'] = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']); if ($is_self_page) { // 待機: コミュニティ参加 承認待ち (自分のマイコミュニティ) if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10')))) { $waiting_for_join_community_row_array['waiting_row_array'] = $waiting_row_array; $waiting_for_join_community_row_array['community_row'] = $community_row; array_push($waiting_for_join_community_row_array_array, $waiting_for_join_community_row_array); } // 待機: 親コミュニティ追加 承認待ち if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10')))) { $waiting_for_parent_community_link_row_array['waiting_row_array'] = $waiting_row_array; $waiting_for_parent_community_link_row_array['community_row'] = $community_row; array_push($waiting_for_parent_community_link_row_array_array, $waiting_for_parent_community_link_row_array); } // 待機: サブコミュニティ追加 承認待ち if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10')))) { $waiting_for_sub_community_link_row_array['waiting_row_array'] = $waiting_row_array; $waiting_for_sub_community_link_row_array['community_row'] = $community_row; array_push($waiting_for_sub_community_link_row_array_array, $waiting_for_sub_community_link_row_array); } } } if ($is_self_page) { // 待機: マイフレンズ追加 承認待ち $waiting_for_add_friends_row_array = ACSWaiting::get_waiting_row_array($user_community_id, ACSMsg::get_mst('waiting_type_master', 'D10'), ACSMsg::get_mst('waiting_status_master', 'D10')); // 待機: コミュニティ招待 承認待ち $waiting_for_invite_to_community_row_array = ACSWaiting::get_waiting_row_array($user_community_id, ACSMsg::get_mst('waiting_type_master', 'D30'), ACSMsg::get_mst('waiting_status_master', 'D10')); // マイダイアリーの新着コメント $new_comment_diary_row_array = ACSDiary::get_new_comment_diary_row_array($user_community_id); // 新着メッセージ $new_message_row_array = ACSMessage::get_new_message_row_array($user_community_id); // システムからのお知らせ $system_announce_row_array = ACSSystemAnnounce::get_valid_system_announce_row_array(); } // set $request->setAttribute('user_community_id', $user_community_id); $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('is_self_page', $is_self_page); $request->setAttribute('friends_row_array', $friends_row_array); $request->setAttribute('community_row_array', $community_row_array); $request->setAttribute('waiting_for_add_friends_row_array', $waiting_for_add_friends_row_array); $request->setAttribute('waiting_for_join_community_row_array_array', $waiting_for_join_community_row_array_array); $request->setAttribute('waiting_for_parent_community_link_row_array_array', $waiting_for_parent_community_link_row_array_array); $request->setAttribute('waiting_for_sub_community_link_row_array_array', $waiting_for_sub_community_link_row_array_array); $request->setAttribute('waiting_for_invite_to_community_row_array', $waiting_for_invite_to_community_row_array); $request->setAttribute('new_comment_diary_row_array', $new_comment_diary_row_array); $request->setAttribute('system_announce_row_array', $system_announce_row_array); $request->setAttribute('last_login', $last_login_row['contents_value']); $request->setAttribute('selection_css', $selection_css); $request->setAttribute('new_message_row_array', $new_message_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'); // get $target_community_row = $request->getAttribute('target_community_row'); $file_obj = $request->getAttribute('file_obj'); $community_folder_obj = $request->getAttribute('community_folder_obj'); $file_detail_info_row = $request->getAttribute('file_detail_info_row'); $target_folder_obj = $community_folder_obj->get_folder_obj(); $target_community_id = $target_community_row['community_id']; // URL付加情報(表示するユーザ情報) $target_community_info = '&community_id=' . $target_community_id; $target_folder_info = '&folder_id=' . $community_folder_obj->folder_obj->get_folder_id(); // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $target_community_row['community_id']); // ルートフォルダかどうか $is_root_folder = $target_folder_obj->get_is_root_folder(); // プットフォルダかどうか $is_put_folder = $target_folder_obj->is_put_folder($target_community_row['community_id']); // コミュニティ情報 // $target_community_row['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . $target_community_info; // ファイル情報 $file_info_row = array(); $file_info_row['file_id'] = $file_obj->get_file_id(); $file_info_row['display_file_name'] = $file_obj->get_display_file_name(); $file_info_row['mime_type'] = $file_obj->get_mime_type(); $file_info_row['file_size_kb'] = $file_obj->get_file_size_kb(); $file_info_row['file_size'] = $file_obj->get_file_size(); $file_info_row['entry_user_community_name'] = $file_obj->get_entry_user_community_name(); $file_info_row['entry_date'] = $file_obj->get_entry_date_yyyymmddhmi(); $file_info_row['update_date'] = $file_obj->get_update_date_yyyymmddhmi(); $file_info_row['update_user_community_name'] = $file_obj->get_update_user_community_name(); $file_info_row['link_url'] = $this->getControllerPath('Community', 'DownloadFile') . $target_community_info . "&file_id=" . $file_obj->get_file_id() . $target_folder_info; // 登録者 $file_info_row['entry_user_community_name'] = $file_obj->get_entry_user_community_name(); $file_info_row['entry_user_community_link_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $file_info_row['entry_user_community_link_url'] .= '&id=' . $file_obj->get_entry_user_community_id(); $file_info_row['entry_date'] = $file_obj->get_entry_date_yyyymmddhmi(); // 更新者 $file_info_row['update_user_community_name'] = $file_obj->get_update_user_community_name(); $file_info_row['update_user_community_link_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $file_info_row['update_user_community_link_url'] .= '&id=' . $file_obj->get_update_user_community_id(); $file_info_row['update_date'] = $file_obj->get_update_date_yyyymmddhmi(); // フォルダパス情報 $path_folder_obj_array = $community_folder_obj->get_path_folder_obj_array(); $path_folder_row_array = array(); foreach ($path_folder_obj_array as $path_folder_obj) { $path_folder_row = array(); // フォルダ名 if ($path_folder_obj->get_is_root_folder()) { $folder_name = $target_community_row['community_name']; //$folder_name .= "のフォルダ"; $folder_name = ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'EditFileDetailSuccessView.class.php', 'FOLDER_NM'), array("{COMMUNITY_NAME}" => $target_community_row['community_name'])); } else { $folder_name = $path_folder_obj->get_folder_name(); } // フォルダURL $link_url = $this->getControllerPath('Community', 'Folder'); $link_url .= $target_community_info; $link_url .= "&folder_id=" . $path_folder_obj->get_folder_id(); // set $path_folder_row['folder_name'] = $folder_name; $path_folder_row['link_url'] = $link_url; array_push($path_folder_row_array, $path_folder_row); } /* ---------------- */ /* フォルダ詳細情報 */ /* ---------------- */ $detail_folder_obj = $community_folder_obj->get_folder_obj(); $detail_folder_row = array(); $detail_folder_row['folder_name'] = $detail_folder_obj->get_folder_name(); $detail_folder_row['comment'] = $detail_folder_obj->get_comment(); $detail_folder_row['open_level_name'] = $detail_folder_obj->get_open_level_name(); // 閲覧許可コミュニティ名作成 $detail_folder_row['trusted_community_row_array'] = array(); $trusted_community_row_array = $detail_folder_obj->get_trusted_community_row_array(); if ($is_community_member) { foreach ($trusted_community_row_array as $trusted_community_row) { $_trusted_community_row = array(); $_trusted_community_row['community_name'] = $trusted_community_row['community_name']; $_trusted_community_row['community_top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id']; array_push($detail_folder_row['trusted_community_row_array'], $_trusted_community_row); } } // link url $detail_folder_row['link_url'] = $this->getControllerPath('Community', 'Folder') . $target_community_info . "&folder_id=" . $detail_folder_obj->get_folder_id(); // action URL $action_url = $this->getControllerPath('Community', 'EditFileDetail'); $action_url .= $target_community_info; $action_url .= $target_folder_info; $action_url .= '&file_id=' . $file_info_row['file_id']; // 戻り先URL(ファイル詳細情報) $back_url = ""; $back_url = $this->getControllerPath('Community', 'FileDetail'); $back_url .= $target_community_info; $back_url .= $target_folder_info; $back_url .= '&file_id=' . $file_info_row['file_id']; // set $this->setAttribute('target_community_row', $target_community_row); $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('file_info_row', $file_info_row); $this->setAttribute('path_folder_row_array', $path_folder_row_array); $this->setAttribute('detail_folder_row', $detail_folder_row); $this->setAttribute('file_detail_info_row', $file_detail_info_row); $this->setAttribute('menu', $menu); $this->setAttribute('action_url', $action_url); $this->setAttribute('back_url', $back_url); $this->setAttribute('file_contents_type_master_row_array_array', $request->getAttribute('file_contents_type_master_row_array_array')); $this->setAttribute('file_category_master_array', $request->getAttribute('file_category_master_array')); $this->setAttribute('file_contents_type_master_array', $request->getAttribute('file_contents_type_master_array')); // テンプレート $this->setScreenId("0001"); $this->setTemplate('EditFileDetail.tpl.php'); 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'); $target_community_row = $request->getAttribute('target_community_row'); $community_folder_obj = $request->getAttribute('community_folder_obj'); $target_folder_obj = $community_folder_obj->get_folder_obj(); $folder_obj_array = $target_folder_obj->get_folder_obj_array(); $file_obj_array = $target_folder_obj->get_file_obj_array(); $mode = $request->getAttribute('mode'); if ($mode == 'group') { $file_detail_info_row_array = $request->getAttribute('file_detail_info_row_array'); $file_contents_type_master_row_array_array = $request->getAttribute('file_contents_type_master_row_array_array'); } // URL に付加する target_community $target_community_info = '&community_id=' . $target_community_row['community_id']; // URL に付加する target_folder $target_folder_info = '&folder_id=' . $target_folder_obj->get_folder_id(); // コミュニティのURL $community_top_page_url = $this->getControllerPath('Community', 'Index'); $community_top_page_url .= $target_community_info; // フォルダパス情報 $path_folder_obj_array = $community_folder_obj->get_path_folder_obj_array(); // 表示用に加工 $path_folder_obj_row_array = $this->make_display_folder_row_array($path_folder_obj_array, $target_community_info, $target_folder_info, $target_community_row, $mode, $controller); // フォルダの公開範囲 $target_folder_open_level_row['name'] = $target_folder_obj->get_open_level_name(); $target_folder_open_level_row['trusted_community_row_array'] = $this->make_display_trusted_community_row_array($target_folder_obj->get_trusted_community_row_array(), &$controller); // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $target_community_row['community_id']); // ルートフォルダかどうか $is_root_folder = $target_folder_obj->get_is_root_folder(); // プットフォルダかどうか $is_put_folder = $target_folder_obj->is_put_folder($target_community_row['community_id']); // ファイルアップロード URL $upload_file_url = $this->getControllerPath('Community', 'UploadFile'); $upload_file_url .= $target_community_info; $upload_file_url .= $target_folder_info; /* フォルダ・ファイル一覧 */ // フォルダ一覧 $display_folder_obj_array = $target_folder_obj->get_display_folder_obj_array_for_community($acs_user_info_row, $target_community_row); $folder_row_array = $this->make_display_folder_row_array($display_folder_obj_array, $target_community_info, $target_folder_info, $target_community_row, $mode, $controller); if ($mode == 'group') { // グループ表示 // // ファイルカテゴリマスタ $file_category_master_array = ACSDB::get_master_array('file_category'); // 指定なしのファイルカテゴリコード $default_file_category_code = array_search(ACSMsg::get_mst('file_category_master', 'D0000'), $file_category_master_array); $file_detail_info_row_array_array = array(); foreach ($file_category_master_array as $file_category_code => $file_category_name) { $file_detail_info_row_array_array[$file_category_code] = array(); $file_detail_info_row_array_array[$file_category_code]['file_category_code'] = $file_category_code; $file_detail_info_row_array_array[$file_category_code]['file_category_name'] = $file_category_name; $file_detail_info_row_array_array[$file_category_code]['file_detail_info_row_array'] = array(); } // Actionで取得した$file_detail_info_rowの配列を、ファイル種類コードごとの配列に振り分ける foreach ($file_detail_info_row_array as $file_detail_info_row) { // ファイルカテゴリコード $file_category_code = $file_detail_info_row['file_category_code']; // リンクURL $file_detail_info_row['link_url'] = $this->getControllerPath('Community', 'DownloadFile') . $target_community_info . '&file_id=' . $file_detail_info_row['file_id'] . $target_folder_info; // ファイル詳細情報URL $file_detail_info_row['file_detail_url'] = $this->getControllerPath('Community', 'FileDetail') . $target_community_info . '&file_id=' . $file_detail_info_row['file_id'] . $target_folder_info; // サムネイル画像URL if ($file_category_master_array[$file_category_code] == ACSMsg::get_mst('file_category_master', 'D0003')) { $file_detail_info_row['image_url'] = $this->getControllerPath('Community', 'DownloadFile') . $target_community_info . '&file_id=' . $file_detail_info_row['file_id'] . $target_folder_info . '&mode=thumb'; } // push if ($file_category_code == '') { // ファイルカテゴリコードが存在しない場合はデフォルト(指定なし)扱い $file_category_code = $default_file_category_code; } array_push($file_detail_info_row_array_array[$file_category_code]['file_detail_info_row_array'], $file_detail_info_row); } // フォルダ 通常表示URL $folder_url = $this->getControllerPath('Community', 'Folder'); $folder_url .= $target_community_info; $folder_url .= $target_folder_info; } else { // ファイル一覧 $file_row_array = array(); foreach ($file_obj_array as $file_obj) { $a_file = array(); $link_url = ""; $update_user_community_link_url = ""; $link_url = $this->getControllerPath('Community', 'DownloadFile'); $link_url .= $target_community_info; $link_url .= "&file_id=" . $file_obj->get_file_id(); $link_url .= $target_folder_info; $update_user_community_link_url = $this->getControllerPath('User', 'Index'); $update_user_community_link_url .= "&id=" . $file_obj->get_update_user_community_id(); $a_file['name'] = $file_obj->get_display_file_name(); $a_file['file_id'] = $file_obj->get_file_id(); $a_file['link_url'] = $link_url; $a_file['file_size'] = $file_obj->get_file_size_kb(); $a_file['update_user_community_name'] = $file_obj->get_update_user_community_name(); $a_file['update_user_community_link_url'] = $update_user_community_link_url; $a_file['update_date'] = $file_obj->get_update_date_yyyymmddhmi(); // ファイル詳細情報URL $a_file['detail_url'] = $this->getControllerPath('Community', 'FileDetail'); $a_file['detail_url'] .= $target_community_info; $a_file['detail_url'] .= "&file_id=" . $file_obj->get_file_id(); $a_file['detail_url'] .= $target_folder_info; // プットファイルかどうか if ($file_obj->get_owner_community_id() == $target_community_row['community_id']) { $a_file['is_put'] = false; } else { $a_file['is_put'] = true; } array_push($file_row_array, $a_file); } // フォルダ グループ表示URL $folder_group_mode_url = $this->getControllerPath('Community', 'Folder'); $folder_group_mode_url .= $target_community_info; $folder_group_mode_url .= $target_folder_info; $folder_group_mode_url .= '&mode=group'; } // ルートフォルダのファイルは、非公開として扱う if (!$is_community_member && $is_root_folder) { $file_row_array = array(); $file_detail_info_row_array_array = array(); } // フォルダ作成 URL if (!$is_put_folder) { $edit_folder_url = $this->getControllerPath('Community', 'EditFolder'); $edit_folder_url .= $target_community_info; $edit_folder_url .= $target_folder_info; } else { $edit_folder_url = ""; } // 名前変更URL $rename_folder_url = ""; $rename_folder_url = $this->getControllerPath('Community', 'RenameFolderList'); $rename_folder_url .= $target_community_info; $rename_folder_url .= $target_folder_info; // 削除URL $delete_folder_url = ""; $delete_folder_url = $this->getControllerPath('Community', 'DeleteFolder'); $delete_folder_url .= $target_community_info; $delete_folder_url .= $target_folder_info; $delete_folder_url .= "&action_type=confirm"; // 遷移する先の画面は確認画面 // 移動URL $move_folder_url = ""; $move_folder_url = $this->getControllerPath('Community', 'MoveFolderList'); $move_folder_url .= $target_community_info; $move_folder_url .= $target_folder_info; // コミュニティフォルダ検索URL $search_folder_url = $this->getControllerPath('Community', 'SearchFolder'); $search_folder_url .= $target_community_info; $this->setAttribute('target_folder_open_level_row', $target_folder_open_level_row); $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('is_root_folder', $is_root_folder); $this->setAttribute('is_put_folder', $is_put_folder); $this->setAttribute('upload_file_url', $upload_file_url); $this->setAttribute('folder_put_community_url', $folder_put_community_url); $this->setAttribute('target_user_community_name', $target_community_row['community_name']); $this->setAttribute('path_folder_obj_row_array', $path_folder_obj_row_array); $this->setAttribute('folder_row_array', $folder_row_array); $this->setAttribute('file_row_array', $file_row_array); // 操作メニュー $this->setAttribute('edit_folder_url', $edit_folder_url); $this->setAttribute('rename_folder_url', $rename_folder_url); $this->setAttribute('delete_folder_url', $delete_folder_url); $this->setAttribute('move_folder_url', $move_folder_url); $this->setAttribute('search_folder_url', $search_folder_url); $this->setAttribute('mode', $mode); if ($mode == 'group') { $this->setAttribute('folder_url', $folder_url); $this->setAttribute('file_detail_info_row_array_array', $file_detail_info_row_array_array); $this->setAttribute('file_contents_type_master_row_array_array', $file_contents_type_master_row_array_array); } else { $this->setAttribute('folder_group_mode_url', $folder_group_mode_url); } // エラーメッセージ $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); // テンプレート if ($mode == 'group') { $this->setScreenId("0001"); $this->setTemplate('Folder_group.tpl.php'); } else { $this->setScreenId("0001"); $this->setTemplate('Folder.tpl.php'); } 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 $target_community_row = $request->getAttribute('target_community_row'); $file_obj = $request->getAttribute('file_obj'); $community_folder_obj = $request->getAttribute('community_folder_obj'); $file_detail_info_row = $request->getAttribute('file_detail_info_row'); $file_history_row_array = $request->getAttribute('file_history_row_array'); $target_folder_obj = $community_folder_obj->get_folder_obj(); $target_community_id = $target_community_row['community_id']; $is_community_admin = $request->getAttribute('is_community_admin'); $file_public_access_row = $request->getAttribute('file_public_access_row'); // URL付加情報(表示するユーザ情報) $target_community_info = '&community_id=' . $target_community_id; $target_folder_info = '&folder_id=' . $community_folder_obj->folder_obj->get_folder_id(); // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $target_community_row['community_id']); // ルートフォルダかどうか $is_root_folder = $target_folder_obj->get_is_root_folder(); // プットフォルダかどうか $is_put_folder = $target_folder_obj->is_put_folder($target_community_row['community_id']); // プットファイルかどうか if ($file_obj->get_owner_community_id() != $target_community_id) { $is_put_file = true; } else { $is_put_file = false; } // コミュニティ情報 // $target_community_row['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . $target_community_info; // ファイル情報 // $file_info_row = array(); $file_info_row['file_id'] = $file_obj->get_file_id(); $file_info_row['display_file_name'] = $file_obj->get_display_file_name(); $file_info_row['mime_type'] = $file_obj->get_mime_type(); $file_info_row['file_size_kb'] = $file_obj->get_file_size_kb(); $file_info_row['file_size'] = $file_obj->get_file_size(); $file_info_row['entry_user_community_name'] = $file_obj->get_entry_user_community_name(); $file_info_row['entry_date'] = $file_obj->get_entry_date_yyyymmddhmi(); $file_info_row['update_date'] = $file_obj->get_update_date_yyyymmddhmi(); $file_info_row['update_user_community_name'] = $file_obj->get_update_user_community_name(); $file_info_row['link_url'] = $this->getControllerPath('Community', 'DownloadFile') . $target_community_info . "&file_id=" . $file_obj->get_file_id() . $target_folder_info; // 登録者 $file_info_row['entry_user_community_name'] = $file_obj->get_entry_user_community_name(); $file_info_row['entry_user_community_link_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $file_info_row['entry_user_community_link_url'] .= '&id=' . $file_obj->get_entry_user_community_id(); $file_info_row['entry_date'] = $file_obj->get_entry_date_yyyymmddhmi(); // 更新者 $file_info_row['update_user_community_name'] = $file_obj->get_update_user_community_name(); $file_info_row['update_user_community_link_url'] = $this->getControllerPath('User', DEFAULT_ACTION); $file_info_row['update_user_community_link_url'] .= '&id=' . $file_obj->get_update_user_community_id(); $file_info_row['update_date'] = $file_obj->get_update_date_yyyymmddhmi(); // フォルダパス情報 $path_folder_obj_array = $community_folder_obj->get_path_folder_obj_array(); $path_folder_row_array = array(); foreach ($path_folder_obj_array as $path_folder_obj) { $path_folder_row = array(); // フォルダ名 if ($path_folder_obj->get_is_root_folder()) { $folder_name = $target_community_row['community_name']; //$folder_name .= "のフォルダ"; $folder_name = ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'FileDetailSuccessView.class.php', 'FOLDER_NM'), array("{COMMUNITY_NAME}" => $target_community_row['community_name'])); } else { $folder_name = $path_folder_obj->get_folder_name(); } // フォルダURL $link_url = $this->getControllerPath('Community', 'Folder'); $link_url .= $target_community_info; $link_url .= "&folder_id=" . $path_folder_obj->get_folder_id(); // set $path_folder_row['folder_name'] = $folder_name; $path_folder_row['link_url'] = $link_url; array_push($path_folder_row_array, $path_folder_row); } // フォルダ詳細情報 // $detail_folder_obj = $community_folder_obj->get_folder_obj(); $detail_folder_row = array(); $detail_folder_row['folder_name'] = $detail_folder_obj->get_folder_name(); $detail_folder_row['comment'] = $detail_folder_obj->get_comment(); $detail_folder_row['open_level_name'] = $detail_folder_obj->get_open_level_name(); // 閲覧許可コミュニティ名作成 $detail_folder_row['trusted_community_row_array'] = array(); $trusted_community_row_array = $detail_folder_obj->get_trusted_community_row_array(); if ($is_community_member) { foreach ($trusted_community_row_array as $trusted_community_row) { $_trusted_community_row = array(); $_trusted_community_row['community_name'] = $trusted_community_row['community_name']; $_trusted_community_row['community_top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id']; array_push($detail_folder_row['trusted_community_row_array'], $_trusted_community_row); } } // ルートフォルダのファイルの場合は非公開 if ($is_root_folder) { $detail_folder_row['open_level_name'] = ACSMsg::get_mst('open_level_master', 'D04'); $detail_folder_row['trusted_community_row_array'] = array(); } // link url $detail_folder_row['link_url'] = $this->getControllerPath('Community', 'Folder') . $target_community_info . "&folder_id=" . $detail_folder_obj->get_folder_id(); // ファイル履歴情報 // foreach ($file_history_row_array as $index => $file_history_row) { $file_history_row_array[$index]['update_date'] = ACSLib::convert_pg_date_to_str($file_history_row['update_date'], 1, 1); $file_history_row_array[$index]['link_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $file_history_row['community_id']; $file_history_row_array[$index]['download_history_file_url'] = $this->getControllerPath('Community', 'DownloadHistoryFile') . $target_community_info . "&folder_id=" . $detail_folder_obj->get_folder_id() . '&file_id=' . $file_history_row['file_id'] . '&file_history_id=' . $file_history_row['file_history_id']; if ($index != 0 && !$is_put_file) { $file_history_row_array[$index]['restore_history_file_url'] = $this->getControllerPath('Community', 'RestoreHistoryFile') . $target_community_info . "&folder_id=" . $detail_folder_obj->get_folder_id() . '&file_id=' . $file_history_row['file_id'] . '&file_history_id=' . $file_history_row['file_history_id']; } foreach ($file_history_row['file_history_comment_row_array'] as $index2 => $file_history_comment_row) { $file_history_row_array[$index]['file_history_comment_row_array'][$index2]['post_date'] = ACSLib::convert_pg_date_to_str($file_history_comment_row['post_date'], false, true, true); $file_history_row_array[$index]['file_history_comment_row_array'][$index2]['link_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $file_history_comment_row['community_id']; } } // ファイル履歴コメントURL $file_history_comment_url = $this->getControllerPath('Community', 'FileHistoryComment') . $target_community_info . $target_folder_info . '&file_id=' . $file_info_row['file_id'] . '&file_history_id=' . $file_history_row_array[0]['file_history_id']; // メニュー // プットフォルダのファイルまたはプットファイルは表示しない if ($is_community_member && (!$is_put_folder && $file_obj->get_owner_community_id() == $target_community_id)) { // ファイル更新URL $menu['update_file_url'] = $this->getControllerPath('Community', 'UpdateFile') . $target_community_info . $target_folder_info . '&file_id=' . $file_info_row['file_id']; // 名前変更URL $menu['rename_folder_list_url'] = $this->getControllerPath('Community', 'RenameFolderList') . $target_community_info . $target_folder_info . '&selected_file[]=' . $file_info_row['file_id']; // 移動URL $menu['move_folder_list_url'] = $this->getControllerPath('Community', 'MoveFolderList') . $target_community_info . $target_folder_info . '&selected_file[]=' . $file_info_row['file_id']; // 削除URL $menu['delete_folder_url'] = $this->getControllerPath('Community', 'DeleteFolder') . $target_community_info . $target_folder_info . '&action_type=confirm' . '&selected_file[]=' . $file_info_row['file_id']; // 詳細情報編集URL $menu['edit_file_detail_url'] = $this->getControllerPath('Community', 'EditFileDetail') . $target_community_info . $target_folder_info . '&file_id=' . $file_info_row['file_id']; } if (!$is_put_file) { // ファイル公開情報 if ($file_public_access_row['file_id'] != "") { $file_public_access_row['access_start_date_disp'] = ACSLib::convert_pg_date_to_str($file_public_access_row['access_start_date'], 0, 0, 0); // ファイルアクセスURL設定 $file_public_access_row['access_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL') . $this->getControllerPath('Public', 'DownloadFile') . "&key=" . $file_public_access_row['access_code']; } // ファイル公開設定URL $file_public_access_row['submit_url'] = $this->getControllerPath('Community', 'PublicAccessFileDetail') . $target_community_info . "&file_id=" . $file_obj->get_file_id() . $target_folder_info; } // 戻り先URL(フォルダ一覧)// $back_url = ""; $back_url = $this->getControllerPath('Community', 'Folder'); $back_url .= $target_community_info; $back_url .= $target_folder_info; // ページング設定 $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, $file_history_row_array, $display_count); // set $this->setAttribute('acs_user_info_row', $acs_user_info_row); $this->setAttribute('target_community_row', $target_community_row); $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('is_root_folder', $is_root_folder); $this->setAttribute('is_put_folder', $is_put_folder); $this->setAttribute('is_put_file', $is_put_file); $this->setAttribute('path_folder_obj_row_array', $path_folder_obj_row_array); $this->setAttribute('file_info_row', $file_info_row); $this->setAttribute('path_folder_row_array', $path_folder_row_array); $this->setAttribute('detail_folder_row', $detail_folder_row); $this->setAttribute('file_detail_info_row', $file_detail_info_row); $this->setAttribute('file_history_row_array', $file_history_row_array); $this->setAttribute('paging_info', $paging_info); $this->setAttribute('menu', $menu); $this->setAttribute('back_url', $back_url); $this->setAttribute('file_history_comment_url', $file_history_comment_url); $this->setAttribute('is_community_admin', $is_community_admin); $this->setAttribute('file_public_access_row', $file_public_access_row); // エラーメッセージ $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); // テンプレート $this->setScreenId("0001"); $this->setTemplate('FileDetail.tpl.php'); return parent::execute(); }
function make_display_folder_row_array($folder_obj_array, $target_community_info, $target_user_info_row, $target_folder_info, $acs_user_community_id, $mode, &$controller) { $folder_row_array = array(); foreach ($folder_obj_array as $folder_obj) { $folder_row = array(); $link_url = ""; $name = ""; $update_user_community_link_url = ""; $trusted_community_row_array = array(); $put_community_row_array = array(); // $link_url = $this->getControllerPath('User', $controller->getCurrentAction()); $link_url = $this->getControllerPath('User', 'Folder'); $link_url .= $target_community_info; $link_url .= "&folder_id=" . $folder_obj->get_folder_id(); if ($mode == 'group') { $link_url .= '&mode=' . $mode; } $folder_put_community_url = $this->getControllerPath('User', 'FolderPutCommunity'); $folder_put_community_url .= $target_community_info; $folder_put_community_url .= "&folder_id=" . $folder_obj->get_folder_id(); // フォルダ詳細 URL $detail_url = $this->getControllerPath('User', 'FolderDetail'); $detail_url .= $target_community_info; $detail_url .= $target_folder_info; $detail_url .= "&detail_folder_id=" . $folder_obj->get_folder_id(); if ($folder_obj->get_is_root_folder()) { // $name = $target_user_info_row['community_name']; // $name .= "さんのフォルダ"; $name = ACSMsg::get_tag_replace(ACSMsg::get_msg('User', 'FolderSuccessView.class.php', 'FOLDER_NM'), array("{COMMUNITY_NAME}" => $target_user_info_row['community_name'])); } else { $name = $folder_obj->get_folder_name(); } $update_user_community_link_url = $this->getControllerPath('User', 'Index'); $update_user_community_link_url .= "&id=" . $folder_obj->get_update_user_community_id(); // 閲覧許可コミュニティ名作成 $org_trusted_community_row_array = $folder_obj->get_trusted_community_row_array(); foreach ($org_trusted_community_row_array as $org_trusted_community_row) { $trusted_community_row = array(); $trusted_community_row['community_name'] = $org_trusted_community_row['community_name']; // リンクも追加する? array_push($trusted_community_row_array, $trusted_community_row); } // プット先コミュニティを表示するURL $put_community_url = ""; if ($folder_obj->has_put_community()) { // 表示可能なプットコミュニティかをチェック $_has_put_community = false; foreach ($folder_obj->get_put_community_row_array() as $put_community_row) { // プット先コミュニティ設定 URL // メンバでない非公開コミュニティは表示対象にしない $_is_community_member = ACSCommunity::is_community_member($acs_user_community_id, $put_community_row['community_id']); if ($put_community_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03') && !$_is_community_member) { continue; } else { $_has_put_community = true; break; } } if ($_has_put_community) { $put_community_url = $this->getControllerPath('User', 'PutCommunity'); $put_community_url .= $target_community_info; $put_community_url .= "&folder_id=" . $folder_obj->get_folder_id(); } } $folder_row['name'] = $name; $folder_row['folder_id'] = $folder_obj->get_folder_id(); $folder_row['link_url'] = $link_url; $folder_row['folder_put_community_url'] = $folder_put_community_url; $folder_row['open_level_name'] = $folder_obj->get_open_level_name(); $folder_row['trusted_community_row_array'] = $trusted_community_row_array; $folder_row['put_community_url'] = $put_community_url; $folder_row['update_user_community_name'] = $folder_obj->get_update_user_community_name(); $folder_row['update_user_community_link_url'] = $update_user_community_link_url; $folder_row['update_date'] = $folder_obj->get_update_date_yyyymmddhmi(); $folder_row['detail_url'] = $detail_url; array_push($folder_row_array, $folder_row); } return $folder_row_array; }
/** * コミュニティのコンテンツにアクセス可能かどうか * * @param $acs_user_info_row アクセス者のユーザ情報 * @param $role_array アクセス者のrole_array * @param $row アクセス対象となるデータ (連想配列) * @return アクセス可(true)/アクセス不可(false) */ static function is_valid_user_for_community($acs_user_info_row, $role_array, $row) { $ret = false; // コミュニティメンバ、システム管理者以外の場合 // コミュニティ全体の公開範囲をチェック if (!ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $row['community_id']) && !ACSAccessControl::is_system_administrator($acs_user_info_row)) { $community_self_info_row = ACSCommunity::get_contents_row($row['community_id'], ACSMsg::get_mst('contents_type_master', 'D00')); if ($community_self_info_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03')) { return false; } } foreach ($role_array as $role_key => $role_value) { if (ACSLib::get_boolean($row["open_for_{$role_key}"]) && $role_value) { $ret = true; break; } elseif ($role_key == 'member') { // 閲覧許可を与えるコミュニティが指定されている場合 if (count($row['trusted_community_row_array']) > 0) { foreach ($row['trusted_community_row_array'] as $trusted_community_row) { if (ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $trusted_community_row['community_id'])) { $ret = true; break; } } } if ($ret) { break; } } } return $ret; }