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'); // 対象となるユーザコミュニティIDを取得 $user_community_id = $request->ACSgetParameter('id'); $waiting_type_code = $request->ACSgetParameter('waiting_type_code'); $waiting_status_code = $request->ACSgetParameter('waiting_status_code'); // 待機種別マスタ $waiting_type_master_array = ACSDB::get_master_array('waiting_type'); // 待機状態マスタ $waiting_status_master_array = ACSDB::get_master_array('waiting_status'); $waiting_type_name = $waiting_type_master_array[$waiting_type_code]; $waiting_status_name = $waiting_status_master_array[$waiting_status_code]; // 待機情報 $waiting_row_array = ACSWaiting::get_waiting_row_array($user_community_id, $waiting_type_name, $waiting_status_name); if ($waiting_type_name == ACSMsg::get_mst('waiting_type_master', 'D30')) { foreach ($waiting_row_array as $index => $waiting_row) { $waiting_row_array[$index]['entry_user_info_row'] = ACSUser::get_user_info_row_by_user_community_id($waiting_row['entry_user_community_id']); } } // set $request->setAttribute('waiting_type_name', $waiting_type_name); $request->setAttribute('waiting_row_array', $waiting_row_array); return View::INPUT; }
/** * ファイル履歴情報を登録する * * @param $file_info_row ファイル情報 * @param $update_user_community_id 登録/更新者のユーザコミュニティID * @param $comment コメント * @param $file_history_operation_name ファイル履歴操作名 * @return 成功(file_history_id) / 失敗(false) */ static function set_file_history($file_info_row, $update_user_community_id, $comment, $file_history_operation_name) { $file_history_operation_master_array = ACSDB::get_master_array('file_history_operation'); $file_history_id_seq = ACSDB::get_next_seq('file_history_id_seq'); $file_history_operation_code = array_search($file_history_operation_name, $file_history_operation_master_array); ACSLib::escape_sql_array($file_info_row); ACSLib::get_sql_value_array($file_info_row); // ファイル履歴を登録 $sql = "INSERT INTO file_history"; $sql .= " (file_history_id, file_id, display_file_name, server_file_name, thumbnail_server_file_name, mime_type, file_size, update_date, update_user_community_id, file_history_operation_code)"; $sql .= " VALUES ({$file_history_id_seq}, {$file_info_row['file_id']}, {$file_info_row['display_file_name']}, {$file_info_row['server_file_name']}, {$file_info_row['thumbnail_server_file_name']}, {$file_info_row['mime_type']}, {$file_info_row['file_size']}, {$file_info_row['update_date']}, '{$update_user_community_id}', '{$file_history_operation_code}')"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // ファイル履歴コメントを登録 $ret = ACSFileHistoryComment::set_file_history_comment($file_history_id_seq, $update_user_community_id, $comment); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // trueの場合はファイル履歴IDをセット if ($ret) { $ret = $file_history_id_seq; } return $ret; }
/** * ログを登録する * * @param $acs_user_info_row ACSユーザ情報 * @param $operation_type_name 操作名 * @param $operation_result 操作結果 (true/false) * @param $message メッセージ * @return 成功(true) / 失敗(false) */ static function set_log($acs_user_info_row, $operation_type_name, $operation_result, $message = '') { // 操作コードを取得 $operation_master_row_array = ACSDB::get_master_array('operation'); // ログIDのシーケンス取得 $log_id_seq = ACSDB::get_next_seq('log_id_seq'); // INSERTデータ $form['log_id'] = $log_id_seq; $form['log_date'] = 'now'; $form['user_id'] = $acs_user_info_row['user_id']; // 2009.09.08 user_name if ($acs_user_info_row['user_name'] == NULL || $acs_user_info_row['user_name'] == "") { $form['user_name'] = "anonymous"; } else { $form['user_name'] = $acs_user_info_row['user_name']; } //$form['user_name'] = $acs_user_info_row['user_name']; $form['user_community_id'] = $acs_user_info_row['user_community_id']; $form['community_name'] = $acs_user_info_row['community_name']; $form['administrator_flag'] = $acs_user_info_row['administrator_flag']; $form['operation_code'] = array_search($operation_type_name, $operation_master_row_array); $form['operation_result'] = ACSLib::get_pg_boolean($operation_result); $form['message'] = $operation_master_row_array[$form['operation_code']] . $message; // escape ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); $sql = "INSERT INTO log (log_id, log_date, user_id, user_name, user_community_id, community_name, administrator_flag, operation_code, operation_result, message)"; $sql .= " VALUES ({$form['log_id']}, {$form['log_date']}, {$form['user_id']}, {$form['user_name']}, {$form['user_community_id']}, {$form['community_name']}, {$form['administrator_flag']}, {$form['operation_code']}, {$form['operation_result']}, {$form['message']})"; $ret = ACSDB::_do_query($sql); return $ret; }
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; }
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 $contents_key = $request->getAttribute('contents_key'); $contents_type_code = $request->getAttribute('contents_type_code'); $open_level_master_row_array = $request->getAttribute('open_level_master_row_array'); $friends_group_row_array = $request->getAttribute('friends_group_row_array'); // コンテンツ種別マスタ $contents_type_master_array = ACSDB::get_master_array('contents_type'); $contents_type_name = $contents_type_master_array[$contents_type_code]; // テンプレート $this->setScreenId("0001"); $this->setTemplate('SetOpenLevelForProfileView.tpl.php'); // set $this->setAttribute('open_level_master_row_array', $open_level_master_row_array); $this->setAttribute('friends_group_row_array', $friends_group_row_array); $this->setAttribute('contents_key', $contents_key); $this->setAttribute('contents_type_name', $contents_type_name); return parent::execute(); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_user_community_id = $request->ACSgetParameter('id'); $folder_id = $request->ACSgetParameter('folder_id'); $file_id = $request->ACSgetParameter('file_id'); $file_obj = ACSFile::get_file_info_instance($file_id); $contents_link_url = $this->getControllerPath('User', 'FileDetail') . "&id=" . $target_user_community_id . "&file_id=" . $file_id . "&folder_id=" . $folder_id; // 足跡登録 $contents_type_name = ACSMsg::get_mst('contents_type_master', 'D33'); $contents_type_arr = ACSDB::get_master_array("contents_type", "contents_type_name='" . $contents_type_name . "'"); $form['community_id'] = $target_user_community_id; $form['visitor_community_id'] = $acs_user_info_row['user_community_id']; $form['contents_type_code'] = array_search($contents_type_name, $contents_type_arr); $form['contents_title'] = $file_obj->get_display_file_name(); $form['contents_link_url'] = $contents_link_url; $form['contents_date'] = $file_obj->get_update_date(); $form['post_date'] = 'now'; $ret = ACSUser::set_footprint($form); header("Location: {$contents_link_url}"); }
function getDefaultView() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $target_user_community_id = $request->getParameter('id'); $target_user_community_folder_id = $request->getParameter('folder_id'); $file_id = $request->getParameter('file_id'); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // マスタ $file_category_master_array = ACSDB::get_master_array('file_category'); $file_contents_type_master_array = ACSDB::get_master_array('file_contents_type'); // ファイルカテゴリコードごとのファイルコンテンツ種別の連想配列を取得する $file_contents_type_master_row_array_array = ACSFileDetailInfo::get_file_contents_type_master_row_array_array(); // set $request->setAttribute('file_contents_type_master_row_array_array', $file_contents_type_master_row_array_array); $request->setAttribute('file_category_master_array', $file_category_master_array); $request->setAttribute('file_contents_type_master_array', $file_contents_type_master_array); return View::INPUT; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象のdiary_idを取得 $diary_id = $request->ACSgetParameter('diary_id'); $diary_row = ACSDiary::get_diary_row($diary_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']); } // ユーザ情報 $user_community_id = $diary_row['user_community_id']; $contents_link_url = $this->getControllerPath('User', 'DiaryComment') . "&diary_id=" . $diary_row['diary_id']; // 足跡登録 $contents_type_name = ACSMsg::get_mst('contents_type_master', 'D21'); $contents_type_arr = ACSDB::get_master_array("contents_type", "contents_type_name='" . $contents_type_name . "'"); $form['community_id'] = $user_community_id; $form['visitor_community_id'] = $acs_user_info_row['user_community_id']; $form['contents_type_code'] = array_search($contents_type_name, $contents_type_arr); $form['contents_title'] = $diary_row['subject']; $form['contents_link_url'] = $contents_link_url; $form['contents_date'] = $diary_row['post_date']; $form['post_date'] = 'now'; $ret = ACSUser::set_footprint($form); header("Location: {$contents_link_url}"); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $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(); }
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'); // 対象となるコミュニティIDを取得 $target_community_id = $request->getParameter('community_id'); // 対象となるフォルダIDを取得 $target_community_folder_id = $request->getParameter('folder_id'); // 詳細情報を表示するファイルIDを取得 $file_id = $request->getParameter('file_id'); // 表示するページの所有者情報取得 $target_community_row = ACSCommunity::get_community_row($target_community_id); // フォルダ情報取得 $community_folder_obj = new ACSUserFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); // ファイル情報取得 $file_obj = ACSFile::get_file_info_instance($file_id); // ファイルの詳細情報 $file_detail_info_row = ACSFileDetailInfo::get_file_detail_info_row($file_id); // マスタ $file_category_master_array = ACSDB::get_master_array('file_category'); $file_contents_type_master_array = ACSDB::get_master_array('file_contents_type'); // ファイルカテゴリコードごとのファイルコンテンツ種別の連想配列を取得する $file_contents_type_master_row_array_array = ACSFileDetailInfo::get_file_contents_type_master_row_array_array(); // アクセス制御 // プットフォルダ、ファイルはNG if ($file_obj->get_owner_community_id() != $target_community_id) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // set $request->setAttribute('target_community_row', $target_community_row); $request->setAttribute('file_obj', $file_obj); $request->setAttribute('community_folder_obj', $community_folder_obj); $request->setAttribute('file_detail_info_row', $file_detail_info_row); $request->setAttribute('file_contents_type_master_row_array_array', $file_contents_type_master_row_array_array); $request->setAttribute('file_category_master_array', $file_category_master_array); $request->setAttribute('file_contents_type_master_array', $file_contents_type_master_array); return View::SUCCESS; }
function getDefaultView() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } $open_level_master_array = ACSDB::get_master_array('open_level'); if ($acs_user_info_row['is_acs_user'] && $acs_user_info_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03')) { // マイページ全体が非公開のユーザ // // 非公開ユーザコミュニティの情報を取得 $target_user_info_row = ACSUser::get_user_profile_row($acs_user_info_row['user_community_id'], 'include_private'); } elseif (!$acs_user_info_row['is_acs_user'] && $acs_user_info_row['is_ldap_user']) { // システムに未登録のLDAPユーザ // $ldap_user_info_row = ACSLDAP::get_ldap_user_info_row($acs_user_info_row['user_id']); $target_user_info_row['contents_row_array'] = array(); // ニックネームのデフォルト値を氏名とする $target_user_info_row['community_name'] = $ldap_user_info_row['user_name']; $target_user_info_row['contents_row_array']['user_name'] = ACSCommunity::get_empty_contents_row(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D01')); $target_user_info_row['contents_row_array']['user_name']['contents_value'] = $ldap_user_info_row['user_name']; $target_user_info_row['contents_row_array']['mail_addr'] = ACSCommunity::get_empty_contents_row(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D02')); $target_user_info_row['contents_row_array']['mail_addr']['contents_value'] = $ldap_user_info_row['mail_addr']; $target_user_info_row['contents_row_array']['belonging'] = ACSCommunity::get_empty_contents_row(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D03')); $target_user_info_row['contents_row_array']['belonging']['contents_value'] = $ldap_user_info_row['belonging']; $target_user_info_row['contents_row_array']['friends_list'] = ACSCommunity::get_empty_contents_row(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D11')); $target_user_info_row['contents_row_array']['mail_lang'] = ACSCommunity::get_empty_contents_row(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D51')); // 新規LDAPユーザである $is_new_ldap_user = true; } else { // 対象となるユーザコミュニティIDを取得 $user_community_id = $request->ACSgetParameter('id'); // プロフィール $target_user_info_row = ACSUser::get_user_profile_row($user_community_id); } // set $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('is_new_ldap_user', $is_new_ldap_user); return View::INPUT; }
/** * ファイルカテゴリコードごとのファイルコンテンツ種別の連想配列を取得する * * @param * @return */ static function get_file_contents_type_master_row_array_array() { $file_category_master_row_array = ACSDB::get_master_array('file_category'); $file_contents_type_master_row_array = ACSDB::get_master_array('file_contents_type'); $file_contents_type_master_row_array_array = array(); foreach ($file_category_master_row_array as $file_category_code => $file_category_name) { $file_contents_type_list_row_array = ACSFileDetailInfo::get_file_contents_type_list_row_array($file_category_code); $file_contents_type_master_row_array_array[$file_category_code] = array(); $file_contents_type_master_row_array_array[$file_category_code]['file_category_code'] = $file_category_code; $file_contents_type_master_row_array_array[$file_category_code]['file_category_name'] = $file_category_name; $file_contents_type_master_row_array_array[$file_category_code]['file_contents_row_array'] = array(); foreach ($file_contents_type_list_row_array as $file_contents_type_list_row) { $file_contents_row = array(); $file_contents_row['file_contents_type_code'] = $file_contents_type_list_row['file_contents_type_code']; $file_contents_row['file_contents_type_name'] = $file_contents_type_master_row_array[$file_contents_type_list_row['file_contents_type_code']]; $file_contents_type_master_row_array_array[$file_category_code]['file_contents_type_master_row_array'][$file_contents_type_list_row['file_contents_type_code']] = $file_contents_row; } } return $file_contents_type_master_row_array_array; }
function getDefaultView() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるユーザコミュニティIDを取得 $target_user_community_id = $request->getParameter('id'); // 対象となるフォルダIDを取得 $target_user_community_folder_id = $request->getParameter('folder_id'); // 詳細情報を表示するファイルIDを取得 $file_id = $request->getParameter('file_id'); // 表示するページの所有者情報取得 $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); // ファイル情報取得 $file_obj = ACSFile::get_file_info_instance($file_id); // ファイルの詳細情報 $file_detail_info_row = ACSFileDetailInfo::get_file_detail_info_row($file_id); // マスタ $file_category_master_array = ACSDB::get_master_array('file_category'); $file_contents_type_master_array = ACSDB::get_master_array('file_contents_type'); // ファイルカテゴリコードごとのファイルコンテンツ種別の連想配列を取得する $file_contents_type_master_row_array_array = ACSFileDetailInfo::get_file_contents_type_master_row_array_array(); // set $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('file_obj', $file_obj); $request->setAttribute('user_folder_obj', $user_folder_obj); $request->setAttribute('file_detail_info_row', $file_detail_info_row); $request->setAttribute('file_contents_type_master_row_array_array', $file_contents_type_master_row_array_array); $request->setAttribute('file_category_master_array', $file_category_master_array); $request->setAttribute('file_contents_type_master_array', $file_contents_type_master_array); return View::SUCCESS; }
/** * 依頼通知メールを送信する * * @param $waiting_id 待機ID * @param $return 成功(true) / 失敗(false) * @return */ static function send_admission_request_notify_mail($waiting_id) { // 待機状態マスタ $waiting_status_master_array = ACSDB::get_master_array('waiting_status'); // 「承認待ち」の待機状態コード $waiting_status_code = array_search(ACSMsg::get_mst('waiting_status_master', 'D10'), $waiting_status_master_array); // 待機情報 $waiting_row = ACSWaiting::get_waiting_row($waiting_id); $system_group = ACSMsg::get_mst('system_config_group', 'D01'); // システムURL //$system_base_url = ACSSystemConfig::get_keyword_value('システム', 'SYSTEM_BASE_URL'); $system_base_url = ACSSystemConfig::get_keyword_value($system_group, 'SYSTEM_BASE_URL'); // システムログインURL //$system_base_login_url = ACSSystemConfig::get_keyword_value('システム', 'SYSTEM_BASE_LOGIN_URL'); $system_base_login_url = ACSSystemConfig::get_keyword_value($system_group, 'SYSTEM_BASE_LOGIN_URL'); // システムのメールアドレス (From:) $system_mail_addr = ACSSystemConfig::get_keyword_value($system_group, 'SYSTEM_MAIL_ADDR'); // 利用者の言語設定を一時的に保存 $org_lang = ACSMsg::get_lang(); // 各言語のタイトルを取得 $mail_titles = array(); foreach (ACSMsg::get_lang_list_array() as $lang_key => $lang_name) { ACSMsg::set_lang($lang_key); $mail_titles[$lang_key] = ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'MTL%03d') . "\n"; } // 言語を一旦元に戻す ACSMsg::set_lang($org_lang); if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D10')) { // 依頼側のユーザ情報 $user_info_row = ACSUser::get_user_profile_row($waiting_row['waiting_community_id']); // 依頼される側のユーザ情報 $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['community_id']); // 待機承認URL $waiting_url = $system_base_login_url . SCRIPT_PATH; $waiting_url .= "?" . MODULE_ACCESSOR . "=User"; $waiting_url .= "&" . ACTION_ACCESSOR . "=WaitingList"; $waiting_url .= "&id={$waiting_row['community_id']}"; $waiting_url .= "&waiting_type_code={$waiting_row['waiting_type_code']}"; $waiting_url .= "&waiting_status_code={$waiting_status_code}"; // メール本文 $target_lang = ACSMsg::get_mail_lang_by_inforow($target_user_info_row); // 一旦依頼される側の言語に設定する ACSMsg::set_lang($target_lang); $body = $mail_titles[$target_lang]; $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'ADF%03d'), array("{TARGET_USER_NAME}" => $target_user_info_row['user_name'], "{USER_NAME}" => $user_info_row['user_name'], "{USER_COMMUNITY_NAME}" => $user_info_row['community_name'], "{MESSAGE}" => trim($waiting_row['message']), "{WAITING_URL}" => $waiting_url, "{SYSTEM_BASE_URL}" => $system_base_url)); $subject = ACSMsg::get_mdmsg(__FILE__, 'M002'); // 言語を元に戻す ACSMsg::set_lang($org_lang); $ret = ACSLib::send_mail($system_mail_addr, $target_user_info_row['mail_addr'], null, $subject, $body); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D20')) { // 依頼側のユーザ情報 $user_info_row = ACSUser::get_user_profile_row($waiting_row['waiting_community_id']); // 依頼される側のコミュニティ情報 $target_community_row = ACSCommunity::get_community_row($waiting_row['community_id']); // コミュニティ管理者情報の配列 $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($target_community_row['community_id']); // 待機承認URL $waiting_url = $system_base_login_url . SCRIPT_PATH; $waiting_url .= "?" . MODULE_ACCESSOR . "=Community"; $waiting_url .= "&" . ACTION_ACCESSOR . "=WaitingList"; $waiting_url .= "&community_id={$waiting_row['community_id']}"; $waiting_url .= "&waiting_type_code={$waiting_row['waiting_type_code']}"; $waiting_url .= "&waiting_status_code={$waiting_status_code}"; foreach ($community_admin_user_info_row_array as $community_admin_user_info_row) { $community_admin_user_info_row = ACSUser::get_user_profile_row($community_admin_user_info_row['user_community_id']); $target_lang = ACSMsg::get_mail_lang_by_inforow($community_admin_user_info_row); // 一旦依頼される側の言語に設定する ACSMsg::set_lang($target_lang); $body = $mail_titles[$target_lang]; $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'JCM%03d'), array("{TARGET_COMMUNITY_NAME}" => $target_community_row['community_name'], "{USER_NAME}" => $user_info_row['user_name'], "{USER_COMMUNITY_NAME}" => $user_info_row['community_name'], "{MESSAGE}" => trim($waiting_row['message']), "{WAITING_URL}" => $waiting_url, "{SYSTEM_BASE_URL}" => $system_base_url)); $subject = ACSMsg::get_mdmsg(__FILE__, 'M003'); $ret = ACSLib::send_mail($system_mail_addr, $community_admin_user_info_row['mail_addr'], null, $subject, $body); } // 言語を元に戻す ACSMsg::set_lang($org_lang); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D30')) { // 招待されたコミュニティ情報 $community_row = ACSCommunity::get_community_row($waiting_row['waiting_community_id']); // 依頼側のユーザ情報 $user_info_row = ACSUser::get_user_profile_row($waiting_row['entry_user_community_id']); // 依頼される側のユーザ情報 $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['community_id']); // 待機承認URL $waiting_url = $system_base_login_url . SCRIPT_PATH; $waiting_url .= "?" . MODULE_ACCESSOR . "=User"; $waiting_url .= "&" . ACTION_ACCESSOR . "=WaitingList"; $waiting_url .= "&id={$waiting_row['community_id']}"; $waiting_url .= "&waiting_type_code={$waiting_row['waiting_type_code']}"; $waiting_url .= "&waiting_status_code={$waiting_status_code}"; // コミュニティトップページURL $community_top_page_url = $system_base_login_url . SCRIPT_PATH; $community_top_page_url .= "?" . MODULE_ACCESSOR . "=Community"; $community_top_page_url .= "&" . ACTION_ACCESSOR . "=" . DEFAULT_ACTION; $community_top_page_url .= "&community_id=" . $community_row['community_id']; $target_lang = ACSMsg::get_mail_lang_by_inforow($target_user_info_row); // 一旦依頼される側の言語に設定する ACSMsg::set_lang($target_lang); $body = $mail_titles[$target_lang]; $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'ICM%03d'), array("{TARGET_USER_NAME}" => $target_user_info_row['user_name'], "{USER_NAME}" => $user_info_row['user_name'], "{USER_COMMUNITY_NAME}" => $user_info_row['community_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{COMMUNITY_URL}" => $community_top_page_url, "{MESSAGE}" => trim($waiting_row['message']), "{WAITING_URL}" => $waiting_url, "{SYSTEM_BASE_URL}" => $system_base_url)); $subject = ACSMsg::get_mdmsg(__FILE__, 'M004'); // 言語を元に戻す ACSMsg::set_lang($org_lang); $ret = ACSLib::send_mail($system_mail_addr, $target_user_info_row['mail_addr'], null, $subject, $body); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D40') || $waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D50')) { // 依頼側のコミュニティ情報 $community_row = ACSCommunity::get_community_row($waiting_row['waiting_community_id']); // 依頼側のユーザ情報 $user_info_row = ACSUser::get_user_profile_row($waiting_row['entry_user_community_id']); // 依頼される側のコミュニティ情報 $target_community_row = ACSCommunity::get_community_row($waiting_row['community_id']); // コミュニティ管理者情報の配列 $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($target_community_row['community_id']); // 待機承認URL $waiting_url = $system_base_login_url . SCRIPT_PATH; $waiting_url .= "?" . MODULE_ACCESSOR . "=Community"; $waiting_url .= "&" . ACTION_ACCESSOR . "=WaitingList"; $waiting_url .= "&community_id={$waiting_row['community_id']}"; $waiting_url .= "&waiting_type_code={$waiting_row['waiting_type_code']}"; $waiting_url .= "&waiting_status_code={$waiting_status_code}"; foreach ($community_admin_user_info_row_array as $community_admin_user_info_row) { $community_admin_user_info_row = ACSUser::get_user_profile_row($community_admin_user_info_row['user_community_id']); $target_lang = ACSMsg::get_mail_lang_by_inforow($community_admin_user_info_row); // 一旦依頼される側の言語に設定する ACSMsg::set_lang($target_lang); $body = $mail_titles[$target_lang]; $body .= ACSMsg::get_tag_replace(ACSMsg::get_serial_msg('lib', 'ACSWaiting.class.php', 'CML%03d'), array("{TARGET_COMMUNITY_NAME}" => $target_community_row['community_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{USER_NAME}" => $user_info_row['user_name'], "{USER_COMMUNITY_NAME}" => $user_info_row['community_name'], "{WAITING_TYPE_NAME}" => $waiting_row['waiting_type_name'], "{COMMUNITY_URL}" => $community_top_page_url, "{MESSAGE}" => trim($waiting_row['message']), "{WAITING_URL}" => $waiting_url, "{SYSTEM_BASE_URL}" => $system_base_url)); $subject = ACSMsg::get_mdmsg(__FILE__, 'M005'); $ret = ACSLib::send_mail($system_mail_addr, $community_admin_user_info_row['mail_addr'], null, $subject, $body); } // 言語を元に戻す ACSMsg::set_lang($org_lang); } return $ret; }
/** * マイページデザインを登録する * * @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; }
/** * コミュニティを更新する * 2006/3/9 * @param $form コミュニティ情報 * return 成功(コミュニティID) / 失敗(false) */ static function update_community($form) { // コミュニティ種別マスタ $community_type_master_array = ACSDB::get_master_array('community_type'); $community_type_code = array_search(ACSMsg::get_mst('community_type_master', 'D40'), $community_type_master_array); // コンテンツ種別マスタ $contents_type_master_array = ACSDB::get_master_array('contents_type'); // コミュニティメンバ種別マスタ $community_member_type_master_array = ACSDB::get_master_array('community_member_type'); $community_id_seq = $form['community_id']; $org_form = $form; ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); // BEGIN ACSDB::_do_query("BEGIN"); // (1) コミュニティ (community) $admission_flag = ACSLib::get_pg_boolean($org_form['admission_flag']); $sql = "UPDATE community"; $sql .= " SET community_name = {$form['community_name']},"; $sql .= " category_code = {$form['category_code']},"; $sql .= " admission_flag = {$form['admission_flag']}"; $sql .= " WHERE community_id = {$community_id_seq}"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // (2) コミュニティプロフィール $contents_form = array(); $contents_form['community_id'] = $community_id_seq; $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D07'), $contents_type_master_array); $contents_form['contents_value'] = $org_form['community_profile']; $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D07')); $ret = ACSCommunity::set_contents($contents_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // (3) 参加資格 (join_trusted_community) $join_trusted_community_form = array(); $join_trusted_community_form['community_id'] = $community_id_seq; // join_trusted_community 前準備 旧データの一括削除 $ret = ACSCommunity::delete_join_trusted_community($join_trusted_community_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } //登録 if (is_array($org_form['join_trusted_community_id_array'])) { foreach ($org_form['join_trusted_community_id_array'] as $trusted_community_id) { $join_trusted_community_form['trusted_community_id'] = $trusted_community_id; $ret = ACSCommunity::set_join_trusted_community($join_trusted_community_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } } } // (4) 公開範囲 電子掲示板 // contents $contents_form = array(); $contents_form['community_id'] = $community_id_seq; $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D41'), $contents_type_master_array); $contents_form['contents_value'] = ''; $contents_form['open_level_code'] = $org_form['bbs_open_level_code']; $ret = ACSCommunity::set_contents($contents_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // contents_trusted_community if (is_array($org_form['bbs_trusted_community_id_array'])) { $contents_trusted_community_form = array(); $contents_trusted_community_form['community_id'] = $community_id_seq; $contents_trusted_community_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D41'), $contents_type_master_array); $contents_trusted_community_form['open_level_code'] = $org_form['bbs_open_level_code']; // contents_trusted_community 前準備 旧データの一括削除 $ret = ACSCommunity::update_contents_trusted_community($contents_trusted_community_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } //登録 foreach ($org_form['bbs_trusted_community_id_array'] as $trusted_community_id) { $contents_trusted_community_form['trusted_community_id'] = $trusted_community_id; $ret = ACSCommunity::set_contents_trusted_community($contents_trusted_community_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } } } // (5) 公開範囲 コミュニティフォルダ (cotents) // contents $contents_form = array(); $contents_form['community_id'] = $community_id_seq; $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D31'), $contents_type_master_array); $contents_form['contents_value'] = ''; $contents_form['open_level_code'] = $org_form['community_folder_open_level_code']; $ret = ACSCommunity::set_contents($contents_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // contents_trusted_community if (is_array($org_form['community_folder_trusted_community_id_array'])) { $contents_trusted_community_form = array(); $contents_trusted_community_form['community_id'] = $community_id_seq; $contents_trusted_community_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D31'), $contents_type_master_array); $contents_trusted_community_form['open_level_code'] = $org_form['community_folder_open_level_code']; // contents_trusted_community 前準備 旧データの一括削除 $ret = ACSCommunity::update_contents_trusted_community($contents_trusted_community_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // 登録 foreach ($org_form['community_folder_trusted_community_id_array'] as $trusted_community_id) { $contents_trusted_community_form['trusted_community_id'] = $trusted_community_id; $ret = ACSCommunity::set_contents_trusted_community($contents_trusted_community_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } } } // (6) 公開範囲 全体 // contents $contents_form = array(); $contents_form['community_id'] = $community_id_seq; $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D00'), $contents_type_master_array); $contents_form['contents_value'] = ''; $contents_form['open_level_code'] = $org_form['self_open_level_code']; $ret = ACSCommunity::set_contents($contents_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // (7) コミュニティML // contents // コミュニティMLアドレス if ($org_form['community_ml_address']) { $contents_form = array(); $contents_form['community_id'] = $community_id_seq; $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D61'), $contents_type_master_array); $contents_form['contents_value'] = $org_form['community_ml_address']; $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D61')); $ret = ACSCommunity::set_contents($contents_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } // コミュニティMLステータス $contents_form = array(); $contents_form['community_id'] = $community_id_seq; $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D62'), $contents_type_master_array); $contents_form['contents_value'] = 'QUEUE'; $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D40'), ACSMsg::get_mst('contents_type_master', 'D62')); $ret = ACSCommunity::set_contents($contents_form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); return $ret; } } // COMMIT ACSDB::_do_query("COMMIT"); return $community_id_seq; }
/** * 外部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; }
/** * ダイアリーを登録する * * @param $form ダイアリー情報の配列 * @return 成功(登録されたダイアリーID) / 失敗(false) */ static function set_diary($form) { $org_form = $form; ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); // BEGIN //ACSDB::_do_query("BEGIN"); $diary_id_seq = ACSDB::get_next_seq('diary_id_seq'); // diary $sql = "INSERT INTO diary"; $sql .= " (diary_id, community_id, subject, body, open_level_code, diary_delete_flag)"; $sql .= " VALUES ({$diary_id_seq}, {$form['user_community_id']}, {$form['subject']}, {$form['body']}, {$form['open_level_code']},'f')"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); echo "ERROR: insert diary error"; return $ret; } $form = $org_form; if ($form['new_file'] != "") { //画像ファイルの登録 $file_obj = $form['new_file']; $ret = $file_obj->save_upload_file('DIARY'); //ファイルをディスクに保存 if ($ret) { $ret = $file_obj->add_file(); //ファイル情報をDBへ保存 } if ($ret) { $ret = ACSDiaryFile::insert_diary_file($file_obj, $diary_id_seq); } if (!$ret) { ACSDB::_do_query("ROLLBACK"); echo "ERROR: insert diary_file error"; return $ret; } } // diary_trusted_community // 友人に公開を選択した場合 $open_level_master_array = ACSDB::get_master_array('open_level'); // 友人に公開 if ($open_level_master_array[$form['open_level_code']] == ACSMsg::get_mst('open_level_master', 'D05')) { // マイフレンズグループを指定した場合 if ($form['trusted_community_flag']) { foreach ($form['trusted_community_id_array'] as $trusted_community_id) { $trusted_community_id = pg_escape_string($trusted_community_id); $sql = "INSERT INTO diary_trusted_community"; $sql .= " (diary_id, trusted_community_id)"; $sql .= " VALUES ({$diary_id_seq}, {$trusted_community_id})"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); echo "ERROR: insert diary_trusted_community error:FRIEND"; return $ret; } } } else { // 全てのマイフレンズ $trusted_community_id = ACSUser::get_friends_community_id($form['user_community_id']); $sql = "INSERT INTO diary_trusted_community"; $sql .= " (diary_id, trusted_community_id)"; $sql .= " VALUES ({$diary_id_seq}, {$trusted_community_id})"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); echo "ERROR: insert diary_trusted_community error:ALL"; return $ret; } } } // COMMIT //ACSDB::_do_query("COMMIT"); if ($ret) { return $diary_id_seq; } else { return false; } }
function validate() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $open_level_master_array = ACSDB::get_master_array('open_level'); $params =& $request->getParameters(); $result = true; // RSS URL if ($params['external_rss_url'] != '' && !preg_match('/^http:\\/\\/.+/', $params['external_rss_url'])) { $request->setError('external_rss_url', ACSMsg::get_msg('Community', 'EditExternalRSSAction.class.php', 'M005')); $result = false; } // 公開範囲 if ($open_level_master_array[$params['external_rss_url_open_level_code']] == ACSMsg::get_mst('open_level_master', 'D06')) { if ($params['external_rss_public_release_expire_term'] != '' && (!preg_match('/^[0-9]+/', $params['external_rss_public_release_expire_term']) || intval($params['external_rss_public_release_expire_term']) < 1)) { $request->setError('external_rss_public_release_expire_term', ACSMsg::get_msg('Community', 'EditExternalRSSAction.class.php', 'M006')); $result = false; } } return $result; }
/** * 掲示板の親記事を登録する * * @param 親記事情報の配列 * @return 成功(true) / 失敗(false) */ static function set_bbs($form) { $org_form = $form; ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); // BEGIN //ACSDB::_do_query("BEGIN"); $bbs_id_seq = ACSDB::get_next_seq('bbs_id_seq'); $sql = "INSERT INTO bbs"; $sql .= " (bbs_id, community_id, user_community_id, subject, body, open_level_code, expire_date,ml_send_flag)"; $sql .= " VALUES ({$bbs_id_seq}, {$form['community_id']}, {$form['user_community_id']}, {$form['subject']}, {$form['body']}, {$form['open_level_code']}, {$form['xdate']}, " . ($org_form['is_ml_send'] == 't' ? "TRUE" : "FALSE") . ")"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "bbs insert error"; return $ret; } $form = $org_form; if ($form['new_file'] != "") { //画像ファイルの登録 $file_obj = $form['new_file']; $ret = $file_obj->save_upload_file('BBS'); //ファイルをディスクに保存 if ($ret) { $ret = $file_obj->add_file(); //ファイル情報をDBへ保存 } if ($ret) { $ret = ACSBBSFile::insert_bbs_file($file_obj, $bbs_id_seq); } if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "bbs_file insert error"; return $ret; } } // bbs_trusted_community $open_level_master_array = ACSDB::get_master_array('open_level'); // 非公開 (メンバのみ) if ($open_level_master_array[$form['open_level_code']] == ACSMsg::get_mst('open_level_master', 'D04') && is_array($form['trusted_community_id_array'])) { foreach ($form['trusted_community_id_array'] as $trusted_community_id) { $trusted_community_id = pg_escape_string($trusted_community_id); $sql = "INSERT INTO bbs_trusted_community"; $sql .= " (bbs_id, trusted_community_id)"; $sql .= " VALUES ({$bbs_id_seq}, {$trusted_community_id})"; $ret = ACSDB::_do_query($sql); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "bbs_trusted_community insert error"; return $ret; } } } if ($ret) { $ret = $bbs_id_seq; } // COMMIT //ACSDB::_do_query("COMMIT"); return $ret; }
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'); $is_new_ldap_user = $request->getAttribute('is_new_ldap_user'); $form = $request->getAttribute('form'); // 加工 // コンテンツ名の配列 $contents_name_array = array('user_name' => ACSMsg::get_mst('contents_type_master', 'D01'), 'mail_addr' => ACSMsg::get_mst('contents_type_master', 'D02'), 'belonging' => ACSMsg::get_mst('contents_type_master', 'D03'), 'speciality' => ACSMsg::get_mst('contents_type_master', 'D04'), 'birthplace' => ACSMsg::get_mst('contents_type_master', 'D05'), 'birthday' => ACSMsg::get_mst('contents_type_master', 'D06'), 'community_profile' => ACSMsg::get_mst('contents_type_master', 'D07'), 'community_profile_login' => ACSMsg::get_mst('contents_type_master', 'D08'), 'community_profile_friend' => ACSMsg::get_mst('contents_type_master', 'D09'), 'friends_list' => ACSMsg::get_mst('contents_type_master', 'D11'), 'mail_lang' => ACSMsg::get_mst('contents_type_master', 'D51')); // 入力エラー時の復元処理 if (is_array($form)) { // コンテンツ種別マスタ $contents_type_master_array = ACSDB::get_master_array('contents_type'); // 公開範囲マスタ $open_level_master_array = ACSDB::get_master_array('open_level'); // $target_user_info_row[contents_row_array]の復元 // ニックネーム $target_user_info_row['community_name'] = $form['community_name']; // 他 foreach ($contents_name_array as $contents_key => $contents_name) { $target_user_info_row['contents_row_array'][$contents_key]['contents_type_code'] = array_search($contents_name, $contents_type_master_array); $target_user_info_row['contents_row_array'][$contents_key]['contents_type_name'] = $contents_name; if ($contents_key != 'user_name') { $target_user_info_row['contents_row_array'][$contents_key]['contents_value'] = $form[$contents_key]; } $target_user_info_row['contents_row_array'][$contents_key]['open_level_code'] = $form['open_level_code_array'][$contents_key]; $target_user_info_row['contents_row_array'][$contents_key]['open_level_name'] = $open_level_master_array[$form['open_level_code_array'][$contents_key]]; // 信頼済みマイフレンズグループコミュニティ if ($form['trusted_community_id_csv_array'][$contents_key] != '') { $target_user_info_row['contents_row_array'][$contents_key]['trusted_community_row_array'] = array(); $trusted_community_id_array = explode(',', $form['trusted_community_id_csv_array'][$contents_key]); foreach ($trusted_community_id_array as $trusted_community_id) { // マイフレンズグループコミュニティ情報を取得 $friends_group_community_row = ACSCommunity::get_community_row($trusted_community_id); array_push($target_user_info_row['contents_row_array'][$contents_key]['trusted_community_row_array'], $friends_group_community_row); } $target_user_info_row['contents_row_array'][$contents_key]['trusted_community_flag'] = 1; $target_user_info_row['contents_row_array'][$contents_key]['trusted_community_id_csv'] = $form['trusted_community_id_csv_array'][$contents_key]; } else { unset($target_user_info_row['contents_row_array'][$contents_key]['trusted_community_row_array']); unset($target_user_info_row['contents_row_array'][$contents_key]['trusted_community_flag']); unset($target_user_info_row['contents_row_array'][$contents_key]['trusted_community_id_csv']); } } } else { // データが存在しないときはデフォルトの値を取得する foreach ($contents_name_array as $contents_key => $contents_name) { if (!$target_user_info_row['contents_row_array'][$contents_key]) { $target_user_info_row['contents_row_array'][$contents_key] = ACSCommunity::get_empty_contents_row(ACSMsg::get_mst('community_type_master', 'D10'), $contents_name); } } } // URL $action_url = $this->getControllerPath('User', 'EditProfile') . '&id=' . $target_user_info_row['user_community_id']; $back_url = $this->getControllerPath('User', 'Index') . '&id=' . $target_user_info_row['user_community_id']; // 信頼済みコミュニティ設定URL $set_open_level_for_profile_url = $this->getControllerPath('User', 'SetOpenLevelForProfile') . '&id=' . $target_user_info_row['user_community_id']; // テンプレート $this->setScreenId("0001"); $this->setTemplate('EditProfile.tpl.php'); // set $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); $this->setAttribute('target_user_info_row', $target_user_info_row); $this->setAttribute('is_new_ldap_user', $is_new_ldap_user); $this->setAttribute('action_url', $action_url); $this->setAttribute('back_url', $back_url); $this->setAttribute('set_open_level_for_profile_url', $set_open_level_for_profile_url); return parent::execute(); }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるコミュニティIDを取得 $form = $request->ACSgetParameters(); // 待機種別マスタ $waiting_type_master_array = ACSDB::get_master_array('waiting_type'); // 待機状態マスタ $waiting_status_master_array = ACSDB::get_master_array('waiting_status'); // 待機情報 $waiting_row = ACSWaiting::get_waiting_row($form['waiting_id']); // コミュニティ情報 $community_row = ACSCommunity::get_community_row($waiting_row['community_id']); // forward $done_obj = new ACSDone(); if ($form['accept_button']) { // 承認ボタン押下時 // ACSDB::_do_query("BEGIN"); if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D20')) { // コミュニティメンバ追加 $community_member_form = array(); $community_member_form['community_id'] = $waiting_row['community_id']; $community_member_form['user_community_id'] = $waiting_row['waiting_community_id']; $ret = ACSCommunity::set_community_member($community_member_form); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D40')) { // コミュニティ間リンク設定 $ret = ACSCommunity::set_community_link($waiting_row['community_id'], $waiting_row['waiting_community_id']); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D50')) { // コミュニティ間リンク設定 $ret = ACSCommunity::set_community_link($waiting_row['waiting_community_id'], $waiting_row['community_id']); } if ($ret) { // 承認済みをセット $ret = ACSWaiting::update_waiting_waiting_status_code($form['waiting_id'], ACSMsg::get_mst('waiting_status_master', 'D20'), $acs_user_info_row['user_community_id'], $form['reply_message']); if ($ret) { ACSDB::_do_query("COMMIT"); // 整合性保持 if ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D20')) { // 参加の重複を解除 ACSWaiting::update_waiting_for_join_community($waiting_row['community_id'], $waiting_row['waiting_community_id']); // 招待の重複を解除 ACSWaiting::update_waiting_for_invite_to_community($waiting_row['waiting_community_id'], $waiting_row['community_id']); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D40')) { // 親コミュニティ追加の重複解除 ACSWaiting::update_waiting_for_parent_community_link($waiting_row['community_id'], $waiting_row['waiting_community_id']); // サブコミュニティ追加の重複解除 ACSWaiting::update_waiting_for_sub_community_link($waiting_row['waiting_community_id'], $waiting_row['community_id']); } elseif ($waiting_row['waiting_type_name'] == ACSMsg::get_mst('waiting_type_master', 'D50')) { // サブコミュニティ追加の重複解除 ACSWaiting::update_waiting_for_sub_community_link($waiting_row['community_id'], $waiting_row['waiting_community_id']); // 親コミュニティ追加の重複解除 ACSWaiting::update_waiting_for_parent_community_link($waiting_row['waiting_community_id'], $waiting_row['community_id']); } // 返信メッセージ if ($form['reply_message'] != '') { $ret = ACSWaiting::send_admission_accept_notify_mail($form['waiting_id']); } $done_obj->set_title(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'FIN_ADM'), array("{WAITING_TYPE_NAME}" => $waiting_row[waiting_type_name]))); $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M001')); } else { $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M002')); } } else { ACSDB::_do_query("ROLLBACK"); } } elseif ($form['reject_button']) { // 拒否ボタン押下時 $ret = ACSWaiting::update_waiting_waiting_status_code($form['waiting_id'], ACSMsg::get_mst('waiting_status_master', 'D30'), $acs_user_info_row['user_community_id']); if ($ret) { $done_obj->set_title(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'FIN_DIS'), array("{WAITING_TYPE_NAME}" => $waiting_row[waiting_type_name]))); $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M001')); } else { $done_obj->set_message(ACSMsg::get_msg('Community', 'WaitingListAction.class.php', 'M002')); } } $done_obj->add_link(ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'WaitingListAction.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'); $target_community_row = $request->getAttribute('target_community_row'); $community_folder_obj = $request->getAttribute('community_folder_obj'); $target_folder_obj = $community_folder_obj->get_folder_obj(); $folder_obj_array = $target_folder_obj->get_folder_obj_array(); $file_obj_array = $target_folder_obj->get_file_obj_array(); $mode = $request->getAttribute('mode'); if ($mode == 'group') { $file_detail_info_row_array = $request->getAttribute('file_detail_info_row_array'); $file_contents_type_master_row_array_array = $request->getAttribute('file_contents_type_master_row_array_array'); } // URL に付加する target_community $target_community_info = '&community_id=' . $target_community_row['community_id']; // URL に付加する target_folder $target_folder_info = '&folder_id=' . $target_folder_obj->get_folder_id(); // コミュニティのURL $community_top_page_url = $this->getControllerPath('Community', 'Index'); $community_top_page_url .= $target_community_info; // フォルダパス情報 $path_folder_obj_array = $community_folder_obj->get_path_folder_obj_array(); // 表示用に加工 $path_folder_obj_row_array = $this->make_display_folder_row_array($path_folder_obj_array, $target_community_info, $target_folder_info, $target_community_row, $mode, $controller); // フォルダの公開範囲 $target_folder_open_level_row['name'] = $target_folder_obj->get_open_level_name(); $target_folder_open_level_row['trusted_community_row_array'] = $this->make_display_trusted_community_row_array($target_folder_obj->get_trusted_community_row_array(), &$controller); // コミュニティメンバかどうか $is_community_member = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $target_community_row['community_id']); // ルートフォルダかどうか $is_root_folder = $target_folder_obj->get_is_root_folder(); // プットフォルダかどうか $is_put_folder = $target_folder_obj->is_put_folder($target_community_row['community_id']); // ファイルアップロード URL $upload_file_url = $this->getControllerPath('Community', 'UploadFile'); $upload_file_url .= $target_community_info; $upload_file_url .= $target_folder_info; /* フォルダ・ファイル一覧 */ // フォルダ一覧 $display_folder_obj_array = $target_folder_obj->get_display_folder_obj_array_for_community($acs_user_info_row, $target_community_row); $folder_row_array = $this->make_display_folder_row_array($display_folder_obj_array, $target_community_info, $target_folder_info, $target_community_row, $mode, $controller); if ($mode == 'group') { // グループ表示 // // ファイルカテゴリマスタ $file_category_master_array = ACSDB::get_master_array('file_category'); // 指定なしのファイルカテゴリコード $default_file_category_code = array_search(ACSMsg::get_mst('file_category_master', 'D0000'), $file_category_master_array); $file_detail_info_row_array_array = array(); foreach ($file_category_master_array as $file_category_code => $file_category_name) { $file_detail_info_row_array_array[$file_category_code] = array(); $file_detail_info_row_array_array[$file_category_code]['file_category_code'] = $file_category_code; $file_detail_info_row_array_array[$file_category_code]['file_category_name'] = $file_category_name; $file_detail_info_row_array_array[$file_category_code]['file_detail_info_row_array'] = array(); } // Actionで取得した$file_detail_info_rowの配列を、ファイル種類コードごとの配列に振り分ける foreach ($file_detail_info_row_array as $file_detail_info_row) { // ファイルカテゴリコード $file_category_code = $file_detail_info_row['file_category_code']; // リンクURL $file_detail_info_row['link_url'] = $this->getControllerPath('Community', 'DownloadFile') . $target_community_info . '&file_id=' . $file_detail_info_row['file_id'] . $target_folder_info; // ファイル詳細情報URL $file_detail_info_row['file_detail_url'] = $this->getControllerPath('Community', 'FileDetail') . $target_community_info . '&file_id=' . $file_detail_info_row['file_id'] . $target_folder_info; // サムネイル画像URL if ($file_category_master_array[$file_category_code] == ACSMsg::get_mst('file_category_master', 'D0003')) { $file_detail_info_row['image_url'] = $this->getControllerPath('Community', 'DownloadFile') . $target_community_info . '&file_id=' . $file_detail_info_row['file_id'] . $target_folder_info . '&mode=thumb'; } // push if ($file_category_code == '') { // ファイルカテゴリコードが存在しない場合はデフォルト(指定なし)扱い $file_category_code = $default_file_category_code; } array_push($file_detail_info_row_array_array[$file_category_code]['file_detail_info_row_array'], $file_detail_info_row); } // フォルダ 通常表示URL $folder_url = $this->getControllerPath('Community', 'Folder'); $folder_url .= $target_community_info; $folder_url .= $target_folder_info; } else { // ファイル一覧 $file_row_array = array(); foreach ($file_obj_array as $file_obj) { $a_file = array(); $link_url = ""; $update_user_community_link_url = ""; $link_url = $this->getControllerPath('Community', 'DownloadFile'); $link_url .= $target_community_info; $link_url .= "&file_id=" . $file_obj->get_file_id(); $link_url .= $target_folder_info; $update_user_community_link_url = $this->getControllerPath('User', 'Index'); $update_user_community_link_url .= "&id=" . $file_obj->get_update_user_community_id(); $a_file['name'] = $file_obj->get_display_file_name(); $a_file['file_id'] = $file_obj->get_file_id(); $a_file['link_url'] = $link_url; $a_file['file_size'] = $file_obj->get_file_size_kb(); $a_file['update_user_community_name'] = $file_obj->get_update_user_community_name(); $a_file['update_user_community_link_url'] = $update_user_community_link_url; $a_file['update_date'] = $file_obj->get_update_date_yyyymmddhmi(); // ファイル詳細情報URL $a_file['detail_url'] = $this->getControllerPath('Community', 'FileDetail'); $a_file['detail_url'] .= $target_community_info; $a_file['detail_url'] .= "&file_id=" . $file_obj->get_file_id(); $a_file['detail_url'] .= $target_folder_info; // プットファイルかどうか if ($file_obj->get_owner_community_id() == $target_community_row['community_id']) { $a_file['is_put'] = false; } else { $a_file['is_put'] = true; } array_push($file_row_array, $a_file); } // フォルダ グループ表示URL $folder_group_mode_url = $this->getControllerPath('Community', 'Folder'); $folder_group_mode_url .= $target_community_info; $folder_group_mode_url .= $target_folder_info; $folder_group_mode_url .= '&mode=group'; } // ルートフォルダのファイルは、非公開として扱う if (!$is_community_member && $is_root_folder) { $file_row_array = array(); $file_detail_info_row_array_array = array(); } // フォルダ作成 URL if (!$is_put_folder) { $edit_folder_url = $this->getControllerPath('Community', 'EditFolder'); $edit_folder_url .= $target_community_info; $edit_folder_url .= $target_folder_info; } else { $edit_folder_url = ""; } // 名前変更URL $rename_folder_url = ""; $rename_folder_url = $this->getControllerPath('Community', 'RenameFolderList'); $rename_folder_url .= $target_community_info; $rename_folder_url .= $target_folder_info; // 削除URL $delete_folder_url = ""; $delete_folder_url = $this->getControllerPath('Community', 'DeleteFolder'); $delete_folder_url .= $target_community_info; $delete_folder_url .= $target_folder_info; $delete_folder_url .= "&action_type=confirm"; // 遷移する先の画面は確認画面 // 移動URL $move_folder_url = ""; $move_folder_url = $this->getControllerPath('Community', 'MoveFolderList'); $move_folder_url .= $target_community_info; $move_folder_url .= $target_folder_info; // コミュニティフォルダ検索URL $search_folder_url = $this->getControllerPath('Community', 'SearchFolder'); $search_folder_url .= $target_community_info; $this->setAttribute('target_folder_open_level_row', $target_folder_open_level_row); $this->setAttribute('community_top_page_url', $community_top_page_url); $this->setAttribute('is_community_member', $is_community_member); $this->setAttribute('is_root_folder', $is_root_folder); $this->setAttribute('is_put_folder', $is_put_folder); $this->setAttribute('upload_file_url', $upload_file_url); $this->setAttribute('folder_put_community_url', $folder_put_community_url); $this->setAttribute('target_user_community_name', $target_community_row['community_name']); $this->setAttribute('path_folder_obj_row_array', $path_folder_obj_row_array); $this->setAttribute('folder_row_array', $folder_row_array); $this->setAttribute('file_row_array', $file_row_array); // 操作メニュー $this->setAttribute('edit_folder_url', $edit_folder_url); $this->setAttribute('rename_folder_url', $rename_folder_url); $this->setAttribute('delete_folder_url', $delete_folder_url); $this->setAttribute('move_folder_url', $move_folder_url); $this->setAttribute('search_folder_url', $search_folder_url); $this->setAttribute('mode', $mode); if ($mode == 'group') { $this->setAttribute('folder_url', $folder_url); $this->setAttribute('file_detail_info_row_array_array', $file_detail_info_row_array_array); $this->setAttribute('file_contents_type_master_row_array_array', $file_contents_type_master_row_array_array); } else { $this->setAttribute('folder_group_mode_url', $folder_group_mode_url); } // エラーメッセージ $this->setAttribute('error_message', $this->getErrorMessage($controller, $request, $user)); // テンプレート if ($mode == 'group') { $this->setScreenId("0001"); $this->setTemplate('Folder_group.tpl.php'); } else { $this->setScreenId("0001"); $this->setTemplate('Folder.tpl.php'); } return parent::execute(); }