-
Notifications
You must be signed in to change notification settings - Fork 370
/
HACKING
83 lines (58 loc) · 2.58 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
About Registration
==================
We use a customized registration process based on thirdpart/registration.
The customization begins with:
(r'^accounts/', include('base.registration_urls'))
See base.registration_urls to follow the code.
Registration is seperated into two phase: registration and activation.
Registration Page with Form -----> Registration Complete Page
(Notify User to check mail)
|
|
V
User check email and click activate link
|
|
V
User Home Page <----- Activate and login User.
The registration app provide two view functions, i.e., `register` and `activate`.
### Register
The actual registration of the account will be delegated to the
backend; it will be used as follows:
1. The backend's ``registration_allowed()`` method will be called,
passing the ``HttpRequest``, to determine whether registration of
an account is to be allowed; if not, a redirect is issued to the
view corresponding to the named URL pattern
``registration_disallowed``.
2. The form to use for account registration will be obtained by
calling the backend's ``get_form_class()`` method, passing the
``HttpRequest``.
3. If valid, the form's ``cleaned_data`` will be passed (as keyword
arguments, and along with the ``HttpRequest``) to the backend's
``register()`` method, which should return the new ``User`` object.
4. Upon successful registration, the backend's
``post_registration_redirect()`` method will be called, passing the
``HttpRequest`` and the new ``User``, to determine the URL to
redirect the user to.
We use a customized backend: seahub.base.accounts.RegistrationBackend
### Registration Process
Process 1:
1. User register
2. Admin activate
3. User login and bind ccnet ID
To Enable this process, just set
REGISTRATION_SEND_MAIL = False
Process 2:
1. User register and receive activation email
2. User active account and bind ccnet ID
Process 3:
1. Admin add user
2. User login and bind ccnet ID
About Authentication
====================
We use a custimized authentication method. See
seahub.base.accounts.EmailOrUsernameModelBackend
AUTHENTICATION_BACKENDS = (
'seahub.base.accounts.EmailOrUsernameModelBackend',
'django.contrib.auth.backends.ModelBackend'
)