Changeset 6419
- Timestamp:
- 08/20/08 08:36:00 (5 months ago)
- Location:
- Trunk/association/serversides/cctiddly/Trunk
- Files:
-
- 5 modified
-
handle/register.php (modified) (1 diff)
-
tiddlers/normal/ccAdaptor.js (modified) (1 diff)
-
tiddlers/normal/ccLogin.js (modified) (1 diff)
-
tiddlers/normal/ccRegister.js (modified) (7 diffs)
-
tiddlers/normal/purpleTheme.tiddler (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Trunk/association/serversides/cctiddly/Trunk/handle/register.php
r6409 r6419 22 22 echo count(db_record_select($tiddlyCfg['table']['user'],$data)); 23 23 exit; 24 } else {25 debug("username is not available", "params");26 exit;27 24 } 28 29 25 $res = db_record_insert($tiddlyCfg['table']['user'],$data); 30 26 -
Trunk/association/serversides/cctiddly/Trunk/tiddlers/normal/ccAdaptor.js
r6370 r6419 377 377 } 378 378 } 379 //console.log('puttidlercallback:'+context.status)380 379 if(context.callback){ 381 380 context.callback(context,context.userParams); -
Trunk/association/serversides/cctiddly/Trunk/tiddlers/normal/ccLogin.js
r6395 r6419 147 147 148 148 config.macros.ccLogin.loginCallback=function(context,userParams, responseText){ 149 alert("aaaa"+responseText);150 149 if(context.status){ 151 150 window.location=window.fullUrl; -
Trunk/association/serversides/cctiddly/Trunk/tiddlers/normal/ccRegister.js
r6409 r6419 8 8 stepRegisterTitle:"Register for an account.", 9 9 stepRegisterIntroText:"Hi, please register below.... ", 10 stepRegisterHtml:"<table><tr><td style='text-align: right;'>username</td><td><input class='input' id='reg_username' name='reg_username' tabindex='1'/></td><td><span></span><input type='hidden' name='username_error'></input></td></tr><tr><td style='text-align: right;'>email</td><td><input class='input' name=reg_mail id='reg_mail' tabindex='2'/></td><td class='inlineError' id='mail_error'/></tr><tr><td style='text-align: right;'>password</td><td><input type='password' class='input' id='password1' name='reg_password1' tabindex='3'/></td><td class='inlineError' id='pass1_error'/></tr><tr><td style='text-align: right;'>confirm password</td><td><input type='password' class='input' id='password2' name='reg_password2' tabindex='4'/></td><td class='inlineError' id='pass2_error'/></tr></table>",10 stepRegisterHtml:"<table><tr><td style='text-align: right;'>username</td><td><input class='input' id='reg_username' name='reg_username' tabindex='1'/></td><td><span></span><input type='hidden' name='username_error'></input></td></tr><tr><td style='text-align: right;'>email</td><td><input class='input' name=reg_mail id='reg_mail' tabindex='2'/></td><td><span> </span><input type='hidden' name='mail_error'></input></td></tr><tr><td style='text-align: right;'>password</td><td><input type='password' class='input' id='password1' name='reg_password1' tabindex='3'/></td><td><span> </span><input type='hidden' name='pass1_error'></input></td></tr><tr><td style='text-align: right;'>confirm password</td><td><input type='password' class='input' id='password2' name='reg_password2' tabindex='4'/></td><td><span> </span><input type='hidden' name='pass2_error'></input></td></tr></table>", 11 11 buttonCancel:"Cancel", 12 12 buttonCancelToolTip:"Cancel transaction ", … … 28 28 w.setButtons([ 29 29 {caption: me.buttonRegister, tooltip: me.buttonRegisterToolTip, onClick:function() { config.macros.register.doRegister(place, w)}}, 30 {caption: me.buttonCancel, tooltip: me.buttonCancelToolTip, onClick: function() { config.macros. login.refresh(place)}}30 {caption: me.buttonCancel, tooltip: me.buttonCancelToolTip, onClick: function() { config.macros.ccLogin.refresh(place)}} 31 31 ]); 32 33 } 32 } 33 34 35 config.macros.register.setStatus=function(w, element, text){ 36 var label_var = w.getElement(element); 37 removeChildren(label_var.previousSibling); 38 var label = document.createTextNode(text); 39 label_var.previousSibling.insertBefore(label,null); 40 } 41 42 34 43 35 44 config.macros.register.doRegister=function(place, w){ … … 38 47 displayMessage("no username entered"); 39 48 } 40 41 if(config.macros.ccRegister.emailValid(w.formElem["reg_mail"].value)){ 42 displayMessage("invalid email"); 43 // mail_space=document.getElementById('mail_error'); 44 // mail_space.innerHTML="email ok"; 45 // mail_space.setAttribute("class","inlineOk"); 46 }else{ 47 displayMessage("working email"); 48 // mail_space=document.getElementById('mail_error'); 49 // mail_space.innerHTML='not a valid email address '; 50 // mail_space.setAttribute("class","inlineError"); 51 return false; 52 } 53 if(w.formElem["reg_password1"].value===''){ 54 displayMessage("no first password was not entered"); 55 // document.getElementById('pass1_error').innerHTML='Please enter a password'; 56 // this.password1.setAttribute("class","inputError"); 57 return false; 58 if(w.formElem["reg_password2"].value===''){ 59 displayMessage("no second password was not entered"); 60 // document.getElementById('pass2_error').innerHTML='Please enter a password'; 61 // this.password2.setAttribute("class","inputError"); 62 return false; 63 49 displayMessage("reg value "+w.formElem["reg_mail"].value); 50 if(config.macros.register.emailValid(w.formElem["reg_mail"].value)){ 51 config.macros.register.setStatus(w, "mail_error", "email address is ok"); 52 }else{ 53 config.macros.register.setStatus(w, "mail_error", "invalid email address"); 54 return false; 55 } 56 if(w.formElem["reg_password1"].value==''){ 57 displayMessage("no paswo1"); 58 config.macros.register.setStatus(w, "pass1_error", "no password entered"); 59 return false; 60 }else{ 61 config.macros.register.setStatus(w, "pass1_error", ""); 62 } 63 if(w.formElem["reg_password2"].value==''){ 64 config.macros.register.setStatus(w, "pass2_error", "no password entered"); 65 return false; 66 } 64 67 if(w.formElem["reg_password1"].value != w.formElem["reg_password2"].value ){ 65 68 displayMessage("your passwords do not match"); … … 75 78 // document.getElementById('submitStatus').innerHTML='Please wait, your account is being created.'; 76 79 // setTimeout(config.macros.ccRegister.registerCheckResp,3000); 77 80 78 81 var loginResp=doHttp('POST',url+'/handle/register.php',"username="+w.formElem['reg_username'].value+"®_mail="+w.formElem['reg_mail'].value+"&password="+w.formElem['reg_password1'].value+"&password2="+w.formElem['reg_password2'].value,null,null,null,config.macros.register.registerCallback,params); 79 82 w.addStep(me.step2Title,"attempting to register your account.") ; … … 84 87 } 85 88 89 config.macros.register.emailValid=function(str){ 90 if((str.indexOf(".") > 0) && (str.indexOf("@") > 0)){ 91 return true; 92 }else{ 93 return false; 94 } 95 }; 96 97 config.macros.register.usernameValid=function(str){ 98 if((str.indexOf("_") > 0) && (str.indexOf("@") > 0)){ 99 return false; 100 }else{ 101 return true; 102 } 103 }; 104 86 105 config.macros.register.registerCallback=function(status,params,responseText,uri,xhr){ 87 106 displayMessage("txt = "+responseText); … … 89 108 window.location=window.location; 90 109 return true; 110 91 111 } 92 112 … … 98 118 }; 99 119 120 121 100 122 config.macros.register.isUsernameAvailabeCallback=function(status,params,responseText,uri,xhr){ 101 var username_error = params.w.getElement("username_error");102 removeChildren(username_error.previousSibling);103 123 var resp = (responseText > 0) ? 'The username has already been taken' : 'The username is available'; 104 var label = document.createTextNode(resp); 105 username_error.previousSibling.insertBefore(label,null); 124 config.macros.register.setStatus(params.w, "username_error", resp); 106 125 }; 107 126 -
Trunk/association/serversides/cctiddly/Trunk/tiddlers/normal/purpleTheme.tiddler
r6339 r6419 159 159 } 160 160 161 162 #sidebarOptions input { 163 border:1px solid #ddd; 164 } 165 166 161 167 .tabUnselected { 162 168 background:#eee none repeat scroll 0%; … … 273 279 #sidebarOptions input { 274 280 width:96%; 275 margin-left:0px; 276 } 281 margin-left:-0.1em;} 277 282 278 283 #sidebarTabs {
