Rev 5187 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | # Variable calculations should be done in this file. |
2 | # It is read and interpreted by wims for all valid calls to the module. |
||
3 | wims_form_method=post |
||
4 | wims_prefix=mb user |
||
5 | wims_helper=chapter=3 |
||
6 | |||
7 | !if $forum=$empty |
||
15323 | bpr | 8 | error=no_forum |
9 | !exit |
||
23 | reyssat | 10 | !endif |
2832 | bpr | 11 | !if $wims_class= |
5181 | guerimand | 12 | !read adm/language lang/names.phtml |
2832 | bpr | 13 | !else |
15323 | bpr | 14 | !read adm/class/classlang names.phtml |
2832 | bpr | 15 | !set modu_lang=$moduclass_lang |
16 | !endif |
||
23 | reyssat | 17 | !read adm/class/authchars |
18 | !if $forume=$empty |
||
15323 | bpr | 19 | !defread wimshome/log/forums/$forum/.def |
20 | !if $mb_defined!=yes |
||
21 | error=bad_forum |
||
22 | !exit |
||
23 | !endif |
||
24 | !if * isin $mb_password |
||
25 | error=no_register |
||
26 | !exit |
||
27 | !endif |
||
28 | !if $mb_password=+mail |
||
29 | mailverif=yes |
||
30 | !endif |
||
31 | participants=!recordcnt wimshome/log/forums/$forum/.userlist |
||
32 | forume=$mb_password\ |
||
23 | reyssat | 33 | $mb_title\ |
34 | $mb_description\ |
||
35 | $mb_supervisor\ |
||
36 | $mb_email |
||
15323 | bpr | 37 | !distribute lines $forume into password,title,description,supervisor,smail |
38 | passverify= |
||
39 | !exit |
||
23 | reyssat | 40 | !else |
15323 | bpr | 41 | !distribute lines $forume into password,title,description,supervisor,smail |
23 | reyssat | 42 | !endif |
43 | |||
44 | # forum password verification. |
||
45 | !if $step=1 |
||
15323 | bpr | 46 | forumpass=!text remove +-*/= in $forumpass |
47 | !if $forumpass=$password or $mailverif=yes |
||
48 | passverify=ok |
||
49 | !else |
||
50 | error=bad_forumpass |
||
51 | !endif |
||
52 | !exit |
||
23 | reyssat | 53 | !endif |
54 | |||
55 | !if $step=2 |
||
15323 | bpr | 56 | !for i in lastn,firstn |
57 | $i=!translate internal ,!$$<>" to $ $ in $($i) |
||
58 | $i=!trim $($i) |
||
59 | $i=!singlespace $($i) |
||
60 | $i=!char 1 to 20 of $($i) |
||
61 | !next i |
||
62 | !if $lastn=$empty |
||
63 | error=no_real |
||
64 | !exit |
||
65 | !endif |
||
66 | email=!translate internal ',|!<>"$$ to $ $ in $email |
||
67 | email=!word -1 of $email |
||
68 | email=!char 1 to 60 of $email |
||
69 | !if $email!=$empty and (@ notin $email or . notin $email) |
||
70 | email= |
||
71 | !endif |
||
72 | !if $mailverif=yes and $email=$empty |
||
73 | error=no_email |
||
74 | !exit |
||
75 | !endif |
||
76 | tmail=$email |
||
77 | n=!charcnt $login |
||
78 | !if $n<$login_min or $n>$login_max |
||
79 | error=login_size |
||
80 | !exit |
||
81 | !endif |
||
82 | test=!text select $char_login in $login |
||
83 | !if $test!=$login |
||
84 | error=bad_login |
||
85 | !exit |
||
86 | !endif |
||
87 | n=!charcnt $pass |
||
88 | !if $n<$passwd_min or $n>$passwd_max |
||
89 | error=pass_size |
||
90 | !exit |
||
91 | !endif |
||
92 | test=!text select $char_passwd in $pass |
||
93 | !if $test!=$pass |
||
94 | error=bad_pass |
||
95 | !exit |
||
96 | !endif |
||
97 | user_exists= |
||
98 | !defread wimshome/log/forums/$forum/.users/$login |
||
99 | !if $user_exists=yes |
||
100 | error=login_double |
||
101 | !exit |
||
102 | !endif |
||
23 | reyssat | 103 | !exit |
104 | !endif |
||
105 | |||
106 | !if $step=3 |
||
15323 | bpr | 107 | !if $pass!=$pass2 |
108 | error=pass_error |
||
109 | !exit |
||
110 | !endif |
||
111 | user_exists= |
||
112 | !defread wimshome/log/forums/$forum/.users/$login |
||
113 | !if $user_exists=yes |
||
114 | error=login_double |
||
115 | !exit |
||
116 | !endif |
||
117 | !if $mailverif=yes |
||
118 | secode=!randint 10^5,10^8-1 |
||
119 | !read lang/mail.proc.$modu_lang |
||
120 | !exit |
||
121 | !endif |
||
122 | !if $mailverif=next and $vericode!=$secode |
||
123 | error=auth_fail |
||
124 | !exit |
||
125 | !endif |
||
126 | pass=!passcrypt $pass |
||
127 | !writefile wimshome/log/forums/$forum/.users/$login !set user_lastname=$lastn\ |
||
23 | reyssat | 128 | !set user_firstname=$firstn\ |
129 | !set user_password=$pass\ |
||
130 | !set user_email=$tmail\ |
||
131 | !set user_exists=yes |
||
15323 | bpr | 132 | user_exists= |
133 | !defread wimshome/log/forums/$forum/.users/$login |
||
134 | !if $user_exists!=yes |
||
135 | error=insert_fail |
||
136 | !exit |
||
137 | !endif |
||
138 | !mexec mkuserlist.sh |
||
139 | wims_module_log=registered $login in $forum |
||
23 | reyssat | 140 | !exit |
141 | !endif |