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 execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $user_id = $user->getAttribute('login_user_id');
     if ($user_id == null || $user_id == "") {
         if (ACSSystem::check_connect_outside() != "0") {
             // LDAP接続エラーの場合、処理終了
             $this->setError($controller, $request, $user, 'login_input', ACSMsg::get_msg('Common', 'GlobalSecureAction.class.php', 'M002'));
         } else {
             if ($_POST['userid'] != NULL && $_POST['userid'] != "") {
                 // エラーの場合、処理終了
                 $this->setError($controller, $request, $user, 'login_input', ACSMsg::get_msg('Common', 'GlobalSecureAction.class.php', 'M001'));
             }
         }
         return View::INPUT;
     }
     if ($acs_user_info_row['is_acs_user']) {
         // ログ登録: ログイン
         ACSLog::set_log($acs_user_info_row, 'Login', true, "[UserID:" . $acs_user_info_row['user_id'] . "]");
         // ラストログイン登録
         ACSUser::set_last_login($acs_user_info_row);
         header("Location: ./" . $_SERVER['REQUEST_URI']);
     }
 }
 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_id = $form['user_id'];
     if (ACSUser::get_user_info_row_by_user_id($user_id)) {
         echo ACSMsg::get_msg('System', 'AddUserAction.class.php', 'M001');
         return;
     }
     // ユーザ情報を新規登録する
     $ret = ACSUser::set_user_info($form);
     // ログ登録: ユーザ新規登録
     ACSLog::set_log($acs_user_info_row, 'New User Registration', $ret, "[UserID:{$form['user_id']}]");
     $user_list_url = $this->getControllerPath('System', 'UserList');
     header("Location: {$user_list_url}");
 }
Example #4
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();
     // ログ情報を取得する
     $log_row_array = ACSLog::search_log_row_array($form);
     // set
     $request->setAttribute('form', $form);
     $request->setAttribute('log_row_array', $log_row_array);
     return View::INPUT;
 }
 function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     // 管理者かどうか確認
     if (!$this->get_execute_privilege()) {
         $controller->forward(SECURE_MODULE, SECURE_ACTION);
         return;
     }
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // 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}");
 }
Example #6
0
 /**
  * ユーザ情報(プロフィール)をセットする
  *
  * @param $acs_user_info_row
  * @param ユーザ情報(プロフィール)
  * @return 成功(true) / 失敗(false)
  */
 static function set_user_profile($acs_user_info_row, $form)
 {
     $user_community_id = $form['id'];
     $contents_type_master_array = ACSDB::get_master_array('contents_type');
     $contents_type_code_array['self'] = array_search(ACSMsg::get_mst('contents_type_master', 'D00'), $contents_type_master_array);
     $contents_type_code_array['user_name'] = array_search(ACSMsg::get_mst('contents_type_master', 'D01'), $contents_type_master_array);
     $contents_type_code_array['mail_addr'] = array_search(ACSMsg::get_mst('contents_type_master', 'D02'), $contents_type_master_array);
     $contents_type_code_array['belonging'] = array_search(ACSMsg::get_mst('contents_type_master', 'D03'), $contents_type_master_array);
     $contents_type_code_array['speciality'] = array_search(ACSMsg::get_mst('contents_type_master', 'D04'), $contents_type_master_array);
     $contents_type_code_array['birthplace'] = array_search(ACSMsg::get_mst('contents_type_master', 'D05'), $contents_type_master_array);
     $contents_type_code_array['birthday'] = array_search(ACSMsg::get_mst('contents_type_master', 'D06'), $contents_type_master_array);
     $contents_type_code_array['community_profile'] = array_search(ACSMsg::get_mst('contents_type_master', 'D07'), $contents_type_master_array);
     $contents_type_code_array['community_profile_login'] = array_search(ACSMsg::get_mst('contents_type_master', 'D08'), $contents_type_master_array);
     $contents_type_code_array['community_profile_friend'] = array_search(ACSMsg::get_mst('contents_type_master', 'D09'), $contents_type_master_array);
     $contents_type_code_array['friends_list'] = array_search(ACSMsg::get_mst('contents_type_master', 'D11'), $contents_type_master_array);
     $contents_type_code_array['mail_lang'] = array_search(ACSMsg::get_mst('contents_type_master', 'D51'), $contents_type_master_array);
     // コミュニティ種別マスタ
     $community_type_master_array = ACSDB::get_master_array('community_type');
     // コミュニティ種別コード
     $user_community_type_code = array_search(ACSMsg::get_mst('community_type_master', 'D10'), $community_type_master_array);
     $friends_community_type_code = array_search(ACSMsg::get_mst('community_type_master', 'D20'), $community_type_master_array);
     // 公開レベルマスタ
     $open_level_master_array = ACSDB::get_master_array('open_level');
     // BEGIN
     ACSDB::_do_query("BEGIN");
     // user_infoが未登録のLDAPユーザの場合は基本情報を登録する
     if (!$acs_user_info_row['is_acs_user'] && $acs_user_info_row['is_ldap_user']) {
         // 新コミュニティID
         $user_community_id_seq = ACSDB::get_next_seq('community_id_seq');
         $user_community_id = $user_community_id_seq;
         // (1) ユーザコミュニティ (community)
         $sql = "INSERT INTO community";
         $sql .= " (community_id, community_name, community_type_code)";
         $sql .= " VALUES ({$user_community_id_seq}, null, '{$user_community_type_code}')";
         $ret = ACSDB::_do_query($sql);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // (2) ユーザ情報 (user_info)
         $sql = "INSERT INTO user_info";
         $sql .= " (user_id, user_community_id, administrator_flag)";
         $sql .= " VALUES ('{$form['user_id']}', '{$user_community_id_seq}', 'f')";
         $ret = ACSDB::_do_query($sql);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // (3) マイフレンズ
         $contents_form = array();
         $contents_form['community_id'] = $user_community_id_seq;
         $contents_form['contents_type_code'] = array_search(ACSMsg::get_mst('contents_type_master', 'D11'), $contents_type_master_array);
         $contents_form['contents_value'] = '';
         $contents_form['open_level_code'] = ACSAccessControl::get_default_open_level_code(ACSMsg::get_mst('community_type_master', 'D10'), ACSMsg::get_mst('contents_type_master', 'D11'));
         $ret = ACSCommunity::set_contents($contents_form);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // (4) マイフレンズコミュニティ (community)
         $friends_community_id_seq = ACSDB::get_next_seq('community_id_seq');
         $sql = "INSERT INTO community";
         $sql .= " (community_id, community_type_code)";
         $sql .= " VALUES ('{$friends_community_id_seq}', '{$friends_community_type_code}')";
         $ret = ACSDB::_do_query($sql);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         // (5) マイフレンズコミュニティをユーザコミュニティのサブコミュニティとする (sub_community)
         $sql = "INSERT INTO sub_community";
         $sql .= " (community_id, sub_community_id)";
         $sql .= " VALUES ('{$user_community_id_seq}', '{$friends_community_id_seq}')";
         $ret = ACSDB::_do_query($sql);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
         $is_ldap_user_login_flag = 1;
         // ユーザ基本情報ここまで
     }
     // ニックネーム
     $ret = ACSCommunity::set_community_name($user_community_id, $form['community_name']);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // コンテンツ: 氏名, メールアドレス, 所属, 専攻, 出身, 生年月日, プロフィールは3種
     foreach (array('user_name', 'mail_addr', 'belonging', 'speciality', 'birthplace', 'birthday', 'community_profile', 'community_profile_login', 'community_profile_friend', 'friends_list', 'mail_lang') as $contents_key) {
         $contents_form = array('community_id' => $user_community_id, 'contents_type_code' => $contents_type_code_array[$contents_key], 'contents_value' => $form[$contents_key], 'open_level_code' => $form['open_level_code_array'][$contents_key]);
         $ret = ACSCommunity::set_contents($contents_form);
         if (!$ret) {
             ACSDB::_do_query("ROLLBACK");
             return $ret;
         }
     }
     // コンテンツ: ページ全体 = 一般公開とする
     $contents_form = array('community_id' => $user_community_id, 'contents_type_code' => $contents_type_code_array['self'], 'contents_value' => '', 'open_level_code' => array_search(ACSMsg::get_mst('open_level_master', 'D01'), $open_level_master_array));
     $ret = ACSCommunity::set_contents($contents_form);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     // 信頼済みコミュニティ: 出身, 生年月日
     foreach (array('birthplace', 'birthday') as $contents_key) {
         if ($form['trusted_community_flag'][$contents_key]) {
             // マイフレンズグループ
             $trusted_community_id_array = explode(',', $form['trusted_community_id_csv_array'][$contents_key]);
             foreach ($trusted_community_id_array as $trusted_community_id) {
                 if ($trusted_community_id == '') {
                     continue;
                 }
                 $contents_trusted_community_form = array('community_id' => $user_community_id, 'contents_type_code' => $contents_type_code_array[$contents_key], 'open_level_code' => $form['open_level_code_array'][$contents_key], 'trusted_community_id' => $trusted_community_id);
                 $ret = ACSCommunity::set_contents_trusted_community($contents_trusted_community_form);
                 if (!$ret) {
                     ACSDB::_do_query("ROLLBACK");
                     return $ret;
                 }
             }
         } else {
             // マイフレンズ
             $trusted_community_id = ACSUser::get_friends_community_id($user_community_id);
             // フレンズコミュニティID
             $contents_trusted_community_form = array('community_id' => $user_community_id, 'contents_type_code' => $contents_type_code_array[$contents_key], 'open_level_code' => $form['open_level_code_array'][$contents_key], 'trusted_community_id' => $trusted_community_id);
             $ret = ACSCommunity::set_contents_trusted_community($contents_trusted_community_form);
             if (!$ret) {
                 ACSDB::_do_query("ROLLBACK");
                 return $ret;
             }
         }
     }
     // COMMIT
     ACSDB::_do_query("COMMIT");
     if ($is_ldap_user_login_flag) {
         $acs_user_info_row = ACSUser::get_user_info_row_by_user_id($form['user_id']);
         // ログ登録: LDAPユーザ新規登録
         ACSLog::set_log($acs_user_info_row, 'New LDAP User Registration', $ret, "[UserID:{$form['user_id']}]");
         // ラストログイン登録
         ACSUser::set_last_login($acs_user_info_row);
     }
     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');
     $form = $request->ACSGetParameters();
     // システム設定データ取得(全件)
     $system_config_obj = new ACSSystemConfig();
     // Validatorで出来ないエラーチェックを行う //
     $err_flg = false;
     foreach ($system_config_obj->get_system_config_keyword_data_obj_array() as $get_system_config_keyword_data_obj) {
         $keyword = $get_system_config_keyword_data_obj->get_keyword();
         $system_config_group_name = $get_system_config_keyword_data_obj->get_system_config_group_name();
         $name = $get_system_config_keyword_data_obj->get_name();
         $type = $get_system_config_keyword_data_obj->get_type();
         // numberの項目は自然数
         if ($type == 'number' && !ACSErrorCheck::is_natural_number($form[$keyword])) {
             //$this->setError($controller, $request, $user, $keyword, "[$system_config_group_name] -> [$name] の値が正しくありません。(1以上)");
             $this->setError($controller, $request, $user, $keyword, ACSMsg::get_tag_replace(ACSMsg::get_msg('System', 'EditSystemConfigAction.class.php', 'M_WRONG_VALUE'), array("{GROUP_NAME}" => $system_config_group_name, "{NAME}" => $name, "{VAL}" => 1)));
             $err_flg = true;
         }
         // number0の項目は自然数(0を含む)
         if ($type == 'number0' && !ACSErrorCheck::is_natural_number($form[$keyword], true)) {
             $this->setError($controller, $request, $user, $keyword, ACSMsg::get_tag_replace(ACSMsg::get_msg('System', 'EditSystemConfigAction.class.php', 'M_WRONG_VALUE'), array("{GROUP_NAME}" => $system_config_group_name, "{NAME}" => $name, "{VAL}" => 0)));
             $err_flg = true;
         }
     }
     if ($err_flg) {
         return $this->handleError();
     }
     $ret = true;
     ACSDB::_do_query("BEGIN");
     foreach ($system_config_obj->get_system_config_keyword_data_obj_array() as $system_config_keyword_data_obj) {
         $_system_config_row = array();
         $param_key = $system_config_keyword_data_obj->get_keyword();
         //$param_key = $system_config_keyword_data_obj->get_system_config_group() . ',' . $system_config_keyword_data_obj->get_keyword();
         // parameter 取得
         $update_value = $request->getParameter($param_key, 'NO_KEY');
         if ($update_value == 'NO_KEY') {
             // POST にキーがない場合、無視する
             continue;
         }
         // 必須チェック
         //if (!$update_value) {
         if (trim($update_value) == '') {
             $ret = false;
             break;
         }
         // 値チェック
         // number 型のデータの場合、数値チェック(1 以上)を行う
         if ($system_config_keyword_data_obj->get_type() == 'number') {
             if (!is_numeric($update_value) or $update_value < 1) {
                 $ret = false;
                 break;
             }
         }
         // number0 型のデータの場合、数値チェック(0 以上)を行う
         if ($system_config_keyword_data_obj->get_type() == 'number0') {
             if (!is_numeric($update_value) or $update_value < 0) {
                 $ret = false;
                 break;
             }
         }
         // 更新処理
         $ret = ACSSystemConfig::update_value($system_config_keyword_data_obj->get_system_config_group_name(), $system_config_keyword_data_obj->get_keyword(), $update_value);
         if (!$ret) {
             break;
         }
     }
     if (!$ret) {
         // rollback
         ACSDB::_do_query("ROLLBACK");
         print "ERROR: Update configuration failed.";
         exit;
     }
     // commit
     ACSDB::_do_query("COMMIT");
     // ログ登録: システム設定変更
     ACSLog::set_log($acs_user_info_row, 'Change System Settings', $ret);
     // 完了画面表示
     // 引数セット
     $message = ACSMsg::get_msg('System', 'EditSystemConfigAction.class.php', 'M005');
     $system_config_url = $this->getControllerPath('System', 'EditSystemConfig');
     $system_config_link_name = ACSMsg::get_msg('System', 'EditSystemConfigAction.class.php', 'M002');
     $system_top_page_url = $this->getControllerPath('System', DEFAULT_ACTION);
     $system_top_page_link_name = ACSMsg::get_msg('System', 'EditSystemConfigAction.class.php', 'M003');
     $done_obj = new ACSDone();
     $done_obj->set_title(ACSMsg::get_msg('System', 'EditSystemConfigAction.class.php', 'M004'));
     $done_obj->set_message($message);
     $done_obj->add_link($system_config_link_name, $system_config_url);
     $done_obj->add_link($system_top_page_link_name, $system_top_page_url);
     $request->setAttribute('done_obj', $done_obj);
     // 画面呼び出し
     $controller->forward('Common', 'Done');
 }