Changeset 1196
- Timestamp:
- 02/18/10 13:31:33 (2 years ago)
- Location:
- trunk/unxsISP/interfaces/customer
- Files:
-
- 3 modified
-
product.c (modified) (1 diff)
-
purchase.c (modified) (3 diffs)
-
registration.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/unxsISP/interfaces/customer/product.c
r574 r1196 12 12 13 13 #include "interface.h" 14 staticunsigned uProduct=0;14 unsigned uProduct=0; 15 15 static unsigned uStep=0; 16 16 17 staticunsigned uServices[100]={0};18 staticunsigned uServiceStartPoint[100]={0};19 staticunsigned uServiceEndPoint[100]={0};20 staticchar cParameterInput[100][100]={""}; //tClientConfig.cValue17 unsigned uServices[100]={0}; 18 unsigned uServiceStartPoint[100]={0}; 19 unsigned uServiceEndPoint[100]={0}; 20 char cParameterInput[100][100]={""}; //tClientConfig.cValue 21 21 static char cParameterLabel[100][100]={""}; //tParameter.cISMName 22 staticchar cParameterName[100][100]={""}; //tParameter.cParameter22 char cParameterName[100][100]={""}; //tParameter.cParameter 23 23 static char *cParameterStyle[100]; 24 24 25 staticunsigned uParameterCount=0;26 staticunsigned uServicesCount=0;25 unsigned uParameterCount=0; 26 unsigned uServicesCount=0; 27 27 static unsigned uPrevStatus=0; 28 28 MYSQL MysqlExt; -
trunk/unxsISP/interfaces/customer/purchase.c
r1195 r1196 43 43 void htmlPurchasePage(char *cTitle,char *cTemplateName); 44 44 void UpdateCustomerInfo(void); 45 void DeployRadius(void); 45 46 unsigned ValidPurchaseInput(void); 46 47 unsigned SubmitRequest(unsigned uInvoice); //payment.c 47 48 49 //product.c module vars for deployment 50 extern unsigned uProduct; 51 extern unsigned uServices[]; 52 extern char cParameterInput[][100]; //tClientConfig.cValue 53 extern char cParameterName[][100]; //tParameter.cParameter 54 extern unsigned uParameterCount; 55 extern unsigned uServicesCount; 56 extern unsigned uServiceStartPoint[]; 57 extern unsigned uServiceEndPoint[]; 58 void DeployProduct(void); 48 59 49 60 void ProcessPurchaseVars(pentry entries[], int x) … … 112 123 //If goes OK, create unxsISP data for radius account deployment 113 124 //and submit job 125 DeployRadius(); 114 126 } 115 127 } 116 128 117 129 } 130 118 131 }//void PurchaseCommands(pentry entries[], int x) 119 132 … … 395 408 396 409 410 void DeployRadius(void) 411 { 412 MYSQL_RES *res; 413 MYSQL_ROW field; 414 415 //Initialize known values 416 uProduct=1; 417 uServices[0]=1; 418 uServiceStartPoint[0]=0; 419 uServiceEndPoint[0]=4; 420 sprintf(cParameterName[0],"unxsRadius.Login"); 421 sprintf(cParameterName[1],"unxsRadius.ClearText"); 422 sprintf(cParameterName[2],"unxsRadius.Passwd"); 423 sprintf(cParameterName[3],"unxsRadius.Profile"); 424 425 //Set radius account parameters 426 sprintf(gcQuery,"SELECT cLabel,cClrPasswd FROM tAuthorize WHERE uCertClient=%u",guLoginClient); 427 mysql_query(&gMysql,gcQuery); 428 if(mysql_errno(&gMysql)) 429 htmlPlainTextError(mysql_error(&gMysql)); 430 res=mysql_store_result(&gMysql); 431 if((field=mysql_fetch_row(res))) 432 { 433 sprintf(cParameterInput[0],"%s",field[0]); 434 sprintf(cParameterInput[1],"Yes"); 435 sprintf(cParameterInput[2],"%s",field[1]); 436 sprintf(cParameterInput[3],"Unlimited"); 437 } 438 else 439 htmlPlainTextError("Unexpected condition. Contact support. DeployRadius() error"); 440 441 uParameterCount=4; 442 uServicesCount=1; 443 444 //Commit 445 DeployProduct(); 446 447 }//void DeployRadius(void) 448 -
trunk/unxsISP/interfaces/customer/registration.c
r1184 r1196 549 549 sprintf(cUser,"%s.%s",cFirstName,cLastName); 550 550 551 sprintf(gcQuery,"INSERT INTO tAuthorize SET cLabel='%s.%s',cPasswd='%s', uPerm=1,uCertClient=%u,uOwner=%s,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",551 sprintf(gcQuery,"INSERT INTO tAuthorize SET cLabel='%s.%s',cPasswd='%s',cClrPasswd='%s',uPerm=1,uCertClient=%u,uOwner=%s,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())", 552 552 cFirstName 553 553 ,cLastName 554 554 ,cGenPassword 555 ,cPassword 555 556 ,guLoginClient 556 557 ,cuCompany
