コード例 #1
0
 function getDefaultView()
 {
     $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');
     // get
     $bbs_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', 'D41'));
     $community_folder_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', 'D31'));
     $self_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', 'D00'));
     // カテゴリグループマスタ
     $category_group_master_row_array = ACSCommunity::get_category_group_master_row_array();
     foreach ($category_group_master_row_array as $index => $category_group_master_row) {
         // カテゴリグループごとのカテゴリマスタ
         $category_group_master_row_array[$index]['category_master_row_array'] = ACSCommunity::get_category_master_row_array_by_category_group_code($category_group_master_row['category_group_code']);
     }
     // set
     $request->setAttribute('bbs_open_level_master_row_array', $bbs_open_level_master_row_array);
     $request->setAttribute('community_folder_open_level_master_row_array', $community_folder_open_level_master_row_array);
     $request->setAttribute('category_group_master_row_array', $category_group_master_row_array);
     $request->setAttribute('self_open_level_master_row_array', $self_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を取得
     $user_community_id = $request->ACSgetParameter('id');
     // 対象となるcontents_keyを取得
     $contents_key = $request->ACSgetParameter('contents_key');
     // 対象となるコンテンツ種別コードを取得
     $contents_type_code = $request->ACSgetParameter('contents_type_code');
     // コンテンツ種別マスタ
     $contents_type_master_array = ACSDB::get_master_array('contents_type');
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), $contents_type_master_array[$contents_type_code]);
     if ($acs_user_info_row['is_acs_user']) {
         // マイフレンズグループ
         $friends_group_row_array = ACSUser::get_friends_group_row_array($user_community_id);
     } else {
         $friends_group_row_array = array();
     }
     // set
     $request->setAttribute('contents_key', $contents_key);
     $request->setAttribute('contents_type_code', $contents_type_code);
     $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;
 }
コード例 #3
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');
     $user_community_id = $request->getAttribute('user_community_id');
     $profile = $request->getAttribute('target_user_info_row');
     //ユーザが選択した閲覧者
     $view_mode = $request->getAttribute('view_mode');
     // 公開レベルマスタ
     $open_level_master_array = ACSDB::get_master_array('open_level');
     //表示対象となる情報を取捨選抜する
     $view_at = array();
     switch ($view_mode) {
         case 1:
             array_push($view_at, array_search(ACSMsg::get_mst('open_level_master', 'D01'), $open_level_master_array));
             array_push($view_at, array_search(ACSMsg::get_mst('open_level_master', 'D02'), $open_level_master_array));
             break;
         case 2:
             array_push($view_at, array_search(ACSMsg::get_mst('open_level_master', 'D01'), $open_level_master_array));
             array_push($view_at, array_search(ACSMsg::get_mst('open_level_master', 'D02'), $open_level_master_array));
             array_push($view_at, array_search(ACSMsg::get_mst('open_level_master', 'D05'), $open_level_master_array));
             break;
         default:
             array_push($view_at, array_search(ACSMsg::get_mst('open_level_master', 'D01'), $open_level_master_array));
     }
     //一般公開 01 ログインユーザに公開 02 すべての友人に公開 05
     $profile['contents_row_array']['birthplace'] = ACSAccessControl::set_not_open($profile['contents_row_array']['birthplace'], $view_at);
     $profile['contents_row_array']['user_name'] = ACSAccessControl::set_not_open($profile['contents_row_array']['user_name'], $view_at);
     $profile['contents_row_array']['birthday'] = ACSAccessControl::set_not_open($profile['contents_row_array']['birthday'], $view_at);
     //top
     $top_page_url = $this->getControllerPath('User', 'Index') . '&id=' . $user_community_id;
     // メニュー設定
     $menu = array();
     //一般公開 01
     $menu['all_url'] = $this->getControllerPath('User', 'ProfileCheck') . '&id=' . $user_community_id . '&view_mode=0';
     //ログインユーザに公開 02
     $menu['login_url'] = $this->getControllerPath('User', 'ProfileCheck') . '&id=' . $user_community_id . '&view_mode=1';
     //すべての友人に公開 05
     $menu['friend_url'] = $this->getControllerPath('User', 'ProfileCheck') . '&id=' . $user_community_id . '&view_mode=2';
     // set
     $this->setAttribute('profile', $profile);
     // メニュー
     $this->setAttribute('menu', $menu);
     $this->setAttribute('top_page_url', $top_page_url);
     $this->setAttribute('view_mode', $view_mode);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('ProfileCheck.tpl.php');
     return parent::execute();
 }
コード例 #4
0
 function get_access_control_info(&$controller, &$request, &$user)
 {
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるユーザコミュニティIDを取得
     $user_community_id = $request->getParameter('id');
     // コミュニティ情報
     $user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
     // アクセス制御情報 //
     $friends_list_contents_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D11'));
     $access_control_info = array('role_array' => ACSAccessControl::get_user_community_role_array($acs_user_info_row, $user_info_row), 'contents_row_array' => array($friends_list_contents_row));
     return $access_control_info;
 }
コード例 #5
0
 function getDefaultView()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     // ユーザ情報
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
     $year = $request->ACSgetParameter('year');
     // 年
     $month = $request->ACSgetParameter('month');
     // 月
     $day = $request->ACSgetParameter('day');
     // 日
     if (checkdate($month, $day, $year)) {
         // 年月日指定
         $diary_row_array = ACSDiary::get_diary_row_array_by_year_month_day($user_community_id, $year, $month, $day);
     } elseif (checkdate($month, 1, $year)) {
         // 年月指定
         $diary_row_array = ACSDiary::get_diary_row_array_by_year_month($user_community_id, $year, $month);
         unset($day);
     } else {
         // 全てのダイアリー
         $diary_row_array = ACSDiary::get_diary_row_array($user_community_id);
         unset($year);
         unset($month);
         unset($day);
     }
     // 公開範囲を最終登録と同じもので表示しておく
     if ($diary_row_array) {
         $last_open_level_code = $diary_row_array[0]['open_level_code'];
     }
     // 信頼済みコミュニティ情報
     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']);
         }
     }
     // 公開範囲
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D21'));
     // マイフレンズグループ
     $friends_group_row_array = ACSUser::get_friends_group_row_array($user_community_id);
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('diary_row_array', $diary_row_array);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $request->setAttribute('friends_group_row_array', $friends_group_row_array);
     $request->setAttribute('last_open_level_code', $last_open_level_code);
     return View::INPUT;
 }
コード例 #6
0
 function get_access_control_info(&$controller, &$request, &$user)
 {
     $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_contents_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D41'));
     $bbs_contents_row['trusted_community_row_array'] = ACSCommunity::get_contents_trusted_community_row_array($community_id, $bbs_contents_row['contents_type_code'], $bbs_contents_row['open_level_code']);
     $access_control_info = array('role_array' => ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row), 'contents_row_array' => array($bbs_contents_row));
     return $access_control_info;
 }
コード例 #7
0
 function getDefaultView()
 {
     $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');
     // get
     $external_rss_url_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', 'D63'));
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSgetParameter('community_id');
     // コミュニティ情報
     $community_row = ACSCommunity::get_community_profile_row($community_id);
     $community_row = ACSExternalRSS::add_contents_row_array($community_row);
     // 入力エラー時の復元 //
     $form = $request->ACSGetParameters();
     if ($form['is_error']) {
         $community_row['contents_row_array']['external_rss_url']['contents_value'] = $form['external_rss_url'];
         $community_row['contents_row_array']['external_rss_url']['open_level_code'] = $form['external_rss_url_open_level_code'];
         $community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'] = array();
         if (is_array($form['external_rss_url_trusted_community_id_array'])) {
             foreach ($form['external_rss_url_trusted_community_id_array'] as $trusted_community_id) {
                 array_push($community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'], array('community_id' => $trusted_community_id));
             }
         }
         $community_row['contents_row_array']['external_rss_post_user']['contents_value'] = $form['external_rss_post_user'];
         $community_row['contents_row_array']['external_rss_public_release_expire_term']['contents_value'] = $form['external_rss_public_release_expire_term'];
         $community_row['contents_row_array']['external_rss_ml_send_flag']['contents_value'] = $form['external_rss_ml_send_flag'];
     }
     // 初期値 //
     // 投稿者
     if (!isset($community_row['contents_row_array']['external_rss_post_user']['contents_value'])) {
         $community_row['contents_row_array']['external_rss_post_user']['contents_value'] = $acs_user_info_row['user_community_id'];
     }
     // 公開範囲
     if (!isset($community_row['contents_row_array']['external_rss_url']['open_level_code'])) {
         $community_row['contents_row_array']['external_rss_url']['open_level_code'] = $community_row['contents_row_array']['bbs']['open_level_code'];
         $community_row['contents_row_array']['external_rss_url']['trusted_community_row_array'] = $community_row['contents_row_array']['bbs']['trusted_community_row_array'];
     }
     // コミュニティ管理者情報
     $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_row['community_id']);
     // set
     $request->setAttribute('community_row', $community_row);
     $request->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array);
     $request->setAttribute('external_rss_url_open_level_master_row_array', $external_rss_url_open_level_master_row_array);
     return View::INPUT;
 }
コード例 #8
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');
     $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;
 }
コード例 #9
0
 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();
 }
コード例 #10
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
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $open_level_master_row_array = $request->getAttribute('open_level_master_row_array');
     // トップページURL
     $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id'];
     //他人の日記を閲覧している場合のトップページURL
     $link_page_url['else_user_top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id'];
     //他人の日記を閲覧している場合の日記ページURL
     $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $target_user_info_row['community_id'];
     //検索画面url
     $link_page_url['search_diary_url'] = SCRIPT_PATH;
     // get でサブミットするための、遷移先情報
     $module = 'User';
     $action = 'SearchResultDiary';
     $id = $target_user_info_row['community_id'];
     $move_id = '1';
     // 本人のページかどうか
     if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     //---- アクセス制御 ----//
     $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
     //----------------------//
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('is_self_page', $is_self_page);
     $this->setAttribute('link_page_url', $link_page_url);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('module', $module);
     $this->setAttribute('action', $action);
     $this->setAttribute('id', $id);
     $this->setAttribute('move_id', $move_id);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('SearchDiary.tpl.php');
     return parent::execute();
 }
コード例 #11
0
 function get_execute_privilege(&$controller, &$request, &$user)
 {
     // 公開範囲情報取得
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $diary_file_row = ACSDiaryFile::get_diary_file_row_by_file_id($request->ACSgetParameter('id'));
     $diary_row = ACSDiary::get_diary_row($diary_file_row['diary_id']);
     if (!$diary_row) {
         return false;
     }
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($diary_row['community_id']);
     if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
         $diary_row['trusted_community_row_array'] = ACSDiary::get_diary_trusted_community_row_array($diary_row['diary_id']);
     }
     // アクセス制御判定
     $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
     $ret = ACSAccessControl::is_valid_user_for_user_community($acs_user_info_row, $role_array, $diary_row);
     return $ret;
 }
コード例 #12
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を取得
     $user_community_id = $request->ACSgetParameter('id');
     // ユーザ情報
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id);
     // 公開範囲のリストデータ
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D21'));
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     return View::INPUT;
 }
コード例 #13
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $target_user_community_id = $request->getParameter('id');
     $view_mode = $request->getParameter('mode');
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $target_user_info_row = ACSUser::get_user_profile_row($target_user_community_id);
     $is_permitted = false;
     /* アクセス権チェック */
     // マイページが閲覧可能かチェックする
     // 削除フラグ、全体の公開範囲をチェック
     /* 写真表示 */
     // ファイル情報取得
     // (1) 一般ユーザ(外部ユーザ)かどうか
     if (!$acs_user_info_row['is_acs_user']) {
         $image_file_id = $target_user_info_row['file_id_ol01'];
     } else {
         // (2) ログインユーザかどうか
         $image_file_id = $target_user_info_row['file_id_ol02'];
         // (3) 友人かどうか
         if (ACSUser::is_in_friends_id_array($acs_user_info_row, $target_user_info_row['user_community_id'])) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
         // (4) 本人かどうか
         if ($acs_user_info_row['user_id'] == $target_user_info_row['user_id']) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
         // (5) システム管理者かどうか
         if (ACSAccessControl::is_system_administrator($acs_user_info_row)) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
     }
     if ($image_file_id) {
         $file_obj = ACSFile::get_file_info_instance($image_file_id);
         $ret = $file_obj->view_image($view_mode);
     } else {
         $image_url = ACSUser::get_default_image_url($view_mode);
         header("Location: {$image_url}");
     }
 }
コード例 #14
0
 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();
 }
コード例 #15
0
ファイル: BaseView.class.php プロジェクト: nkawa/acs-git-test
 /**
  * execute
  */
 function execute()
 {
     $context =& $this->getContext();
     $request =& $context->getRequest();
     $moduleName = $context->getModuleName();
     $actionName = $context->getActionName();
     $controller = $context->getController();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // ログイン中のユーザ情報
     $this->setAttribute('acs_user_info_row', $acs_user_info_row);
     // ログインユーザかどうか
     $this->setAttribute('is_login_user', $acs_user_info_row['is_login_user']);
     // コミュニティメニューURL
     $this->setAttribute('community_menu_url', $this->getControllerPath('Community', 'SearchCommunity'));
     // ユーザ検索URL
     $this->setAttribute('search_user_url', $this->getControllerPath('User', 'SearchUser'));
     // 新着情報URL
     $this->setAttribute('public_index_url', $this->getControllerPath('Public', DEFAULT_ACTION));
     // FAQ URL
     $this->setAttribute('faq_url', ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL') . 'faq/');
     // システム管理メニューURL
     if (ACSAccessControl::is_system_administrator($acs_user_info_row)) {
         $this->setAttribute('is_system_administrator', true);
         $this->setAttribute('system_manage_menu_url', $this->getControllerPath('System', DEFAULT_ACTION));
     }
     // ログインURL
     $login_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL');
     $login_url .= $this->getControllerPath(DEFAULT_MODULE, 'Login');
     $this->setAttribute('login_url', $login_url);
     // ログアウトURL
     $logout_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     $logout_url .= $this->getControllerPath(DEFAULT_MODULE, 'Logout');
     $this->setAttribute('logout_url', $logout_url);
     // 新着情報URL(非ログイン)
     $public_index_url_not_login = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     $public_index_url_not_login .= $this->getControllerPath('Public', DEFAULT_ACTION);
     $this->setAttribute('public_index_url_not_login', $public_index_url_not_login);
 }
コード例 #16
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');
     // コミュニティトップページの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'];
     // 加工
     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'];
         // 投稿日時
         $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'];
     }
     //---- アクセス制御 ----//
     $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);
     //----------------------//
     // set
     $this->setAttribute('community_top_page_url', $community_top_page_url);
     $this->setAttribute('bbs_top_page_url', $bbs_top_page_url);
     $this->setAttribute('community_row', $request->getAttribute('community_row'));
     $this->setAttribute('bbs_row_array', $bbs_row_array);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('BBSThreadList.tpl.php');
     return parent::execute();
 }
コード例 #17
0
 function getDefaultView()
 {
     $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');
     // get
     $bbs_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', 'D41'));
     $community_folder_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', 'D31'));
     $self_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', 'D00'));
     // 対象となるコミュニティIDを取得
     $community_id = $request->ACSGetParameter('community_id');
     // コミュニティ情報
     $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);
     $category_group_master_row_array = ACSCommunity::get_category_group_master_row_array();
     foreach ($category_group_master_row_array as $index => $category_group_master_row) {
         $category_group_master_row_array[$index]['category_master_row_array'] = ACSCommunity::get_category_master_row_array_by_category_group_code($category_group_master_row['category_group_code']);
     }
     // set
     $request->setAttribute('bbs_open_level_master_row_array', $bbs_open_level_master_row_array);
     $request->setAttribute('community_folder_open_level_master_row_array', $community_folder_open_level_master_row_array);
     $request->setAttribute('category_group_master_row_array', $category_group_master_row_array);
     $request->setAttribute('self_open_level_master_row_array', $self_open_level_master_row_array);
     $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);
     return View::INPUT;
 }
コード例 #18
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // get
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $user_folder_obj = $request->getAttribute('user_folder_obj');
     $edit_folder_id = $request->getAttribute('edit_folder_id');
     $default_data_row = $request->getAttribute('default_data_row');
     // デフォルト値として表示する値
     $target_user_community_id = $target_user_info_row['user_community_id'];
     $view_mode = $request->getAttribute('view_mode');
     $target_user_info = '&id=' . $target_user_community_id;
     $folder_info = '&folder_id=' . $user_folder_obj->folder_obj->get_folder_id();
     if ($view_mode == 'update') {
         $edit_folder_info = '&edit_folder_id=' . $edit_folder_id;
     } else {
         $edit_folder_info = "";
     }
     // フォルダの所有者
     $_target_user_info_row['community_name'] = $target_user_info_row['community_name'];
     $_target_user_info_row['top_page_url'] = $this->getControllerPath('User', DEFAULT_ACTION);
     $_target_user_info_row['top_page_url'] .= $target_community_info;
     // 登録・更新処理URL
     $action_url = "";
     $action_url = $this->getControllerPath('User', 'EditFolder');
     $action_url .= $target_user_info;
     $action_url .= $folder_info;
     $action_url .= $edit_folder_info;
     $action_url .= '&action_type=' . $view_mode;
     $cancel_url = "";
     if ($view_mode == 'create') {
         $cancel_url = $this->getControllerPath('User', 'Folder');
         $cancel_url .= $target_user_info;
         $cancel_url .= $folder_info;
     } elseif ($view_mode == 'update') {
         $cancel_url = $this->getControllerPath('User', 'FolderDetail');
         $cancel_url .= $target_user_info;
         $cancel_url .= $folder_info;
         $cancel_url .= '&detail_folder_id=' . $edit_folder_id;
     }
     // 公開範囲を設定できるかどうか
     $is_set_open_level_available = $user_folder_obj->is_set_open_level_available();
     // 公開範囲選択肢取得
     $open_level_master_row_array = ACSAccessControl::get_open_level_master_row_array(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D32'));
     // デフォルト表示データがある場合、is_default を変更する
     if ($default_data_row) {
         $selected_open_level_code = $default_data_row['open_level_code'];
         $index_count = 0;
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $selected_open_level_code) {
                 $open_level_master_row_array[$index_count]['is_default'] = true;
             } else {
                 $open_level_master_row_array[$index_count]['is_default'] = false;
             }
             $index_count++;
         }
     }
     // マイフレンズグループ取得 (公開範囲「友人に公開」の選択肢)
     $friends_group_row_array = ACSUser::get_friends_group_row_array($target_user_info_row['user_community_id']);
     // 友人に公開の場合のオプションデフォルト値を追加
     // default_data_row に 'trusted_community_flag' を追加する
     $selected_trusted_community_id_array = $default_data_row['trusted_community_id_array'];
     // 「友人に公開」の 公開範囲コード取得
     foreach ($open_level_master_row_array as $open_level_master_row) {
         if ($open_level_master_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
             $friends_open_level_code = $open_level_master_row['open_level_code'];
             break;
         }
     }
     if ($default_data_row['trusted_community_flag']) {
         // 選択された値がわかっている場合(エラーの場合)
         // そのままの値を使用する
     } elseif ($default_data_row['open_level_code'] != $friends_open_level_code) {
         // 全ての友人 をデフォルトにする
         $default_data_row['trusted_community_flag'] = '0';
     } elseif ($friends_group_row_array && $selected_trusted_community_id_array) {
         // 指定されているコミュニティIDが1つで、community_type がマイフレンズでないの場合
         //    マイフレンズグループ を選択する
         if (count($selected_trusted_community_id_array) == 1) {
             $_trusted_community_row = ACSCommunity::get_community_row($selected_trusted_community_id_array[0]);
             if ($_trusted_community_row['community_type_name'] != ACSMsg::get_mst('community_type_master', 'D20')) {
                 $default_data_row['trusted_community_flag'] = '1';
             } else {
                 $default_data_row['trusted_community_flag'] = '0';
             }
         } else {
             // 複数ある場合は、マイフレンズグループ
             $default_data_row['trusted_community_flag'] = '1';
         }
     } elseif ($default_data_row['open_level_code'] == $friends_open_level_code && !$selected_trusted_community_id_array) {
         // 友人に公開で、閲覧許可コミュニティがない場合は マイフレンズを選択
         $default_data_row['trusted_community_flag'] = '1';
     }
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('EditFolder.tpl.php');
     // set
     $this->setAttribute('target_user_info_row', $_target_user_info_row);
     $this->setAttribute('view_mode', $view_mode);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('cancel_url', $cancel_url);
     $this->setAttribute('is_set_open_level_available', $is_set_open_level_available);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('default_data_row', $default_data_row);
     // エラーメッセージ
     $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user));
     return parent::execute();
 }
コード例 #19
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;
 }
コード例 #20
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // get
     $target_community_info_row = $request->getAttribute('target_community_info_row');
     $user_folder_obj = $request->getAttribute('user_folder_obj');
     $edit_folder_id = $request->getAttribute('edit_folder_id');
     $default_data_row = $request->getAttribute('default_data_row');
     // デフォルト値として表示する値
     $parent_community_row_array = $request->getAttribute('parent_community_row_array');
     $sub_community_row_array = $request->getAttribute('sub_community_row_array');
     $target_community_id = $target_community_info_row['community_id'];
     $view_mode = $request->getAttribute('view_mode');
     $target_community_info = '&community_id=' . $target_community_id;
     $folder_info = '&folder_id=' . $user_folder_obj->folder_obj->get_folder_id();
     if ($view_mode == 'update') {
         $edit_folder_info = '&edit_folder_id=' . $edit_folder_id;
     } else {
         $edit_folder_info = "";
     }
     // フォルダの所有者
     $_target_community_info_row['community_id'] = $target_community_info_row['community_id'];
     $_target_community_info_row['community_name'] = $target_community_info_row['community_name'];
     $_target_community_info_row['top_page_url'] = $this->getControllerPath('User', DEFAULT_ACTION);
     $_target_community_info_row['top_page_url'] .= $target_community_info;
     // 登録・更新処理URL
     $action_url = "";
     $action_url = $this->getControllerPath('Community', 'EditFolder');
     $action_url .= $target_community_info;
     $action_url .= $folder_info;
     $action_url .= $edit_folder_info;
     $action_url .= '&action_type=' . $view_mode;
     $cancel_url = "";
     if ($view_mode == 'create') {
         $cancel_url = $this->getControllerPath('Community', 'Folder');
         $cancel_url .= $target_community_info;
         $cancel_url .= $folder_info;
     } elseif ($view_mode == 'update') {
         $cancel_url = $this->getControllerPath('Community', 'FolderDetail');
         $cancel_url .= $target_community_info;
         $cancel_url .= $folder_info;
         $cancel_url .= '&detail_folder_id=' . $edit_folder_id;
     }
     // 公開範囲を設定できるかどうか
     $is_set_open_level_available = $user_folder_obj->is_set_open_level_available();
     // 公開範囲選択肢取得
     $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', 'D32'));
     // デフォルト表示データがある場合、is_default を変更する
     if ($default_data_row) {
         $selected_open_level_code = $default_data_row['open_level_code'];
         $index_count = 0;
         foreach ($open_level_master_row_array as $open_level_master_row) {
             if ($open_level_master_row['open_level_code'] == $selected_open_level_code) {
                 $open_level_master_row_array[$index_count]['is_default'] = true;
             } else {
                 $open_level_master_row_array[$index_count]['is_default'] = false;
             }
             $index_count++;
         }
     }
     // -------------------------
     // 閲覧許可コミュニティ
     $trusted_community_row_array = array();
     // 親コミュニティ
     $parent_community_info_array = $this->make_trusted_community_row_array($controller, $parent_community_row_array);
     //array_push($trusted_community_row_array, $parent_community_row_array);
     // サブコミュニティ
     $sub_community_info_array = $this->make_trusted_community_row_array($controller, $sub_community_row_array);
     //array_push($trusted_community_row_array, $sub_community_row_array);
     // 選択されているコミュニティ
     $selected_trusted_community_row_array = ACSCommunity::get_each_community_row_array($default_data_row['trusted_community_id_array']);
     $selected_trusted_community_info_array = $this->make_trusted_community_row_array($controller, $selected_trusted_community_row_array);
     // デフォルトで表示する閲覧許可コミュニティを作成
     //$trusted_community_row_array = array_merge($parent_community_info_array, $sub_community_info_array, $selected_trusted_community_info_array);
     //$trusted_community_row_array = array_unique($trusted_community_row_array);
     // 閲覧許可コミュニティ追加URL
     #index.php?module=Community&action=SelectTrustedCommunity&form_name=folder_open_level_form
     $add_trusted_community_url = "";
     $add_trusted_community_url = $this->getControllerPath('Community', 'SelectTrustedCommunity');
     $add_trusted_community_url .= '&form_name=folder_info';
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('EditFolder.tpl.php');
     // set
     $this->setAttribute('target_community_info_row', $_target_community_info_row);
     $this->setAttribute('view_mode', $view_mode);
     $this->setAttribute('action_url', $action_url);
     $this->setAttribute('cancel_url', $cancel_url);
     $this->setAttribute('is_set_open_level_available', $is_set_open_level_available);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('parent_community_info_array', $parent_community_info_array);
     $this->setAttribute('sub_community_info_array', $sub_community_info_array);
     $this->setAttribute('selected_trusted_community_info_array', $selected_trusted_community_info_array);
     $this->setAttribute('add_trusted_community_url', $add_trusted_community_url);
     //		$this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('default_data_row', $default_data_row);
     // エラーメッセージ
     $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user));
     return parent::execute();
 }
コード例 #21
0
ファイル: ACSUser.class.php プロジェクト: nkawa/acs-git-test
 /**
  * マイページデザインを登録する
  *
  * @param $acs_user_info_row ACSユーザ情報
  * @param $css_file デザインのCSSファイル名
  * @return 成功(true) / 失敗(false)
  */
 static function set_design($acs_user_info_row, $css_file)
 {
     $contents_type_name = ACSMsg::get_mst('contents_type_master', 'D53');
     $contents_type_arr = ACSDB::get_master_array("contents_type", "contents_type_name='" . $contents_type_name . "'");
     $form['community_id'] = $acs_user_info_row['user_community_id'];
     $form['contents_type_code'] = array_search($contents_type_name, $contents_type_arr);
     $form['contents_value'] = $css_file;
     // ログインユーザに公開
     $form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D10'), $contents_type_name);
     // BEGIN
     ACSDB::_do_query("BEGIN");
     $ret = ACSCommunity::set_contents($form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // COMMIT
     ACSDB::_do_query("COMMIT");
     return $ret;
 }
コード例 #22
0
 /**
  * フォルダにアクセス権があるか
  *
  * @param  $target_user_info_row 表示対象マイページ情報
  * @return true / false
  */
 function has_privilege($target_user_info_row)
 {
     $ret_folder_obj_array = array();
     /* role_array 取得 */
     $role_array = ACSAccessControl::get_user_community_role_array($this->get_acs_user_info_row(), $target_user_info_row);
     $folder_obj = $this->get_folder_obj();
     $ret_folder_obj = ACSAccessControl::get_valid_obj_row_array_for_user_community($this->get_acs_user_info_row(), $role_array, array($folder_obj));
     if ($ret_folder_obj) {
         return true;
         // ない場合は、アクセス不可
     } else {
         return false;
     }
 }
コード例 #23
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}");
         }
     }
 }
コード例 #24
0
 /**
  * 外部RSS自動取込の設定内容を登録する
  *
  * @param $community_id コミュニティID
  * @param $form 入力フォーム情報
  * @return 成功(true) / 失敗(false)
  */
 static function set_external_rss_contents($community_id, $form)
 {
     $contents_type_master_array = ACSDB::get_master_array('contents_type');
     $open_level_master_array = ACSDB::get_master_array('open_level');
     // 63: external_rss_url
     $contents_form = array();
     $contents_form['community_id'] = $community_id;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D63'), $contents_type_master_array);
     $contents_form['open_level_code'] = $form['external_rss_url_open_level_code'];
     $contents_form['contents_value'] = $form['external_rss_url'];
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // 非公開 (メンバのみ) の公開コミュニティ
     if (is_array($form['external_rss_url_trusted_community_id_array'])) {
         $external_rss_url_trusted_community_form = array();
         $external_rss_url_trusted_community_form['community_id'] = $community_id;
         $external_rss_url_trusted_community_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D63'), $contents_type_master_array);
         $external_rss_url_trusted_community_form['open_level_code'] = $form['external_rss_url_open_level_code'];
         foreach ($form['external_rss_url_trusted_community_id_array'] as $trusted_community_id) {
             $external_rss_url_trusted_community_form['trusted_community_id'] = $trusted_community_id;
             $ret = ACSCommunity::set_contents_trusted_community($external_rss_url_trusted_community_form);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // 64: external_rss_post_user
     $contents_form = array();
     $contents_form['community_id'] = $community_id;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D64'), $contents_type_master_array);
     $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D64'));
     $contents_form['contents_value'] = $form['external_rss_post_user'];
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // 65: external_rss_ml_send_flag
     $contents_form = array();
     $contents_form['community_id'] = $community_id;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D65'), $contents_type_master_array);
     $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D65'));
     $contents_form['contents_value'] = ACSLib::get_pg_boolean($form['external_rss_ml_send_flag']);
     // 't', 'f'
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // 66: external_rss_public_release_expire_term
     $contents_form = array();
     $contents_form['community_id'] = $community_id;
     $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D66'), $contents_type_master_array);
     $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D66'));
     $contents_form['contents_value'] = $form['external_rss_public_release_expire_term'];
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     return $ret;
 }
コード例 #25
0
 function execute()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $controller = $context->getController();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $community_row = $request->getAttribute('community_row');
     $sub_community_row_array = $request->getAttribute('sub_community_row_array');
     $parent_community_row_array = $request->getAttribute('parent_community_row_array');
     $community_member_user_info_row_array = $request->getAttribute('community_member_user_info_row_array');
     $community_admin_user_info_row_array = $request->getAttribute('community_admin_user_info_row_array');
     $community_id = $community_row['community_id'];
     $bbs_row_array = $request->getAttribute('bbs_row_array');
     // コミュニティメンバ数
     $community_member_display_max = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D03'), 'COMMUNITY_MEMBER_DISPLAY_MAX_COUNT');
     $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_id);
     $is_community_admin = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_id);
     // 掲示板新着記事数
     $bbs_display_max = 10;
     // URL
     $bbs_url = $this->getControllerPath("Community", 'BBS') . '&community_id=' . $community_id;
     $community_folder_url = $this->getControllerPath("Community", 'Folder') . '&community_id=' . $community_id;
     if (!$is_community_member && $acs_user_info_row['is_acs_user']) {
         $join_community_url = $this->getControllerPath("Community", 'JoinCommunity') . '&community_id=' . $community_id;
     }
     if ($is_community_admin) {
         //コミュニティ プロフィールの編集
         $community_change_url = $this->getControllerPath("Community", 'EditCommunity') . '&community_id=' . $community_id;
     }
     // コミュニティ退会URL
     //   コミュニティメンバで、管理者でない場合は表示
     if ($is_community_member and !$is_community_admin) {
         $leave_community_url = $this->getControllerPath("Community", 'LeaveCommunity') . '&community_id=' . $community_id;
     }
     // RSS出力ページのURL
     $PressRelease_community_url = $this->getControllerPath("Community", 'PressReleaseRSS') . '&community_id=' . $community_id;
     // 加工 //
     $community_row['register_date'] = ACSLib::convert_pg_date_to_str($community_row['register_date'], 0, 0, 0);
     // 登録日
     $community_row['community_member_num'] = count($community_member_user_info_row_array);
     // メンバー数
     // 画像ファイルのパスを設定
     $community_row['image_url'] = ACSCommunity::get_image_url($community_id);
     if ($is_community_admin) {
         $edit_profile_image_url = $this->getControllerPath("Community", 'EditProfileImage') . '&community_id=' . $community_id;
     }
     // 参加資格の自由参加可能コミュニティ
     foreach ($community_row['join_trusted_community_row_array'] as $index => $join_trusted_community_row) {
         $community_row['join_trusted_community_row_array'][$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $join_trusted_community_row['community_id'];
     }
     // 掲示板の公開コミュニティ
     foreach ($community_row['contents_row_array']['bbs']['trusted_community_row_array'] as $index => $trusted_community_row) {
         $community_row['contents_row_array']['bbs']['trusted_community_row_array'][$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id'];
     }
     // コミュニティフォルダの公開コミュニティ
     foreach ($community_row['contents_row_array']['community_folder']['trusted_community_row_array'] as $index => $trusted_community_row) {
         $community_row['contents_row_array']['community_folder']['trusted_community_row_array'][$index]['top_page_url'] = $this->getControllerPath("Community", DEFAULT_ACTION) . '&community_id=' . $trusted_community_row['community_id'];
     }
     // コミュニティメンバ
     $community_member_display_user_info_row_array = array();
     $array_count = 0;
     foreach ($community_member_user_info_row_array as $index => $community_member_user_info_row) {
         $array_count++;
         $_community_member_row = array();
         $_community_member_row['community_name'] = $community_member_user_info_row['community_name'];
         $_community_member_row['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $community_member_user_info_row['user_community_id'];
         $_community_member_row['image_url'] = ACSUser::get_image_url($community_member_user_info_row['user_community_id'], 'thumb');
         $_community_member_row['friends_row_array_num'] = ACSUser::get_friends_row_array_num($community_member_user_info_row['user_community_id']);
         array_push($community_member_display_user_info_row_array, $_community_member_row);
         if ($array_count == $community_member_display_max) {
             break;
         }
     }
     // コミュニティ管理者
     foreach ($community_admin_user_info_row_array as $index => $community_admin_user_info_row) {
         $community_admin_user_info_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $community_admin_user_info_row['user_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'];
     }
     // サブコミュニティ
     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'];
     }
     // URL
     // コミュニティ間リンク設定
     if ($is_community_admin) {
         $community_link_url = $this->getControllerPath("Community", 'CommunityLink') . '&community_id=' . $community_row['community_id'];
     }
     // コミュニティメンバ一覧
     $community_member_list_url = $this->getControllerPath("Community", 'CommunityMemberList') . '&community_id=' . $community_row['community_id'];
     // メンバ削除
     $delete_community_member_list_url = "";
     if ($is_community_admin) {
         $delete_community_member_list_url = $this->getControllerPath("Community", 'DeleteCommunityMemberList');
         $delete_community_member_list_url .= '&community_id=' . $community_row['community_id'];
     }
     // コミュニティ削除
     $delete_community_url = "";
     if ($is_community_admin) {
         $delete_community_url = $this->getControllerPath("Community", 'DeleteCommunity');
         $delete_community_url .= '&community_id=' . $community_row['community_id'];
     }
     // コミュニティ招待 URL
     if ($is_community_admin) {
         $invite_to_community_url = $this->getControllerPath("Community", 'InviteToCommunity') . '&community_id=' . $community_row['community_id'];
     }
     // コミュニティスケジュール URL
     if ($is_community_member) {
         $community_schedule_url = $this->getControllerPath("Community", 'Schedule') . '&community_id=' . $community_id;
     }
     // コミュニティ管理者設定
     if ($is_community_admin) {
         $edit_community_admin_url = $this->getControllerPath("Community", 'EditCommunityAdmin') . '&community_id=' . $community_row['community_id'];
     }
     // 外部RSS自動取り込み設定
     if ($is_community_admin) {
         $edit_external_rss_url = $this->getControllerPath("Community", 'EditExternalRSS') . '&community_id=' . $community_row['community_id'];
     }
     if ($is_community_admin) {
         // 待機: コミュニティ参加 承認待ち
         $waiting_for_join_community_row_array = $request->getAttribute('waiting_for_join_community_row_array');
         $waiting_for_join_community_row_array_num = count($waiting_for_join_community_row_array);
         if ($waiting_for_join_community_row_array_num) {
             // マイフレンズ追加 承認待ち URL
             $waiting_for_join_community_url = $this->getControllerPath("Community", 'WaitingList') . '&community_id=' . $community_id . '&waiting_type_code=' . $waiting_for_join_community_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_join_community_row_array[0]['waiting_status_code'];
         }
         // 待機: 親コミュニティ追加
         $waiting_for_parent_community_link_row_array = $request->getAttribute('waiting_for_parent_community_link_row_array');
         $waiting_for_parent_community_link_row_array_num = count($waiting_for_parent_community_link_row_array);
         if ($waiting_for_parent_community_link_row_array_num) {
             // 親コミュニティ追加 承認待ち URL
             $waiting_for_parent_community_link_url = $this->getControllerPath("Community", 'WaitingList') . '&community_id=' . $community_id . '&waiting_type_code=' . $waiting_for_parent_community_link_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_parent_community_link_row_array[0]['waiting_status_code'];
         }
         // 待機: サブコミュニティ追加
         $waiting_for_sub_community_link_row_array = $request->getAttribute('waiting_for_sub_community_link_row_array');
         $waiting_for_sub_community_link_row_array_num = count($waiting_for_sub_community_link_row_array);
         if ($waiting_for_sub_community_link_row_array_num) {
             // サブコミュニティ追加 承認待ち URL
             $waiting_for_sub_community_link_url = $this->getControllerPath("Community", 'WaitingList') . '&community_id=' . $community_id . '&waiting_type_code=' . $waiting_for_sub_community_link_row_array[0]['waiting_type_code'] . '&waiting_status_code=' . $waiting_for_sub_community_link_row_array[0]['waiting_status_code'];
         }
     }
     // 掲示板に対するアクセス権
     $bbs_contents_row = ACSCommunity::get_contents_row($community_id, ACSMsg::get_mst('contents_type_master', 'D41'));
     $bbs_contents_row['trusted_community_row_array'] = ACSCommunity::get_contents_trusted_community_row_array($community_id, $bbs_contents_row['contents_type_code'], $bbs_contents_row['open_level_code']);
     $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $community_row);
     $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_contents_row);
     if ($ret) {
         // 掲示版最新情報
         foreach ($bbs_row_array as $index => $bbs_row) {
             // 返信画面URL
             $bbs_row_array[$index]['bbs_res_url'] = $this->getControllerPath("Community", 'BBSRes') . '&community_id=' . $community_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'];
             $bbs_row_array[$index]['bbs_last_post_date'] = ACSLib::convert_pg_date_to_str($bbs_row['bbs_last_post_date'], true, false, false);
         }
         //---- アクセス制御 ----//
         $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);
         //----------------------//
         $bbs_row_array = array_slice($bbs_row_array, 0, $bbs_display_max);
     } else {
         $bbs_row_array = array();
     }
     // set
     $this->setAttribute('community_row', $community_row);
     $this->setAttribute('parent_community_row_array', $parent_community_row_array);
     $this->setAttribute('sub_community_row_array', $sub_community_row_array);
     $this->setAttribute('community_member_display_user_info_row_array', $community_member_display_user_info_row_array);
     $this->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array);
     $this->setAttribute('bbs_row_array', $bbs_row_array);
     $this->setAttribute('is_community_member', $is_community_member);
     $this->setAttribute('is_community_admin', $is_community_admin);
     $this->setAttribute('bbs_url', $bbs_url);
     $this->setAttribute('community_folder_url', $community_folder_url);
     $this->setAttribute('create_sub_community_url', $create_sub_community_url);
     $this->setAttribute('join_community_url', $join_community_url);
     $this->setAttribute('leave_community_url', $leave_community_url);
     $this->setAttribute('community_change_url', $community_change_url);
     $this->setAttribute('community_schedule_url', $community_schedule_url);
     $this->setAttribute('community_link_url', $community_link_url);
     $this->setAttribute('delete_community_url', $delete_community_url);
     $this->setAttribute('edit_community_admin_url', $edit_community_admin_url);
     $this->setAttribute('invite_to_community_url', $invite_to_community_url);
     $this->setAttribute('edit_community_profile_url', $edit_community_profile_url);
     $this->setAttribute('edit_external_rss_url', $edit_external_rss_url);
     $this->setAttribute('community_member_list_url', $community_member_list_url);
     $this->setAttribute('delete_community_member_list_url', $delete_community_member_list_url);
     $this->setAttribute('PressRelease_community_url', $PressRelease_community_url);
     //画像
     $this->setAttribute('edit_profile_image_url', $edit_profile_image_url);
     // 待機
     $this->setAttribute('waiting_for_join_community_row_array_num', $waiting_for_join_community_row_array_num);
     $this->setAttribute('waiting_for_join_community_url', $waiting_for_join_community_url);
     $this->setAttribute('waiting_for_parent_community_link_row_array_num', $waiting_for_parent_community_link_row_array_num);
     $this->setAttribute('waiting_for_parent_community_link_url', $waiting_for_parent_community_link_url);
     $this->setAttribute('waiting_for_sub_community_link_row_array_num', $waiting_for_sub_community_link_row_array_num);
     $this->setAttribute('waiting_for_sub_community_link_url', $waiting_for_sub_community_link_url);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('Index.tpl.php');
     return parent::execute();
 }
コード例 #26
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
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $diary_row_array = $request->getAttribute('diary_row_array_result');
     $open_level_master_row_array = $request->getAttribute('open_level_master_row_array');
     $friends_group_row_array = $request->getAttribute('friends_group_row_array');
     $err_str = $request->getAttribute('err_str');
     $form_pre = $request->getAttribute('form_pre');
     // トップページURL
     $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id'];
     //他人の日記を閲覧している場合のトップページURL
     $link_page_url['else_user_top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id'];
     //他人の日記を閲覧している場合の日記ページURL
     $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $target_user_info_row['community_id'];
     //検索画面url
     $link_page_url['search_diary_url'] = SCRIPT_PATH;
     // get でサブミットするための、遷移先情報
     $module = 'User';
     $action = 'SearchResultDiary';
     $id = $target_user_info_row['community_id'];
     $move_id = '2';
     // 加工
     if ($diary_row_array) {
         foreach ($diary_row_array as $index => $diary_row) {
             // ユーザ画像URL
             $diary_row_array[$index]['image_url'] = ACSUser::get_image_url($diary_row['community_id'], 'thumb');
             //ユーザページ
             $user_row = ACSUser::get_user_profile_row($diary_row['community_id']);
             $diary_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $diary_row['community_id'];
             $diary_row_array[$index]['community_name'] = $user_row['community_name'];
             // 投稿日時
             $diary_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($diary_row['post_date']);
             // コメントページURL
             $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $diary_row['community_id'] . '&diary_id=' . $diary_row['diary_id'];
             // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか
             if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
                 if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) {
                     $diary_row_array[$index]['trusted_community_flag'] = 0;
                 } else {
                     $diary_row_array[$index]['trusted_community_flag'] = 1;
                 }
             }
         }
         //---- アクセス制御 ----//
         $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
         $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array);
         //特別::全件検索の場合 ターゲットが自分のままになってしまうことを回避
         $diary_row_array_result = array();
         foreach ($diary_row_array as $index => $diary_row) {
             $diary_target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($diary_row['community_id']);
             $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $diary_target_user_info_row);
             $is_valid_user = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $diary_row);
             if ($is_valid_user) {
                 //アクセス権がある
                 array_push($diary_row_array_result, $diary_row);
             }
         }
         //----------------------//
     }
     // 本人のページかどうか
     if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('diary_row_array_result', $diary_row_array_result);
     $this->setAttribute('is_self_page', $is_self_page);
     $this->setAttribute('link_page_url', $link_page_url);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('err_str', $err_str);
     $this->setAttribute('form_pre', $form_pre);
     $this->setAttribute('module', $module);
     $this->setAttribute('action', $action);
     $this->setAttribute('id', $id);
     $this->setAttribute('move_id', $move_id);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('SearchResultDiary.tpl.php');
     return parent::execute();
 }
コード例 #27
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
     $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;
 }
コード例 #28
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を取得
     $target_user_community_id = $request->getParameter('id');
     // 対象となるフォルダIDを取得
     $target_user_community_folder_id = $request->getParameter('folder_id');
     // 処理の種類
     $action_type = $request->getParameter('action_type');
     // get
     $form = $request->ACSGetParameters();
     // Validatorで出来ないエラーチェックを行う //
     if (mb_strlen($form['folder_name']) > 100) {
         $this->setError($controller, $request, $user, 'folder_name', ACSMsg::get_msg('User', 'EditFolderAction.class.php', 'M001'));
         return $this->handleError(&$controller, &$request, &$user);
     }
     // 表示するページの所有者情報取得
     $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($target_user_community_id);
     // フォルダ情報取得
     $user_folder_obj = new ACSUserFolder($target_user_community_id, $acs_user_info_row, $target_user_community_folder_id);
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('user_folder_obj', $user_folder_obj);
     /* ----------------- */
     /* 入力画面表示処理 */
     /* ----------------- */
     // action_type (create or update) が存在し、エラーで遷移してきていない場合
     if (!$action_type || $this->hasErrors($controller, $request, $user)) {
         return $this->getDefaultView();
     }
     // 選択された公開範囲の判別のためのデータ取得
     $open_level_master_row_array = ACSAccessControl::get_all_open_level_master_row_array();
     /* ---------- */
     /* 入力値取得 */
     /* ---------- */
     $edit_folder_id = $request->getParameter('edit_folder_id');
     $input_folder_row = array();
     $input_folder_row['folder_name'] = $request->getParameter('folder_name');
     $input_folder_row['comment'] = $request->getParameter('comment');
     $input_folder_row['open_level_code'] = $request->getParameter('open_level_code');
     $open_level_row = $open_level_master_row_array[$input_folder_row['open_level_code']];
     $open_level_name = $open_level_row['open_level_name'];
     if ($open_level_name == ACSMsg::get_mst('open_level_master', 'D05')) {
         if ($request->getParameter('trusted_community_flag') == '0') {
             // 全ての友人をセット
             $friends_community_id = ACSUser::get_friends_community_id($target_user_community_id);
             $input_folder_row['trusted_community_id_array'] = array($friends_community_id);
         } else {
             // マイフレンズグループの場合は、指定されているマイフレンズグループIDをセット
             $input_folder_row['trusted_community_id_array'] = $request->getParameter('trusted_community');
         }
     }
     /* ---------------------- */
     /* フォルダ名重複チェック */
     /* ---------------------- */
     // 対象となるフォルダ配下のフォルダを取得
     $sub_folder_obj_array = $user_folder_obj->folder_obj->get_folder_obj_array();
     foreach ($sub_folder_obj_array as $sub_folder_obj) {
         if ($sub_folder_obj->get_folder_id() == $edit_folder_id) {
             // 更新対象のフォルダはチェック対象としない
             continue;
         }
         if ($sub_folder_obj->get_folder_name() == $input_folder_row['folder_name']) {
             // エラーメッセージをセットし、処理を中断する
             return $this->setError($controller, $request, $user, 'folder_name', ACSMsg::get_msg('User', 'EditFolderAction.class.php', 'M003') . '[' . $input_folder_row['folder_name'] . ']');
         }
     }
     ACSDB::_do_query("BEGIN");
     /* -------- */
     /* 登録処理 */
     /* -------- */
     if ($action_type == 'create') {
         $ret = $user_folder_obj->folder_obj->create_folder($input_folder_row);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK;");
             print "ERROR: フォルダを作成できませんでした。";
             exit;
         }
     } elseif ($action_type == 'update') {
         /* -------- */
         /* 更新処理 */
         /* -------- */
         // 更新対象のフォルダ情報取得
         $update_user_folder_obj = new ACSUserFolder($request->getParameter('id'), $acs_user_info_row, $edit_folder_id);
         $ret = $update_user_folder_obj->folder_obj->update_folder($input_folder_row);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK;");
             print "ERROR: フォルダ情報を変更できませんでした。";
             exit;
         }
     }
     ACSDB::_do_query("COMMIT;");
     /* -------------------- */
     /* フォルダ一覧画面表示 */
     /* -------------------- */
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $folder_action = $this->getControllerPath('User', 'Folder');
     $folder_action .= '&id=' . $target_user_info_row['user_community_id'];
     $folder_action .= '&folder_id=' . $target_user_community_folder_id;
     header("Location: {$folder_action}");
 }
コード例 #29
0
 /**
  * フォルダ全体の公開範囲 (デフォルト) 取得
  *
  * @param  $community_type_name
  * @return open_level_row
  */
 static function select_folder_open_level_default_row($community_type_name)
 {
     $default_row = array();
     $row_array = ACSAccessControl::get_open_level_master_row_array($community_type_name, ACSMsg::get_mst('contents_type_master', 'D31'));
     foreach ($row_array as $row) {
         if ($row['is_default']) {
             $default_row = $row;
             break;
         }
     }
     return $default_row;
 }
コード例 #30
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     //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', 'D10'), ACSMsg::get_mst('contents_type_master', 'D21'));
     // ユーザー情報
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 対象となるUserIDを取得
     $user_community_id = $request->getParameter('id');
     /* 入力画面より */
     if ($move_id == 1) {
         //☆☆ ここからほぼ同じ
         // 画面上のフォーム情報を取得する
         $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['trusted_community_flag'] = $request->getParameter('trusted_community_flag');
         //マイフレンズグループを指定した場合
         $form['trusted_community_id_array'] = $request->getParameter('trusted_community_id_array');
         //選択したグループ群
         $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 "Read file failed.\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['user_community_id'] = $user_community_id;
         $user->setAttribute('new_form_obj', $form);
         //☆☆ ここまでほぼ同じ
         return View::SUCCESS;
         /* 登録確定ボタン「はい」より */
     } else {
         if ($move_id == 2) {
             $user_community_id = $request->getParameter('id');
             //☆☆ ここからほぼ同じ
             // 画面上のフォーム情報を取得する
             $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'), $user_community_id, $form['user_community_id']);
                 if ($file_obj) {
                     //form情報へ登録
                     $form['new_file'] = $file_obj;
                 } else {
                     echo "Create file failed.";
                     return;
                 }
             }
             //2.Diaryテーブル情報
             $ret = ACSDiary::set_Diary($form);
             if ($ret) {
                 ACSDB::_do_query("COMMIT");
             } else {
                 ACSDB::_do_query("ROLLBACK");
             }
             // 書き込み後、GETの処理へ
             $diary_top_page_url = $this->getControllerPath('User', 'Diary') . '&id=' . $user_community_id;
             header("Location: {$diary_top_page_url}");
         }
     }
 }