/[theodore]/bunnyblog/modules/logintools/newlogin.pyc


UCC Code Repository

Contents of /bunnyblog/modules/logintools/newlogin.pyc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Tue Jan 29 14:32:01 2008 UTC (12 years ago) by svn-admin
File MIME type: application/octet-stream
File size: 12592 byte(s)
Re-import of repository after repository database corruption.

1
2 µ‹Gc@sldkZdkZeiidƒdklZdkTdkTdkTdZ dZ
3 dZ dZ dZ d d
4 d gZhd
5 d <d d<dd<d d<d d<Zd d
6 dd dd gZdeiiddƒZdd„Zdd„Zd„Zd„Zd„Zddd„Zd„Zd„Zd„Zdd „Zdd!„Zd"„Z d#„Z!dd$„Z"dS(%Ns
7 ../modules(s ConfigObj(t*snewlogin_page.htmlsnewlogin_nojs.txtslogin_done.htmlseditform_nojs.txtsedacc_page.htmltemailtusernametrealnames
8 Login Nametpass1tPasswordtpass2sConfirmation Passwords Email Addresss Real Nametpass0shttp://t HTTP_HOSTtcCs²t|dƒ}|d}t|ƒt|tƒ}|id|ƒ}t|t
9 ƒ}|id|ƒ}t |ƒ}|o|idt|ƒ}ntGHdGH|GHtiƒdS(sDisplay the newlogin form.s
10 config.init templatedirs
11 **script**s**new login form**s<!-- **action** -->s N(t ConfigObjtuserdirtconfigR
12 t checknewlogintreadfilet newform_nojst newloginformtreplacet
13 thisscripttnewlogintemplatet newloginpaget filltemplatetactiont
14 actionlinet
15 serverlinetsystexit(R RRR
16 RRR ((t ./modules/logintools/newlogin.pytnewlogin-s
17 
18  cCsá|di}|djptiƒnt|ƒ|iƒ} | g}t
19 D]}|| jo ||qLqL~}t ||dtƒ} x;t
20 D]3}| |p"tdt
21 || |||ƒqqWt| ƒ}|ptd| |||ƒnt| |||ƒ}t| |||ƒ} | d}t|dƒ}t|| |ƒ}|dd }|t|d
22 |}t d |ƒt!|||d |d t"ƒ|d} t$| t%ƒ}
23 |
24 i'd|ƒ}
25 t(GHdGH|
26 GHtiƒdS(s4Process the results from new login form submissions.tlogintdonewloginnojstnolistsRequired field missing : "%s"s$Email address appears to be invalid.Rs
27 config.init email_messages
28 s?login=confirm&id=slog.txtt email_subjectthtmlR
29 s**this script**s N()ttheformtvaluet loginactionRRRR tkeyst
30 allentriest_[1]tnewloginformkeystentrytvallisttgetformtTruetformdictt invalidentryRRt validateemailRt validateloginRt validatepasstpasswordRR R t savedetailstlink_urltmsgt SCRIPTLOCt writefilet
31 sendmailmetFalseR
32 Rt logindonet logindonepageRR(R$R RRR&R7RRR,R(R=R/R4R
33 R R6R)R+R((Rt
34 donewloginCs>  
35  6 & 
36  
37 cCs¶dkl}l}dkl}t}y ||diƒ\} }} Wnt ƒnXt |dƒ}|i| ƒp t ƒn|| }|| =|d}||djo|di|ƒn|iƒt |dƒ} ||d}tii|ƒo t ƒn|| _d}xn|D]f}|d jo||}q|d
38 jo*||}||d td tƒ| |<q||| |<qW| iƒd k l!} | ƒ}|| d|ƒ|d<t |dƒ}| d}|d}|o%t&|ƒot&|ƒ|dd<n|o||dd<n|dood|}
39 x9| D]1}|d
40 jo|
41 |d| |d7}
42 qEqEWt)|d|
43 |d|ddtƒn|| |i*ƒfS(sMConfirm a login.
44 Either from an invite or from a user who has registered.(spass_decspass_enc(s encodestringtidstemp.iniRtpendings default.inis.iniRR4t timestampt daynumber(s SimpleCookietuserids
45 config.inismax-aget
46 cookiepathtpatht adminmails(A new user has created a login - "%s".
47
48 s : s
49 R"R#N(+tdataenctpass_dectpass_encRt encodestringR;tfailR$R%tthevalRBRAt newloginfailR R t tempstorethas_keytuservalsRtremovetwritet newconfigtnewpathtosREtisfiletfilenametNoneRR+R4R.tCookiet SimpleCookiet thecookieR tmaxageRDtintRR7R:toutput(R$R RRRPR[RKRNR\RZR7RSRLRAR4RJRHRTRDR RIRBRR+((Rtconfirmpsf    
50 
51 
52     
53  
54   
55 
56  
57  "cCs#d}t||||||ƒdS(s<Display the form for the user to edit their account details.R N(R7t display_editt
58 userconfigR RRt newcookie(R RRaRRbR7((Rt editaccount«scCsÔdkl}l}|di}|djptiƒn|iƒ} | g}t D]}|| jo ||qUqU~}
59 t|
60 |dtƒ}|d}||dƒd}|d} |d } t|ƒ} |d
61 }| p&d }t|||||||ƒn| |jo;| p ||jo&d }t|||||||ƒn| |d
62 <|d p&d}t|||||||ƒn|d |d <| p| oç| | jo&d}t|||||||ƒnt| ƒdjo&d}t|||||||ƒn| p ||jo&d}t|||||||ƒn|| dtdtƒ|d<t || t!|dƒdƒ}nx-|D]%}|t jo||||<q”q”W|i"ƒ|||fS(s7Process the results from edit account form submissions.(spass_encspass_decRtdoeditaccountnojsR RR4iRRRs5The email address you supplied appears to be invalid.sDYou must correctly enter your password to change your email address.Rs'You need to enter a name for us to use.sThe two passwords don't match.is.The password must be longer than 5 characters.s<You must correctly enter your current password to change it.RBRAs
63 config.iniRDN(#RGRIRHR$R%R&RRR'R(R)t edacckeysR+R,R-R.R/toldpassRat
64 storedpassRRR1RtoldemailR7R`R RRRbtlent
65 makecookieR RR(R$RaR RRRbR&R7RgRR,RRR(R/RHRhRIR)R+Rf((Rt doeditaccount°sV   6
66 
67 
68  
69  " 
70       $ 
71 cCs*|p
72 h}n|p
73 t}n|idƒ}|djo
74 g}nŽ|}x<|t|ƒdjo$|d7}||djoPqQqQWg}|||!i
75 dƒD]$}||jo||i ƒq¨q¨~}xN||D]B}|ddgjoqàn|i d||i|d ƒƒ}qàW|S( s'Fill in the blanks in a new login form.s**keynamelist**iÿÿÿÿis"'><t,RRs**%s**R N(R/R,t newloginlistttemplatetfindtindextkeynameststartRiR)tsplitR+tstripRtget(RnR/R,RpRqR)RrR+((RRès*
76 
77  
78 
79 
80 H &cCs|diƒ}t|ƒS(NR(R/RtRt
81 validemail(R/R((RR1ÿscCsÃ|d}t|dƒ}|idgƒ}tii ||dƒp ||jp|i
82 ƒt jot d||||ƒnx;|i
83 ƒD]-}|tjot d||||ƒqŽqŽW|S(NRstemp.iniR@s.inisUsername already exists.s%Username contains invalid characters.(R/tnameR R RNRut pendinglistRURERVtlowert RESERVEDNAMESR0RRtchart
84 validchars(R/R RRRNRwRxR{((RR2s
85 ;  cCsl|d}|d}||jotd||||ƒnt|ƒdjotd||||ƒn|S(NRRsThe two passwords don't match.is0The password must be at least 5 characters long.(R/RRR0R RRRi(R/R RRRR((RR3s
86 
87  c CsÅt|dƒ}|d}t|tƒ}|id|ƒ}t|t ƒ}|id|ƒ}t ||ƒ}|idd|dƒ}|o|idt|ƒ}ntGHd GH|GHtiƒd
88 S( sDisplay the newlogin form.s
89 config.iniR
90 s
91 **script**s**new login form**s<!-- **message** -->s<h2>s </h2><br>s<!-- **action** -->s N(R R R R
92 RRRRRRRRR/R7RRRRR( R7R/R RRR
93 RRR ((RR0s
94 cCsádkl}
95 l}dkl}t|dƒ}|o||d<n|
96 ƒ\}}} |||| ƒ}xh|D]`}|diƒoIt|dƒ|djo*||d} |di| ƒ||=qÐqpqpWtdƒ}x+|i|t|ƒƒotdƒ}qãW|t|ƒ} h|| <|| } xY|D]Q}|d jp |d
97 jo||| d <q9|d joq9||| |<q9W|idƒpg|d<n|di|dƒ|iƒ|| d tdtƒS(s®
98 Given the form from a validated new login, it saves the details to the
99 temporary store.
100
101 It also cleans up any out of date ones that haven't been used.
102 (s
103 returndatesdaycount(spass_encstemp.iniRiiRR@RRR4RRARBN(t dateutilst
104 returndatetdaycountRGRIR R RNRR/tyeartmonthtdayttodaytsectiontisdigitR]RwRQt randomstringtranROtstrtkeytstoreR+tappendRRR.(R R/RRR€RNR„R‡RRŠR~R‰R‚RwRIRƒR+((RR5,sD  
105 
106  
107 cCs7t|dƒ}t|dƒodSntdƒdS(sbCheck that new logins are enabled on this setup.
108 Return or display the error message and quit.s
109 config.init newloginlinkNs.Sorry, New Logins are Disabled on this System.(R R R tistrueterror(R R ((RRVs
110 cCstdƒdS(NsMSorry, you have either already confirmed your login, or it is out of date :-)(RŽ(((RRM^sc Csƒdkl}
111 |GHt|dƒ}|d} |p
112 |}nt t
113 | t ƒƒ} | i d|ƒ} t
114 | tƒ}|i d| ƒ}t||ƒ}|o|i dd|dƒ}n|i d |
115 t|d
116 ƒƒƒ}|i d |d ƒ}|i d |
117 t|dƒƒƒ}|i d|dƒ}|i d|d|ƒ}|o|i dt|ƒ}ntGHdGH|GHtiƒdS(sî
118 Display the form for editing account details.
119 This is a different form to creating a new account as it requires
120 confirmation of the old password before doing certain things, like
121 changing email address and password.
122 (sctimes
123 config.iniR
124 s
125 **script**s**edit account form**s<!-- **message** -->s<h2>s </h2><br>s**created on**tcreateds**num logins**t numloginss **last used**tlastuseds **num used**tnumuseds**this script**s?action=s<!-- **action** -->s N(ttimetctimeRbR R R R
126 RaR/tunicodeRt editform_nojst edaccformRRt edacctemplatet edaccpageRR7tfloatRRRRR( R/R RR7RRbRaR™R R—R”R
127 ((RR`cs2 
128 
129 ""(#RRURER‹t configobjR t pathutilstcgiutilst
130 loginutilsRRR<R–R˜RmR*RetenvironRuR8RXRR>R_RcRkRR1R2R3R0R5RRMR`(RcR*R`R8RmRkR>R1R_R5R R3R2R–R˜RRRRRR<R0RRMRURe((Rt?s:   3  - ;  8   *  

Properties

Name Value
svn:mime-type application/octet-stream

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26