3 * ¥·¥¹¥Æ¥à¡¡¥æ¡¼¥¶´ÉÍý¡¡¥æ¡¼¥¶¾ðÊóÊѹ¹²èÌÌ action¥¯¥é¥¹
4 * @package acs/webapp/modules/System/actions
9 // $Id: EditUserAction.class.php,v 1.8 2008/04/24 16:00:00 y-yuki Exp $
11 class EditUserAction extends BaseAction
13 // GET([Êѹ¹]¥ê¥ó¥¯¤«¤é¤ÎÁ«°Ü)
14 function getDefaultView() {
15 $context = $this->getContext();
16 $controller = $context->getController();
17 $request = $context->getRequest();
18 $user = $context->getUser();
21 if (!$this->get_execute_privilege()) {
22 $controller->forward(SECURE_MODULE, SECURE_ACTION);
26 $acs_user_info_row = $user->getAttribute('acs_user_info_row');
27 $user_id = $request->getParameter('id');
28 $user_info_row = ACSUser::get_user_profile_row($user_id, 'include_private_flag');
30 $request->setAttribute('user_info_row', $user_info_row);
31 $user->setAttribute('user_id', $user_id);
35 // POST¡Ê[Êѹ¹]¥Ü¥¿¥ó¤«¤é¤ÎÁ«°Ü¡Ë
37 $context = $this->getContext();
38 $controller = $context->getController();
39 $request = $context->getRequest();
40 $user = $context->getUser();
43 if (!$this->get_execute_privilege()) {
44 $controller->forward(SECURE_MODULE, SECURE_ACTION);
48 $acs_user_info_row = $user->getAttribute('acs_user_info_row');
51 $form = $request->ACSGetParameters();
52 $user_community_id = $user->getAttribute('user_id');
54 $form['user_community_id'] = $user_community_id;
55 $target_user_info_row = ACSUser::get_user_profile_row($user_community_id, 'include_private_flag');
56 $post_user_info_row = ACSUser::get_user_info_row_by_user_id($form['user_id']);
57 if ($post_user_info_row
58 && $user_community_id != $post_user_info_row['user_community_id'])
60 echo ACSMsg::get_msg('System', 'EditUserAction.class.php', 'M002');
65 if($form['passwd_change'] == 'change_on' && $form['passwd'] == $form['passwd2'] || $form['passwd_change'] == ''){
66 // ¥æ¡¼¥¶¾ðÊó¤òÊѹ¹¤¹¤ë
67 $ret = ACSUser::update_user_info($form);
69 echo "Warning: Update user information failed.";
73 echo ACSMsg::get_msg('System', 'EditUserAction.class.php', 'M001');
77 // ¥í¥°ÅÐÏ¿: ¥æ¡¼¥¶¾ðÊóÊѹ¹
78 ACSLog::set_log($acs_user_info_row, 'Change User Information', $ret, "[UserID:$target_user_info_row[user_id]]");
81 $user_list_url = $this->getControllerPath('System', 'UserList');
82 header("Location: $user_list_url");
85 function getRequestMethods() {
89 function isSecure () {
93 function getCredential () {
94 return array('SYSTEM_ADMIN_USER');
97 function get_execute_privilege () {
98 $context = $this->getContext();
99 $user = $context->getUser();
102 if ($user->hasCredential('SYSTEM_ADMIN_USER')) {