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を取得 $target_user_community_id = $request->getParameter('id'); // 対象となるフォルダIDを取得 $target_user_community_folder_id = $request->getParameter('folder_id'); // 詳細情報を表示するファイルIDを取得 $file_id = $request->getParameter('file_id'); // 表示するページの所有者情報取得 $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($target_user_community_id); // フォルダ情報取得 $user_folder_obj = new ACSUserFolder($target_user_community_id, $acs_user_info_row, $target_user_community_folder_id); $folder_obj = $user_folder_obj->get_folder_obj(); // フォルダの公開範囲でアクセス制御 if (!$user_folder_obj->has_privilege($target_user_info_row)) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // ルートフォルダ直下のファイルは本人以外アクセス不可 $privilege_array = $this->getCredential(); //if ($folder_obj->get_is_root_folder() && !in_array('USER_PAGE_OWNER', $privilege_array)) { if ($folder_obj->get_is_root_folder() && !$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // ファイル情報取得 $file_obj = ACSFile::get_file_info_instance($file_id); // ファイルの詳細情報 $file_detail_info_row = ACSFileDetailInfo::get_file_detail_info_row($file_id); // ファイルの履歴情報 $file_history_row_array = ACSFileHistory::get_file_history_row_array($file_id); // ファイル履歴ごとのコメント foreach ($file_history_row_array as $index => $file_history_row) { $file_history_row_array[$index]['file_history_comment_row_array'] = ACSFileHistoryComment::get_file_history_comment_row_array($file_history_row['file_history_id']); } // ファイルアクセス履歴登録 if ($acs_user_info_row['is_acs_user']) { ACSFile::set_file_access_history($acs_user_info_row['user_community_id'], $file_id); } // 足跡情報取得 $footprint_url = $this->getControllerPath('User', 'FileDetail') . "&id=" . $target_user_community_id . "&file_id=" . $file_obj->get_file_id() . "&folder_id=" . $user_folder_obj->folder_obj->get_folder_id(); $where = "foot.contents_link_url = '" . $footprint_url . "'"; $where .= " AND foot.visitor_community_id = '" . $acs_user_info_row['user_community_id'] . "'"; $footprint_info = ACSUser::get_footprint_list($target_user_community_id, $where); // set $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('file_obj', $file_obj); $request->setAttribute('user_folder_obj', $user_folder_obj); $request->setAttribute('file_detail_info_row', $file_detail_info_row); $request->setAttribute('file_history_row_array', $file_history_row_array); $request->setAttribute('footprint_info', $footprint_info); return View::SUCCESS; }
function getDefaultView() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象のdiary_idを取得 $diary_id = $request->ACSgetParameter('diary_id'); // ダイアリー親記事の情報を取得 $diary_row = ACSDiary::get_diary_row($diary_id); if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { $diary_row['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']); } // ユーザ情報 $user_community_id = $diary_row['user_community_id']; $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id); // 権限 if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // ダイアリーコメント $diary_comment_row_array = ACSDiary::get_diary_comment_row_array($diary_row['diary_id']); // ダイアリーアクセス履歴登録 if ($acs_user_info_row['is_acs_user']) { ACSDiary::set_diary_access_history($acs_user_info_row['user_community_id'], $diary_id); } // 足跡情報取得 $footprint_url = $this->getControllerPath('User', 'DiaryComment') . '&diary_id=' . $diary_row['diary_id']; $where = "foot.contents_link_url = '" . $footprint_url . "'"; $where .= " AND foot.visitor_community_id = '" . $acs_user_info_row['user_community_id'] . "'"; $footprint_info = ACSUser::get_footprint_list($user_community_id, $where); // set $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('diary_row', $diary_row); $request->setAttribute('diary_comment_row_array', $diary_comment_row_array); $request->setAttribute('footprint_info', $footprint_info); return View::INPUT; }
/** * 足跡情報一覧を取得する * * @param $user_community_id コミュニティID * $days データ取得日数 * @return $row(成功) / false(失敗) */ static function get_footprint_row($user_community_id, $days = 0) { // 日数指定がある場合 if ($days != 0) { $where = ACSLib::get_sql_condition_from_today("foot.post_date", $days); } $ret = ACSUser::get_footprint_list($user_community_id, $where); return $ret; }