Changeset 1196

Show
Ignore:
Timestamp:
02/18/10 13:31:33 (2 years ago)
Author:
Hugo
Message:

ispClient: save commit

Location:
trunk/unxsISP/interfaces/customer
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/unxsISP/interfaces/customer/product.c

    r574 r1196  
    1212 
    1313#include "interface.h" 
    14 static unsigned uProduct=0; 
     14unsigned uProduct=0; 
    1515static unsigned uStep=0; 
    1616 
    17 static unsigned uServices[100]={0}; 
    18 static unsigned uServiceStartPoint[100]={0}; 
    19 static unsigned uServiceEndPoint[100]={0}; 
    20 static char cParameterInput[100][100]={""}; //tClientConfig.cValue 
     17unsigned uServices[100]={0}; 
     18unsigned uServiceStartPoint[100]={0}; 
     19unsigned uServiceEndPoint[100]={0}; 
     20char cParameterInput[100][100]={""}; //tClientConfig.cValue 
    2121static char cParameterLabel[100][100]={""}; //tParameter.cISMName 
    22 static char cParameterName[100][100]={""};  //tParameter.cParameter 
     22char cParameterName[100][100]={""};  //tParameter.cParameter 
    2323static char *cParameterStyle[100]; 
    2424 
    25 static unsigned uParameterCount=0; 
    26 static unsigned uServicesCount=0; 
     25unsigned uParameterCount=0; 
     26unsigned uServicesCount=0; 
    2727static unsigned uPrevStatus=0; 
    2828MYSQL MysqlExt; 
  • trunk/unxsISP/interfaces/customer/purchase.c

    r1195 r1196  
    4343void htmlPurchasePage(char *cTitle,char *cTemplateName); 
    4444void UpdateCustomerInfo(void); 
     45void DeployRadius(void); 
    4546unsigned ValidPurchaseInput(void); 
    4647unsigned SubmitRequest(unsigned uInvoice); //payment.c 
    4748 
     49//product.c module vars for deployment 
     50extern unsigned uProduct; 
     51extern unsigned uServices[]; 
     52extern char cParameterInput[][100]; //tClientConfig.cValue 
     53extern char cParameterName[][100];  //tParameter.cParameter 
     54extern unsigned uParameterCount; 
     55extern unsigned uServicesCount; 
     56extern unsigned uServiceStartPoint[]; 
     57extern unsigned uServiceEndPoint[]; 
     58void DeployProduct(void); 
    4859 
    4960void ProcessPurchaseVars(pentry entries[], int x) 
     
    112123                                //If goes OK, create unxsISP data for radius account deployment 
    113124                                //and submit job 
     125                                DeployRadius(); 
    114126                        } 
    115127                } 
    116128 
    117129        } 
     130 
    118131}//void PurchaseCommands(pentry entries[], int x) 
    119132 
     
    395408 
    396409 
     410void 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  
    549549        sprintf(cUser,"%s.%s",cFirstName,cLastName); 
    550550 
    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())", 
    552552                        cFirstName 
    553553                        ,cLastName 
    554554                        ,cGenPassword 
     555                        ,cPassword 
    555556                        ,guLoginClient 
    556557                        ,cuCompany