##// END OF EJS Templates
docs: add change user details docs
marcink -
r925:b469a885 default
parent child Browse files
Show More
@@ -22,8 +22,8 b' account permissions.'
22 .. code-block:: bash
22 .. code-block:: bash
23
23
24 # Open iShell from the terminal
24 # Open iShell from the terminal
25 $ .rccontrol/enterprise-5/profile/bin/paster \
25 $ .rccontrol/enterprise-1/profile/bin/paster \
26 ishell .rccontrol/enterprise-5/rhodecode.ini
26 ishell .rccontrol/enterprise-1/rhodecode.ini
27
27
28 .. code-block:: mysql
28 .. code-block:: mysql
29
29
@@ -52,11 +52,12 b' following example to make changes to thi'
52 .. code-block:: mysql
52 .. code-block:: mysql
53
53
54 # Use this example to enable global .hgrc access
54 # Use this example to enable global .hgrc access
55 In [4]: new_option = RhodeCodeUi()
55 In [1]: new_option = RhodeCodeUi()
56 In [5]: new_option.ui_section='web'
56 In [2]: new_option.ui_section='web'
57 In [6]: new_option.ui_key='allow_push'
57 In [3]: new_option.ui_key='allow_push'
58 In [7]: new_option.ui_value='*'
58 In [4]: new_option.ui_value='*'
59 In [8]: Session().add(new_option);Session().commit()
59 In [5]: Session().add(new_option);Session().commit()
60 In [6]: exit()
60
61
61 Manually Reset Password
62 Manually Reset Password
62 ^^^^^^^^^^^^^^^^^^^^^^^
63 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -72,24 +73,47 b' Use the following code example to carry '
72 .. code-block:: bash
73 .. code-block:: bash
73
74
74 # starts the ishell interactive prompt
75 # starts the ishell interactive prompt
75 $ .rccontrol/enterprise-5/profile/bin/paster \
76 $ .rccontrol/enterprise-1/profile/bin/paster \
76 ishell .rccontrol/enterprise-5/rhodecode.ini
77 ishell .rccontrol/enterprise-1/rhodecode.ini
77
78
78 .. code-block:: mysql
79 .. code-block:: mysql
79
80
80 from rhodecode.lib.auth import generate_auth_token
81 In [1]: from rhodecode.lib.auth import generate_auth_token
81 from rhodecode.lib.auth import get_crypt_password
82 In [2]: from rhodecode.lib.auth import get_crypt_password
82
83 # Enter the user name whose password you wish to change
83 # Enter the user name whose password you wish to change
84 my_user = 'USERNAME'
84 In [3]: my_user = 'USERNAME'
85 u = User.get_by_username(my_user)
85 In [4]: u = User.get_by_username(my_user)
86
87 # If this fails then the user does not exist
86 # If this fails then the user does not exist
88 u.auth_token = generate_auth_token(my_user)
87 In [5]: u.auth_token = generate_auth_token(my_user)
89
90 # Set the new password
88 # Set the new password
91 u.password = get_crypt_password('PASSWORD')
89 In [6]: u.password = get_crypt_password('PASSWORD')
90 In [7]: Session().add(u);Session().commit()
91 In [8]: exit()
92
93
94
95 Change user details
96 ^^^^^^^^^^^^^^^^^^^
97
98 If you need to manually change some of users details, use the following steps.
99
100 1. Navigate to your |RCE| install location.
101 2. Run the interactive ``ishell`` prompt.
102 3. Set a new arguments for users.
92
103
93 Session().add(u)
104 Use the following code example to carry out these steps.
94 Session().commit()
105
95 exit
106 .. code-block:: bash
107
108 # starts the ishell interactive prompt
109 $ .rccontrol/enterprise-1/profile/bin/paster \
110 ishell .rccontrol/enterprise-1/rhodecode.ini
111
112 .. code-block:: mysql
113
114 # Use this example to change email and username of LDAP user
115 In [1]: my_user = User.get_by_username('some_username')
116 In [2]: my_user.email = 'new_email@foobar.com'
117 In [3]: my_user.username = 'SomeUser'
118 In [4]: Session().add(my_user);Session().commit()
119 In [5]: exit()
General Comments 0
You need to be logged in to leave comments. Login now