function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $form = $form = $request->ACSGetParameters(); // 対象となるコミュニティIDを取得 $community_id = $request->ACSgetParameter('community_id'); // コミュニティ情報 $community_row = ACSCommunity::get_community_profile_row($community_id); // 承認が必要か $is_admission_required = ACSCommunity::is_admission_required_for_join_community($acs_user_info_row['user_community_id'], $community_id); // forward $done_obj = new ACSDone(); $done_obj->set_message(ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M003')); $done_obj->add_link($community_row['community_name'] . ' ' . ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M004'), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']); if ($is_admission_required) { // コミュニティ参加承認待ち登録 $waiting_id = ACSWaiting::set_waiting_for_join_community($community_id, $acs_user_info_row['user_community_id'], $form['message']); // 参加承認依頼通知メール ACSWaiting::send_admission_request_notify_mail($waiting_id); $done_obj->set_title(ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M001')); } else { // コミュニティメンバ登録 $community_member_form = array(); $community_member_form['community_id'] = $community_id; $community_member_form['user_community_id'] = $acs_user_info_row['user_community_id']; ACSCommunity::set_community_member($community_member_form); $done_obj->set_title(ACSMsg::get_msg('Community', 'JoinCommunityAction.class.php', 'M002')); } $request->setAttribute('done_obj', $done_obj); $controller->forward('Common', 'Done'); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $community_id = $request->getParameter('community_id'); $view_mode = $request->getParameter('mode'); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $community_row = ACSCommunity::get_community_profile_row($community_id); $is_permitted = false; /* アクセス権チェック */ // 閲覧可能かチェックする // 削除フラグ、全体の公開範囲をチェック /* 写真表示 */ // ファイル情報取得 $image_file_id = $community_row['file_id']; if ($image_file_id) { $file_obj = ACSFile::get_file_info_instance($image_file_id); $ret = $file_obj->view_image($view_mode); } else { $image_url = ACSCommunity::get_default_image_url($view_mode); header("Location: {$image_url}"); } }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるコミュニティ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); // set $request->setAttribute('community_row', $community_row); $request->setAttribute('sub_community_row_array', $sub_community_row_array); $request->setAttribute('parent_community_row_array', $parent_community_row_array); return View::SUCCESS; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるコミュニティIDを取得 $community_id = $request->ACSgetParameter('community_id'); $form = $request->ACSGetParameters(); // コミュニティ情報 $community_row = ACSCommunity::get_community_profile_row($community_id); if ($form['mode'] == 'parent') { $parent_community_id = $form['delete_community_id']; $sub_community_id = $community_id; } elseif ($form['mode'] == 'sub') { $parent_community_id = $community_id; $sub_community_id = $form['delete_community_id']; } // 削除 ACSCommunity::delete_community_link($parent_community_id, $sub_community_id); // forward $done_obj = new ACSDone(); $done_obj->set_title(ACSMsg::get_msg('Community', 'DeleteCommunityLinkAction.class.php', 'M001')); $done_obj->set_message(ACSMsg::get_msg('Community', 'DeleteCommunityLinkAction.class.php', 'M002')); $done_obj->add_link(ACSMsg::get_msg('Community', 'DeleteCommunityLinkAction.class.php', 'M003'), $this->getControllerPath('Community', 'CommunityLink') . '&community_id=' . $community_row['community_id']); $done_obj->add_link(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'DeleteCommunityLinkAction.class.php', 'BACK_TO_CM'), array("{COMMUNITY_NAME}" => $community_row['community_name'])), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']); $request->setAttribute('done_obj', $done_obj); $controller->forward('Common', 'Done'); }
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 $waiting_type_name = $request->getAttribute('waiting_type_name'); $waiting_row_array = $request->getAttribute('waiting_row_array'); // 加工 foreach ($waiting_row_array as $index => $waiting_row) { $waiting_row_array[$index]['entry_date'] = ACSLib::convert_pg_date_to_str($waiting_row['entry_date']); $waiting_row_array[$index]['complete_date'] = ACSLib::convert_pg_date_to_str($waiting_row['entry_date']); if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D10')) { $waiting_row_array[$index]['image_url'] = ACSUser::get_image_url($waiting_row['waiting_community_id'], 'thumb'); $waiting_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $waiting_row['waiting_community_id']; } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D30')) { $waiting_row_array[$index]['image_url'] = ACSCommunity::get_image_url($waiting_row['waiting_community_id'], 'thumb'); $waiting_row_array[$index]['top_page_url'] = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $waiting_row['waiting_community_id']; $waiting_row_array[$index]['entry_user_info_row']['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $waiting_row['entry_user_info_row']['user_community_id']; // コミュニティプロフィール $waiting_row_array[$index]['waiting_community_row'] = ACSCommunity::get_community_profile_row($waiting_row['waiting_community_id']); } $waiting_row_array[$index]['action_url'] = $this->getControllerPath('User', 'WaitingList') . '&id=' . $acs_user_info_row['user_community_id'] . '&waiting_id=' . $waiting_row['waiting_id']; } // テンプレート $this->setScreenId("0001"); $this->setTemplate('WaitingList.tpl.php'); // set $this->setAttribute('waiting_type_name', $waiting_type_name); $this->setAttribute('waiting_row_array', $waiting_row_array); return parent::execute(); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 旧コミュニティ情報 $community_id = $request->ACSGetParameter('community_id'); $old_community_row = ACSCommunity::get_community_profile_row($community_id); // 新情報 $form = $request->ACSGetParameters(); $form['user_community_id'] = $acs_user_info_row['user_community_id']; // コミュニティML設定は変更不可(サニタイズ) if ($old_community_row['contents_row_array']['ml_addr']['contents_value']) { $form['community_ml_address'] = ''; } else { if ($form['community_ml_address'] != '') { // コミュニティMLにプレフィックス・サフィックスを追加 $form['community_ml_address'] = ACS_COMMUNITY_ML_ADDR_PREFIX . $form['community_ml_address'] . ACS_COMMUNITY_ML_ADDR_SUFFIX; } } /***************************** //旧情報に信頼Communityが登録されている場合は退避しておく 初期データのform表示がされたため、退避は不要となった 2006/3/22 if(count($old_community_row['contents_row_array']['bbs']['trusted_community_row_array']) > 0){ if($form['bbs_open_level_code'] == '04'){ $form['bbs_trusted_community_id_array'] = array(); foreach($old_community_row['contents_row_array']['bbs']['trusted_community_row_array'] as $index => $set_data){ array_push($form['bbs_trusted_community_id_array'],$set_data['community_id']); } } } if($old_community_row['contents_row_array']['community_folder']['trusted_community_row_array']){ if(!$form['community_folder_trusted_community_id_array'] && $form['community_folder_open_level_code'] == '04'){ $form['community_folder_trusted_community_id_array'] = array(); foreach($old_community_row['contents_row_array']['community_folder']['trusted_community_row_array'] as $index => $set_data){ array_push($form['community_folder_trusted_community_id_array'],$set_data['community_id']); } } } /* if($old_community_row['join_trusted_community_row_array'] && !$form['join_trusted_community_row_array']){ $form['join_trusted_community_row_array'] = $old_community_row['join_trusted_community_row_array']; } ******************************/ // DB更新 $community_id = ACSCommunity::update_community($form); // コミュニティトップページ表示 $community_top_page_url = $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_id; header("Location: {$community_top_page_url}"); }
function execute() { $context =& $this->getContext(); $controller = $context->getController(); $user = $context->getUser(); $request = $context->getRequest(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるコミュニティIDを取得 $community_id = $request->ACSGetParameter('community_id'); // コミュニティ存在チェック $community_row = ACSCommunity::get_community_row($community_id); if (!$community_row || $community_row['community_type_name'] != ACSMsg::get_mst('community_type_master', 'D40')) { return View::ERROR; } // 権限チェック if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // コミュニティ情報 $community_row = ACSCommunity::get_community_profile_row($community_id); // サブコミュニティ情報の一覧 $sub_community_row_array = ACSCommunity::get_sub_community_row_array($community_id); // 親コミュニティ情報の一覧 $parent_community_row_array = ACSCommunity::get_parent_community_row_array($community_id); // コミュニティメンバ, コミュニティ管理者 $community_member_user_info_row_array = ACSCommunity::get_community_member_user_info_row_array($community_id); $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($community_id); // 待機: コミュニティ参加 承認待ち $waiting_for_join_community_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10')); // 待機: 親コミュニティ追加, サブコミュニティ追加 $waiting_for_parent_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10')); $waiting_for_sub_community_link_row_array = ACSWaiting::get_waiting_row_array($community_id, ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10')); // 最新情報: BBS // BBS記事一覧 $bbs_row_array = ACSBBS::get_bbs_row_array($community_id); foreach ($bbs_row_array as $index => $bbs_row) { // 信頼済みコミュニティ一覧 $bbs_row_array[$index]['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']); } // set $request->setAttribute('community_row', $community_row); $request->setAttribute('sub_community_row_array', $sub_community_row_array); $request->setAttribute('parent_community_row_array', $parent_community_row_array); $request->setAttribute('community_member_user_info_row_array', $community_member_user_info_row_array); $request->setAttribute('community_admin_user_info_row_array', $community_admin_user_info_row_array); $request->setAttribute('waiting_for_join_community_row_array', $waiting_for_join_community_row_array); $request->setAttribute('waiting_for_parent_community_link_row_array', $waiting_for_parent_community_link_row_array); $request->setAttribute('waiting_for_sub_community_link_row_array', $waiting_for_sub_community_link_row_array); $request->setAttribute('bbs_row_array', $bbs_row_array); return View::SUCCESS; }
function 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; }
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; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $form = $form = $request->ACSGetParameters(); // 対象となるコミュニティIDを取得 $community_id = $request->ACSgetParameter('community_id'); // コミュニティ情報 $community_row = ACSCommunity::get_community_profile_row($community_id); ACSDB::_do_query("BEGIN"); // 生成されたwaiting_idの配列 $waiting_id_array = array(); foreach ($form['user_community_id_array'] as $invited_user_community_id) { // コミュニティ招待承認待ち登録 $waiting_id = ACSWaiting::set_waiting_for_invite_to_community($invited_user_community_id, $community_id, $acs_user_info_row['user_community_id'], $form['message']); if (!$waiting_id) { ACSDB::_do_query("ROLLBACK"); break; } // 生成されたwaiting情報を保持 array_push($waiting_id_array, $waiting_id); } if ($waiting_id) { ACSDB::_do_query("COMMIT"); } // 生成されたwaiting情報を元に複数メール送信 foreach ($waiting_id_array as $waiting_id) { // コミュニティ招待承認依頼通知メール ACSWaiting::send_admission_request_notify_mail($waiting_id); } // forward $done_obj = new ACSDone(); $done_obj->set_title(ACSMsg::get_msg('Community', 'InviteToCommunityAction.class.php', 'M001')); $done_obj->set_message(ACSMsg::get_msg('Community', 'InviteToCommunityAction.class.php', 'M002')); $done_obj->add_link(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'InviteToCommunityAction.class.php', 'BACK_TO_CM'), array("{COMMUNITY_NAME}" => $community_row['community_name'])), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']); $request->setAttribute('done_obj', $done_obj); $controller->forward('Common', 'Done'); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるコミュニティIDを取得 $community_id = $request->ACSgetParameter('community_id'); $form = $request->ACSGetParameters(); // コミュニティ情報 $community_row = ACSCommunity::get_community_profile_row($community_id); // forward $done_obj = new ACSDone(); ACSDB::_do_query("BEGIN"); // 生成されたwaiting_idの配列 $waiting_id_array = array(); $ret = 1; // 1:成功 / 0:失敗 foreach ($form['trusted_community_id_array'] as $link_community_id) { if (ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $link_community_id)) { // リンク依頼先コミュニティの管理者である場合は承認待ち登録せずに、即座にリンクを追加する if ($form['link_type'] == 'parent') { $ret = ACSCommunity::set_community_link($link_community_id, $community_id); } elseif ($form['link_type'] == 'sub') { $ret = ACSCommunity::set_community_link($community_id, $link_community_id); } } else { if ($form['link_type'] == 'parent') { // 親コミュニティ追加承認待ち登録 $waiting_id = ACSWaiting::set_waiting_for_parent_community_link($link_community_id, $community_id, $acs_user_info_row['user_community_id'], $form['message']); } elseif ($form['link_type'] == 'sub') { // サブコミュニティ追加承認待ち登録 $waiting_id = ACSWaiting::set_waiting_for_sub_community_link($link_community_id, $community_id, $acs_user_info_row['user_community_id'], $form['message']); } if ($waiting_id) { // 生成されたwaiting情報を保持 array_push($waiting_id_array, $waiting_id); } else { $ret = 0; } } if (!$ret) { ACSDB::_do_query("ROLLBACK"); break; } } if ($ret) { // COMMIT ACSDB::_do_query("COMMIT"); // 生成されたwaiting情報を元に複数メール送信 foreach ($waiting_id_array as $waiting_id) { // コミュニティ間リンク追加依頼通知メール ACSWaiting::send_admission_request_notify_mail($waiting_id); } $done_obj->set_title(ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M001')); $done_obj->set_message(ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M002')); $done_obj->add_link(ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M003'), $this->getControllerPath('Community', 'CommunityLink') . '&community_id=' . $community_row['community_id']); $done_obj->add_link($community_row['community_name'] . ' ' . ACSMsg::get_msg('Community', 'AddCommunityLinkAction.class.php', 'M004'), $this->getControllerPath('Community', DEFAULT_ACTION) . '&community_id=' . $community_row['community_id']); } else { $done_obj->set_message('失敗しました。'); } $request->setAttribute('done_obj', $done_obj); $controller->forward('Common', 'Done'); }
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; }
function get_execute_privilege(&$controller, &$request, &$user) { // 公開範囲情報取得 $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_community_row = ACSCommunity::get_community_profile_row($request->getParameter('community_id')); $bbs_row = ACSBBS::get_bbs_row($request->getParameter('bbs_id')); if (!$bbs_row) { return false; } $bbs_row['trusted_community_row_array'] = ACSBBS::get_bbs_trusted_community_row_array($bbs_row['bbs_id']); // アクセス制御判定 $role_array = ACSAccessControl::get_community_role_array($acs_user_info_row, $target_community_row); $ret = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $bbs_row); return $ret; }