예제 #1
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     // ユーザ情報
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id);
     // 取得期間
     $term = intval($request->ACSgetParameter('term'));
     if (!$term) {
         // システム設定: マイページ: ダイアリーRSS取得期間
         $term = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D02'), 'DIARY_RSS_TERM');
     }
     // 最新のダイアリーRSS
     $diary_row_array = ACSDiary::get_new_diary_rss_row_array($user_community_id, $term);
     // set
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('diary_row_array', $diary_row_array);
     $request->setAttribute('term', $term);
     return View::SUCCESS;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     if (empty($user_community_id)) {
         $user_community_id = $acs_user_info_row['user_community_id'];
     }
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     // プロフィール
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id);
     //ユーザが閲覧者を選択した場合
     $view_mode = $request->getParameter('view_mode');
     // set
     $request->setAttribute('user_community_id', $user_community_id);
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('view_mode', $view_mode);
     return View::SUCCESS;
 }
예제 #3
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // 管理者かどうか確認
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $user_community_id = $user->getAttribute('user_id');
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id, 'include_private_flag');
     // ユーザ情報の削除フラグを変更する
     $ret = ACSUser::delete_user_community($user_community_id);
     if (!$ret) {
         echo "Warning : DB ERROR : Delete user failed.";
         return;
     }
     // ログ登録: ユーザ削除
     ACSLog::set_log($acs_user_info_row, 'Remove User', $ret, "[UserID:{$target_user_info_row['user_id']}]");
     // ユーザ一覧を表示
     $user_list_url = $this->getControllerPath('System', 'UserList');
     header("Location: {$user_list_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');
     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;
 }
예제 #5
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $target_user_community_id = $request->getParameter('id');
     $view_mode = $request->getParameter('mode');
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $target_user_info_row = ACSUser::get_user_profile_row($target_user_community_id);
     $is_permitted = false;
     /* アクセス権チェック */
     // マイページが閲覧可能かチェックする
     // 削除フラグ、全体の公開範囲をチェック
     /* 写真表示 */
     // ファイル情報取得
     // (1) 一般ユーザ(外部ユーザ)かどうか
     if (!$acs_user_info_row['is_acs_user']) {
         $image_file_id = $target_user_info_row['file_id_ol01'];
     } else {
         // (2) ログインユーザかどうか
         $image_file_id = $target_user_info_row['file_id_ol02'];
         // (3) 友人かどうか
         if (ACSUser::is_in_friends_id_array($acs_user_info_row, $target_user_info_row['user_community_id'])) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
         // (4) 本人かどうか
         if ($acs_user_info_row['user_id'] == $target_user_info_row['user_id']) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
         // (5) システム管理者かどうか
         if (ACSAccessControl::is_system_administrator($acs_user_info_row)) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
     }
     if ($image_file_id) {
         $file_obj = ACSFile::get_file_info_instance($image_file_id);
         $ret = $file_obj->view_image($view_mode);
     } else {
         $image_url = ACSUser::get_default_image_url($view_mode);
         header("Location: {$image_url}");
     }
 }
 /**
  * 初期画面
  * GETメソッドの場合、呼ばれる
  */
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     /* エラーを取得 */
     //$error_row = $user->getAttribute('error_row');
     //$user->removeAttribute('error_row');
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     // 対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     // プロフィール情報を取得
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id);
     // 公開レベルコード
     $open_level_code_row = array('05', '02', '01');
     //画像が新規登録か更新かを判定する true:新規 false:更新
     // ファイル情報の存在確認
     // ラベル
     for ($i = 0; $i < count($open_level_code_row); $i++) {
         //
         $image_file_id = $target_user_info_row['file_id_ol' . $open_level_code_row[$i]];
         if ($image_file_id) {
             $image_new_add['file_id_ol' . $open_level_code_row[$i]] = false;
         } else {
             $image_new_add['file_id_ol' . $open_level_code_row[$i]] = true;
         }
     }
     // set
     //user_community_id をviewクラスへ通知する
     $request->setAttribute('user_community_id', $user_community_id);
     //target_user_info_rowをviewクラスへ通知する
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     //画像が新規登録か更新かのimage_new_addをviewクラスへ通知する
     $request->setAttribute('image_new_add', $image_new_add);
     $request->setAttribute('open_level_code_row', $open_level_code_row);
     //		$request->setAttribute('image_file_label', $image_file_label);
     return View::INPUT;
 }
예제 #7
0
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // 管理者かどうか確認
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $form = $request->ACSGetParameters();
     $user_community_id = $user->getAttribute('user_id');
     $form['user_community_id'] = $user_community_id;
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id, 'include_private_flag');
     $post_user_info_row = ACSUser::get_user_info_row_by_user_id($form['user_id']);
     if ($post_user_info_row && $user_community_id != $post_user_info_row['user_community_id']) {
         echo ACSMsg::get_msg('System', 'EditUserAction.class.php', 'M002');
         return;
     }
     //パスワードチェック
     if ($form['passwd_change'] == 'change_on' && $form['passwd'] == $form['passwd2'] || $form['passwd_change'] == '') {
         // ユーザ情報を変更する
         $ret = ACSUser::update_user_info($form);
         if (!$ret) {
             echo "Warning: Update user information failed.";
             return;
         }
     } else {
         echo ACSMsg::get_msg('System', 'EditUserAction.class.php', 'M001');
         return;
     }
     // ログ登録: ユーザ情報変更
     ACSLog::set_log($acs_user_info_row, 'Change User Information', $ret, "[UserID:{$target_user_info_row['user_id']}]");
     // ユーザ一覧を表示
     $user_list_url = $this->getControllerPath('System', 'UserList');
     header("Location: {$user_list_url}");
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $target_user_community_id = $request->getParameter('id');
     $view_mode = $request->getParameter('mode');
     $open_level_code = $request->getParameter('open_level_code');
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $target_user_info_row = ACSUser::get_user_profile_row($target_user_community_id);
     $is_permitted = false;
     /* 写真表示 */
     // ファイル情報取得
     $image_file_id = $target_user_info_row['file_id_ol' . $open_level_code];
     if ($image_file_id) {
         $file_obj = ACSFile::get_file_info_instance($image_file_id);
         $ret = $file_obj->view_image($view_mode);
     } else {
         $image_url = ACSUser::get_default_image_url($view_mode);
         header("Location: {$image_url}");
     }
 }
예제 #9
0
 /**
  * スケジュール調整決定通知定型文取得
  *
  * @return true / false
  */
 function get_decision_mail_message($lang, $decide_adjustment_date_id)
 {
     $current_lang = ACSMsg::get_lang();
     ACSMsg::set_lang($lang);
     $msg = ACSMsg::get_serial_msg('lib', basename(__FILE__), 'DEC%03d');
     // システムURL
     $system_group = ACSMsg::get_mst('system_config_group', 'D01');
     $system_base_url = ACSSystemConfig::get_keyword_value($system_group, 'SYSTEM_BASE_URL');
     $system_base_login_url = ACSSystemConfig::get_keyword_value($system_group, 'SYSTEM_BASE_LOGIN_URL');
     // コミュニティ情報の取得
     $community_row =& ACSCommunity::get_community_row($this->community_id);
     // 決定日
     $adjustment_dates_list = $this->get_adjustment_dates();
     // 回答状況
     $person_count_array =& ACSSchedule::get_total_person_count($this->community_id, $this->schedule_id);
     $person_count = $person_count_array[$this->schedule_id];
     // 対象が全員の場合は参加人数をメンバ数に修正
     if ($this->is_target_all()) {
         $person_count['participate_person_count'] = ACSCommunity::get_community_member_count($this->community_id);
     }
     // スケジュールURL
     $schedule_url = $system_base_login_url . SCRIPT_PATH . "?" . MODULE_ACCESSOR . "=Community" . "&" . ACTION_ACCESSOR . "=AnswerSchedule" . "&community_id=" . $this->community_id . "&schedule_id=" . $this->schedule_id;
     $user_community_row =& ACSUser::get_user_profile_row($this->user_community_id);
     $msg = ACSMsg::get_tag_replace($msg, array('{SYSTEM_BASE_URL}' => $system_base_url, '{COMMUNITY_ID}' => $this->community_id, '{COMMUNITY_NAME}' => $community_row['community_name'], '{USER_NAME}' => $user_community_row['user_name'], '{USER_COMMUNITY_NAME}' => $user_community_row['community_name'], '{SCHEDULE_NAME}' => $this->schedule_name, '{SCHEDULE_DETAIL}' => $this->schedule_detail, '{SCHEDULE_CLOSING_DATETIME}' => ACSLib::convert_pg_date_to_str($this->schedule_closing_datetime), '{SCHEDULE_ANSWER_COUNT}' => $person_count['answer_person_count'], '{SCHEDULE_PARTICIPATE_COUNT}' => $person_count['participate_person_count'], '{SCHEDULE_DECISION_DATE}' => $adjustment_dates_list[$decide_adjustment_date_id]['date_string'], '{ANSWER_SCHEDULE_URL}' => $schedule_url));
     ACSMsg::set_lang($current_lang);
     return $msg;
 }
예제 #10
0
 /**
  * スケジュール通知メールの送信
  *
  * 各ユーザの言語に対応してスケジュール関連の<br>
  * 通知メールを送信する
  *
  * @param object $schedule スケジュールインスタンス(ACSSchedule)
  * @param string $serial_msg_key_fmg シリアルメッセージ取得用フォーマット(例:"RMD%03d")
  * @param string $subject_msg_key 件名メッセージ取得用キー(例:"M001")
  * @param array  $additional_tags 追加する置換プレースフォルダ(未指定も可)
  * @param array  $additional_message_tags 追加する置換プレースフォルダ(メッセージid指定)
  *               (未指定も可) メール言語に対応して置換されます
  * @return boolean true/false
  */
 static function send_schedule_announce_mail(&$schedule, $serial_msg_key_fmg, $subject_msg_key, $additional_tags = "", $additional_message_tags = "")
 {
     // スケジュールURL
     $schedule_url = "{SYSTEM_SCRIPT_PATH}" . "?{SYSTEM_MODULE_ACCESSOR}=Community" . "&{SYSTEM_ACTION_ACCESSOR}=AnswerSchedule" . "&community_id={$schedule->community_id}" . "&schedule_id={$schedule->schedule_id}";
     $user_community_row =& ACSUser::get_user_profile_row($schedule->user_community_id);
     // システムのメールアドレスを取得
     $system_mail_addr = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_MAIL_ADDR');
     // 各言語用のメッセージを準備
     $msgs = array();
     $subjects = array();
     $org_lang = ACSMsg::get_lang();
     foreach (ACSMsg::get_lang_list_array() as $lang => $lang_disp) {
         ACSMsg::set_lang($lang);
         $tags_array = array('{USER_NAME}' => $user_community_row['user_name'], '{USER_COMMUNITY_NAME}' => $user_community_row['community_name'], '{SCHEDULE_NAME}' => $schedule->schedule_name, '{SCHEDULE_DETAIL}' => $schedule->schedule_detail, '{SCHEDULE_CLOSING_DATETIME}' => ACSLib::convert_pg_date_to_str($schedule->schedule_closing_datetime), '{SCHEDULE_URL}' => $schedule_url);
         if (is_array($additional_tags)) {
             $tags_array = array_merge($tags_array, $additional_tags);
         }
         if (is_array($additional_message_tags)) {
             $msg_array = array();
             foreach ($additional_message_tags as $tag => $msg_key) {
                 $msg_array[$tag] = ACSMsg::get_mdmsg(__FILE__, $msg_key);
             }
             $tags_array = array_merge($tags_array, $msg_array);
         }
         $msgs[$lang] = ACSMsg::get_serial_msg('lib', basename(__FILE__), $serial_msg_key_fmg);
         $msgs[$lang] = ACSMsg::get_tag_replace($msgs[$lang], $tags_array);
         // subjectの編集
         $subjects[$lang] = ACSMsg::get_mdmsg(__FILE__, $subject_msg_key);
     }
     ACSMsg::set_lang($org_lang);
     // メールの送信(全コミュニティメンバ)
     return ACSCommunityMail::send_community_mail($schedule->community_id, $system_mail_addr, $subjects, $msgs);
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // get
     $target_user_info_row = $request->getAttribute('target_user_info_row');
     $diary_row_array = $request->getAttribute('diary_row_array_result');
     $open_level_master_row_array = $request->getAttribute('open_level_master_row_array');
     $friends_group_row_array = $request->getAttribute('friends_group_row_array');
     $err_str = $request->getAttribute('err_str');
     $form_pre = $request->getAttribute('form_pre');
     // トップページURL
     $link_page_url['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $acs_user_info_row['user_community_id'];
     //他人の日記を閲覧している場合のトップページURL
     $link_page_url['else_user_top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Index') . '&id=' . $target_user_info_row['community_id'];
     //他人の日記を閲覧している場合の日記ページURL
     $link_page_url['else_user_diary_url'] = $this->getControllerPath(DEFAULT_MODULE, 'Diary') . '&id=' . $target_user_info_row['community_id'];
     //検索画面url
     $link_page_url['search_diary_url'] = SCRIPT_PATH;
     // get でサブミットするための、遷移先情報
     $module = 'User';
     $action = 'SearchResultDiary';
     $id = $target_user_info_row['community_id'];
     $move_id = '2';
     // 加工
     if ($diary_row_array) {
         foreach ($diary_row_array as $index => $diary_row) {
             // ユーザ画像URL
             $diary_row_array[$index]['image_url'] = ACSUser::get_image_url($diary_row['community_id'], 'thumb');
             //ユーザページ
             $user_row = ACSUser::get_user_profile_row($diary_row['community_id']);
             $diary_row_array[$index]['top_page_url'] = $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $diary_row['community_id'];
             $diary_row_array[$index]['community_name'] = $user_row['community_name'];
             // 投稿日時
             $diary_row_array[$index]['post_date'] = ACSLib::convert_pg_date_to_str($diary_row['post_date']);
             // コメントページURL
             $diary_row_array[$index]['diary_comment_url'] = $this->getControllerPath('User', 'DiaryComment') . '&id=' . $diary_row['community_id'] . '&diary_id=' . $diary_row['diary_id'];
             // 信頼済みコミュニティ(マイフレンズグループ)が定義されているか
             if ($diary_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D05')) {
                 if (count($diary_row['trusted_community_row_array']) && $diary_row['trusted_community_row_array'][0]['community_type_name'] == ACSMsg::get_mst('community_type_master', 'D20')) {
                     $diary_row_array[$index]['trusted_community_flag'] = 0;
                 } else {
                     $diary_row_array[$index]['trusted_community_flag'] = 1;
                 }
             }
         }
         //---- アクセス制御 ----//
         $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $target_user_info_row);
         $diary_row_array = ACSAccessControl::get_valid_row_array_for_user_community($acs_user_info_row, $role_array, $diary_row_array);
         //特別::全件検索の場合 ターゲットが自分のままになってしまうことを回避
         $diary_row_array_result = array();
         foreach ($diary_row_array as $index => $diary_row) {
             $diary_target_user_info_row = ACSUser::get_user_info_row_by_user_community_id($diary_row['community_id']);
             $role_array = ACSAccessControl::get_user_community_role_array($acs_user_info_row, $diary_target_user_info_row);
             $is_valid_user = ACSAccessControl::is_valid_user_for_community($acs_user_info_row, $role_array, $diary_row);
             if ($is_valid_user) {
                 //アクセス権がある
                 array_push($diary_row_array_result, $diary_row);
             }
         }
         //----------------------//
     }
     // 本人のページかどうか
     if ($target_user_info_row['user_community_id'] == $acs_user_info_row['user_community_id']) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     // set
     $this->setAttribute('target_user_info_row', $target_user_info_row);
     $this->setAttribute('diary_row_array_result', $diary_row_array_result);
     $this->setAttribute('is_self_page', $is_self_page);
     $this->setAttribute('link_page_url', $link_page_url);
     $this->setAttribute('open_level_master_row_array', $open_level_master_row_array);
     $this->setAttribute('friends_group_row_array', $friends_group_row_array);
     $this->setAttribute('err_str', $err_str);
     $this->setAttribute('form_pre', $form_pre);
     $this->setAttribute('module', $module);
     $this->setAttribute('action', $action);
     $this->setAttribute('id', $id);
     $this->setAttribute('move_id', $move_id);
     // テンプレート
     $this->setScreenId("0001");
     $this->setTemplate('SearchResultDiary.tpl.php');
     return parent::execute();
 }
예제 #12
0
 /**
  * 通知メールを送信する
  *
  * @param $message_id メッセージID
  * @param $receiver_id 受信者ID
  * @param $sender_id 送信者ID
  */
 static function send_info_mail($message_id, $receiver_id, $sender_id)
 {
     $system_group = ACSMsg::get_mst('system_config_group', 'D01');
     // システムURL
     $system_base_url = ACSSystemConfig::get_keyword_value($system_group, 'SYSTEM_BASE_URL');
     // システムログイン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);
     // 依頼側のユーザ情報
     $user_info_row = ACSUser::get_user_profile_row($sender_id);
     // 依頼される側のユーザ情報
     $target_user_info_row = ACSUser::get_user_profile_row($receiver_id);
     // 待機承認URL
     $message_url = $system_base_login_url . SCRIPT_PATH;
     $message_url .= "?" . MODULE_ACCESSOR . "=User";
     $message_url .= "&" . ACTION_ACCESSOR . "=MessageShow";
     $message_url .= "&id={$receiver_id}";
     $message_url .= "&message_id={$message_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', 'ACSMessage.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_URL}" => $message_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);
 }
예제 #13
0
 function execute()
 {
     $context =& $this->getContext();
     $user = $context->getUser();
     $request = $context->getRequest();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 表示対象となるユーザコミュニティIDを取得
     $user_community_id = $request->ACSgetParameter('id');
     if (empty($user_community_id)) {
         $user_community_id = $acs_user_info_row['user_community_id'];
     }
     // 表示対象のユーザが存在しない場合は、エラーを表示
     if (!ACSUser::get_user_info_row_by_user_community_id($user_community_id)) {
         // 未ログインの時はPublic/Indexに遷移
         header("Location: ./index.php?module=Public&action=Index");
         //			return View::ERROR;
     }
     // 自身のページか
     if ($acs_user_info_row['user_community_id'] == $user_community_id) {
         $is_self_page = 1;
     } else {
         $is_self_page = 0;
     }
     // プロフィール
     $target_user_info_row = ACSUser::get_user_profile_row($user_community_id);
     // マイフレンズ
     $friends_row_array = ACSUser::get_simple_friends_row_array($user_community_id);
     // マイコミュニティ
     $community_row_array = ACSUser::get_community_row_array($user_community_id);
     // 最終ログイン
     // ログイン済みの場合
     if ($acs_user_info_row['is_login_user']) {
         $last_login_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D52'));
     }
     // マイページデザインを取得する
     $selection_css_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D53'));
     $selection_css = $selection_css_row['contents_value'] == '' ? ACS_DEFAULT_SELECTION_CSS_FILE : $selection_css_row['contents_value'];
     $waiting_for_join_community_row_array_array = array();
     $waiting_for_parent_community_link_row_array_array = array();
     $waiting_for_sub_community_link_row_array_array = array();
     foreach ($community_row_array as $index => $community_row) {
         $community_row_array[$index]['contents_row_array']['self'] = ACSCommunity::get_contents_row($community_row['community_id'], ACSMsg::get_mst('contents_type_master', 'D00'));
         $community_row_array[$index]['is_community_admin'] = ACSCommunity::is_community_admin($acs_user_info_row['user_community_id'], $community_row['community_id']);
         $community_row_array[$index]['is_community_member'] = ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $community_row['community_id']);
         if ($is_self_page) {
             // 待機: コミュニティ参加 承認待ち (自分のマイコミュニティ)
             if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D20'), ACSMsg::get_mst('waiting_status_master', 'D10')))) {
                 $waiting_for_join_community_row_array['waiting_row_array'] = $waiting_row_array;
                 $waiting_for_join_community_row_array['community_row'] = $community_row;
                 array_push($waiting_for_join_community_row_array_array, $waiting_for_join_community_row_array);
             }
             // 待機: 親コミュニティ追加 承認待ち
             if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D40'), ACSMsg::get_mst('waiting_status_master', 'D10')))) {
                 $waiting_for_parent_community_link_row_array['waiting_row_array'] = $waiting_row_array;
                 $waiting_for_parent_community_link_row_array['community_row'] = $community_row;
                 array_push($waiting_for_parent_community_link_row_array_array, $waiting_for_parent_community_link_row_array);
             }
             // 待機: サブコミュニティ追加 承認待ち
             if ($community_row['is_community_admin'] && ($waiting_row_array = ACSWaiting::get_waiting_row_array($community_row['community_id'], ACSMsg::get_mst('waiting_type_master', 'D50'), ACSMsg::get_mst('waiting_status_master', 'D10')))) {
                 $waiting_for_sub_community_link_row_array['waiting_row_array'] = $waiting_row_array;
                 $waiting_for_sub_community_link_row_array['community_row'] = $community_row;
                 array_push($waiting_for_sub_community_link_row_array_array, $waiting_for_sub_community_link_row_array);
             }
         }
     }
     if ($is_self_page) {
         // 待機: マイフレンズ追加 承認待ち
         $waiting_for_add_friends_row_array = ACSWaiting::get_waiting_row_array($user_community_id, ACSMsg::get_mst('waiting_type_master', 'D10'), ACSMsg::get_mst('waiting_status_master', 'D10'));
         // 待機: コミュニティ招待 承認待ち
         $waiting_for_invite_to_community_row_array = ACSWaiting::get_waiting_row_array($user_community_id, ACSMsg::get_mst('waiting_type_master', 'D30'), ACSMsg::get_mst('waiting_status_master', 'D10'));
         // マイダイアリーの新着コメント
         $new_comment_diary_row_array = ACSDiary::get_new_comment_diary_row_array($user_community_id);
         // 新着メッセージ
         $new_message_row_array = ACSMessage::get_new_message_row_array($user_community_id);
         // システムからのお知らせ
         $system_announce_row_array = ACSSystemAnnounce::get_valid_system_announce_row_array();
     }
     // set
     $request->setAttribute('user_community_id', $user_community_id);
     $request->setAttribute('target_user_info_row', $target_user_info_row);
     $request->setAttribute('is_self_page', $is_self_page);
     $request->setAttribute('friends_row_array', $friends_row_array);
     $request->setAttribute('community_row_array', $community_row_array);
     $request->setAttribute('waiting_for_add_friends_row_array', $waiting_for_add_friends_row_array);
     $request->setAttribute('waiting_for_join_community_row_array_array', $waiting_for_join_community_row_array_array);
     $request->setAttribute('waiting_for_parent_community_link_row_array_array', $waiting_for_parent_community_link_row_array_array);
     $request->setAttribute('waiting_for_sub_community_link_row_array_array', $waiting_for_sub_community_link_row_array_array);
     $request->setAttribute('waiting_for_invite_to_community_row_array', $waiting_for_invite_to_community_row_array);
     $request->setAttribute('new_comment_diary_row_array', $new_comment_diary_row_array);
     $request->setAttribute('system_announce_row_array', $system_announce_row_array);
     $request->setAttribute('last_login', $last_login_row['contents_value']);
     $request->setAttribute('selection_css', $selection_css);
     $request->setAttribute('new_message_row_array', $new_message_row_array);
     return View::SUCCESS;
 }
예제 #14
0
 /**
  * 依頼承諾メールを送信する
  *
  * @param $waiting_id 待機ID
  * @param $return 成功(true) / 失敗(false)
  * @return 
  */
 static function send_admission_accept_notify_mail($waiting_id)
 {
     // 待機情報
     $waiting_row = ACSWaiting::get_waiting_row($waiting_id);
     // システムURL
     $system_base_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     // システムログインURL
     $system_base_login_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL');
     // システムのメールアドレス (From:)
     $system_mail_addr = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), '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['community_id']);
         // 承認される側のユーザ情報
         $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['waiting_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', 'AMF%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['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
         $subject = ACSMsg::get_mdmsg(__FILE__, 'M006');
         $ret = ACSLib::send_mail($system_mail_addr, $target_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', 'D20')) {
         // 承認側のコミュニティ情報
         $community_row = ACSCommunity::get_community_row($waiting_row['community_id']);
         // 承認される側のユーザ情報
         $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['waiting_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}";
         $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', 'ACM%03d'), array("{TARGET_USER_NAME}" => $target_user_info_row['user_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{MESSAGE}" => trim($waiting_row['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
         $subject = ACSMsg::get_mdmsg(__FILE__, 'M007');
         // 言語を元に戻す
         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', 'D30')) {
         // 招待されたコミュニティ情報
         $community_row = ACSCommunity::get_community_row($waiting_row['waiting_community_id']);
         // 承認側のユーザ情報
         $user_info_row = ACSUser::get_user_profile_row($waiting_row['community_id']);
         // 承認された側のユーザ情報
         $target_user_info_row = ACSUser::get_user_profile_row($waiting_row['entry_user_community_id']);
         // コミュニティトップページ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', 'AIM%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['reply_message']), "{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['community_id']);
         // 承認される側コミュニティ情報
         $target_community_row = ACSCommunity::get_community_row($waiting_row['waiting_community_id']);
         // 承認される側のコミュニティ管理者情報の配列
         $community_admin_user_info_row_array = ACSCommunity::get_community_admin_user_info_row_array($target_community_row['community_id']);
         // コミュニティトップページ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'];
         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', 'ACL%03d'), array("{TARGET_COMMUNITY_NAME}" => $target_community_row['community_name'], "{COMMUNITY_NAME}" => $community_row['community_name'], "{WAITING_TYPE_NAME}" => $waiting_row['waiting_type_name'], "{COMMUNITY_URL}" => $community_top_page_url, "{MESSAGE}" => trim($waiting_row['reply_message']), "{SYSTEM_BASE_URL}" => $system_base_url));
             $subject = ACSMsg::get_mdmsg(__FILE__, 'M009');
             $ret = ACSLib::send_mail($system_mail_addr, $community_admin_user_info_row['mail_addr'], null, $subject, $body);
         }
         // 言語を元に戻す
         ACSMsg::set_lang($org_lang);
     }
     return $ret;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $this->setScreenId("0001");
     $this->setTemplate('AnswerSchedule.tpl.php');
     $current_module = 'Community';
     $current_action = 'AnswerSchedule';
     // ログインユーザ情報
     $acs_user_info_row = $request->getAttribute('acs_user_info_row');
     $this->setAttribute('acs_user_info_row', $acs_user_info_row);
     // コミュニティ情報
     $target_community_row =& $request->getAttribute('target_community_row');
     $this->setAttribute('target_community_row', $target_community_row);
     // スケジュールインスタンスの設定
     $schedule =& $request->getAttribute('schedule');
     $this->setAttribute('schedule', $schedule);
     // 共通URLパラメータ
     $url_params = "community_id=" . $target_community_row['community_id'];
     // 入力終了時POST-URL
     $this->setAttribute('url_commit', $this->getControllerPath($current_module, $current_action));
     // 決定時POST-URL
     $this->setAttribute('url_decide', $this->getControllerPath($current_module, 'DecideSchedule'));
     // コミュニティのURL
     $this->setAttribute('url_community_top', $this->getControllerPath($current_module, 'Index') . "&" . $url_params);
     // スケジュール調整表一覧のURL
     $this->setAttribute('url_schedule_list', $this->getControllerPath($current_module, 'Schedule') . "&" . $url_params);
     // 主催者
     // コミュニティ情報の取得
     $user_community_row =& ACSUser::get_user_profile_row($schedule->user_community_id);
     $this->setAttribute('user_community_name', $user_community_row['community_name']);
     $this->setAttribute('user_community_name_url', $this->getControllerPath(DEFAULT_MODULE, DEFAULT_ACTION) . '&id=' . $schedule->user_community_id);
     // 回答一覧
     $answer_selection =& $schedule->get_answer_selection();
     $html_options_answer_selection = array();
     $answer_detail_text = "";
     foreach ($answer_selection as $key => $val) {
         if ($val['answer_char'] != "") {
             $html_options_answer_selection[$key] = $val['answer_char'];
             if ($answer_detail_text != "") {
                 $answer_detail_text .= "<br>";
             }
             $answer_detail_text .= htmlspecialchars($val['answer_char']) . "..." . ACSMsg::get_msg('Community', 'AnswerScheduleSuccessView.class.php', 'M001') . ":" . htmlspecialchars($val['answer_score']);
             if ($val['answer_detail']) {
                 $answer_detail_text .= " " . ACSMsg::get_msg('Community', 'AnswerScheduleSuccessView.class.php', 'M002') . ":" . htmlspecialchars($val['answer_detail']);
             }
         }
     }
     $this->setAttribute('html_options_answer_selection', $html_options_answer_selection);
     $this->setAttribute('answer_detail_text', $answer_detail_text);
     // スケジュール候補日時
     $this->setAttribute('adjustment_dates_count', $schedule->get_adjustment_dates_count());
     $adjustment_dates_list =& $schedule->get_adjustment_dates();
     $this->setAttribute('adjustment_dates_list', $adjustment_dates_list);
     // 状態
     if ($schedule->is_fixed()) {
         $schedule_status = ACSMsg::get_msg('Community', 'AnswerScheduleSuccessView.class.php', 'M003') . "&nbsp;&nbsp;決定日:" . $adjustment_dates_list[$schedule->decide_adjustment_date_id]['date_string'];
     } else {
         $schedule_status = $schedule->is_close() ? ACSMsg::get_msg('Community', 'AnswerScheduleSuccessView.class.php', 'M004') : ACSMsg::get_msg('Community', 'AnswerScheduleSuccessView.class.php', 'M005');
     }
     $this->setAttribute('schedule_status', $schedule_status);
     // スケジュール参加情報
     $schedule_participant_list =& $request->getAttribute('schedule_participant_list');
     $this->setAttribute('schedule_participant', $request->getAttribute('schedule_participant'));
     $this->setAttribute('schedule_participant_list', $schedule_participant_list);
     // 集計情報
     $total_count = array();
     $total_score = array();
     foreach ($adjustment_dates_list as $adjustment_date_id => $adjustment_date_array) {
         foreach ($schedule_participant_list as $user_community_id => $schedule_participant) {
             $answer_no = $schedule_participant->get_answer($adjustment_date_id);
             $total_count[$adjustment_date_id][$answer_no]++;
             $total_score[$adjustment_date_id] += $answer_selection[$answer_no]['answer_score'];
         }
     }
     $this->setAttribute('total_count', $total_count);
     $this->setAttribute('total_score', $total_score);
     return parent::execute();
 }