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(); $target_user_community_id = $request->getParameter('id'); $image_new_mode = $request->getParameter('image_new_mode'); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $file_id = $request->getParameter('file_id'); $open_level_code = $request->getParameter('open_level_code'); if ($_FILES['new_file']["name"] == "") { print "ERROR: This is not imagefile format."; } // ファイル情報取得 $file_obj = ACSFile::get_upload_file_info_instance($_FILES['new_file'], $target_user_community_id, $acs_user_info_row['user_community_id']); //ファイルの種類チェック $image_check = $file_obj->is_image_file(); if (!$image_check) { print "ERROR: This is not imagefile format."; } /* ファイルアップロード処理 */ // ファイルの保存 $ret = $file_obj->save_upload_file('PROFILE'); ACSDB::_do_query("BEGIN"); // 追加のみ $ret = $file_obj->add_file(); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Update image failed.:file_info"; } else { // 上書きされるファイルIDを取得する $delete_file_id = ACSCommunityImageFileModel::get_file_id_for_open_level($target_user_community_id, $open_level_code); // 一度削除する(空振りもOK) $ret = ACSCommunityImageFileModel::delete_community_image_with_open_level($file_obj, $open_level_code); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Update image failed.:image_file"; } else { //community_image_fileテーブルへの追加 $ret = ACSCommunityImageFileModel::put_community_image_with_open_level($file_obj, $open_level_code); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Update image failed.:image_file"; } else { // 上書きされるファイルがある場合→削除 if ($delete_file_id) { $delete_file_obj = ACSFile::get_file_info_instance($delete_file_id); $delete_file_obj->delete_file(); } ACSDB::_do_query("COMMIT"); //追加モードのコミット } } } /* 表示アクション呼び出し */ $image_change_url = $this->getControllerPath('User', 'EditProfileImage'); $image_change_url .= '&id=' . $target_user_community_id; header("Location: {$image_change_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'); // 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 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(); //削除処理を行う $target_user_community_id = $request->getParameter('community_id'); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $file_id = $request->getParameter('file_id'); // ファイル情報取得 $file_obj = ACSFile::get_file_info_instance($file_id); //ファイル情報テーブルのデータ削除 ACSDB::_do_query("BEGIN"); $ret = $file_obj->delete_file(); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Remove imagefile failed.:file_info"; } else { //community_image_fileテーブルのデータ削除 $ret = ACSCommunityImageFileModel::delete_community_image($file_obj); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Remove imagefile failed.:image_file"; } else { ACSDB::_do_query("COMMIT"); } } //表示 $image_change_url = $this->getControllerPath('Community', 'EditProfileImage'); $image_change_url .= '&community_id=' . $target_user_community_id; header("Location: {$image_change_url}"); 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; }
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'); $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 execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); //mode 画面の遷移を取得する $move_id = $request->getParameter('move_id'); // ユーザー情報 $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象となるUserIDを取得 $user_community_id = $request->getParameter('id'); // ユーザ情報 $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id); /* 入力画面より */ if ($move_id == 1) { //☆☆ ここからほぼ同じ // 画面上のフォーム情報を取得する $form['subject'] = $request->getParameter('subject'); //件名:subject $form['body'] = $request->getParameter('body'); //内容:body $form['info_mail'] = $request->getParameter('info_mail'); //メール通知:info_mail $user->setAttribute('new_form_obj', $form); $request->setAttribute('target_user_info_row', $target_user_info_row); //☆☆ ここまでほぼ同じ return View::SUCCESS; /* 登録確定ボタン「はい」より */ } else { if ($move_id == 2) { $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $user_community_id = $request->getParameter('id'); //☆☆ ここからほぼ同じ // 画面上のフォーム情報を取得する $form = $user->getAttribute('new_form_obj'); $new_file_obj = $form['file_obj']; $form['user_community_id'] = $user_community_id; $form['acs_user_info_id'] = $acs_user_info_row['user_community_id']; //☆☆ ここまでほぼ同じ // DBへの書き込み等 ACSDB::_do_query("BEGIN"); // Messageテーブル情報 $ret = ACSMessage::set_message($form); if ($ret) { ACSDB::_do_query("COMMIT"); } else { ACSDB::_do_query("ROLLBACK"); } // 通知メール送信処理 if ($form['info_mail'] == "on") { ACSMessage::send_info_mail($ret, $form['user_community_id'], $form['acs_user_info_id']); } // 書き込み後、GETの処理へ $action_url = $this->getControllerPath('User', 'MessageBox') . '&id=' . $acs_user_info_row['user_community_id'] . '&move_id=2'; header("Location: {$action_url}"); } } }
/** * file_access_history UPDATE * * @param $form ファイルアクセス履歴情報 * @return 成功(true) / 失敗(false) */ static function update_file_access_history($form) { ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); $sql = "UPDATE file_access_history" . " SET" . " access_date = " . $form['access_date'] . " WHERE user_community_id = " . $form['user_community_id'] . " AND file_id = " . $form['file_id']; $ret = ACSDB::_do_query($sql); return $ret; }
/** * システムアナウンスを削除する (掲載中止) * * @param システムアナウンスID * @return 成功(true) / 失敗(false) */ static function delete_system_announce($system_announce_id) { $system_announce_id = pg_escape_string($system_announce_id); $sql = "UPDATE system_announce"; $sql .= " SET system_announce_delete_flag = 't'"; $sql .= " WHERE system_announce_id = '{$system_announce_id}'"; ACSDB::_do_query($sql); return $ret; }
/** * 値更新 * * @param $system_config_group 更新対象のキー * @param $keyword 更新対象のキー * @param $update_value 更新する値 */ static function update_system_config_value($system_config_group_name, $keyword, $update_value) { $sql = "UPDATE system_config"; $sql .= " SET"; $sql .= " value = '" . pg_escape_string($update_value) . "'"; $sql .= " WHERE"; $sql .= " keyword = '" . $keyword . "'"; $ret = ACSDB::_do_query($sql); return $ret; }
/** * ファイル履歴コメントを登録する * * @param $file_history_id ファイル履歴ID * @param $entry_user_community_id 登録者のユーザコミュニティID * @param $comment コメント * @return */ static function set_file_history_comment($file_history_id, $entry_user_community_id, $comment) { $file_history_comment_id_seq = ACSDB::get_next_seq('file_history_comment_id_seq'); $comment = ACSLib::get_sql_value(pg_escape_string($comment)); $sql = "INSERT INTO file_history_comment"; $sql .= " (file_history_comment_id, file_history_id, user_community_id, comment)"; $sql .= " VALUES ({$file_history_comment_id_seq}, {$file_history_id}, '{$entry_user_community_id}', {$comment})"; $ret = ACSDB::_do_query($sql); return $ret; }
static function insert_community_member($form) { ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); $sql = "INSERT INTO community_member"; $sql .= " (community_id, user_community_id, community_member_type_code)"; $sql .= " VALUES ({$form['community_id']}, {$form['user_community_id']}, {$form['community_member_type_code']})"; $ret = ACSDB::_do_query($sql); return $ret; }
/** * waiting INSERT * * @param $form 待機コミュニティメンバ情報 * @return 成功(true) / 失敗(false) */ static function insert_waiting($form) { ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); $sql = "INSERT INTO waiting"; $sql .= " (waiting_id, community_id, waiting_community_id, waiting_type_code, waiting_status_code, message, entry_user_community_id)"; $sql .= " VALUES ({$form['waiting_id']}, {$form['community_id']}, {$form['waiting_community_id']}, {$form['waiting_type_code']}, {$form['waiting_status_code']}, {$form['message']}, {$form['entry_user_community_id']})"; $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'); $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 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; } /* コミュニティ情報取得 */ $target_community_id = $request->getParameter('community_id'); $target_community_row = ACSCommunity::get_community_row($request->getParameter('community_id')); /* 削除処理 */ ACSDB::_do_query("BEGIN"); $ret = ACSCommunity::delete_community($target_community_id); if (!$ret) { ACSDB::_do_query("ROLLBACK"); "ERROR : delete community failed"; exit; } // フォルダのディレクトリ移動 $from_dir = ACS_FOLDER_DIR . "/"; $from_dir .= ACSFile::get_upload_file_save_path($target_community_id); if (file_exists($from_dir)) { $to_dir = ACS_TRASH_FOLDER_DIR . "/"; $to_dir .= ACSFile::get_upload_file_save_path($target_community_id); if (!file_exists(ACS_TRASH_FOLDER_DIR)) { // 置き場所ディレクトリがなければ作成する mkdir(ACS_TRASH_FOLDER_DIR); chmod(ACS_TRASH_FOLDER_DIR, 0777); } $ret = rename($from_dir, $to_dir); if (!$ret) { ACSDB::_do_query("ROLLBACK"); "ERROR : delete community failed"; exit; } } ACSDB::_do_query("COMMIT"); /* 完了画面表示 */ // 引数セット $message = ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'DeleteCommunityAction.class.php', 'DELETECM'), array('{TARGET_COMMUNITY_NAME}' => $target_community_row['community_name'])); $top_page_url = $this->getControllerPath('User', 'Index'); $top_page_link_name = ACSMsg::get_msg('Community', 'DeleteCommunityAction.class.php', 'M001'); $done_obj = new ACSDone(); $done_obj->set_title(ACSMsg::get_msg('Community', 'DeleteCommunityAction.class.php', 'M002')); $done_obj->set_message($message); $done_obj->add_link($top_page_link_name, $top_page_url); $request->setAttribute('done_obj', $done_obj); // 画面呼び出し $controller->forward('Common', 'Done'); }
/** * bbs_access_history UPDATE * * @param $form 掲示板アクセス履歴情報 * @return 成功(true) / 失敗(false) */ static function update_bbs_access_history($form) { ACSLib::escape_sql_array($form); ACSLib::get_sql_value_array($form); $sql = "UPDATE bbs_access_history"; $sql .= " SET"; $sql .= " access_date = {$form['access_date']}"; $sql .= " WHERE user_community_id = {$form['user_community_id']}"; $sql .= " AND bbs_id = {$form['bbs_id']}"; $ret = ACSDB::_do_query($sql); return $ret; }
function getDefaultView() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 対象のmessage_idを取得 $message_id = $request->ACSgetParameter('message_id'); // ユーザ情報 $user_community_id = $request->ACSgetParameter('id'); $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($user_community_id); // 他ユーザのデータが見えないようチェック if ($this->get_execute_privilege() == 2 && $acs_user_info_row["user_community_id"] != $user_community_id) { // ログイン画面に遷移 $controller->forward("User", "Login"); return; } if ($this->get_execute_privilege() == 1 && $acs_user_info_row["user_community_id"] != $user_community_id) { // このページへアクセスすることはできません。 $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } //送信済画面の処理 $move_id = $request->getParameter('move_id'); if ($move_id == 2) { // 送信済メッセージ詳細 $message_row = ACSMessage::get_send_message_row($message_id); } else { // 受信メッセージ詳細 $message_row = ACSMessage::get_receive_message_row($message_id); // 未読・既読判定 if ($message_row['read_flag'] == "f") { // 未読時、DBのフラグ変更 $message_receiver_id = $message_row['message_receiver_id']; ACSDB::_do_query("BEGIN"); // message_receiverテーブル情報変更 $ret = ACSMessage::read_message($message_receiver_id); if ($ret) { ACSDB::_do_query("COMMIT"); } else { ACSDB::_do_query("ROLLBACK"); } } } // set $request->setAttribute('target_user_info_row', $target_user_info_row); $request->setAttribute('message_row', $message_row); $request->setAttribute('move_id', $move_id); return View::INPUT; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); //mode 画面の遷移を取得する $move_id = $request->getParameter('move_id'); // ユーザー情報 $acs_user_info_row = $user->getAttribute('acs_user_info_row'); /* 入力画面より */ if ($move_id == 1) { //☆☆ ここからほぼ同じ // 画面上のフォーム情報を取得する $form['body'] = $request->getParameter('body'); //内容:body $form['user_community_id'] = $acs_user_info_row['user_community_id']; $user->setAttribute('new_form_obj', $form); $target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($form['user_community_id']); $request->setAttribute('target_user_info_row', $target_user_info_row); //☆☆ ここまでほぼ同じ return View::SUCCESS; /* 登録確定ボタン「はい」より */ } else { if ($move_id == 2) { $user_id = $request->getParameter('id'); // 対象のdiary_idを取得 $diary_id = $request->getParameter('diary_id'); //☆☆ ここからほぼ同じ // 画面上のフォーム情報を取得する $form = $user->getAttribute('new_form_obj'); $form['diary_id'] = $diary_id; //☆☆ ここまでほぼ同じ // DBへの書き込み等 ACSDB::_do_query("BEGIN"); //DiaryCommentテーブル情報 $ret = ACSDiary::set_diary_comment($form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); echo "ERROR: Insert dairy comment failed."; return; } ACSDB::_do_query("COMMIT"); // 書き込み後、GETの処理へ $diary_comment_top_page_url = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $acs_user_info_row['user_community_id'] . '&diary_id=' . $diary_id . '&move_id=4'; header("Location: {$diary_comment_top_page_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'); $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 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; }
function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); //削除処理を行う $target_user_community_id = $request->getParameter('id'); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $file_id = $request->getParameter('file_id'); $open_level_code = $request->getParameter('open_level_code'); if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // ファイル情報取得 $file_obj = ACSFile::get_file_info_instance($file_id); //ファイル情報テーブルのデータ削除 ACSDB::_do_query("BEGIN"); $ret = ACSCommunityImageFileModel::delete_community_image_with_open_level($file_obj, $open_level_code); if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Delete image failed. :image_file"; } else { $row = ACSCommunityImageFileModel::get_file_id_with_open_level($file_obj->get_owner_community_id()); if ($row == NULL || $file_id != $row['file_id_ol05'] && $file_id != $row['file_id_ol02'] && $file_id != $row['file_id_ol01']) { // ファイルごと削除 $ret = $file_obj->delete_file(); } if (!$ret) { ACSDB::_do_query("ROLLBACK"); print "ERROR: Delete image failed. :image_file"; } else { ACSDB::_do_query("COMMIT"); } } //表示 $image_change_url = $this->getControllerPath('User', 'EditProfileImage'); $image_change_url .= '&id=' . $target_user_community_id; header("Location: {$image_change_url}"); 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'); /* コミュニティ情報取得 */ $target_community_id = $request->getParameter('community_id'); $target_community_row = ACSCommunity::get_community_row($request->getParameter('community_id')); /* 削除処理 */ ACSDB::_do_query("BEGIN"); $ret = ACSCommunity::delete_community_member($target_community_id, array($acs_user_info_row['user_community_id'])); if (!$ret) { ACSDB::_do_query("ROLLBACK"); "ERROR : Delete community member failed."; exit; } ACSDB::_do_query("COMMIT"); /* 完了画面表示 */ // 引数セット $message = ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'LeaveCommunityAction.class.php', 'LEAVE_CM'), array("{COMMUNITY_NAME}" => $target_community_row['community_name'])); // マイページトップページURL $top_page_url = $this->getControllerPath('User', 'Index'); $top_page_link_name = ACSMsg::get_msg('Community', 'LeaveCommunityAction.class.php', 'M001'); // コミュニティURL $community_top_page_url = $this->getControllerPath('Community', 'Index'); $community_top_page_url .= '&community_id=' . $target_community_row['community_id']; $community_top_page_link_name = ACSMsg::get_tag_replace(ACSMsg::get_msg('Community', 'LeaveCommunityAction.class.php', 'BACK_TO_CM'), array("{COMMUNITY_NAME}" => $target_community_row['community_name'])); $done_obj = new ACSDone(); $done_obj->set_title(ACSMsg::get_msg('Community', 'LeaveCommunityAction.class.php', 'M002')); $done_obj->set_message($message); $done_obj->add_link($top_page_link_name, $top_page_url); $done_obj->add_link($community_top_page_link_name, $community_top_page_url); $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'); $community_id = $request->getParameter('community_id'); $bbs_id = $request->getParameter('bbs_id'); // 入力データ $form = $request->ACSGetParameters(); $form['user_community_id'] = $acs_user_info_row['user_community_id']; // bbs更新 ACSDB::_do_query("BEGIN"); $ret = ACSBBS::update_bbs($form); if (!$ret) { ACSDB::_do_query("ROLLBACK"); exit; } ACSDB::_do_query("COMMIT"); $bbs_url = $this->getControllerPath('Community', 'BBS') . '&community_id=' . $community_id; header("Location: {$bbs_url}"); }
function 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; }
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; } // 必須チェック // Validator でできないチェックはここで行う if (!$request->getParameter('selected_folder') && !$request->getParameter('selected_file')) { // エラーの場合、処理終了 return $this->setError($controller, $request, $user, 'selected_folder', ACSMsg::get_msg('Community', 'DeleteFolderAction.class.php', 'M001')); } $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'); // 表示するページの所有者情報取得 $target_community_info_row = ACSCommunity::get_community_row($target_community_id); // フォルダ情報取得 $community_folder_obj = new ACSCommunityFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); // set $request->setAttribute('target_community_info_row', $target_community_info_row); $request->setAttribute('community_folder_obj', $community_folder_obj); /* ------------ */ /* 確認画面表示 */ /* ------------ */ if ($request->getParameter('action_type') == 'confirm') { return $this->getDefaultView(); } elseif ($request->getParameter('action_type') == 'delete') { ACSDB::_do_query("BEGIN"); // フォルダ $folder_row_array = array(); $delete_folder_id_array = $request->getParameter('selected_folder'); if ($delete_folder_id_array) { foreach ($delete_folder_id_array as $folder_id) { // 削除処理 $_folder_obj = $community_folder_obj->folder_obj->get_folder_obj($folder_id); $ret = $community_folder_obj->delete_folder($_folder_obj); if (!$ret) { ACSDB::_do_query("ROLLBACK;"); print "ERROR: Remove folder failed."; exit; } } } // ファイル $file_row_array = array(); $delete_file_id_array = $request->getParameter('selected_file'); if ($delete_file_id_array) { foreach ($delete_file_id_array as $file_id) { // 公開用ファイル情報 ACSFileDetailInfo::delete_file_public_access($file_id); // 削除処理 $_file_obj = $community_folder_obj->folder_obj->get_file_obj($file_id); $ret = $_file_obj->delete_file(); if (!$ret) { ACSDB::_do_query("ROLLBACK;"); print "ERROR: Remove file failed."; exit; } } } ACSDB::_do_query("COMMIT;"); // フォルダ表示アクション呼び出し $folder_action = $this->getControllerPath('Community', 'Folder'); $folder_action .= '&community_id=' . $target_community_id; $folder_action .= '&folder_id=' . $target_community_folder_id; header("Location: {$folder_action}"); } }
/** * ファイル公開情報を削除する * * @param file_id ファイルID * @return true(正常)/false(失敗) */ static function delete_file_public_access($file_id) { $sql = "DELETE FROM file_public_access \n\t\t\t\tWHERE file_id = " . $file_id; $ret = ACSDB::_do_query($sql); return $ret; }
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を取得 $target_community_id = $request->getParameter('community_id'); // 対象となるフォルダIDを取得 $target_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('Community', 'EditFileAction.class.php', 'M001')); return $this->handleError(); } // 表示するページの所有者情報取得 $target_community_info_row = ACSCommunity::get_community_row($target_community_id); // フォルダ情報取得 $user_folder_obj = new ACSCommunityFolder($target_community_id, $acs_user_info_row, $target_community_folder_id); // set $request->setAttribute('target_community_info_row', $target_community_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(); } /* ---------- */ /* 入力値取得 */ /* ---------- */ $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'); $input_folder_row['trusted_community_id_array'] = $request->getParameter('trusted_community_id_array'); /* ---------------------- */ /* フォルダ名重複チェック */ /* ---------------------- */ // 対象となるフォルダ配下のフォルダを取得 $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('Community', '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: Create folder failed."; exit; } } elseif ($action_type == 'update') { /* -------- */ /* 更新処理 */ /* -------- */ // 更新対象のフォルダ情報取得 $update_user_folder_obj = new ACSCommunityFolder($request->getParameter('community_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: Create folder information failed."; exit; } } ACSDB::_do_query("COMMIT;"); /* -------------------- */ /* フォルダ一覧画面表示 */ /* -------------------- */ $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $folder_action = $this->getControllerPath('Community', 'Folder'); $folder_action .= '&community_id=' . $target_community_info_row['community_id']; $folder_action .= '&folder_id=' . $target_community_folder_id; header("Location: {$folder_action}"); }