Changeset 1181
- Timestamp:
- 02/10/10 08:48:40 (2 years ago)
- Files:
-
- 1 modified
-
trunk/unxsISP/interfaces/customer/registration.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/unxsISP/interfaces/customer/registration.c
r1180 r1181 35 35 //Local only 36 36 unsigned ValidateRegistrationInput(void); 37 void EmailRegistration(char *c TemplateName);37 void EmailRegistration(char *cSubject,char *cTemplateName); 38 38 void CommitRegistration(void); 39 39 void CreateTempRegistration(void); 40 40 void GenerateLoginInfo(void); 41 void CreatetTempClient(void); 41 42 42 43 //main.c … … 93 94 !strcmp(gcFunction,"Envoyer")) 94 95 { 96 CreatetTempClient(); 95 97 if(ValidateRegistrationInput()) 96 98 { … … 338 340 339 341 340 void EmailRegistration(char *c TemplateName)342 void EmailRegistration(char *cSubject,char *cTemplateName) 341 343 { 342 344 FILE *fp; 343 345 char cFrom[256]={"root"}; 344 char cSubject[256]={""};345 346 struct t_template template; 346 347 cSubject[255]=0; … … 417 418 418 419 LoadRegistration(); 420 printf("Content-type: text/plain\n\n"); 419 421 420 422 GetConfiguration("uRegistrationCompany",cuCompany); … … 431 433 ); 432 434 mysql_query(&gMysql,gcQuery); 435 printf("%s\n",gcQuery); 433 436 if(mysql_errno(&gMysql)) 434 437 htmlPlainTextError(mysql_error(&gMysql)); 435 438 guLoginClient=mysql_insert_id(&gMysql); 436 439 SetLanguage(); 440 printf("guLoginClient=%u\n",guLoginClient); 437 441 438 442 GenerateLoginInfo(); 439 443 440 EmailRegistration(" RegistrationMail1");441 444 EmailRegistration("Your Login Information","RegistrationMail1"); 445 printf("%s\n",gcQuery); 442 446 sprintf(gcQuery,"DELETE FROM tTempClient WHERE cHash='%s'",TextAreaSave(cId)); 443 447 mysql_query(&gMysql,gcQuery); 444 if(mysql_errno(&gMysql))445 htmlPlainTextError(mysql_error(&gMysql));446 448 printf("%s\n",gcQuery); 449 if(mysql_errno(&gMysql)) 450 htmlPlainTextError(mysql_error(&gMysql)); 447 451 htmlHeader("unxsISP Customer Interface","Header"); 448 452 htmlRegistrationPage("","RegistrationCompleted.Body"); … … 484 488 sprintf(cId,"%s",field[0]); 485 489 486 EmailRegistration(" RegistrationMail0");490 EmailRegistration("Please Confirm Your Registration","RegistrationMail0"); 487 491 488 492 }//void EmailAfterRegistration(void) … … 497 501 char *cLanguage=""; 498 502 499 CreatetTempClient();500 501 503 if(guTemplateSet==2) 502 504 cLanguage="English"; … … 543 545 char cGenPassword[100]={""}; 544 546 547 (void)srand((int)time((time_t *)NULL)); 545 548 to64(&cGenPassword[0],rand(),6); 546 549 cGenPassword[6]=0; … … 551 554 sprintf(cUser,"%s.%s",cFirstName,cLastName); 552 555 553 sprintf(gcQuery,"INSERT INTO tAuthorize SET cLabel='%s.%s',cPasswd='%s',uPerm=1,u Owner=%u,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",556 sprintf(gcQuery,"INSERT INTO tAuthorize SET cLabel='%s.%s',cPasswd='%s',uPerm=1,uCertClient=%u,uOwner=%s,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())", 554 557 cFirstName 555 558 ,cLastName 556 559 ,cGenPassword 557 560 ,guLoginClient 561 ,cuCompany 558 562 ); 559 563 mysql_query(&gMysql,gcQuery); … … 587 591 588 592 589 //unxsISP radius integration code590 591 void CreateProductInstace(void)592 {593 unsigned uInstance=0;594 595 //Insert tInstance record596 sprintf(gcQuery,"INSERT INTO tInstance SET uClient=%u,uProduct=1,cLabel='AstraTurbo',uCreatedBy=1,uOwner='%s',uCreatedDate=UNIX_TIMESTAMP(NOW())",597 guLoginClient598 ,cuCompany599 );600 mysql_query(&gMysql,gcQuery);601 if(mysql_errno(&gMysql))602 htmlPlainTextError(mysql_error(&gMysql));603 604 uInstance=mysql_insert_id(&gMysql);605 606 //Insert tClientConfig records607 //radius login608 sprintf(gcQuery,"INSERT INTO tClientConfig SET uGroup=%u,uService=1,uParameter=1,"609 "cValue='%s',uOwner=%u,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",610 uInstance611 ,cUser612 ,guLoginClient613 );614 mysql_query(&gMysql,gcQuery);615 if(mysql_errno(&gMysql))616 htmlPlainTextError(mysql_error(&gMysql));617 618 //radius password619 sprintf(gcQuery,"INSERT INTO tClientConfig SET uGroup=%u,uService=1,uParameter=2,"620 "cValue='%s',uOwner=%u,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",621 uInstance622 ,cPassword623 ,guLoginClient624 );625 mysql_query(&gMysql,gcQuery);626 if(mysql_errno(&gMysql))627 htmlPlainTextError(mysql_error(&gMysql));628 629 //radius profile630 sprintf(gcQuery,"INSERT INTO tClientConfig SET uGroup=%u,uService=1,uParameter=3,"631 "cValue='Unlimited',uOwner=%u,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",632 uInstance633 ,guLoginClient634 );635 mysql_query(&gMysql,gcQuery);636 if(mysql_errno(&gMysql))637 htmlPlainTextError(mysql_error(&gMysql));638 639 //radius cleartext yes/no640 sprintf(gcQuery,"INSERT INTO tClientConfig SET uGroup=%u,uService=1,uParameter=41,"641 "cValue='Yes',uOwner=%u,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",642 uInstance643 ,guLoginClient644 );645 mysql_query(&gMysql,gcQuery);646 if(mysql_errno(&gMysql))647 htmlPlainTextError(mysql_error(&gMysql));648 649 }//void CreateProductInstace(void)650 651 652 void SubmitunxsISPJob(void)653 {654 }//void SubmitunxsISPJob(void)655
