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');
     $commented_diary_row_array = $request->getAttribute('commented_diary_row_array');
     // 加工
     foreach ($commented_diary_row_array as $index => $commented_diary_row) {
         $commented_diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $commented_diary_row['community_id'] . '&diary_id=' . $commented_diary_row['diary_id'];
         $commented_diary_row_array[$index]['is_unread'] = ACSLib::get_boolean($commented_diary_row['is_unread']);
     }
     // 新着日記一覧URL
     $diary_comment_history_url = $this->getControllerPath(DEFAULT_MODULE, 'DiaryCommentHistory') . '&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');
     $commented_diary_row_array = array_slice($commented_diary_row_array, 0, $display_count);
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('commented_diary_row_array', $commented_diary_row_array);
     $this->setAttribute('diary_comment_history_url', $diary_comment_history_url);
     $this->setAttribute('get_days', $request->getAttribute('get_days'));
     // テンプレート
     $this->setTemplate('DiaryCommentHistory.tpl.php');
     $context->getController()->setRenderMode(View::RENDER_VAR);
     $request->setAttribute("DiaryCommentHistory", $this->render());
     return parent::execute();
 }
 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');
     $commented_diary_row_array = $request->getAttribute('commented_diary_row_array');
     // 加工
     foreach ($commented_diary_row_array as $index => $commented_diary_row) {
         $commented_diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath(DEFAULT_MODULE, 'DiaryComment') . '&id=' . $commented_diary_row['community_id'] . '&diary_id=' . $commented_diary_row['diary_id'];
         $commented_diary_row_array[$index]['is_unread'] = ACSLib::get_boolean($commented_diary_row['is_unread']);
     }
     // ページング設定
     $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, $commented_diary_row_array, $display_count);
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('commented_diary_row_array', $commented_diary_row_array);
     $this->setAttribute('diary_comment_history_url', $diary_comment_history_url);
     $this->setAttribute('paging_info', $paging_info);
     $this->setAttribute('get_days', $request->getAttribute('get_days'));
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('DiaryCommentHistory.tpl.php');
     return parent::execute();
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $system_announce_row_array = $request->getAttribute('system_announce_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, $system_announce_row_array, $display_count);
     foreach ($system_announce_row_array as $index => $system_announce_row) {
         $system_announce_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $system_announce_row['community_id'];
         $system_announce_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($system_announce_row['post_date'], true, true);
         $system_announce_row_array[$index]['expire_date'] = ACSLib::convert_pg_date_to_str($system_announce_row['expire_date'], false, false, false);
         $system_announce_row_array[$index]['is_expire'] = ACSLib::get_boolean($system_announce_row['is_expire']);
         $system_announce_row_array[$index]['system_announce_delete_flag'] = ACSLib::get_boolean($system_announce_row['system_announce_delete_flag']);
         $system_announce_row_array[$index]['delete_system_announce_url'] = $this->getControllerPath('System', 'DeleteSystemAnnounce') . '&system_announce_id=' . $system_announce_row['system_announce_id'];
     }
     // システムアナウンス(システムからのお知らせ)作成URL
     $create_system_announce_url = $this->getControllerPath('System', 'CreateSystemAnnounce');
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('SystemAnnounceList.tpl.php');
     // set
     $this->setAttribute('system_announce_row_array', $system_announce_row_array);
     $this->setAttribute('paging_info', $paging_info);
     $this->setAttribute('create_system_announce_url', $create_system_announce_url);
     return parent::execute();
 }
 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();
 }
示例#5
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // get
     // ユーザ情報一覧
     $log_row_array = $request->getAttribute('log_row_array');
     $form = $request->getAttribute('form');
     // 加工
     foreach ($log_row_array as $index => $log_row) {
         $log_row_array[$index]['log_date'] = ACSLib::convert_pg_date_to_str($log_row['log_date'], true, true, true);
         $log_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $log_row['user_community_id'];
         if (ACSLib::get_boolean($log_row_array[$index]['administrator_flag'])) {
             // システム管理者
             $log_row_array[$index]['user_level_name'] = ACSMsg::get_msg('System', 'LogInputView.class.php', 'M001');
         } else {
             // ログインユーザ
             $log_row_array[$index]['user_level_name'] = ACSMsg::get_msg('System', 'LogInputView.class.php', 'M002');
         }
         if (ACSLib::get_boolean($log_row_array[$index]['operation_result'])) {
             // 成功
             $log_row_array[$index]['operation_result_name'] = ACSMsg::get_msg('System', 'LogInputView.class.php', 'M003');
         } else {
             // 失敗
             $log_row_array[$index]['operation_result_name'] = ACSMsg::get_msg('System', 'LogInputView.class.php', 'M004');
         }
     }
     // ページング設定
     $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D07'), 'LOG_DISPLAY_MAX_COUNT');
     $paging_info = $this->getPagingInfo($controller, $request, $log_row_array, $display_count);
     // URL
     $action_url = $this->getControllerPath();
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('Log.tpl.php');
     // set
     $this->setAttribute('form', $form);
     $this->setAttribute('log_row_array', $log_row_array);
     $this->setAttribute('paging_info', $paging_info);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('module', 'System');
     $this->setAttribute('action', 'Log');
     return parent::execute();
 }
 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();
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $community_row = $request->getAttribute('community_row');
     $bbs_row = $request->getAttribute('bbs_row');
     //ユーザ入力情報
     $form = $user->getAttribute('new_form_obj');
     // コミュニティメンバかどうか
     $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']);
     //コミュニティ管理者かどうか
     $is_community_admin = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id']);
     // 加工
     if ($bbs_row['bbs_res_delete_flag'] != 't') {
         // 親記事の投稿者 トップページURL
         $bbs_row['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_row['user_community_id'];
         // 写真URL
         $bbs_row['image_url'] = ACSUser::get_image_url($bbs_row['user_community_id'], 'thumb');
         // 投稿日時
         $bbs_row['post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['post_date']);
         //ファイルの画像URL
         $bbs_row['file_url'] = "";
         if ($bbs_row['file_id'] != "") {
             $bbs_row['file_url'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'thumb');
             //投稿内表示用
             $bbs_row['file_url_alink'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], '');
             //ポップアップ用
         }
         // パブリックリリース 掲載終了日
         if ($bbs_row['expire_date'] != "") {
             $bbs_row['expire_date'] = ACSLib::convert_pg_date_to_str($bbs_row['expire_date'], true, false, false);
         }
         // 外部RSS情報
         $external_rss_row = ACSExternalRSS::get_external_rss_row($bbs_row['bbs_id']);
         if ($external_rss_row) {
             if ($external_rss_row['rss_item_date'] != '') {
                 // YYYY/MM/DD H:MM
                 $external_rss_row['rss_item_date'] = ACSLib::convert_pg_date_to_str($external_rss_row['rss_item_date'], 0, 1, 0);
             }
             $bbs_row['external_rss_row'] = $external_rss_row;
         }
         // 返信記事
         foreach ($bbs_row['bbs_res_row_array'] as $res_index => $bbs_res_row) {
             // 返信記事の投稿者 トップページURL
             $bbs_row['bbs_res_row_array'][$res_index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_res_row['user_community_id'];
             // 写真URL
             $bbs_row['bbs_res_row_array'][$res_index]['image_url'] = ACSUser::get_image_url($bbs_res_row['user_community_id'], 'thumb');
             // 投稿日時
             $bbs_row['bbs_res_row_array'][$res_index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_res_row['post_date']);
             // 返信の削除URL
             $bbs_row['bbs_res_row_array'][$res_index]['delete_bbs_res_url'] = $this->getControllerPath('Community', 'DeleteBBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_res_id=' . $bbs_row['bbs_res_row_array'][$res_index]['bbs_res_id'] . '&bbs_id=' . $bbs_row['bbs_id'];
             // 編集URL
             if (!ACSLib::get_boolean($bbs_res_row['bbs_res_delete_flag']) && ($bbs_res_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin)) {
                 $bbs_row['bbs_res_row_array'][$res_index]['edit_bbs_res_url'] = $this->getControllerPath('Community', 'EditBBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_res_row['bbs_id'] . '&bbs_res_id=' . $bbs_res_row['bbs_res_id'];
             }
             //削除権限フラグ (自分が投稿したもの 又は コミュニティ管理者)
             if ($bbs_res_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin == 1) {
                 $bbs_row['bbs_res_row_array'][$res_index]['bbs_set_delete_flag'] = true;
             } else {
                 $bbs_row['bbs_res_row_array'][$res_index]['bbs_set_delete_flag'] = false;
             }
         }
     }
     // form action 確認画面への遷移
     $action_url = $this->getControllerPath('Community', 'BBSResPre') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'] . '&move_id=1';
     // コミュニティトップページのURL
     $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id'];
     // BBS URL
     $bbs_top_page_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_row['community_id'];
     // set
     $this->setAttribute('is_community_member', $is_community_member);
     $this->setAttribute('community_row', $request->getAttribute('community_row'));
     $this->setAttribute('bbs_row', $bbs_row);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('community_top_page_url', $community_top_page_url);
     $this->setAttribute('bbs_top_page_url', $bbs_top_page_url);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('BBSRes.tpl.php');
     if ($request->getParameter('move_id') == 3) {
         //ユーザ入力情報
         $form = $user->getAttribute('new_form_obj');
         $this->setAttribute('form', $form);
         $this->setAttribute('move_id', $request->getParameter('move_id'));
     }
     return parent::execute();
 }
echo "</select><br>\n";
// 信頼済みコミュニティ
echo "<div id=\"external_rss_url_trusted_community_div\"></div>";
?>
</td>
</tr>

<tr>
<td id="myttl" bgcolor="#DEEEBD"><?php 
echo ACSMsg::get_msg("Community", "EditExternalRSS.tpl.php", 'M007');
?>
</td>
<td bgcolor="#ffffff">
<?php 
unset($checked);
if (ACSLib::get_boolean($this->_tpl_vars['community_row']['contents_row_array']['external_rss_ml_send_flag']['contents_value'])) {
    $checked = ' checked';
}
?>
<input type="checkbox" name="external_rss_ml_send_flag" value="t"<?php 
echo $checked;
?>
>
<?php 
echo ACSMsg::get_msg("Community", "EditExternalRSS.tpl.php", 'M008');
?>
<br>
<?php 
if ($this->_tpl_vars['community_row']['contents_row_array']['ml_addr']['contents_value'] == '') {
    echo "<span class=\"notice\">" . ACSMsg::get_msg("Community", "EditExternalRSS.tpl.php", 'M009') . "</span><br>\n";
}
 /**
  * 外部RSS自動取り込みを実行する
  *
  * @param $community_row コミュニティ情報
  * @return $msg
  */
 static function do_process($community_row)
 {
     $msg = "";
     // 公開レベルマスタ
     $open_level_master_array = ACSDB::get_master_array('open_level');
     // 外部RSSコンテンツ情報を付加
     $community_row = ACSExternalRSS::add_contents_row_array($community_row);
     // RSS情報を取得
     $rss_row_array = ACSExternalRSS::get_external_rss_row_array($community_row['contents_row_array']['external_rss_url']['contents_value']);
     if ($rss_row_array == false) {
         return;
     }
     // 外部RSS.投稿者が該当コミュニティのコミュニティ管理者であるかどうかチェックする
     $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_row['community_id']);
     $err_flg = 1;
     foreach ($community_admin_user_info_row_array as $community_admin_user_info_row) {
         if ($community_admin_user_info_row['user_community_id'] == $community_row['contents_row_array']['external_rss_post_user']['contents_value']) {
             $err_flg = 0;
             break;
         }
     }
     if ($err_flg) {
         return;
     }
     // 投稿者情報 (ml_addrを含む情報)
     $post_user_info_row = ACSUser::get_user_info_row_by_user_community_id($community_row['contents_row_array']['external_rss_post_user']['contents_value']);
     $post_user_info_row = ACSUser::get_user_info_row_by_user_id($post_user_info_row['user_id']);
     // 投稿情報($form) //
     // 初期化
     $form = array();
     $form['community_id'] = $community_row['community_id'];
     $form['user_community_id'] = $community_row['contents_row_array']['external_rss_post_user']['contents_value'];
     $form['open_level_code'] = $community_row['contents_row_array']['external_rss_url']['open_level_code'];
     // パブリックリリース の場合
     if ($open_level_master_array[$form['open_level_code']] == ACSMsg::get_mst('open_level_master', 'D06') && intval($community_row['contents_row_array']['external_rss_public_release_expire_term']['contents_value']) >= 1) {
         $form['expire_date'] = "CURRENT_DATE + '@ " . ($community_row['contents_row_array']['external_rss_public_release_expire_term']['contents_value'] - 1) . " days'::INTERVAL";
     } else {
         $form['expire_date'] = '';
     }
     // 非公開 (メンバのみ) の場合
     if ($open_level_master_array[$form['open_level_code']] == ACSMsg::get_mst('open_level_master', 'D04')) {
         $form['trusted_community_row_array'] = $community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'];
     } else {
         $form['trusted_community_row_array'] = array();
     }
     $form['ml_send_flag'] = ACSLib::get_pg_boolean(ACSLib::get_boolean($community_row['contents_row_array']['external_rss_ml_send_flag']['contents_value']));
     // RSS記事ごとの処理 //
     foreach ($rss_row_array['items'] as $rss_item_row) {
         // 掲載されているかチェック
         if (!ACSExternalRSS::is_posted_value($community_row['community_id'], $rss_item_row['rss_item_title'], $rss_item_row['rss_item_date'])) {
             // 掲載されていない場合
             $form['subject'] = $rss_item_row['rss_item_title'];
             $form['body'] = $rss_item_row['rss_item_content'];
             $form['post_date'] = $rss_item_row['rss_item_date'];
             $bbs_id = ACSExternalRSS::set_bbs_and_external_rss($form, $rss_row_array['channel_info'], $rss_item_row);
             if (!$bbs_id) {
                 echo "ERROR\n";
                 exit;
             } else {
                 $msg .= "掲載: {$community_row['community_name']} (community_id={$community_row['community_id']})\n";
                 $msg .= "\t=> {$form['subject']} (bbs_id={$bbs_id})\n";
                 if (ACSLib::get_boolean($form['ml_send_flag'])) {
                     // MLステータスの取得
                     $ml_status_row = ACSCommunity::get_contents_row($community_row['community_id'], ACSMsg::get_mst('contents_type_master', 'D62'));
                     $ml_status = $ml_status_row['contents_value'];
                     // ML有りの場合メールを送信
                     if ($ml_status == 'ACTIVE') {
                         // 件名編集
                         $subject = str_replace('{BBSID}', $bbs_id, ACS_COMMUNITY_ML_SUBJECT_FORMAT) . $form['subject'];
                         // ML送信
                         ACSCommunityMail::send_community_mailing_list($community_row['community_id'], $post_user_info_row['mail_addr'], $form['subject'], $form['body']);
                         $msg .= "\t=> ML送信\n";
                     }
                 }
             }
         }
     }
     return $msg;
 }
 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;
     }
 }
示例#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');
     // get
     $community_row = $request->getAttribute('community_row');
     $bbs_row_array = $request->getAttribute('bbs_row_array');
     // コミュニティメンバかどうか
     $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']);
     //コミュニティ管理者かどうか
     $is_community_admin = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id']);
     // form action 確認画面への遷移
     $action_url = $this->getControllerPath('Community', 'BBSPre') . '&community_id=' . $community_row['community_id'] . '&move_id=1';
     // コミュニティトップページのURL
     $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id'];
     // BBSスレッド一覧URL
     $bbs_thread_list_url = $this->getControllerPath('Community', 'BBSThreadList') . '&community_id=' . $community_row['community_id'];
     // 信頼済みコミュニティ選択ページのURL
     $select_trusted_community_url = $this->getControllerPath('Community', 'SelectTrustedCommunity') . '&form_name=bbs_form';
     //検索画面url
     $search_bbs_url = $this->getControllerPath('Community', 'SearchBBS') . '&community_id=' . $community_row['community_id'] . '&move_id=1';
     //外部RSS取り込み実行
     if ($community_row['contents_row_array']['external_rss_url']['contents_value'] != '') {
         $get_external_rss_url = $this->getControllerPath('Community', 'GetExternalRSS') . '&community_id=' . $community_row['community_id'];
     }
     // 掲示板RSS URL
     $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D03'), 'BBS_RSS_TERM');
     $bbs_rss_url = $this->getControllerPath('Community', 'BBSRSS') . '&community_id=' . $community_row['community_id'] . '&term=' . $term;
     // 加工
     foreach ($bbs_row_array as $index => $bbs_row) {
         // 親記事の投稿者 トップページURL
         $bbs_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_row['user_community_id'];
         // 写真URL
         $bbs_row_array[$index]['image_url'] = ACSUser::get_image_url($bbs_row['user_community_id'], 'thumb');
         // 投稿日時
         $bbs_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['post_date']);
         // 返信画面URL
         $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'];
         // 編集画面URL
         if ($bbs_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin) {
             $bbs_row_array[$index]['edit_bbs_url'] = $this->getControllerPath('Community', 'EditBBS') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'];
         }
         // 削除画面URL
         $bbs_row_array[$index]['bbs_delete_url'] = $this->getControllerPath('Community', 'DeleteBBS') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'];
         //削除権限フラグ (自分が投稿したもの 又は コミュニティ管理者)
         if ($bbs_row['user_community_id'] == $acs_user_info_row['user_community_id'] || $is_community_admin == 1) {
             $bbs_row_array[$index]['bbs_set_delete_flag'] = true;
         } else {
             $bbs_row_array[$index]['bbs_set_delete_flag'] = false;
         }
         //ファイルの画像URL
         $bbs_row_array[$index]['file_url'] = "";
         if ($bbs_row['file_id'] != "") {
             $bbs_row_array[$index]['file_url'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], 'thumb');
             //投稿内表示用
             $bbs_row_array[$index]['file_url_alink'] = ACSBBSFile::get_image_url($bbs_row['bbs_id'], '');
             //ポップアップ用
         }
         // パブリックリリース 掲載終了日 2/21add @akitsu
         $bbs_row_array[$index]['expire_date'] = "";
         if ($bbs_row['expire_date'] != "") {
             $bbs_row_array[$index]['expire_date'] = ACSLib::convert_pg_date_to_str($bbs_row['expire_date'], true, false, false);
         }
         if ($bbs_row['bbs_delete_flag'] != 't') {
             // 返信記事
             $bbs_res_display_max = 10;
             $bbs_row_array[$index]['bbs_res_row_array_num'] = count($bbs_row_array[$index]['bbs_res_row_array']);
             if ($bbs_row_array[$index]['bbs_res_row_array_num'] > $bbs_res_display_max) {
                 // 最新の10件のみslice
                 $bbs_row_array[$index]['bbs_res_row_array'] = array_slice($bbs_row_array[$index]['bbs_res_row_array'], -1 * $bbs_res_display_max);
                 // 省略件数を算出
                 $bbs_row_array[$index]['omission_num'] = $bbs_row_array[$index]['bbs_res_row_array_num'] - $bbs_res_display_max;
             }
             foreach ($bbs_row_array[$index]['bbs_res_row_array'] as $res_index => $bbs_res_row) {
                 // 返信記事の投稿者 トップページURL
                 $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $bbs_res_row['user_community_id'];
                 // 写真URL
                 $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['image_url'] = ACSUser::get_image_url($bbs_res_row['user_community_id'], 'thumb');
                 // 投稿日時
                 $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['post_date'] = ACSLib::convert_pg_date_to_str($bbs_res_row['post_date']);
                 //削除情報
                 $bbs_row_array[$index]['bbs_res_row_array'][$res_index]['delete_flag'] = ACSLib::get_boolean($bbs_res_row['res_delete_flag']);
             }
         }
     }
     // 親コミュニティ / サブコミュニティの情報を取得する
     $parent_community_row_array = ACSCommunity::get_parent_community_row_array($community_row['community_id']);
     foreach ($parent_community_row_array as $index => $parent_community_row) {
         $parent_community_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $parent_community_row['community_id'];
     }
     $sub_community_row_array = ACSCommunity::get_sub_community_row_array($community_row['community_id']);
     foreach ($sub_community_row_array as $index => $sub_community_row) {
         $sub_community_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $sub_community_row['community_id'];
     }
     //---- アクセス制御 ----//
     $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row);
     $bbs_row_array = ACSAccessControl::get_valid_row_array_for_community($acs_user_info_row, $role_array, $bbs_row_array);
     //----------------------//
     // 外部RSS情報
     foreach ($bbs_row_array as $index => $bbs_row) {
         $external_rss_row = ACSExternalRSS::get_external_rss_row($bbs_row['bbs_id']);
         if ($external_rss_row) {
             if ($external_rss_row['rss_item_date'] != '') {
                 // YYYY/MM/DD H:MM
                 $external_rss_row['rss_item_date'] = ACSLib::convert_pg_date_to_str($external_rss_row['rss_item_date'], 0, 1, 0);
             }
             $bbs_row_array[$index]['external_rss_row'] = $external_rss_row;
         }
     }
     // ページング設定
     $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'NEW_INFO_LIST_DISPLAY_MAX_COUNT');
     $paging_info = $this->getPagingInfo($controller, $request, $bbs_row_array, $display_count);
     // set
     $this->setAttribute('is_community_member', $is_community_member);
     $this->setAttribute('is_community_admin', $is_community_admin);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('community_top_page_url', $community_top_page_url);
     $this->setAttribute('bbs_thread_list_url', $bbs_thread_list_url);
     $this->setAttribute('select_trusted_community_url', $select_trusted_community_url);
     $this->setAttribute('search_bbs_url', $search_bbs_url);
     $this->setAttribute('get_external_rss_url', $get_external_rss_url);
     $this->setAttribute('bbs_rss_url', $bbs_rss_url);
     $this->setAttribute('community_row', $request->getAttribute('community_row'));
     $this->setAttribute('bbs_row_array', $bbs_row_array);
     $this->setAttribute('paging_info', $paging_info);
     $this->setAttribute('open_level_master_row_array', $request->getAttribute('open_level_master_row_array'));
     $this->setAttribute('parent_community_row_array', $parent_community_row_array);
     $this->setAttribute('sub_community_row_array', $sub_community_row_array);
     // ML送信チェック表示設定
     if ($community_row['contents_row_array']['ml_status']['contents_value'] == 'ACTIVE') {
         $this->setAttribute('is_ml_active', TRUE);
     }
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('BBS.tpl.php');
     // エラーメッセージ
     $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user));
     if ($request->getParameter('move_id') == 3) {
         //ユーザ入力情報
         $form = $user->getAttribute('new_form_obj');
         // パブリックリリース 掲載終了日
         $form['expire_date'] = "";
         if ($form['expire_date'] != "") {
             $form['expire_date'] = ACSLib::convert_pg_date_to_str($form['expire_date'], false, false, false);
         }
         $this->setAttribute('form', $form);
         $this->setAttribute('move_id', $request->getParameter('move_id'));
     }
     return parent::execute();
 }
示例#12
0
    echo $value['subject'];
    ?>
" size="50" style="width:400px"></td>
</tr>
<tr>
<td id="myttl" bgcolor="#DEEEBD"><?php 
    echo ACSMsg::get_msg("Community", "BBSRes.tpl.php", 'M015');
    ?>
</td>
<td bgcolor="#ffffff"><textarea name="body" cols="60" rows="10" style="width:480px"><?php 
    echo htmlspecialchars($value['body']);
    ?>
</textarea></td>
</tr>
<?php 
    if (ACSLib::get_boolean($this->_tpl_vars['bbs_row']['ml_send_flag'])) {
        echo '<tr>';
        echo '<td id="myttl" bgcolor="#DEEEBD">' . ACSMsg::get_msg("Community", "BBSRes.tpl.php", 'M019') . '</td>';
        echo '<td bgcolor="#ffffff">' . ACSMsg::get_msg("Community", "BBSRes.tpl.php", 'M020') . '</td>';
        echo '</tr>';
    }
    ?>
</table>
<br>

<input type="submit" value="<?php 
    echo ACSMsg::get_msg("Community", "BBSRes.tpl.php", 'M005');
    ?>
">
</form>
<br>
示例#13
0
 static function is_admission_required_for_join_community($user_community_id, $community_id)
 {
     // 承認必要フラグ
     $is_admission_required = true;
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_row($community_id);
     // 自由参加可能コミュニティ
     $join_trusted_community_row_array = ACSCommunity::get_join_trusted_community_row_array($community_id);
     // マイコミュニティ
     $my_community_row_array = ACSUser::get_community_row_array($user_community_id);
     $my_community_id_array = array();
     foreach ($my_community_row_array as $my_community_row) {
         array_push($my_community_id_array, $my_community_row['community_id']);
     }
     if (!ACSLib::get_boolean($community_row['admission_flag'])) {
         // 承認フラグがfなら自由参加
         $is_admission_required = false;
     } else {
         // マイコミュニティが自由参加可能コミュニティ一覧に含まれるか
         foreach ($join_trusted_community_row_array as $join_trusted_community_row) {
             //if (array_search($join_trusted_community_row['community_id'], $my_community_id_array)) {
             if (in_array($join_trusted_community_row['community_id'], $my_community_id_array)) {
                 $is_admission_required = false;
                 break;
             }
         }
     }
     return $is_admission_required;
 }
 function execute()
 {
     $context =& $this->getContext();
     $controller = $context->getController();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $form = $request->ACSgetParameters();
     // 対象となるユーザコミュニティ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_folder_row_array = ACSCommunityFolder::get_new_community_folder_row_array($user_community_id, $get_days, true);
         // マイコミュニティの新着プットフォルダ一覧を取得する
         $new_put_folder_row_array = ACSCommunityFolder::get_new_community_put_folder_row_array($user_community_id, $form, $get_days, true);
     } else {
         // マイコミュニティの新着フォルダ一覧を取得する
         $new_folder_row_array = ACSCommunityFolder::get_new_community_folder_row_array($user_community_id, $get_days);
         // マイコミュニティの新着プットフォルダ一覧を取得する
         $new_put_folder_row_array = ACSCommunityFolder::get_new_community_put_folder_row_array($user_community_id, $form, $get_days);
     }
     // コミュニティ名取得バッファ
     $this->community_name_buffer = array();
     // ソート用配列の初期化
     $sort_folder_row_array = array();
     // ソート用に加工(コミュニティのファイル)
     foreach ($new_folder_row_array as $index => $new_folder_row) {
         $sort_index = $new_folder_row['update_date'] . " " . sprintf("%06d", $new_folder_row['file_id']) . "c";
         $sort_folder_row_array[$sort_index] = $new_folder_row;
     }
     // ソート用に加工(プットファイル)
     // (複数コミュニティへのput情報が重複しないようcounterを付加)
     // (※複数コミュニティは第一階層のファイルのみが対応されている)
     $counter = 0;
     foreach ($new_put_folder_row_array as $index => $new_folder_row) {
         // PUTであることのフラグを設定をしておく
         $new_folder_row['is_put_icon'] = TRUE;
         $sort_index = $new_folder_row['update_date'] . " " . sprintf("%06d", $new_folder_row['file_id']) . "p" . $counter;
         $sort_folder_row_array[$sort_index] = $new_folder_row;
         $counter++;
     }
     // ソート実施
     krsort($sort_folder_row_array);
     // 表示件数制御 //
     if ($inline_mode) {
         $display_count = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'NEW_INFO_TOP_DISPLAY_MAX_COUNT');
     } else {
         // viewでページングするので全件取得(0=全件取得)
         $display_count = 0;
     }
     // 表示用に整える
     $new_folder_row_array = array();
     foreach ($sort_folder_row_array as $key => $folder_row) {
         // 表示件数に達している場合は処理しない
         if (count($new_folder_row_array) >= $display_count && $display_count != 0) {
             break;
         }
         // putファイルの場合
         if ($folder_row['is_put_icon']) {
             // フォルダ情報の取得
             // (※複数のフォルダ情報の取得する場合も有)
             $add_folder_row_array =& $this->getPutFolderRows($acs_user_info_row, $folder_row);
             // コミュニティファイルの場合
         } else {
             // (必要なフォルダ情報は取得済み)
             $folder_row['url_community_id'] = $folder_row['owner_community_id'];
             $folder_row['url_folder_id'] = $folder_row['folder_id'];
             $add_folder_row_array = array($folder_row);
         }
         // 表示用情報の設定
         foreach ($add_folder_row_array as $add_folder_row) {
             // 表示件数に達している場合は処理しない
             if (count($new_folder_row_array) >= $display_count && $display_count != 0) {
                 break;
             }
             // 既読フラグの設定
             $add_folder_row['is_unread'] = ACSLib::get_boolean($add_folder_row['is_unread']);
             // コミュニティ名をバッファリングしておく(再利用するため)
             $this->community_name_buffer[$add_folder_row['owner_community_id']] = $add_folder_row['community_name'];
             // ファイル詳細情報URLの生成
             $add_folder_row['file_detail_url'] = $this->getControllerPath('Community', 'FileDetail') . '&community_id=' . $add_folder_row['url_community_id'] . '&folder_id=' . $add_folder_row['url_folder_id'] . '&file_id=' . $add_folder_row['file_id'];
             array_push($new_folder_row_array, $add_folder_row);
         }
     }
     // set
     $request->setAttribute('user_community_id', $user_community_id);
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('new_folder_row_array', $new_folder_row_array);
     //$request->setAttribute('new_put_folder_row_array', $new_put_folder_row_array);
     if ($inline_mode) {
         return View::INPUT;
     } else {
         return View::SUCCESS;
     }
 }
 /**
  * システム管理者かどうか
  *
  * @param $acs_user_info_row ユーザ情報の配列
  * @return true / false
  */
 static function is_system_administrator($acs_user_info_row)
 {
     if (ACSLib::get_boolean($acs_user_info_row['administrator_flag']) || $acs_user_info_row['user_id'] == ACS_ADMINISTRATOR_USER_ID) {
         return true;
     } else {
         return false;
     }
 }