function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $target_community_id = $request->getParameter('community_id'); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_community_folder_id = $request->getParameter('folder_id'); // form $form = $request->ACSGetParameters(); /* ファイルアップロード処理 */ $ret = 0; if ($_FILES['new_file']['tmp_name'] != '') { // ファイル情報取得 $file_obj = ACSFile::get_upload_file_info_instance($_FILES['new_file'], $target_community_id, $acs_user_info_row['user_community_id']); // フォルダにファイル追加処理 $user_folder_obj = new ACSCommunityFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); $folder_obj = $user_folder_obj->get_folder_obj(); $ret = $folder_obj->add_file($file_obj); } if (!$ret) { print "ERROR: Upload file failed."; } if ($ret) { // 新規登録したファイルID $file_id = $file_obj->get_file_id(); // 2007.12 追加 // ML通知チェックがあればMLにメール送信する $send_announce_mail = $request->getParameter('send_announce_mail'); if ($send_announce_mail == "t") { ACSCommunityMail::send_fileupload_mail($target_community_id, $acs_user_info_row, $folder_obj, $file_obj); } } // ファイル履歴情報登録 if ($ret) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $ret = ACSFileHistory::set_file_history($file_info_row, $acs_user_info_row['user_community_id'], $form['comment'], ACSMsg::get_mst('file_history_operation_master', 'D0101')); } // ファイル詳細情報登録 if ($form['file_category_code'] != '' && $ret) { $file_contents_type_list_row_array = ACSFileDetailInfo::get_file_contents_type_list_row_array($form['file_category_code']); $file_contents_form_array = array(); foreach ($file_contents_type_list_row_array as $file_contents_type_list_row) { $file_contents_form = array('file_id' => $file_id, 'file_contents_type_code' => $file_contents_type_list_row['file_contents_type_code'], 'file_contents_value' => $form['file_contents_array'][$file_contents_type_list_row['file_contents_type_code']]); array_push($file_contents_form_array, $file_contents_form); } $ret = ACSFileDetailInfo::set_file_detail_info($file_id, $form['file_category_code'], $file_contents_form_array); } // フォルダ表示アクション呼び出し $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $folder_action = $this->getControllerPath('Community', 'Folder'); $folder_action .= '&community_id=' . $target_community_id; $folder_action .= '&folder_id=' . $target_community_folder_id; header("Location: {$folder_action}"); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // get $community_row = $request->getAttribute('community_row'); $bbs_row_array = $request->getAttribute('bbs_row_array'); $term = $request->getAttribute('term'); // ユーザ情報 $community_row['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']; $community_row['image_url'] = ACSCommunity::get_image_url($community_row['community_id']); if ($community_row['file_id'] != '') { $community_file_info_row = ACSFileInfoModel::select_file_info_row($community_row['file_id']); $community_row['image_title'] = $community_file_info_row['display_file_name']; } else { // コミュニティ写真はありません $community_row['image_title'] = ACSMsg::get_msg('Community', ' BBSRSSSuccessView.class.php', 'M001'); } // 加工 foreach ($bbs_row_array as $index => $bbs_row) { // 親記事の投稿者 トップページURL $bbs_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $bbs_row['community_id']; // 返信画面URL $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; // ファイルの画像URL if ($bbs_row['file_id'] != "") { $bbs_row_array[$index]['file_url'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'rss'); } } //---- アクセス制御 ----// $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row); $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array); //----------------------// // ACSBBS::print_bbs_rss()で使用するパラメータをセットする $params = array(); // ベースURL if ($acs_user_info_row['is_acs_user']) { $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL'); } else { $params['base_url'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL'); } // 自身のURL $params['rss_syndication_url'] = $params['base_url'] . $this->getControllerPath('Community', 'BBSRSS') . '&id=' . $community_row['community_id'] . '&term=' . $term; // RSS出力部 ACSBBS::print_bbs_rss($community_row, $bbs_row_array, $params); // 終了 exit; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_community_id = $request->getParameter('community_id'); $target_community_folder_id = $request->getParameter('folder_id'); $file_id = $request->getParameter('file_id'); $file_history_id = $request->getParameter('file_history_id'); // アクセス制御 // プットフォルダ、ファイルはNG $file_obj = ACSFile::get_file_info_instance($file_id); if ($file_obj->get_owner_community_id() != $target_community_id) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; //return VIEW_NONE; } $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $file_history_row = ACSFileHistory::get_file_history_row($file_history_id); // form $form = $request->ACSGetParameters(); // ファイル復活処理 // フォルダobj $community_folder_obj = new ACSUserFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); $folder_obj = $community_folder_obj->get_folder_obj(); // file_info更新 $ret = $folder_obj->restore_history_file($file_info_row, $file_history_row); if (!$ret) { print "ERROR: Restore file failed."; } // ファイル履歴情報登録 if ($ret) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $ret = ACSFileHistory::set_file_history($file_info_row, $acs_user_info_row['user_community_id'], $form['comment'], ACSMsg::get_msg('Community', '', 'M001')); } // ファイル詳細情報へ遷移 $file_detail_url = $this->getControllerPath('Community', 'FileDetail'); $file_detail_url .= '&community_id=' . $target_community_id; $file_detail_url .= '&file_id=' . $file_id; $file_detail_url .= '&folder_id=' . $target_community_folder_id; header("Location: {$file_detail_url}"); //return VIEW_NONE; }
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_user_community_id = $request->getParameter('id'); $target_user_community_folder_id = $request->getParameter('folder_id'); $file_id = $request->getParameter('file_id'); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // form $form = $request->ACSGetParameters(); // ファイル更新処理 if ($_FILES['new_file']['tmp_name'] != '') { // ファイルobj $file_obj = ACSFile::get_upload_file_info_instance_for_update($_FILES['new_file'], $target_user_community_id, $acs_user_info_row['user_community_id'], $file_id); // フォルダobj $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(); // ファイル履歴が1件も登録されていない場合は"作成"を登録する $file_history_row_array = ACSFileHistory::get_file_history_row_array($file_id); if (count($file_history_row_array) == 0) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $file_history_id = ACSFileHistory::set_file_history($file_info_row, $file_info_row['entry_user_community_id'], '', ACSMsg::get_mst('file_history_operation_master', 'D0101')); } // file_info更新, ファイル保存 $ret = $folder_obj->update_file($file_obj); } if (!$ret) { print "ERROR: Upload file failed."; } // ファイル履歴情報登録 if ($ret) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $ret = ACSFileHistory::set_file_history($file_info_row, $acs_user_info_row['user_community_id'], $form['comment'], ACSMsg::get_mst('file_history_operation_master', 'D0201')); } // ファイル詳細情報へ遷移 $file_detail_url = $this->getControllerPath('User', 'FileDetail'); $file_detail_url .= '&id=' . $target_user_community_id; $file_detail_url .= '&file_id=' . $file_id; $file_detail_url .= '&folder_id=' . $target_user_community_folder_id; header("Location: {$file_detail_url}"); }
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_community_id = $request->getParameter('community_id'); // 対象となるフォルダIDを取得 $target_community_folder_id = $request->getParameter('folder_id'); // 詳細情報を表示するファイルIDを取得 $file_id = $request->getParameter('file_id'); // ファイル履歴ID $file_history_id = $request->getParameter('file_history_id'); // form $form = $request->ACSGetParameters(); // 表示するページの所有者情報取得 $target_community_row = ACSCommunity::get_community_row($target_community_id); // フォルダ情報取得 $community_folder_obj = new ACSCommunityFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); $folder_obj = $community_folder_obj->get_folder_obj(); // ファイル情報取得 $file_obj = ACSFile::get_file_info_instance($file_id); // フォルダの公開範囲でアクセス制御 if (!$community_folder_obj->has_privilege($target_community_row)) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // ファイル履歴コメントを登録する if ($form['comment'] != '') { // ファイル履歴が1件も登録されていない場合は"作成"を登録する $file_history_row_array = ACSFileHistory::get_file_history_row_array($file_id); if (count($file_history_row_array) == 0) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $file_history_id = ACSFileHistory::set_file_history($file_info_row, $file_info_row['entry_user_community_id'], '', ACSMsg::get_mst('file_history_operation_master', 'D0101')); } $ret = ACSFileHistoryComment::set_file_history_comment($file_history_id, $acs_user_info_row['user_community_id'], $form['comment']); } // ファイル詳細情報へ遷移 $file_detail_url = $this->getControllerPath('Community', 'FileDetail'); $file_detail_url .= '&community_id=' . $target_community_id; $file_detail_url .= '&file_id=' . $file_id; $file_detail_url .= '&folder_id=' . $target_community_folder_id; header("Location: {$file_detail_url}"); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); // RSS対象のアドレス開始値 $system_top_address = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL'); $rss_syndicationURL = $system_top_address; $rss_syndicationURL .= $this->getControllerPath('Community', 'PressReleaseRSS'); $rss_syndicationURL .= '&community_id=' . $request->getParameter('community_id'); // コミュニティ情報 $community_id = $request->getParameter('community_id'); $community_row = ACSCommunity::get_community_row($community_id); $community_row['community_profile'] = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D07')); //コミュニティトップページ $community_top_page_url = $this->getControllerPath('Community', 'Index') . '&community_id=' . $community_id; $community_row['community_profile']['top_page_url'] = $community_top_page_url; //コミュニティ写真表示 if ($community_row['file_id']) { $community_file_info_row = ACSFileInfoModel::select_file_info_row($community_row['file_id']); $community_row['image_title'] = $community_file_info_row['display_file_name']; } else { $community_row['image_title'] = ACSMsg::get_msg('Community', 'PressReleaseRSSAction.class.php', 'M001'); } $community_row['image_url'] = ACSCommunity::get_image_url($community_id, 'rss'); // BBS記事一覧 一つだけ出力するものを選択できる $bbs_row_array = ACSBBS::get_bbs_rss_row_array($community_id, 1); if (count($bbs_row_array) > 0) { // 掲載終了日が本日を越えていないもののみにする // 本日を取得 $today = date("Y/m/d"); $bbs_rss_array = array(); foreach ($bbs_row_array as $index => $bbs_row) { //対象となる記事のみを抽出 $bbs_date = ACSLib::convert_pg_date_to_str($bbs_row['expire_date'], false, false, false); if ($bbs_date >= $today || $bbs_date == null) { //記事配列を作り変え $bbs_rss_array[$index] = $bbs_row; //記事のリンク先を作る $bbs_rss_array[$index]['bbs_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id']; //画像のリンク先を作る $bbs_rss_array[$index]['file_link'] = ""; if ($bbs_row['file_id'] != "") { $bbs_rss_array[$index]['file_url'] = $system_top_address . ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'rss'); //RSS表示用 } } } $detail = true; //存在する } else { $detail = false; //存在しない } // RSS対象のBBS記事一覧 $user->setAttribute('bbs_rss_array', $bbs_rss_array); // RSS対象のCommunity情報 $user->setAttribute('community_row', $community_row); $community_name = htmlspecialchars($community_row['community_name']); // set $request->setAttribute('rss_syndicationURL', $rss_syndicationURL); $request->setAttribute('bbs_rss_array', $bbs_rss_array); $request->setAttribute('community_row', $community_row); $request->setAttribute('community_name', $community_name); $request->setAttribute('system_top_address', $system_top_address); //記事の存在フラグ $request->setAttribute('detail', $detail); require "PressReleaseRSS.php"; }
/** * インスタンス取得(ファイルID指定) * * @param $file_id */ static function get_file_info_instance($file_id) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $file_obj = new ACSFile($file_info_row); return $file_obj; }
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(); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_community_id = $request->getParameter('community_id'); $target_community_folder_id = $request->getParameter('folder_id'); $file_id = $request->getParameter('file_id'); // アクセス制御 // プットフォルダ、ファイルはNG $file_obj = ACSFile::get_file_info_instance($file_id); if ($file_obj->get_owner_community_id() != $target_community_id) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // form $form = $request->ACSGetParameters(); $ret = false; // ファイル更新処理 if ($_FILES['new_file']['tmp_name'] != '') { // ファイルobj $file_obj = ACSFile::get_upload_file_info_instance_for_update($_FILES['new_file'], $target_community_id, $acs_user_info_row['user_community_id'], $file_id); // フォルダobj $community_folder_obj = new ACSCommunityFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); $folder_obj = $community_folder_obj->get_folder_obj(); // ファイル履歴が1件も登録されていない場合は"作成"を登録する $file_history_row_array = ACSFileHistory::get_file_history_row_array($file_id); if (count($file_history_row_array) == 0) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $file_history_id = ACSFileHistory::set_file_history($file_info_row, $file_info_row['entry_user_community_id'], '', ACSMsg::get_mst('file_history_operation_master', 'D0101')); } // file_info更新, ファイル保存 $ret = $folder_obj->update_file($file_obj); } if (!$ret) { print "ERROR: ファイルアップロードに失敗しました"; } // ファイル履歴情報登録 if ($ret) { $file_info_row = ACSFileInfoModel::select_file_info_row($file_id); $ret = ACSFileHistory::set_file_history($file_info_row, $acs_user_info_row['user_community_id'], $form['comment'], ACSMsg::get_mst('file_history_operation_master', 'D0201')); // 2007.12 追加 // ML通知チェックがあればMLにメール送信する // コミュニティ情報の取得 $send_announce_mail = $request->getParameter('send_announce_mail'); if ($send_announce_mail == "t") { ACSCommunityMail::send_fileupload_mail($target_community_id, $acs_user_info_row, $folder_obj, $file_obj); } } // ファイル詳細情報へ遷移 $file_detail_url = $this->getControllerPath('Community', 'FileDetail'); $file_detail_url .= '&community_id=' . $target_community_id; $file_detail_url .= '&file_id=' . $file_id; $file_detail_url .= '&folder_id=' . $target_community_folder_id; header("Location: {$file_detail_url}"); }