这篇教程C++ websGetVar函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中websGetVar函数的典型用法代码示例。如果您正苦于以下问题:C++ websGetVar函数的具体用法?C++ websGetVar怎么用?C++ websGetVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了websGetVar函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: formDisplayUserstatic void formDisplayUser(webs_t wp, char_t *path, char_t *query){ char_t *userid, *ok, *temp; bool_t enabled; a_assert(wp); userid = websGetVar(wp, T("user"), T("")); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websWrite(wp, T("<body>")); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Display User Cancelled")); } else if (umUserExists(userid) == FALSE) { websWrite(wp, T("ERROR: User <b>%s</b> not found./n"), userid); } else { websWrite(wp, T("<h2>User ID: <b>%s</b></h2>/n"), userid); temp = umGetUserGroup(userid); websWrite(wp, T("<h3>User Group: <b>%s</b></h3>/n"), temp); enabled = umGetUserEnabled(userid); websWrite(wp, T("<h3>Enabled: <b>%d</b></h3>/n"), enabled); } websWrite(wp, T("</body>/n")); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:29,
示例2: formDeleteGroupstatic void formDeleteGroup(webs_t wp, char_t *path, char_t *query){ char_t *group, *ok; a_assert(wp); group = websGetVar(wp, T("group"), T("")); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Delete Group Cancelled.")); } else if ((group == NULL) || (*group == '/0')) { websWrite(wp, T("ERROR: No group was selected.")); } else if (umGetGroupProtected(group)) { websWrite(wp, T("ERROR: Group, /"%s/" is delete-protected."), group); } else if (umGetGroupInUse(group)) { websWrite(wp, T("ERROR: Group, /"%s/" is being used."), group); } else if (umDeleteGroup(group) != 0) { websWrite(wp, T("ERROR: Unable to delete group, /"%s/" "), group); } else { websWrite(wp, T("Group, /"%s/" was successfully deleted."), group); } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:30,
示例3: storageDiskPartstatic void storageDiskPart(webs_t wp, char_t *path, char_t *query){ char_t *part1_vol, *part2_vol, *part3_vol; int max_part = atoi(websGetVar(wp, T("max_part"), T(""))); FILE *fp = NULL; char part[30]; if (NULL == (fp = fopen("/proc/mounts", "r"))) { perror(__FUNCTION__); return; } while(EOF != fscanf(fp, "%s %*s %*s %*s %*s %*s/n", part)) { if (NULL != strstr(part, "/dev/sd") || NULL != strstr(part, "/dev/mmc")) doSystem("umount -l %s", part); } fclose(fp); part1_vol = websGetVar(wp, T("part1_vol"), T("")); part2_vol = websGetVar(wp, T("part2_vol"), T("")); part3_vol = websGetVar(wp, T("part3_vol"), T("")); doSystem("storage.sh reparted %s %s %s %d", part1_vol, part2_vol, part3_vol, max_part); sleep(50); memset(part, 0, 30); do { sprintf(part, "/dev/sda%d", max_part+4); FormatPart(part, ""); sleep(5); } while (max_part--); doSystem("storage.sh restart"); sleep(5); websRedirect(wp, "usb/STORAGEdisk_admin.asp");}
开发者ID:houzhenggang,项目名称:MT,代码行数:34,
示例4: formDeleteUserstatic void formDeleteUser(webs_t wp, char_t *path, char_t *query){ char_t *userid, *ok; a_assert(wp); userid = websGetVar(wp, T("user"), T("")); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Delete User Cancelled")); } else if (umUserExists(userid) == FALSE) { websWrite(wp, T("ERROR: User /"%s/" not found"), userid); } else if (umGetUserProtected(userid)) { websWrite(wp, T("ERROR: User, /"%s/" is delete-protected."), userid); } else if (umDeleteUser(userid) != 0) { websWrite(wp, T("ERROR: Unable to delete user, /"%s/" "), userid); } else { websWrite(wp, T("User, /"%s/" was successfully deleted."), userid); } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:28,
示例5: process_bus_config_sta_status_reqPRIVATE int process_bus_config_sta_status_req(Webs *wp){ char *seq, *status, *act; act = websGetVar(wp, "act", ""); int ret = RET_OK; char sta_buff[2048]; if(strcmp(act, "set") == 0){ seq = websGetVar(wp, "seq", ""); status = websGetVar(wp, "status", ""); ret = set_bus_config_bus_driving_data(atoi(seq), atoi(status)); if(ret == RET_OK){ process_web_write_response(wp, HTTP_CODE_OK, "ok" , 0); }else{ process_web_write_response(wp, HTTP_CODE_OK, "error" , 0); } }else if(strcmp(act, "get") == 0){ memset(sta_buff, 0, sizeof(sta_buff)); ret = get_bus_config_bus_driving_data(sta_buff, 2048); if( (strlen(sta_buff) < 2) || (ret !=RET_OK)){ process_web_write_response(wp, HTTP_CODE_OK, "[]" , 0); }else{ process_web_write_response(wp, HTTP_CODE_OK, sta_buff , 0); } }else{ process_web_write_response(wp, HTTP_CODE_OK, "param error" , 0); }}
开发者ID:lubing521,项目名称:wifi-bus-app,代码行数:28,
示例6: StorageEditUser/* goform/StorageEditUser */static void StorageEditUser(webs_t wp, char_t *path, char_t *query){ char_t *index, *password; char_t *user_ftp_enable, *user_smb_enable; char feild[20]; feild[0] = '/0'; // fetch from web input index = websGetVar(wp, T("hiddenIndex"), T("")); password = websGetVar(wp, T("edituser_pw"), T("")); user_ftp_enable = websGetVar(wp, T("edituser_ftp"), T("")); user_smb_enable = websGetVar(wp, T("edituser_smb"), T("")); /* DEBUG(index); DEBUG(password); DEBUG(user_ftp_enable); DEBUG(user_smb_enable); */ // set to nvram sprintf(feild, "User%sPasswd", index); nvram_bufset(RT2860_NVRAM, feild, password); sprintf(feild, "FtpUser%s", index); // DEBUG(feild); nvram_bufset(RT2860_NVRAM, feild, user_ftp_enable); sprintf(feild, "SmbUser%s", index); // DEBUG(feild); nvram_bufset(RT2860_NVRAM, feild, user_smb_enable); nvram_commit(RT2860_NVRAM); doSystem("storage.sh admin"); websRedirect(wp, "usb/STORAGEuser_admin.asp");}
开发者ID:houzhenggang,项目名称:MT,代码行数:34,
示例7: iTunesSrvstatic void iTunesSrv(webs_t wp, char_t *path, char_t *query){ char_t *enable, *dir_path, *name; // fetch from web input enable = websGetVar(wp, T("enabled"), T("0")); dir_path = websGetVar(wp, T("dir_path"), T("")); name = websGetVar(wp, T("srv_name"), T("")); // set to nvram nvram_bufset(RT2860_NVRAM, "iTunesEnable", enable); nvram_bufset(RT2860_NVRAM, "iTunesDir", dir_path); nvram_bufset(RT2860_NVRAM, "iTunesSrvName", name); nvram_commit(RT2860_NVRAM); // setup device doSystem("killall mt-daapd; killall mDNSResponder"); if (strcmp(enable, "1") == 0) doSystem("config-iTunes.sh /"%s/" /"%s/" /"%s/"", name, nvram_bufget(RT2860_NVRAM, "Password"), dir_path); // debug print websHeader(wp); websWrite(wp, T("<h2>iTunes Server Settings</h2><br>/n")); websWrite(wp, T("capability: %s<br>/n"), enable); websWrite(wp, T("srv_name: %s<br>/n"), name); websWrite(wp, T("media library: %s<br>/n"), dir_path); websFooter(wp); websDone(wp, 200);}
开发者ID:houzhenggang,项目名称:MT,代码行数:31,
示例8: storageAdm/* goform/storageAdm */static void storageAdm(webs_t wp, char_t *path, char_t *query){ char_t *submit; submit = websGetVar(wp, T("hiddenButton"), T("")); if (0 == strcmp(submit, "delete")) { char_t *user_select; char feild[20]; feild[0] = '/0'; user_select = websGetVar(wp, T("storage_user_select"), T("")); sprintf(feild, "User%s", user_select); nvram_bufset(RT2860_NVRAM, feild, ""); doSystem("rm -rf /"%s/home/%s/"", first_part, nvram_bufget(RT2860_NVRAM, feild)); sprintf(feild, "User%sPasswd", user_select); nvram_bufset(RT2860_NVRAM, feild, ""); sprintf(feild, "FtpUser%s", user_select); nvram_bufset(RT2860_NVRAM, feild, ""); sprintf(feild, "SmbUser%s", user_select); nvram_bufset(RT2860_NVRAM, feild, ""); nvram_commit(RT2860_NVRAM); doSystem("storage.sh admin"); } else if (0 == strcmp(submit, "apply")) { initUSB(); } websRedirect(wp, "usb/STORAGEuser_admin.asp");}
开发者ID:houzhenggang,项目名称:MT,代码行数:32,
示例9: loginServiceProc/* Internal login service routine for Form-based auth */static void loginServiceProc(Webs *wp){ WebsRoute *route; assert(wp); route = wp->route; assert(route); if (websLoginUser(wp, websGetVar(wp, "username", ""), websGetVar(wp, "password", ""))) { /* If the application defines a referrer session var, redirect to that */ char *referrer; if ((referrer = websGetSessionVar(wp, "referrer", 0)) != 0) { websRedirect(wp, referrer); } else { websRedirectByStatus(wp, HTTP_CODE_OK); } websSetSessionVar(wp, "loginStatus", "ok"); } else { if (route->askLogin) { (route->askLogin)(wp); } websSetSessionVar(wp, "loginStatus", "failed"); websRedirectByStatus(wp, HTTP_CODE_UNAUTHORIZED); }}
开发者ID:Liu1992,项目名称:GasSub_LPC1788,代码行数:28,
示例10: QoSSetupstatic void QoSSetup(webs_t wp, char_t *path, char_t *query){ char *submitUrl; char_t *QoS_type = websGetVar(wp, T("QoSSelect"), T("0")); if (QoS_type == NULL) QoS_type = "0"; char_t *simpleqos = websGetVar(wp, T("simple_qos"), T("0")); if (strcmp(simpleqos, "on") != 0) simpleqos = "off"; simpleqos = (strcmp(simpleqos, "on") == 0) ? "1" : "0"; nvram_init(RT2860_NVRAM); nvram_bufset(RT2860_NVRAM, "QoSEnable", QoS_type); nvram_bufset(RT2860_NVRAM, "simple_qos", simpleqos); if (CHK_IF_DIGIT(QoS_type, 2)) setupParameters(wp, QoS_args, 0); nvram_close(RT2860_NVRAM); doSystem("service shaper restart && service iptables restart && service kext restart"); submitUrl = websGetVar(wp, T("submit-url"), T("")); // hidden page#ifdef PRINT_DEBUG if (!submitUrl || !submitUrl[0]) websDone(wp, 200); else#endif websRedirect(wp, submitUrl);}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:31,
示例11: process_bus_config_cur_line_reqPRIVATE int process_bus_config_cur_line_req(Webs *wp){ char *line_name,*line_direction,*act; act = websGetVar(wp, "act", ""); int ret = RET_OK; if(strcmp(act, "set") == 0){ line_name = websGetVar(wp, "line_name", ""); line_direction = websGetVar(wp, "line_direction", ""); ret = set_bus_config_bus_num(line_name); ret = set_bus_config_bus_derection( atoi(line_direction) ); ret = update_bus_config_bus_cur_line_info(); if(ret == RET_OK){ process_web_write_response(wp, HTTP_CODE_OK, "ok" , 0); }else{ process_web_write_response(wp, HTTP_CODE_OK, "error" , 0); } }else if(strcmp(act, "get") == 0){ if(strlen(bus_cur_line_info) < 10){ process_web_write_response(wp, HTTP_CODE_OK, "[]" , 0); }else{ process_web_write_response(wp, HTTP_CODE_OK, bus_cur_line_info , 0); } }else{ process_web_write_response(wp, HTTP_CODE_OK, "param error" , 0); }}
开发者ID:lubing521,项目名称:wifi-bus-app,代码行数:27,
示例12: webcamra/* goform/webcamra */static void webcamra(webs_t wp, char_t *path, char_t *query){ char_t *enable, *resolution, *fps, *port; // fetch from web input enable = websGetVar(wp, T("enabled"), T("")); resolution = websGetVar(wp, T("resolution"), T("")); fps = websGetVar(wp, T("fps"), T("")); port = websGetVar(wp, T("port"), T("")); // set to nvram nvram_bufset(RT2860_NVRAM, "WebCamEnabled", enable); nvram_bufset(RT2860_NVRAM, "WebCamResolution", resolution); nvram_bufset(RT2860_NVRAM, "WebCamFPS", fps); nvram_bufset(RT2860_NVRAM, "WebCamPort", port); nvram_commit(RT2860_NVRAM); // setup device doSystem("killall uvc_stream"); if (0 == strcmp(enable, "1")) { doSystem("uvc_stream -r %s -f %s -p %s -b", resolution, fps, port); } // debug print websHeader(wp); websWrite(wp, T("<h2>Web Camera Settings</h2><br>/n")); websWrite(wp, T("enabled: %s<br>/n"), enable); websWrite(wp, T("resolution: %s<br>/n"), resolution); websWrite(wp, T("fps: %s<br>/n"), fps); websWrite(wp, T("port: %s<br>/n"), port); websFooter(wp); websDone(wp, 200);}
开发者ID:houzhenggang,项目名称:MT,代码行数:36,
示例13: formDeleteAccessLimitstatic void formDeleteAccessLimit(webs_t wp, char_t *path, char_t *query){ char_t *url, *ok; a_assert(wp); url = websGetVar(wp, T("url"), T("")); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Delete Access Limit Cancelled")); } else if (umDeleteAccessLimit(url) != 0) { websWrite(wp, T("ERROR: Unable to delete Access Limit for [%s]"), url); } else { websWrite(wp, T("Access Limit for [%s], was successfully deleted."), url); } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:26,
示例14: storageSmbSrv/* goform/storageSmbSrv */static void storageSmbSrv(webs_t wp, char_t *path, char_t *query){ char_t *submit; submit = websGetVar(wp, T("hiddenButton"), T("")); if (0 == strcmp(submit, "delete")) { int index; FILE *fp; char smb_config_file[25]; // strcpy(smb_config_file, "/var/.smb_config"); sprintf(smb_config_file, "%s/.smb_config", first_part); fp = fopen(smb_config_file, "w"); if (NULL == fp) { perror(__FUNCTION__); return; } index = atoi(websGetVar(wp, T("selectIndex"), T(""))); // fprintf(stderr, "before set bitmap: %x%x%x/n", smb_conf.bitmap[2], smb_conf.bitmap[1], smb_conf.bitmap[0]); smb_conf.bitmap[index/32] &= ~(1<<(index%32)); // fprintf(stderr, "after set bitmap: %x%x%x/n", smb_conf.bitmap[2], smb_conf.bitmap[1], smb_conf.bitmap[0]); smb_conf.count--; // fprintf(stderr, "smb dir count: %d/n", smb_conf.count); fwrite(&smb_conf, sizeof(struct smb_dir_config), 1, fp); fclose(fp); websRedirect(wp, "usb/SAMBAsmbsrv.asp"); } else if (0 == strcmp(submit, "apply")) { char_t *smb_enable, *wg, *netbios; // fetch from web input smb_enable = websGetVar(wp, T("smb_enabled"), T("")); wg = websGetVar(wp, T("smb_workgroup"), T("")); netbios = websGetVar(wp, T("smb_netbios"), T("")); // set to nvram nvram_bufset(RT2860_NVRAM, "SmbEnabled", smb_enable); nvram_bufset(RT2860_NVRAM, "HostName", wg); nvram_bufset(RT2860_NVRAM, "SmbNetBIOS", netbios); nvram_commit(RT2860_NVRAM); // setup device SetSambaSrv(); // debug print websHeader(wp); websWrite(wp, T("<h2>smb_enabled: %s</h2><br>/n"), smb_enable); websWrite(wp, T("smb_workgroup: %s<br>/n"), wg); websWrite(wp, T("smb_netbios: %s<br>/n"), netbios); websFooter(wp); websDone(wp, 200); }}
开发者ID:houzhenggang,项目名称:MT,代码行数:59,
示例15: storageMediaSrvstatic void storageMediaSrv(webs_t wp, char_t *path, char_t *query){ char_t *submit; submit = websGetVar(wp, T("hiddenButton"), T("")); if (0 == strcmp(submit, "delete")) { int index; FILE *fp; char media_config_file[25]; // strcpy(smb_config, "/var/.smb_config"); sprintf(media_config_file, "%s/.media_config", first_part); fp = fopen(media_config_file, "w"); if (NULL == fp) { perror(__FUNCTION__); return; } index = atoi(websGetVar(wp, T("media_dir"), T(""))); memset(&media_conf[index].path, 0, sizeof(media_conf[index].path)); fwrite(media_conf, sizeof(media_conf), 1, fp); fclose(fp); websRedirect(wp, "usb/USHAREmediasrv.asp"); } else if (0 == strcmp(submit, "apply")) { char_t *media_enabled, *media_name; int i; // fetch from web input media_enabled = websGetVar(wp, T("media_enabled"), T("")); media_name = websGetVar(wp, T("media_name"), T("")); // set to nvram nvram_bufset(RT2860_NVRAM, "mediaSrvEnabled", media_enabled); nvram_bufset(RT2860_NVRAM, "mediaSrvName", media_name); nvram_commit(RT2860_NVRAM); // setup device if (0 == strcmp(media_enabled, "0")) memset(media_conf, 0, sizeof(media_conf)); RunMediaSrv(); // debug print websHeader(wp); websWrite(wp, T("<h2>Media Server Settings</h2><br>/n")); websWrite(wp, T("media_enabled: %s<br>/n"), media_enabled); websWrite(wp, T("media_name: %s<br>/n"), media_name); for(i=0;i<4;i++) websWrite(wp, T("media dir%d path: %s<br>/n"), i, media_conf[i].path); websFooter(wp); websDone(wp, 200); }}
开发者ID:houzhenggang,项目名称:MT,代码行数:57,
示例16: formTeststatic void formTest( webs_t wp, char_t* path, char_t* query ){ char_t* name, *address; name = websGetVar( wp, T( "name" ), T( "Joe Smith" ) ); address = websGetVar( wp, T( "address" ), T( "1212 Milky Way Ave." ) ); websHeader( wp ); websWrite( wp, T( "<body><h2>Name: %s, Address: %s</h2>/n" ), name, address ); websFooter( wp ); websDone( wp, 200 );}
开发者ID:codywon,项目名称:bell-jpg,代码行数:10,
示例17: actionTest/* Implement /action/actionTest. Parse the form variables: name, address and echo back. */static void actionTest(Webs *wp, char *path, char *query){ char *name, *address; name = websGetVar(wp, "name", NULL); address = websGetVar(wp, "address", NULL); websSetStatus(wp, 200); websWriteHeaders(wp, -1, 0); websWriteEndHeaders(wp); websWrite(wp, "<html><body><h2>name: %s, address: %s</h2></body></html>/n", name, address); websDone(wp);}
开发者ID:AnXi-TieGuanYin-Tea,项目名称:goahead,代码行数:15,
示例18: formAddAccessLimitstatic void formAddAccessLimit(webs_t wp, char_t *path, char_t *query){ char_t *url, *method, *group, *secure, *ok; int nCheck; accessMeth_t am; short nSecure; a_assert(wp); url = websGetVar(wp, T("url"), T("")); group = websGetVar(wp, T("group"), T("")); method = websGetVar(wp, T("method"), T("")); secure = websGetVar(wp, T("secure"), T("")); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Add Access Limit Cancelled.")); } else if ((url == NULL) || (*url == 0)) { websWrite(wp, T("ERROR: No URL was entered.")); } else if (umAccessLimitExists(url)) { websWrite(wp, T("ERROR: An Access Limit for [%s] already exists."), url); } else { if (method && *method) { am = (accessMeth_t) gatoi(method); } else { am = AM_FULL; } if (secure && *secure) { nSecure = (short) gatoi(secure); } else { nSecure = 0; } nCheck = umAddAccessLimit(url, am, nSecure, group); if (nCheck != 0) { websWrite(wp, T("Unable to add Access Limit for [%s]"), url); } else { websWrite(wp, T("Access limit for [%s], was successfully added."), url); } } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:51,
示例19: QoSPortSetupstatic void QoSPortSetup(webs_t wp, char_t *path, char_t *query){ int i; char_t *portX[32]; char_t *portX_remark[32]; char tmp_str[512]; memset(portX, 0, sizeof(char *) * 32); memset(portX_remark, 0, sizeof(char *) * 32); for(i=0; i<5; i++) { sprintf(tmp_str, "port%d_group", i); portX[i] = websGetVar(wp, T(tmp_str), T("")); sprintf(tmp_str, "port%d_remarker", i); portX_remark[i] = websGetVar(wp, T(tmp_str), T("")); } for(i=1; i<9; i++) { sprintf(tmp_str, "ssid%d_group", i); portX[i+4] = websGetVar(wp, T(tmp_str), T("")); sprintf(tmp_str, "ssid%d_remarker", i); portX_remark[i+4] = websGetVar(wp, T(tmp_str), T("")); } tmp_str[0] = '/0'; for(i=0; i<13; i++) { if(portX[i]) strcat(tmp_str, portX[i]); strcat(tmp_str, ","); if(portX_remark[i]) strcat(tmp_str, portX_remark[i]); strcat(tmp_str, ","); } nvram_bufset(RT2860_NVRAM, "QoSPortBasedRules", tmp_str); nvram_commit(RT2860_NVRAM); QoSRestart(); websHeader(wp); for(i=0; i<13; i++) { sprintf(tmp_str, "port%d=%s,%s<br>", i, portX[i], portX_remark[i]); websWrite(wp, T(tmp_str)); } websFooter(wp); websDone(wp, 200);}
开发者ID:withwave,项目名称:RT5350,代码行数:49,
示例20: QoSDeleteRulesstatic void QoSDeleteRules(webs_t wp, char_t *path, char_t *query, char *which_rule){ int i, j, rule_count; char_t name_buf[16]; char_t *value; int *deleArray; char *new_rules; const char *rules = nvram_bufget(RT2860_NVRAM, which_rule); if(!rules || !strlen(rules) ) return; rule_count = getRuleNums(rules); if(!rule_count) return; deleArray = (int *)malloc(rule_count * sizeof(int)); if(!deleArray) return; new_rules = strdup(rules); if(!new_rules) { free(deleArray); return; } for(i=0, j=0; i< rule_count; i++) { snprintf(name_buf, 16, "del_qos_%d", i); value = websGetVar(wp, name_buf, NULL); if(value) { deleArray[j++] = i; } } if(!j) { free(deleArray); free(new_rules); websHeader(wp); websWrite(wp, T("You didn't select any rules to delete.<br>/n")); websFooter(wp); websDone(wp, 200); return; } deleteNthValueMulti(deleArray, j, new_rules, ';'); nvram_set(RT2860_NVRAM, which_rule, new_rules); nvram_commit(RT2860_NVRAM); QoSRestart(); websHeader(wp); websWrite(wp, T("Delete Rules:/n") ); for(i=0; i<j; i++) websWrite(wp, "%d ", (deleArray[i] + 1) ); websFooter(wp); websDone(wp, 200); free(deleArray); free(new_rules);}
开发者ID:withwave,项目名称:RT5350,代码行数:60,
示例21: formLoadUserManagementstatic void formLoadUserManagement( webs_t wp, char_t* path, char_t* query ){ char_t* ok; a_assert( wp ); ok = websGetVar( wp, T( "ok" ), T( "" ) ); websHeader( wp ); websMsgStart( wp ); if ( gstricmp( ok, T( "ok" ) ) != 0 ) { websWrite( wp, T( "Load Cancelled." ) ); } else if ( umRestore( NULL ) != 0 ) { websWrite( wp, T( "ERROR: Unable to load user configuration." ) ); } else { websWrite( wp, T( "User configuration was re-loaded successfully." ) ); } websMsgEnd( wp ); websFooter( wp ); websDone( wp, 200 );}
开发者ID:codywon,项目名称:bell-jpg,代码行数:27,
示例22: save_musicintsave_music(webs_t wp, char *value, struct variable *v, struct service *s){ char buf[LONG_BUF_LEN], tmp[LONG_BUF_LEN]; char *enable; int change = 0; int64_t map = 0; /* Enable */ snprintf(tmp, sizeof(tmp), "music_enable"); enable = websGetVar(wp, tmp, ""); /* save music_rule */ ezplib_get_rule("music_rule", 0, tmp, sizeof(tmp)); snprintf(buf, sizeof(buf), "%s", enable); if (strcmp(buf, tmp)) { config_preaction(&map, v, s, "", ""); ezplib_replace_rule("music_rule", 0, buf); ezplib_replace_rule("bw_enable", 0, buf); config_postaction(map, s, "", ""); change = 1; } return change;}
开发者ID:aircross,项目名称:ray,代码行数:27,
示例23: StorageAddUser/* goform/StorageAddUser */static void StorageAddUser(webs_t wp, char_t *path, char_t *query){ char_t *name, *password; char_t *user_ftp_enable, *user_smb_enable; char mode[6], feild[20]; int index; mode[0] = '/0'; feild[0] = '/0'; // fetch from web input name = websGetVar(wp, T("adduser_name"), T("")); password = websGetVar(wp, T("adduser_pw"), T("")); user_ftp_enable = websGetVar(wp, T("adduser_ftp"), T("")); user_smb_enable = websGetVar(wp, T("adduser_smb"), T("")); /* DEBUG(name); DEBUG(password); DEBUG(user_ftp_enable); DEBUG(user_smb_enable); */ // get null user feild form nvram index = GetNthFree("User"); // fprintf(stderr, "index: %d/n", index); // set to nvram if (0 != index) { sprintf(feild, "User%d", index); nvram_bufset(RT2860_NVRAM, feild, name); sprintf(feild, "User%dPasswd", index); nvram_bufset(RT2860_NVRAM, feild, password); sprintf(feild, "FtpUser%d", index); nvram_bufset(RT2860_NVRAM, feild, user_ftp_enable); sprintf(feild, "SmbUser%d", index); nvram_bufset(RT2860_NVRAM, feild, user_smb_enable); nvram_commit(RT2860_NVRAM); doSystem("storage.sh admin"); websRedirect(wp, "usb/STORAGEuser_admin.asp"); } else { websHeader(wp); websWrite(wp, T("<h2>User Quota is Full!</h2><br>/n")); websFooter(wp); websDone(wp, 200); }}
开发者ID:houzhenggang,项目名称:MT,代码行数:47,
示例24: a_assertchar_t *websCalcUrlDigest(webs_t wp){ char_t *digest, *a1, *a1prime, *a2, *a2prime, *preDigest, *method; a_assert(wp); digest = NULL;/* * Calculate first portion of digest H(A1) */ a1 = NULL; fmtAlloc(&a1, 255, T("%s:%s:%s"), wp->userName, wp->realm, wp->password); a_assert(a1); a1prime = websMD5(a1); bfreeSafe(B_L, a1);/* * Calculate second portion of digest H(A2) */ method = websGetVar(wp, T("REQUEST_METHOD"), NULL); a_assert(method); /* Fixes by Richard Laing, 2003/7/15 */ a2 = balloc(B_L, (gstrlen(method) +2 + gstrlen(wp->url) ) * sizeof(char_t)); a_assert(a2); gsprintf(a2, T("%s:%s"), method, wp->url); a2prime = websMD5(a2); bfreeSafe(B_L, a2);/* * Construct final digest KD(H(A1):nonce:H(A2)) */ a_assert(a1prime); a_assert(a2prime); a_assert(wp->nonce); preDigest = NULL; if (!wp->qop) { fmtAlloc(&preDigest, 255, T("%s:%s:%s"), a1prime, wp->nonce, a2prime); } else { fmtAlloc(&preDigest, 255, T("%s:%s:%s:%s:%s:%s"), a1prime, wp->nonce, wp->nc, wp->cnonce, wp->qop, a2prime); } a_assert(preDigest); digest = websMD5(preDigest);/* * Now clean up */ bfreeSafe(B_L, a1prime); bfreeSafe(B_L, a2prime); bfreeSafe(B_L, preDigest); return digest;}
开发者ID:dulton,项目名称:goahead-1,代码行数:56,
示例25: diag_ping_startintdiag_ping_start(webs_t wp){ int ret = 0; char *ip = websGetVar(wp, "ping_ip", NULL); char *times = websGetVar(wp, "ping_times", NULL); if (!ip || !times || !strcmp(ip, "")) return ret; if (strcmp(times, "0") && strcmp(times, "5") && strcmp(times, "10")) { return ret; } unlink(PING_TMP); nvram_set("ping_ip", ip); nvram_set("ping_times", times); return ret;}
开发者ID:aircross,项目名称:ray,代码行数:20,
示例26: ping_onloadvoid ping_onload(webs_t wp, char *arg){ int pid; char *type = websGetVar(wp, "submit_type", ""); pid = find_pid_by_ps("ping"); if (pid > 0 && strncmp(type, "stop", 4)) { // pinging websWrite(wp, arg); }}
开发者ID:ebichu,项目名称:dd-wrt,代码行数:12,
示例27: MediaDirAddstatic void MediaDirAdd(webs_t wp, char_t *path, char_t *query){ char_t *dir_path; FILE *fp; char media_config_file[25]; int index = 0; sprintf(media_config_file, "%s/.media_config", first_part); fp = fopen(media_config_file, "w"); if (NULL == fp) { perror(__FUNCTION__); return; } // fetch from web input dir_path = websGetVar(wp, T("dir_path"), T("")); /* DEBUG(dir_path); */ while (4 > index) { if (0 == strcmp(dir_path, media_conf[index].path)) { fprintf(stderr, "Existed Media Shared Dir: %s/n", dir_path); fwrite(media_conf, sizeof(media_conf), 1, fp); fclose(fp); return; } index++; } index = 0; while (4 > index) { if (0 == strlen(media_conf[index].path)) { strcpy(media_conf[index].path, dir_path); break; } index++; } if (index == 5) { perror("Media Server Shared Dirs exceed 4"); fclose(fp); return; } fwrite(media_conf, sizeof(media_conf), 1, fp); fclose(fp);}
开发者ID:houzhenggang,项目名称:MT,代码行数:50,
示例28: diag_traceroute_startintdiag_traceroute_start(webs_t wp){ int ret = 0; char *ip = websGetVar(wp, "traceroute_ip", NULL); if (!ip || !strcmp(ip, "")) return ret; unlink(TRACEROUTE_TMP); nvram_set("traceroute_ip", ip); return ret;}
开发者ID:aircross,项目名称:ray,代码行数:14,
示例29: action_bus_config_processPUBLIC void action_bus_config_process(Webs *wp, char *path, char *query){ char *rq_type; int ret = 0; rq_type = websGetVar(wp, "rq_type", ""); if(strcmp(rq_type, BUS_CONFIG_CUR_LINE) == 0){ ret = process_bus_config_cur_line_req(wp); }else if(strcmp(rq_type, BUS_CONFIG_STA_STATUS) == 0) { ret = process_bus_config_sta_status_req(wp); }else{ process_web_write_response(wp, HTTP_CODE_OK, "no param" , 0); } }
开发者ID:lubing521,项目名称:wifi-bus-app,代码行数:14,
注:本文中的websGetVar函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ websValid函数代码示例 C++ websError函数代码示例 |