function get_access_control_info(&$controller, &$request, &$user) { $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるユーザコミュニティIDを取得 $user_community_id = $request->getParameter('id'); // コミュニティ情報 $user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id); // アクセス制御情報 // $friends_list_contents_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D11')); $access_control_info = array('role_array' => ACSAccessControl::get_user_community_role_array($acs_user_info_row, $user_info_row), 'contents_row_array' => array($friends_list_contents_row)); return $access_control_info; }
function execute() { $context =& $this->getContext(); $user = $context->getUser(); $request = $context->getRequest(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $target_user_info_row = $request->getAttribute('target_user_info_row'); $new_diary_row_array = $request->getAttribute('new_diary_row_array'); // 加工 foreach ($new_diary_row_array as $index => $new_diary_row) { $new_diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $new_diary_row['community_id'] . '&diary_id=' . $new_diary_row['diary_id']; $new_diary_row_array[$index]['is_unread'] = ACSLib::get_boolean($new_diary_row['is_unread']); } // 新着日記一覧URL $new_diary_url = $this->getControllerPath(DEFAULT_MODULE, 'NewDiary') . '&id=' . $target_user_info_row['user_community_id']; // 表示件数制御 $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'NEW_INFO_TOP_DISPLAY_MAX_COUNT'); //---- アクセス制御 ----// $_new_diary_row_array = array(); foreach ($new_diary_row_array as $index => $new_diary_row) { if (count($_new_diary_row_array) >= $display_count) { break; } // diary_trusted_community if ($new_diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { $new_diary_row_array[$index]['trusted_community_row_array'] = $new_diary_row['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($new_diary_row['diary_id']); } $diary_target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($new_diary_row['community_id']); $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $diary_target_user_info_row); $new_diary_row = ACSAccessControl::get_valid_row_for_user_community($acs_user_info_row, $role_array, $new_diary_row); if ($new_diary_row) { array_push($_new_diary_row_array, $new_diary_row); } } $new_diary_row_array = $_new_diary_row_array; //----------------------// // set $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('new_diary_row_array', $new_diary_row_array); $this->setAttribute('new_diary_url', $new_diary_url); $this->setAttribute('get_days', $request->getAttribute('get_days')); // テンプレート $this->setTemplate('NewDiary.tpl.php'); $context->getController()->setRenderMode(View::RENDER_VAR); $request->setAttribute("NewDiary", $this->render()); 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_user_info_row = $request->getAttribute('target_user_info_row'); $open_level_master_row_array = $request->getAttribute('open_level_master_row_array'); // トップページURL $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id']; //他人の日記を閲覧している場合のトップページURL $link_page_url['else_user_top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id']; //他人の日記を閲覧している場合の日記ページURL $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $target_user_info_row['community_id']; //検索画面url $link_page_url['search_diary_url'] = SCRIPT_PATH; // get でサブミットするための、遷移先情報 $module = 'User'; $action = 'SearchResultDiary'; $id = $target_user_info_row['community_id']; $move_id = '1'; // 本人のページかどうか if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) { $is_self_page = 1; } else { $is_self_page = 0; } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); //----------------------// // set $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('link_page_url', $link_page_url); $this->setAttribute('open_level_master_row_array', $open_level_master_row_array); $this->setAttribute('module', $module); $this->setAttribute('action', $action); $this->setAttribute('id', $id); $this->setAttribute('move_id', $move_id); // テンプレート $this->setScreenId("0001"); $this->setTemplate('SearchDiary.tpl.php'); return parent::execute(); }
function get_execute_privilege(&$controller, &$request, &$user) { // 公開範囲情報取得 $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $diary_file_row = ACSDiaryFile::get_diary_file_row_by_file_id($request->ACSgetParameter('id')); $diary_row = ACSDiary::get_diary_row($diary_file_row['diary_id']); if (!$diary_row) { return false; } $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($diary_row['community_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']); } // アクセス制御判定 $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); $ret = ACSAccessControl::is_valid_user_for_user_community($acs_user_info_row, $role_array, $diary_row); return $ret; }
function execute() { $context =& $this->getContext(); $user = $context->getUser(); $request = $context->getRequest(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $target_user_info_row = $request->getAttribute('target_user_info_row'); $new_diary_row_array = $request->getAttribute('new_diary_row_array'); // 加工 foreach ($new_diary_row_array as $index => $new_diary_row) { $new_diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $new_diary_row['community_id'] . '&diary_id=' . $new_diary_row['diary_id']; $new_diary_row_array[$index]['is_unread'] = ACSLib::get_boolean($new_diary_row['is_unread']); } //---- アクセス制御 ----// foreach ($new_diary_row_array as $index => $new_diary_row) { // diary_trusted_community if ($new_diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { $new_diary_row_array[$index]['trusted_community_row_array'] = $new_diary_row['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($new_diary_row['diary_id']); } // 簡易処理: $diary_target_user_info_row['user_community_id'] = $new_diary_row['community_id']; $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $diary_target_user_info_row); $new_diary_row = ACSAccessControl::get_valid_row_for_user_community($acs_user_info_row, $role_array, $new_diary_row); if (!$new_diary_row) { unset($new_diary_row_array[$index]); } } //----------------------// // ページング設定 $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, $new_diary_row_array, $display_count); // set $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('new_diary_row_array', $new_diary_row_array); $this->setAttribute('paging_info', $paging_info); $this->setAttribute('get_days', $request->getAttribute('get_days')); // テンプレート $this->setScreenId("0001"); $this->setTemplate('NewDiary.tpl.php'); return parent::execute(); }
/** * フォルダにアクセス権があるか * * @param $target_user_info_row 表示対象マイページ情報 * @return true / false */ function has_privilege($target_user_info_row) { $ret_folder_obj_array = array(); /* role_array 取得 */ $role_array = ACSAccessControl::get_user_community_role_array($this->get_acs_user_info_row(), $target_user_info_row); $folder_obj = $this->get_folder_obj(); $ret_folder_obj = ACSAccessControl::get_valid_obj_row_array_for_user_community($this->get_acs_user_info_row(), $role_array, array($folder_obj)); if ($ret_folder_obj) { return true; // ない場合は、アクセス不可 } else { return false; } }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $target_user_info_row = $request->getAttribute('target_user_info_row'); $diary_row_array = $request->getAttribute('diary_row_array'); $term = $request->getAttribute('term'); // ユーザ情報 $target_user_info_row['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $target_user_info_row['user_community_id']; $target_user_info_row['image_url'] = ACSUser::get_image_url($target_user_info_row['user_community_id']); if ($target_user_info_row['file_id'] != '') { $user_file_info_row = ACSFileInfoModel::select_file_info_row($target_user_info_row['file_id']); $target_user_info_row['image_title'] = $user_file_info_row['display_file_name']; } else { // 写真はありません $target_user_info_row['image_title'] = ACSMsg::get_msg('User', 'DiaryRSSSuccessView.class.php', 'M001'); } // 信頼済みコミュニティ情報 foreach ($diary_row_array as $index => $diary_row) { // 友人に公開 if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { $diary_row_array[$index]['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']); } // ダイアリーコメントURL $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $target_user_info_row['community_id'] . '&diary_id=' . $diary_row['diary_id']; // ファイルの画像URL if ($diary_row['file_id'] != '') { $diary_row_array[$index]['file_url'] = ACSDiaryFile::get_image_url($diary_row['file_id']); } } // ACSDiary::print_diary_rss()で使用するパラメータをセットする $params = array(); // ベースURL if ($acs_user_info_row['is_acs_user']) { $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL'); } else { $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL'); } // 自身のURL $params['rss_syndication_url'] = $params['base_url'] . $this->getControllerPath('User', 'DiaryRSS') . '&id=' . $target_user_info_row['user_community_id'] . '&term=' . $term; // <description> if ($acs_user_info_row['is_acs_user']) { if (ACSUser::is_friends($acs_user_info_row['user_community_id'], $target_user_info_row['user_community_id'])) { // 友人向け $params['description'] = $target_user_info_row['contents_row_array']['community_profile_friend']['contents_value']; } else { // ログインユーザ向け $params['description'] = $target_user_info_row['contents_row_array']['community_profile_login']['contents_value']; } } else { // 一般向け $params['description'] = $target_user_info_row['contents_row_array']['community_profile']['contents_value']; } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array); //----------------------// // RSS出力部 ACSDiary::print_diary_rss($target_user_info_row, $diary_row_array, $params); // 終了 exit; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $target_user_info_row = $request->getAttribute('target_user_info_row'); $diary_row_array = $request->getAttribute('diary_row_array_result'); $open_level_master_row_array = $request->getAttribute('open_level_master_row_array'); $friends_group_row_array = $request->getAttribute('friends_group_row_array'); $err_str = $request->getAttribute('err_str'); $form_pre = $request->getAttribute('form_pre'); // トップページURL $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id']; //他人の日記を閲覧している場合のトップページURL $link_page_url['else_user_top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id']; //他人の日記を閲覧している場合の日記ページURL $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $target_user_info_row['community_id']; //検索画面url $link_page_url['search_diary_url'] = SCRIPT_PATH; // get でサブミットするための、遷移先情報 $module = 'User'; $action = 'SearchResultDiary'; $id = $target_user_info_row['community_id']; $move_id = '2'; // 加工 if ($diary_row_array) { foreach ($diary_row_array as $index => $diary_row) { // ユーザ画像URL $diary_row_array[$index]['image_url'] = ACSUser::get_image_url($diary_row['community_id'], 'thumb'); //ユーザページ $user_row = ACSUser::get_user_profile_row($diary_row['community_id']); $diary_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $diary_row['community_id']; $diary_row_array[$index]['community_name'] = $user_row['community_name']; // 投稿日時 $diary_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($diary_row['post_date']); // コメントページURL $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $diary_row['community_id'] . '&diary_id=' . $diary_row['diary_id']; // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) { $diary_row_array[$index]['trusted_community_flag'] = 0; } else { $diary_row_array[$index]['trusted_community_flag'] = 1; } } } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array); //特別::全件検索の場合 ターゲットが自分のままになってしまうことを回避 $diary_row_array_result = array(); foreach ($diary_row_array as $index => $diary_row) { $diary_target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($diary_row['community_id']); $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $diary_target_user_info_row); $is_valid_user = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $diary_row); if ($is_valid_user) { //アクセス権がある array_push($diary_row_array_result, $diary_row); } } //----------------------// } // 本人のページかどうか if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) { $is_self_page = 1; } else { $is_self_page = 0; } // set $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('diary_row_array_result', $diary_row_array_result); $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('link_page_url', $link_page_url); $this->setAttribute('open_level_master_row_array', $open_level_master_row_array); $this->setAttribute('friends_group_row_array', $friends_group_row_array); $this->setAttribute('err_str', $err_str); $this->setAttribute('form_pre', $form_pre); $this->setAttribute('module', $module); $this->setAttribute('action', $action); $this->setAttribute('id', $id); $this->setAttribute('move_id', $move_id); // テンプレート $this->setScreenId("0001"); $this->setTemplate('SearchResultDiary.tpl.php'); return parent::execute(); }
function execute() { $context =& $this->getContext(); $controller = $context->getController(); $user = $context->getUser(); $request = $context->getRequest(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるユーザコミュニティIDを取得 $user_community_id = $request->ACSgetParameter('id'); if ($user_community_id == null || $user_community_id == '') { $user_community_id = $request->getAttribute("id"); } // 他ユーザのデータが見えないようチェック if (!$this->get_execute_privilege() && $acs_user_info_row["user_community_id"] != $user_community_id) { // このページへアクセスすることはできません。 $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // インライン表示の場合: 1(true) $inline_mode = $request->ACSgetParameter('inline_mode'); if ($inline_mode == null || $inline_mode == '') { $inline_mode = $request->getAttribute("inline_mode"); } // 取得範囲の指定 $get_days = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), $inline_mode ? 'NEW_INFO_TOP_TERM' : 'NEW_INFO_LIST_TERM'); $request->setAttribute('get_days', $get_days); // マイフレンズの新着ファイル一覧を取得する if ($inline_mode) { $new_file_row_array = ACSUserFolder::get_new_friends_file_row_array($user_community_id, $get_days, true); } else { $new_file_row_array = ACSUserFolder::get_new_friends_file_row_array($user_community_id, $get_days); } // 表示件数取得 if ($inline_mode) { $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'NEW_INFO_TOP_DISPLAY_MAX_COUNT'); } else { $display_count = count($new_file_row_array); } $request->setAttribute('display_count', $display_count); // // マイページ新着、新着一覧ともに表示件数分の情報を取得 // $rec_cnt = 0; $_new_file_row_array = array(); foreach ($new_file_row_array as $index => $new_file_row) { // 表示件数に達している場合は終了 if ($rec_cnt >= $display_count) { break; } $target_folder_obj = new ACSUserFolder($new_file_row['owner_community_id'], $acs_user_info_row, $new_file_row['folder_id']); $target_file_obj = new ACSFile($new_file_row); $new_file_row['is_root_folder'] = $target_folder_obj->folder_obj->get_is_root_folder(); // 公開レベル $new_file_row['open_level_code'] = $target_folder_obj->folder_obj->get_open_level_code(); $new_file_row['open_level_name'] = $target_folder_obj->folder_obj->get_open_level_name(); $open_level_master_row = ACSAccessControl::get_open_level_master_row($new_file_row['open_level_code']); $new_file_row = array_merge($new_file_row, $open_level_master_row); $new_file_row['trusted_community_row_array'] = $target_folder_obj->folder_obj->get_trusted_community_row_array(); // パス $path_folder_obj_array = $target_folder_obj->get_path_folder_obj_array(); $path_array = array(); foreach ($path_folder_obj_array as $path_folder_obj_index => $path_folder_obj) { if ($path_folder_obj_index != 0) { array_push($path_array, $path_folder_obj->get_folder_name()); } } array_push($path_array, $new_file_row['display_file_name']); $new_file_row['path_array'] = $path_array; // // アクセス権限の判定 // $is_access_ok = TRUE; // マイフレンズは本人以外なのでis_root_folderのファイルを閲覧できない if ($new_file_row['is_root_folder']) { $is_access_ok = FALSE; // ファイルのアクセス権限をチェックする } else { // ファイルのオーナー情報取得 $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($new_file_row['owner_community_id']); // 権限情報取得 $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); // アクセス判定 if (!ACSAccessControl::is_valid_user_for_user_community($acs_user_info_row, $role_array, $new_file_row)) { $is_access_ok = FALSE; } } if ($is_access_ok) { // ファイル詳細情報URL $new_file_row['file_detail_url'] = $this->getControllerPath(DEFAULT_MODULE, 'FileDetail') . '&id=' . $new_file_row['owner_community_id'] . '&folder_id=' . $new_file_row['folder_id'] . '&file_id=' . $new_file_row['file_id']; $new_file_row['is_unread'] = ACSLib::get_boolean($new_file_row['is_unread']); array_push($_new_file_row_array, $new_file_row); $rec_cnt = $rec_cnt + 1; } } $new_file_row_array = $_new_file_row_array; // set $request->setAttribute('user_community_id', $user_community_id); $request->setAttribute('new_file_row_array', $new_file_row_array); if ($inline_mode) { return View::INPUT; } else { return VIEW::SUCCESS; } }
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 $target_user_info_row = $request->getAttribute('target_user_info_row'); $diary_row_array = $request->getAttribute('diary_row_array'); $diary_comment_row_array = $request->getAttribute('diary_comment_row_array'); $open_level_master_row_array = $request->getAttribute('open_level_master_row_array'); $friends_group_row_array = $request->getAttribute('friends_group_row_array'); $last_open_level_code = $request->getAttribute('last_open_level_code'); // トップページURL $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id']; // 他人の日記を閲覧している場合のトップページURL $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id']; // 検索画面URL $link_page_url['search_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'SearchDiary') . '&id=' . $target_user_info_row['community_id']; // ダイアリーRSS URL $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'DIARY_RSS_TERM'); $link_page_url['diary_rss_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryRSS') . '&id=' . $target_user_info_row['community_id'] . "&term={$term}"; // 加工 foreach ($diary_row_array as $index => $diary_row) { // 画像URL $diary_row_array[$index]['image_url'] = ACSUser::get_image_url($diary_row['community_id'], 'thumb'); // 投稿日時 $diary_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($diary_row['post_date']); // 投稿日時 (省略系: M/D) $diary_row_array[$index]['short_post_date'] = gmdate("n/j", strtotime($diary_row['post_date']) + 9 * 60 * 60); // コメントページURL $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $target_user_info_row['community_id'] . '&diary_id=' . $diary_row['diary_id']; // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) { $diary_row_array[$index]['trusted_community_flag'] = 0; } else { $diary_row_array[$index]['trusted_community_flag'] = 1; } } // 削除画面URL $diary_row_array[$index]['diary_delete_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DeleteDiary') . '&id=' . $target_user_info_row['user_community_id'] . '&diary_id=' . $diary_row['diary_id']; // ファイルの画像URL $diary_row_array[$index]['file_url'] = ""; if ($diary_row['file_id'] != "") { $diary_row_array[$index]['file_url'] = ACSDiaryFile::get_image_url($diary_row['file_id'], 'thumb'); //投稿内表示用 $diary_row_array[$index]['file_url_alink'] = ACSDiaryFile::get_image_url($diary_row['file_id'], ''); //ポップアップ用 } } // 本人のページかどうか if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) { $is_self_page = 1; } else { $is_self_page = 0; } // 書き込みボタンで確認画面を表示 $action_url = $this->getControllerPath(DEFAULT_MODULE, 'DiaryPre') . '&id=' . $target_user_info_row['user_community_id'] . "&move_id=1"; //---- アクセス制御 ----// $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array); //----------------------// // ページング設定 $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, $diary_row_array, $display_count); // set $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('diary_row_array', $diary_row_array); $this->setAttribute('paging_info', $paging_info); $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('action_url', $action_url); $this->setAttribute('link_page_url', $link_page_url); $this->setAttribute('open_level_master_row_array', $open_level_master_row_array); $this->setAttribute('friends_group_row_array', $friends_group_row_array); $this->setAttribute('last_open_level_code', $last_open_level_code); // インライン表示(カレンダー) 初期値は当月 // $this->setAttribute('new_calendar_action_chain', $request->getAttribute('new_calendar_action_chain_html')); /*----------------------------------------------*/ // 初期表示時 // 現在のレンダーモードを取得 $renderMode = $controller->getRenderMode(); //レンダーモードを上書き (画面出力をオフにしてる) $controller->setRenderMode(View::RENDER_VAR); $this->inlineFlg = true; // フォワード側で判断する $request->setAttribute("inline_mode", "1"); // 新着コミュニティ $controller->forward("User", "DiaryCalendar"); $this->setAttribute("DiaryCalendar", $request->getAttribute("DiaryCalendar")); // レンダーモードを元に戻す $controller->setRenderMode($renderMode); $this->inlineFlg = false; /*----------------------------------------------*/ // テンプレート $this->setScreenId("0001"); $this->setTemplate('Diary.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(); $user = $context->getUser(); $request = $context->getRequest(); $controller = $context->getController(); // index用CSSファイル読み込み $this->clearCSSFile(); $this->setSelectionCSSFile($request->getAttribute('selection_css')); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $is_self_page = $request->getAttribute('is_self_page'); $peruse_mode = 9; $user_community_id = $request->getAttribute('user_community_id'); if ($acs_user_info_row['is_acs_user']) { $peruse_mode = 1; //ログインユーザです } // ラストログイン $last_login = $request->getAttribute('last_login'); if ($acs_user_info_row['is_acs_user']) { if ($last_login == "") { $last_login = ACSMsg::get_msg('User', 'IndexSuccessView.class.php', 'M001'); } else { $last_login = ACSLib::convert_pg_date_to_str($last_login); } } else { $last_login = ""; } // マイフレンズ表示件数 $my_friends_display_max = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'FRIENDS_DISPLAY_MAX_COUNT'); // マイコミュニティ表示件数 $my_community_display_max = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'COMMUNITY_DISPLAY_MAX_COUNT'); $profile = $request->getAttribute('target_user_info_row'); // 画像ファイルのパスを設定 $profile['image_url'] = ACSUser::get_image_url($user_community_id); // マイフレンズの設定 $friends_row_array = $request->getAttribute('friends_row_array'); $friends_row_array_num = count($friends_row_array); $friends_row_array = array_slice($friends_row_array, 0, $my_friends_display_max); foreach ($friends_row_array as $index => $friends_row) { $friends_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $friends_row['user_community_id']; $friends_row_array[$index]['image_url'] = ACSUser::get_image_url($friends_row['user_community_id'], 'thumb'); // マイフレンズ人数 $friends_row_array[$index]['friends_row_array_num'] = ACSUser::get_friends_row_array_num($friends_row['user_community_id']); } // マイコミュニティの設定 $community_row_array = $request->getAttribute('community_row_array'); $community_row_array_num = count($community_row_array); $community_list = array(); $array_count = 0; foreach ($community_row_array as $index => $community_row) { $community_data['community_name'] = $community_row['community_name']; $community_data['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']; $community_data['image_url'] = ACSCommunity::get_image_url($community_row['community_id'], 'thumb'); $community_data['community_member_num'] = ACSCommunity::get_community_member_num($community_row['community_id']); // メンバでない非公開コミュニティは表示対象にしない if ($community_row['contents_row_array']['self']['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03') && !$community_row['is_community_member']) { continue; } array_push($community_list, $community_data); $array_count++; if ($array_count == $my_community_display_max) { break; } } // メニュー設定 $menu = array(); $menu['diary_url'] = $this->getControllerPath("User", 'Diary') . '&id=' . $user_community_id; $menu['folder_url'] = $this->getControllerPath("User", 'Folder') . '&id=' . $user_community_id; if ($acs_user_info_row['user_community_id'] == $profile['user_community_id'] && !$acs_user_info_row['is_ldap_user']) { $menu['change_password_url'] = $this->getControllerPath("User", 'ChangePassword') . '&id=' . $user_community_id; } if ($acs_user_info_row['user_community_id'] == $profile['user_community_id']) { $menu['image_change_url'] = $this->getControllerPath("User", 'EditProfileImage') . '&id=' . $user_community_id; } // マイプロフィール編集 自分自身 if ($acs_user_info_row['user_id'] == $profile['user_id']) { $profile_edit_url = $this->getControllerPath("User", 'EditProfile') . '&id=' . $user_community_id; $profile_view_url = $this->getControllerPath("User", 'ProfileCheck') . '&id=' . $user_community_id . '&view_mode=0'; // 足跡確認URL $footprint_url = $this->getControllerPath("User", 'FootprintCheck') . '&id=' . $user_community_id; // デザイン選択URL $select_design_url = $this->getControllerPath("User", 'SelectDesign') . '&id=' . $user_community_id; // バックアップURL $backup_url = $this->getControllerPath("User", 'ContentsBackup') . '&id=' . $user_community_id; // メッセージURL追加 $message_box_url = $this->getControllerPath("User", 'MessageBox') . '&id=' . $user_community_id; $peruse_mode = 1; } else { if (ACSUser::is_friends($acs_user_info_row['user_community_id'], $user_community_id)) { $peruse_mode = 2; // 友人 } } // メッセージを送るボタン追加 $message_btn_url = $this->getControllerPath("User", 'Message') . '&id=' . $user_community_id; // マイフレンズ追加 $target_user_info_row = $request->getAttribute('target_user_info_row'); $is_friends = ACSUser::is_friends($acs_user_info_row['user_community_id'], $target_user_info_row['user_community_id']); if (!$is_friends && $acs_user_info_row['is_acs_user']) { $add_myfriends_url = $this->getControllerPath("User", 'AddFriends') . '&id=' . $user_community_id; } // マイフレンズ一覧URL $friends_list_url = $this->getControllerPath("User", 'FriendsList') . '&id=' . $user_community_id; if ($acs_user_info_row['user_id'] == $target_user_info_row['user_id']) { // マイフレンズグループ一覧URL $friends_group_list_url = $this->getControllerPath("User", 'FriendsGroupList') . '&id=' . $target_user_info_row['user_community_id']; } // マイコミュニティURL $community_list_url = $this->getControllerPath("User", 'CommunityList') . '&id=' . $user_community_id; if ($is_self_page) { // 待機: マイフレンズ追加 $waiting_for_add_friends_row_array = $request->getAttribute('waiting_for_add_friends_row_array'); $waiting_for_add_friends_row_array_num = count($waiting_for_add_friends_row_array); if ($waiting_for_add_friends_row_array_num) { // マイフレンズ追加 承認待ち URL $waiting_list_for_add_friends_url = $this->getControllerPath("User", 'WaitingList') . '&id=' . $user_community_id . '&waiting_type_code=' . $waiting_for_add_friends_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_add_friends_row_array[0]['waiting_status_code']; } // 待機: コミュニティ参加 $waiting_for_join_community_row_array_array = $request->getAttribute('waiting_for_join_community_row_array_array'); foreach ($waiting_for_join_community_row_array_array as $index => $waiting_for_join_community_row_array) { $waiting_for_join_community_row_array_array[$index]['waiting_for_join_community_row_array_num'] = count($waiting_for_join_community_row_array['waiting_row_array']); $waiting_for_join_community_row_array_array[$index]['waiting_list_for_join_community_url'] = $this->getControllerPath('Community', 'WaitingList') . '&community_id=' . $waiting_for_join_community_row_array['community_row']['community_id'] . '&waiting_type_code=' . $waiting_for_join_community_row_array['waiting_row_array'][0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_join_community_row_array['waiting_row_array'][0]['waiting_status_code']; } // 待機: 親コミュニティ追加 $waiting_for_parent_community_link_row_array_array = $request->getAttribute('waiting_for_parent_community_link_row_array_array'); foreach ($waiting_for_parent_community_link_row_array_array as $index => $waiting_for_parent_community_link_row_array) { $waiting_for_parent_community_link_row_array_array[$index]['waiting_for_parent_community_link_row_array_num'] = count($waiting_for_parent_community_link_row_array['waiting_row_array']); $waiting_for_parent_community_link_row_array_array[$index]['waiting_list_for_parent_community_link_url'] = $this->getControllerPath('Community', 'WaitingList') . '&community_id=' . $waiting_for_parent_community_link_row_array['community_row']['community_id'] . '&waiting_type_code=' . $waiting_for_parent_community_link_row_array['waiting_row_array'][0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_parent_community_link_row_array['waiting_row_array'][0]['waiting_status_code']; } // 待機: サブコミュニティ追加 $waiting_for_sub_community_link_row_array_array = $request->getAttribute('waiting_for_sub_community_link_row_array_array'); foreach ($waiting_for_sub_community_link_row_array_array as $index => $waiting_for_sub_community_link_row_array) { $waiting_for_sub_community_link_row_array_array[$index]['waiting_for_sub_community_link_row_array_num'] = count($waiting_for_sub_community_link_row_array['waiting_row_array']); $waiting_for_sub_community_link_row_array_array[$index]['waiting_list_for_sub_community_link_url'] = $this->getControllerPath('Community', 'WaitingList') . '&community_id=' . $waiting_for_sub_community_link_row_array['community_row']['community_id'] . '&waiting_type_code=' . $waiting_for_sub_community_link_row_array['waiting_row_array'][0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_sub_community_link_row_array['waiting_row_array'][0]['waiting_status_code']; } // 待機: コミュニティ招待 $waiting_for_invite_to_community_row_array = $request->getAttribute('waiting_for_invite_to_community_row_array'); $waiting_for_invite_to_community_row_array_num = count($waiting_for_invite_to_community_row_array); if ($waiting_for_invite_to_community_row_array_num) { // マイフレンズ追加 承認待ち URL $waiting_list_for_invite_to_community_url = $this->getControllerPath("User", 'WaitingList') . '&id=' . $user_community_id . '&waiting_type_code=' . $waiting_for_invite_to_community_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_invite_to_community_row_array[0]['waiting_status_code']; } // 新着コメント $new_comment_diary_row_array = $request->getAttribute('new_comment_diary_row_array'); $new_comment_diary_row_array_num = count($new_comment_diary_row_array); if ($new_comment_diary_row_array_num) { // 新着コメントがあるダイアリーの中で、最もダイアリーの投稿日時が古い物([0])のdiary_idを引数に付ける $new_comment_diary_url = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $new_comment_diary_row_array[0]['community_id'] . '&diary_id=' . $new_comment_diary_row_array[0]['diary_id']; } // システムからのお知らせ $system_announce_row_array = $request->getAttribute('system_announce_row_array'); foreach ($system_announce_row_array as $index => $system_announce_row) { $system_announce_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($system_announce_row['post_date'], false, false, false); } // メッセージ機能 $new_message_row_array = $request->getAttribute('new_message_row_array'); $new_message_row_array_num = count($new_message_row_array); if ($new_message_row_array_num == 1) { // 新着メッセージが一件 メッセージ詳細URL $new_message_url = $this->getControllerPath("User", 'MessageShow') . '&id=' . $user_community_id . '&message_id=' . $new_message_row_array[0]['message_id']; } else { if ($new_message_row_array_num > 1) { // 新着メッセージが複数件 受信箱URL $new_message_url = $this->getControllerPath("User", 'MessageBox') . '&id=' . $user_community_id; } } // メッセージ機能 } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); $profile['contents_row_array']['user_name'] = ACSAccessControl::get_valid_row_for_user_community($acs_user_info_row, $role_array, $profile['contents_row_array']['user_name']); $profile['contents_row_array']['birthplace'] = ACSAccessControl::get_valid_row_for_user_community($acs_user_info_row, $role_array, $profile['contents_row_array']['birthplace']); $profile['contents_row_array']['birthday'] = ACSAccessControl::get_valid_row_for_user_community($acs_user_info_row, $role_array, $profile['contents_row_array']['birthday']); // マイフレンズ表示可否 if (!ACSAccessControl::is_valid_user_for_user_community($acs_user_info_row, $role_array, $profile['contents_row_array']['friends_list'])) { $friends_row_array = array(); $friends_list_url = ''; //$friends_row_array_num = 0; } //----------------------// // set $this->setAttribute('profile', $profile); $this->setAttribute('peruse_mode', $peruse_mode); //プロフィール自己紹介分岐用 $this->setAttribute('friends_row_array', $friends_row_array); $this->setAttribute('friends_row_array_num', $friends_row_array_num); $this->setAttribute('community_list', $community_list); $this->setAttribute('community_row_array_num', $community_row_array_num); $this->setAttribute('last_login', $last_login); // メニュー $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('menu', $menu); $this->setAttribute('profile_edit_url', $profile_edit_url); $this->setAttribute('profile_view_url', $profile_view_url); $this->setAttribute('footprint_url', $footprint_url); $this->setAttribute('backup_url', $backup_url); $this->setAttribute('select_design_url', $select_design_url); $this->setAttribute('add_myfriends_url', $add_myfriends_url); $this->setAttribute('friends_list_url', $friends_list_url); $this->setAttribute('friends_group_list_url', $friends_group_list_url); $this->setAttribute('manage_friends_url', $manage_friends_url); $this->setAttribute('community_list_url', $community_list_url); $this->setAttribute('message_btn_url', $message_btn_url); $this->setAttribute('message_box_url', $message_box_url); // 待機: マイフレンズ追加 $this->setAttribute('waiting_for_add_friends_row_array_num', $waiting_for_add_friends_row_array_num); $this->setAttribute('waiting_list_for_add_friends_url', $waiting_list_for_add_friends_url); // 待機: コミュニティ参加 $this->setAttribute('waiting_for_join_community_row_array_array', $waiting_for_join_community_row_array_array); // 待機: 親コミュニティ追加 $this->setAttribute('waiting_for_parent_community_link_row_array_array', $waiting_for_parent_community_link_row_array_array); // 待機: サブコミュニティ追加 $this->setAttribute('waiting_for_sub_community_link_row_array_array', $waiting_for_sub_community_link_row_array_array); // 待機: コミュニティ招待 $this->setAttribute('waiting_for_invite_to_community_row_array_num', $waiting_for_invite_to_community_row_array_num); $this->setAttribute('waiting_list_for_invite_to_community_url', $waiting_list_for_invite_to_community_url); // 新着コメントのあるマイダイアリー $this->setAttribute('new_comment_diary_row_array_num', $new_comment_diary_row_array_num); $this->setAttribute('new_comment_diary_url', $new_comment_diary_url); // システムからのお知らせ $this->setAttribute('system_announce_row_array', $system_announce_row_array); // メッセージ機能 $this->setAttribute('new_message_row_array_num', $new_message_row_array_num); $this->setAttribute('new_message_url', $new_message_url); // インライン表示 /*--------------- 新着情報を取得 ---------------*/ // 現在のレンダーモードを取得 $renderMode = $controller->getRenderMode(); //レンダーモードを上書き (画面出力をオフにしてる) $controller->setRenderMode(View::RENDER_VAR); $this->inlineFlg = true; // フォワード側で判断する $request->setAttribute("inline_mode", "1"); $request->setAttribute("id", $user_community_id); // 新着日記 $controller->forward("User", "NewDiary"); $this->setAttribute("NewDiary", $request->getAttribute("NewDiary")); // 日記コメント履歴 $controller->forward("User", "DiaryCommentHistory"); $this->setAttribute("DiaryCommentHistory", $request->getAttribute("DiaryCommentHistory")); // マイコミュニティ掲示板新着記事 $controller->forward("User", "NewBBS"); $this->setAttribute("NewBBS", $request->getAttribute("NewBBS")); // マイフレンズ:フォルダ新着情報 $controller->forward("User", "NewFriendsFolder"); $this->setAttribute("NewFriendsFolder", $request->getAttribute("NewFriendsFolder")); // マイフレンズ:フォルダ新着情報 $controller->forward("User", "NewCommunityFolder"); $this->setAttribute("NewCommunityFolder", $request->getAttribute("NewCommunityFolder")); // CSS $this->setAttribute('include_css_array', $this->css_file_array); // レンダーモードを元に戻す $controller->setRenderMode($renderMode); $this->inlineFlg = false; /*----------------------------------------------*/ // テンプレート $this->setScreenId("0001"); $this->setTemplate('Index.tpl.php'); return parent::execute(); }
/** * フォルダリストゲット * アクセス者がアクセス可能なフォルダのみ返す * * @param $acs_user_info_row * @param $target_user_info_row */ function get_display_folder_obj_array($acs_user_info_row, $target_user_info_row) { $ret_folder_obj_array = array(); /* role_array 取得 */ $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); if ($this->get_is_root_folder()) { /* 表示可能オブジェクト取得 */ $all_folder_obj_array = $this->get_folder_obj_array(); $ret_folder_obj_array = ACSAccessControl::get_valid_obj_row_array_for_user_community($acs_user_info_row, $role_array, $all_folder_obj_array); } else { $ret_folder_obj_array = $this->get_folder_obj_array(); } // アクセス可能なフォルダのみ返す //return $this->folder_obj_array; return $ret_folder_obj_array; }
function 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 ($user_community_id == null || $user_community_id == '') { $user_community_id = $request->getAttribute("id"); } // ユーザ情報 $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id); $top_page_url = $this->getControllerPath("User", 'Diary') . '&id=' . $user_community_id; $year = $request->ACSgetParameter('year'); // 年 $month = $request->ACSgetParameter('month'); // 月 if (!checkdate($month, 1, $year)) { $date_array = getdate(); // 現在の日付情報 $year = $date_array["year"]; $month = $date_array["mon"]; } //表示月($year/$month)に該当するデータを検索に行く $diary_row_array = ACSDiary::get_diary_row_array_by_year_month($user_community_id, $year, $month); // 信頼済みコミュニティ情報の追加 foreach ($diary_row_array as $index => $diary_row) { if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { $diary_row_array[$index]['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']); } } //---- アクセス制御 ----// $acs_user_info_row = $user->getAttribute('acs_user_info_row'); foreach ($diary_row_array as $index => $diary_row) { // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) { if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) { $diary_row_array[$index]['trusted_community_flag'] = 0; } else { $diary_row_array[$index]['trusted_community_flag'] = 1; } } } $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array); //----------------------// // クラスを初期化 // calendar(開始曜日, 当月以外の日付を表示するかどうか) の形で指定します。 // ※開始曜日(0-日曜 から 6-土曜)、当月以外の日付を表示(0-No, 1-Yes) $calendar_obj = new calendar(0, 0); // 表示月以外の日付を表示しないことで共通させる // リンクを設定 $calendar_obj->clear_link(); if ($diary_row_array) { // リンクのある間、繰り返し foreach ($diary_row_array as $index => $diary_row) { if ($diary_row) { $link_date = substr($diary_row['post_date'], 8, 2); if (substr($link_date, 0, 1) == '0') { $link_date = substr($link_date, 1, 1); } $calendar_obj->set_link($link_date, $top_page_url . "&year={$year}&month={$month}&day={$link_date}", ACSMsg::get_msg('User', 'DiaryCalendarAction.class.php', 'M001')); } } } // 指定月のカレンダー描画 // show_calendar(年, 月, 日) の形で指定します。 // ※日は省略可能です。指定するとその日が太字で表示されます。 $calendar_obj->set_str_url($top_page_url); $new_calendar_html = $calendar_obj->show_calendar($year, $month); // 年と月を指定してカレンダーを表示 $request->setAttribute('new_calendar_html', $new_calendar_html); return View::INPUT; }
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_user_info_row = $request->getAttribute('target_user_info_row'); $form = $request->getAttribute('form'); $folder_row_array = $request->getAttribute('folder_row_array'); $file_info_row_array = $request->getAttribute('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('User', 'Folder') . '&id=' . $target_user_info_row['user_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('User', 'DownloadFile') . '&id=' . $target_user_info_row['user_community_id'] . '&file_id=' . $file_info_row['file_id'] . '&folder_id=' . $file_info_row['folder_id']; } } // 本人かどうか $is_self_page = $target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id'] ? true : false; // URL $folder_url = $this->getControllerPath('User', 'Folder') . '&id=' . $target_user_info_row['user_community_id']; $action_url = $this->getControllerPath(); //---- アクセス制御 ----// $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row); if (is_array($folder_row_array)) { $folder_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $folder_row_array); } if (is_array($file_info_row_array)) { $file_info_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $file_info_row_array); $_file_info_row_array = array(); // 本人以外はis_root_folderのファイルを閲覧できない foreach ($file_info_row_array as $index => $file_info_row) { if (!$is_self_page && $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; } //----------------------// // テンプレート $this->setScreenId("0001"); $this->setTemplate('SearchFolder.tpl.php'); // set $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('form', $form); $this->setAttribute('folder_row_array', $folder_row_array); $this->setAttribute('file_info_row_array', $file_info_row_array); $this->setAttribute('is_self_page', $is_self_page); $this->setAttribute('folder_url', $folder_url); $this->setAttribute('action_url', $action_url); $this->setAttribute('module', 'User'); $this->setAttribute('action', 'SearchFolder'); return parent::execute(); }