Пример #1
0
 function getDefaultView()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     $community_row = ACSExternalRSS::add_contents_row_array($community_row);
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
         // 返信記事
         $bbs_row_array[$index]['bbs_res_row_array'] = ACSBBS::get_bbs_res_row_array($bbs_row['bbs_id']);
     }
     if ($community_row['contents_row_array']['self']['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03')) {
         // 非公開コミュニティ
         $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D43'));
     } else {
         // 公開範囲
         $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     return View::INPUT;
 }
Пример #2
0
 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を取得
     $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'));
     // 取得期間
     $term = intval($request->ACSgetParameter('term'));
     if (!$term) {
         // システム設定: コミュニティ: 掲示板RSS取得期間
         $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D03'), 'BBS_RSS_TERM');
     }
     // 最新の掲示板RSS
     $bbs_row_array = ACSBBS::get_new_bbs_rss_row_array($community_id, $term);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('term', $term);
     return View::SUCCESS;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // コミュニティ情報
     // RSSに表示する全コミュニティ のコミュニティID指定定数
     // 対象とならないコミュニティIDを取得
     $except_community_id = $request->getParameter('except_community_id');
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_rss_row_array($except_community_id, 0);
     // システム情報の設定
     $system_config_keyword_value['SYSTEM_NAME'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_NAME');
     $system_config_keyword_value['SYSTEM_OUTLINE'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_OUTLINE');
     $system_config_keyword_value['SYSTEM_BASE_URL'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     $system_config_keyword_value['SYSTEM_MAIL_ADDR'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_MAIL_ADDR');
     //	$system_config_keyword_value['SYSTEM_IMAGE'] = ACSSystemConfig::get_keyword_value('システム', 'SYSTEM_IMAGE');		// 3/13現在画像は無い 次行 暫定処理
     $system_config_keyword_value['SYSTEM_IMAGE']['title'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M001');
     $system_config_keyword_value['SYSTEM_IMAGE']['url'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M002');
     $system_config_keyword_value['SYSTEM_IMAGE']['link'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M003');
     $system_config_keyword_value['SYSTEM_IMAGE']['description'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M004');
     $rss_syndicationURL .= $system_config_keyword_value['SYSTEM_BASE_URL'] . $this->getControllerPath('Community', 'PressReleaseAllRSS');
     // 掲載終了日が本日を越えていないもののみにする
     // 本日を取得
     $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;
             //相対するCommunity名を作る
             $community_row = ACSCommunity::get_community_row($bbs_row['community_id']);
             $bbs_rss_array[$index]['community_id_name'] = $community_row['community_name'];
             //記事のリンク先を作る
             $bbs_rss_array[$index]['bbs_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $bbs_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_config_keyword_value['SYSTEM_BASE_URL'] . ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'rss');
                 //RSS表示用
             }
         }
     }
     $user->setAttribute('bbs_rss_array', $bbs_rss_array);
     // RSS対象のBBS記事一覧
     $bbs_rss_array = $user->getAttribute('bbs_rss_array');
     // RSS対象のアドレス開始値
     $system_top_address = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     // set
     $request->setAttribute('system_config_keyword_value', $system_config_keyword_value);
     $request->setAttribute('rss_syndicationURL', $rss_syndicationURL);
     $request->setAttribute('bbs_rss_array', $bbs_rss_array);
     $request->setAttribute('system_top_address', $system_top_address);
     require "PressReleaseAllRSS.php";
 }
 public function execute()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 新着パブリックリリース一覧を取得する
     $new_bbs_for_press_release_row_array = ACSBBS::get_new_bbs_for_press_release_row_array();
     // set
     $request->setAttribute('new_bbs_for_press_release_row_array', $new_bbs_for_press_release_row_array);
     return View::INPUT;
 }
Пример #5
0
 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を取得
     $community_id = $request->ACSGetParameter('community_id');
     // コミュニティ存在チェック
     $community_row = ACSCommunity::get_community_row($community_id);
     if (!$community_row || $community_row['community_type_name'] != ACSMsg::get_mst('community_type_master', 'D40')) {
         return View::ERROR;
     }
     // 権限チェック
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // サブコミュニティ情報の一覧
     $sub_community_row_array = ACSCommunity::get_sub_community_row_array($community_id);
     // 親コミュニティ情報の一覧
     $parent_community_row_array = ACSCommunity::get_parent_community_row_array($community_id);
     // コミュニティメンバ, コミュニティ管理者
     $community_member_user_info_row_array = ACSCommunity::get_community_member_user_info_row_array($community_id);
     $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_id);
     // 待機: コミュニティ参加 承認待ち
     $waiting_for_join_community_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     // 待機: 親コミュニティ追加, サブコミュニティ追加
     $waiting_for_parent_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     $waiting_for_sub_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10'));
     // 最新情報: BBS
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('sub_community_row_array', $sub_community_row_array);
     $request->setAttribute('parent_community_row_array', $parent_community_row_array);
     $request->setAttribute('community_member_user_info_row_array', $community_member_user_info_row_array);
     $request->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array);
     $request->setAttribute('waiting_for_join_community_row_array', $waiting_for_join_community_row_array);
     $request->setAttribute('waiting_for_parent_community_link_row_array', $waiting_for_parent_community_link_row_array);
     $request->setAttribute('waiting_for_sub_community_link_row_array', $waiting_for_sub_community_link_row_array);
     $request->setAttribute('bbs_row_array', $bbs_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
     $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;
 }
Пример #7
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $community_id = $request->getParameter('community_id');
     $bbs_id = $request->getParameter('bbs_id');
     $bbs_res_id = $request->getParameter('bbs_res_id');
     // 入力データ
     $form = $request->ACSGetParameters();
     $form['user_community_id'] = $acs_user_info_row['user_community_id'];
     // bbs更新
     $ret = ACSBBS::update_bbs_res($form);
     $bbs_res_url = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_id . '&bbs_id=' . $bbs_id;
     header("Location: {$bbs_res_url}");
 }
Пример #8
0
 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);
     // ユーザ情報
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
     // マイコミュニティの新着掲示板記事一覧を取得する
     if ($inline_mode) {
         $new_bbs_row_array = ACSBBS::get_new_bbs_row_array($user_community_id, $get_days, true);
     } else {
         $new_bbs_row_array = ACSBBS::get_new_bbs_row_array($user_community_id, $get_days);
     }
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('new_bbs_row_array', $new_bbs_row_array);
     if ($inline_mode) {
         return View::INPUT;
     } else {
         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');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     // BBS記事一覧
     $bbs_row_array = ACSBBS::get_bbs_row_array($community_id);
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 信頼済みコミュニティ一覧
         $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     }
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     return View::SUCCESS;
 }
Пример #10
0
 function get_execute_privilege()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // 公開範囲情報取得
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $bbs_row = ACSBBS::get_bbs_row($request->ACSGetParameter('id'));
     if (!$bbs_row) {
         return false;
     }
     // パブリックリリース
     if ($bbs_row['open_level_code'] == '06') {
         return true;
     }
     $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     $target_community_row = ACSCommunity::get_community_profile_row($bbs_row['bbs_community_id']);
     // スレッドごとのアクセス制御判定
     $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $target_community_row);
     $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_row);
     return $ret;
 }
Пример #11
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $community_id = $request->getParameter('community_id');
     $bbs_id = $request->getParameter('bbs_id');
     // 入力データ
     $form = $request->ACSGetParameters();
     $form['user_community_id'] = $acs_user_info_row['user_community_id'];
     // bbs更新
     ACSDB::_do_query("BEGIN");
     $ret = ACSBBS::update_bbs($form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         exit;
     }
     ACSDB::_do_query("COMMIT");
     $bbs_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_id;
     header("Location: {$bbs_url}");
 }
 function get_execute_privilege()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 本人はOK
     if ($user->hasCredential('COMMUNITY_ADMIN')) {
         return true;
     }
     // 書き込んだメンバ本人はOK
     if ($user->hasCredential('COMMUNITY_MEMBER')) {
         $bbs_res_row = ACSBBS::get_bbs_res_row($request->getParameter('bbs_res_id'));
         if ($acs_user_info_row['user_community_id'] == $bbs_res_row['user_community_id']) {
             return true;
         }
     }
     return false;
 }
Пример #13
0
 function get_execute_privilege(&$controller, &$request, &$user)
 {
     // 公開範囲情報取得
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $target_community_row = ACSCommunity::get_community_profile_row($request->getParameter('community_id'));
     $bbs_row = ACSBBS::get_bbs_row($request->getParameter('bbs_id'));
     if (!$bbs_row) {
         return false;
     }
     $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
     // アクセス制御判定
     $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $target_community_row);
     $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_row);
     return $ret;
 }
Пример #14
0
 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;
     }
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // ユーザー情報
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     //エラーの初期化
     /* 入力画面より */
     if ($move_id == 1) {
         $err = 'OK';
         //エラー値の初期化
         //☆☆ ここからほぼ同じ
         // 画面上のフォーム情報を取得する
         $form['subject'] = $request->getParameter('subject');
         //件名:subject
         $form['body'] = $request->getParameter('body');
         //内容:body
         $form['open_level_code'] = $request->getParameter('open_level_code');
         //公開範囲コード:open_level_code
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $form['open_level_code']) {
                 $form['open_level_name'] = htmlspecialchars($open_level_master_row['open_level_name']);
                 //公開範囲表示名:open_level_name
             }
         }
         $form['new_file'] = $request->getParameter('new_file');
         //画像:new_file
         //ファイル情報のあるなしをチェックしておく
         if (!ini_get('mbstring.encoding_translation')) {
             $form['file_name'] = mb_convert_encoding($_FILES['new_file']['name'], mb_internal_encoding(), mb_http_output());
         } else {
             $form['file_name'] = $_FILES['new_file']['name'];
         }
         if ($form['file_name'] != '') {
             /* ディレクトリ存在チェック */
             // ない場合は作成する
             $to_dir = ACS_TEMPORARY_FILE_DIR;
             if (!file_exists($to_dir)) {
                 mkdir($to_dir);
                 chmod($to_dir, 0777);
             }
             //ファイルがある場合、仮置き場所を設定する
             $_FILES['new_file']['upload_tmp_dir'] = ACS_TEMPORARY_FILE_DIR;
             //仮置きのファイル名を設定する
             $type_name = session_id();
             $upload = $_FILES['new_file']['upload_tmp_dir'];
             $upload .= $type_name;
             if (!move_uploaded_file($_FILES['new_file']['tmp_name'], $upload)) {
                 echo "ファイルの読み込みに失敗しました\n";
             }
             $_FILES['new_file']['tmp_name'] = $upload;
             $form['file_obj'] = $_FILES['new_file'];
             $user->setAttribute('new_file_info', $upload);
             $user->setAttribute('new_file_obj', $_FILES['new_file']);
         }
         $form['xdate'] = $request->getParameter('xdate');
         //掲載最終日:xdate
         //掲載最終日デフォルト値
         if ($form['xdate'] == '') {
             $form[xdate] = '';
         }
         //閲覧許可コミュニティ
         $form['trusted_community_id_array'] = $request->getParameter('trusted_community_id_array');
         $form['trusted_community_row_array'] = ACSCommunity::get_each_community_row_array($form['trusted_community_id_array']);
         $form['community_id'] = $community_id;
         //当コミュニティのID
         $form['user_community_id'] = $acs_user_info_row['user_community_id'];
         // 投稿者print "form_row:";
         // ML送信オプション
         $form['is_ml_send'] = $request->getParameter('is_ml_send');
         //画像:new_file
         //☆☆ ここまでほぼ同じ
         $user->setAttribute('new_form_obj', $form);
         return View::SUCCESS;
         /* 登録確定ボタン「はい」より */
     } else {
         if ($move_id == 2) {
             //☆☆ ここからほぼ同
             // 画面上のフォーム情報を取得する
             $form = $user->getAttribute('new_form_obj');
             $new_file_obj = $form['file_obj'];
             //☆☆ ここまでほぼ同じ
             // DBへの書き込み等
             ACSDB::_do_query("BEGIN");
             if ($form['file_name'] != "") {
                 //ファイル情報があった場合
                 //1.ファイル情報取得(新規)
                 $file_obj = ACSFile::get_upload_file_info_instance($user->getAttribute('new_file_obj'), $community_id, $form['user_community_id']);
                 //form情報へ登録
                 $form['new_file'] = $file_obj;
             }
             //2.bbsテーブル情報
             $ret = ACSBBS::set_bbs($form);
             if ($ret) {
                 ACSDB::_do_query("COMMIT");
                 // 掲示板アクセス履歴
                 ACSBBS::set_bbs_access_history($acs_user_info_row['user_community_id'], $ret);
             } else {
                 ACSDB::_do_query("ROLLBACK");
             }
             $bbs_id_seq = $ret;
             // MLオプションありの場合
             if ($form['is_ml_send'] == 't') {
                 // MLステータスの取得
                 $ml_status_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D62'));
                 $ml_status = $ml_status_row['contents_value'];
                 // ML有りの場合メールを送信
                 if ($bbs_id_seq && $ml_status == 'ACTIVE') {
                     // 件名編集
                     $subject = str_replace('{BBSID}', $bbs_id_seq, ACS_COMMUNITY_ML_SUBJECT_FORMAT) . $form['subject'];
                     // ML送信
                     ACSCommunityMail::send_community_mailing_list($community_id, $acs_user_info_row['mail_addr'], $subject, $form['body']);
                 }
             }
             $action_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_id . '&move_id=4';
             header("Location: {$action_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を取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 画面上のフォーム情報を取得する
     if ($move_id == 1) {
         $form = $request->getParameters('search_form_default');
     } else {
         if ($move_id == 2) {
             $form = $request->getParameters('search_form_new');
         }
     }
     // formの情報に従い検索を行う
     if ($move_id > 0) {
         $err_str = "";
         /*	Array
         			    [id] => 1000
         			    [move_id] => 2
         			    [q_text] => 検索条件					//条件(※必須)
         			    [search_title] => title_in_serch		//件名を選択
         			    [search_all] => subject_in_serch		//本文を選択
         			    [open_level_code] => 00					//公開範囲(00は選択なし)(※必須)
         			    [search_all_about] => all_in_serch		//すべてのBBSを選択
         			*/
         // ------------ 検索情報の取得(注意!バイト単位で処理)
         for ($i = 1; $i < 3; $i++) {
             $str_where_create[$i] = ACSBBS::set_bbs_where_list($form, $i);
             if ($str_where_create[$i]['err_str']) {
                 $err_str = $str_where_create[$i]['err_str'];
                 //where句の一部が作成できないオペレータミス
                 if ($err_str != '') {
                     break;
                 }
             } else {
                 $str_where[$i] = $str_where_create[$i]['like_sql'];
             }
         }
         //公開範囲は別指定
         $str_open_level_code = '00';
         if ($form['open_level_code'] != '00') {
             //公開範囲を選択している場合
             $str_open_level_code = $form['open_level_code'];
         }
         // ------------
         //db検索処理 and or 2回行う
         if (!$err_str) {
             $bbs_row_array_result = ACSBBS::get_bbs_where_array($str_where[1], $str_open_level_code, array());
             //複合条件のサマリ
             //and完全一致を省いた日記からor部分一致を検索する
             if ($str_where_create[1]['str_count'] == 2 || $str_where_create[2]['str_count'] == 2) {
                 $str_where_create['not_id'] = array();
                 foreach ($bbs_row_array_result as $index => $bbs_row) {
                     array_push($str_where_create['not_id'], $bbs_row['bbs_id']);
                 }
                 $bbs_row_array_not = ACSBBS::get_bbs_where_array($str_where[2], $str_open_level_code, $str_where_create['not_id']);
                 foreach ($bbs_row_array_not as $index => $bbs_row) {
                     array_push($bbs_row_array_result, $bbs_row);
                 }
             }
             if (!$bbs_row_array_result) {
                 $err_str = ACSMsg::get_msg('Community', 'SearchResultBBSAction.class.php', 'M001');
             } else {
                 // 信頼済みコミュニティ情報
                 foreach ($bbs_row_array_result as $index => $bbs_row) {
                     // 信頼済みコミュニティ一覧
                     $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']);
                 }
             }
         }
     }
     $request->setAttribute('bbs_row_array_result', $bbs_row_array_result);
     $request->setAttribute('err_str', $err_str);
     $request->setAttribute('form_pre', $form);
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // set
     $user->setAttribute('acs_user_info_row', $acs_user_info_row);
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('bbs_row_array', $bbs_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     //		$request->setAttribute('friends_group_row_array', $friends_group_row_array);
     return View::SUCCESS;
 }
 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";
 }
Пример #17
0
 /**
  * 掲示板の親記事を削除する
  *
  * @param 親記事ID
  * @return 成功(true) / 失敗(false)
  */
 static function delete_bbs($bbs_obj)
 {
     $bbs_id = $bbs_obj['bbs_id'];
     ACSDB::_do_query("BEGIN");
     //サブ記事の取得
     $sub_row_array = ACSBBS::get_bbs_res_row_array($bbs_id);
     $bbs_res_id_array = array();
     if (count($sub_row_array) > 0) {
         foreach ($sub_row_array as $index => $sub_row) {
             array_push($bbs_res_id_array, $sub_row['bbs_res_id']);
         }
         //サブ記事の削除設定
         $ret = ACSBBS::delete_bbs_res($bbs_res_id_array);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             echo ACSMsg::get_mdmsg(__FILE__, 'M001');
             return false;
         }
     }
     //親記事が持っているファイル情報の削除
     $bbs_row = ACSBBSFile::select_bbs_file_row($bbs_id);
     $file_id = $bbs_row['file_id'];
     if ($file_id != '') {
         $ret = ACSBBSFile::delete_bbs_file($file_id, $bbs_id);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             echo ACSMsg::get_mdmsg(__FILE__, 'M002');
             return false;
         }
     }
     //親記事の削除(削除フラグ扱い)
     $sql = "UPDATE bbs";
     $sql .= " SET bbs_delete_flag = 't'";
     $sql .= " WHERE bbs.bbs_id = {$bbs_id}";
     $ret = ACSDB::_do_query($sql);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         echo ACSMsg::get_mdmsg(__FILE__, 'M003');
         return false;
     }
     ACSDB::_do_query("COMMIT");
     return true;
 }
Пример #18
0
 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;
     }
     //mode 画面の遷移を取得する
     $move_id = $request->getParameter('move_id');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D42'));
     // ユーザー情報
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるコミュニティIDを取得
     $community_id = $request->getParameter('community_id');
     $bbs_id = $request->getParameter('bbs_id');
     /* 入力画面より */
     if ($move_id == 1) {
         // 画面上のフォーム情報を取得する
         $form['subject'] = $request->getParameter('subject');
         //件名:subject
         // 本文
         $form['body'] = $request->getParameter('body');
         //内容:body
         $form['community_id'] = $community_id;
         //当コミュニティのID
         $form['user_community_id'] = $acs_user_info_row['user_community_id'];
         // 投稿者print "form_row:";
         $form['bbs_id'] = $bbs_id;
         // 投稿者print "form_row:";
         $user->setAttribute('new_form_obj', $form);
         return View::SUCCESS;
         /* 登録確定ボタン「はい」より */
     } else {
         if ($move_id == 2) {
             // 画面上のフォーム情報を取得する
             $form = $user->getAttribute('new_form_obj');
             // DBへの書き込み等
             $ret = ACSBBS::set_bbs_res($form);
             if ($ret) {
                 // 掲示板アクセス履歴へ記録
                 ACSBBS::set_bbs_access_history($acs_user_info_row['user_community_id'], $form['bbs_id']);
                 // bbs情報取得
                 $bbs_row = ACSBBS::get_bbs_row($request->getParameter('bbs_id'));
                 // MLオプションありの場合
                 if ($bbs_row['ml_send_flag'] == 't') {
                     // MLステータスの取得
                     $ml_status_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D62'));
                     $ml_status = $ml_status_row['contents_value'];
                     // ML有りの場合メールを送信
                     if ($ml_status == 'ACTIVE') {
                         // "Re:"の削除
                         $subject_msg = mb_ereg_replace(ACS_COMMUNITY_ML_SUBJECT_PREFIX_CLEAR_REGEX, '', $form['subject']);
                         // 件名編集
                         $subject = "Re: " . str_replace('{BBSID}', $bbs_id, ACS_COMMUNITY_ML_SUBJECT_FORMAT) . $subject_msg;
                         // ML送信
                         ACSCommunityMail::send_community_mailing_list($community_id, $acs_user_info_row['mail_addr'], $subject, $form['body']);
                     }
                 }
             } else {
                 echo ACSMsg::get_msg('Community', 'BBSResPreAction.class.php', 'M001');
             }
             // 書き込み後、BBS Top 表示の処理へ
             $action_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_id . '&move_id=4';
             header("Location: {$action_url}");
         }
     }
 }