Ignore:
Timestamp:
03/02/12 23:11:38 (12 years ago)
Author:
obi
Message:

[titan] next step netbrowser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/networkbrowser/networkbrowser.h

    r14388 r14389  
    311311                        sharedir = ostrcat(sharedir, "/sharedir", 1, 0);
    312312                } else if ( mode == 2 ){
    313                         sharedir = ostrcat(sharedir, "sharedir", 1, 0);
     313// work
     314//                      sharedir = ostrcat(sharedir, "sharedir", 1, 0);
    314315                }
    315316        }
     
    324325                }
    325326        }
    326         if (ipaddresse == NULL){
    327                 ipaddresse = ostrcat(ipaddresse, "192.168.0.1", 1, 0);
    328         }
    329         if (username == NULL){
     327        if (ipaddresse == NULL)
     328                ipaddresse = ostrcat(ipaddresse, "192.168.178.1", 1, 0);
     329        if (ftpport == NULL)
     330                ftpport = ostrcat(ftpport, "21", 1, 0);
     331        if (username == NULL)
    330332                username = ostrcat(username, "username", 1, 0);
    331         }
    332         if (password == NULL){
     333        if (password == NULL)
    333334                password = ostrcat(password, "password", 1, 0);
    334         }
    335         if (protocol == NULL){
     335        if (protocol == NULL)
    336336                protocol = ostrcat(protocol, "udp", 1, 0);
    337         }
    338         if (rsize == NULL){
     337        if (rsize == NULL)
    339338                rsize = ostrcat(rsize, "32768", 1, 0);
    340         }
    341         if (wsize == NULL){
     339        if (wsize == NULL)
    342340                wsize = ostrcat(wsize, "32768", 1, 0);
    343         }
    344         if (options == NULL){
     341        if (options == NULL)
    345342                options = ostrcat(options, "rw,nolock", 1, 0);
    346         }
    347         if (hddreplacement == NULL){
     343        if (hddreplacement == NULL)
    348344                hddreplacement = ostrcat(hddreplacement, "0", 1, 0);
    349         }
    350         if (options1 == NULL){
     345        if (options1 == NULL)
    351346                options1 = ostrcat(options1, "allow_other", 1, 0);
    352         }
    353         if (options2 == NULL){
     347        if (options2 == NULL)
    354348                options2 = ostrcat(options2, "nonempty", 1, 0);
    355         }
    356         if (proxy == NULL){
     349        if (proxy == NULL)
    357350                proxy = ostrcat(proxy, "socks5", 1, 0);
    358         }
    359         if (proxyip == NULL){
    360                 proxyip = ostrcat(proxyip, "proxyip", 1, 0);
    361         }
    362         if (proxyport == NULL){
    363                 proxyport = ostrcat(proxyport, "proxyport", 1, 0);
    364         }
    365         if (proxyuser == NULL){
     351        if (proxyip == NULL)
     352                proxyip = ostrcat(proxyip, "12.23.45.67", 1, 0);
     353        if (proxyport == NULL)
     354                proxyport = ostrcat(proxyport, "8080", 1, 0);
     355        if (proxyuser == NULL)
    366356                proxyuser = ostrcat(proxyuser, "proxyuser", 1, 0);
    367         }
    368         if (proxypass == NULL){
     357        if (proxypass == NULL)
    369358                proxypass = ostrcat(proxypass, "proxypass", 1, 0);
    370         }
    371         if (ssl == NULL){
     359        if (ssl == NULL)
    372360                ssl = ostrcat(ssl, "ssl_try", 1, 0);
    373         }
    374         if (proxyauth == NULL){
     361        if (proxyauth == NULL)
    375362                proxyauth = ostrcat(proxyauth, "0", 1, 0);
    376         }
    377         if (userauth == NULL){
     363        if (userauth == NULL)
    378364                userauth = ostrcat(userauth, "0", 1, 0);
    379         }
    380         if (usessl == NULL){
     365        if (usessl == NULL)
    381366                usessl = ostrcat(usessl, "0", 1, 0);
    382         }
    383         if (useproxy == NULL){
     367        if (useproxy == NULL)
    384368                useproxy = ostrcat(useproxy, "0", 1, 0);
    385         }
    386369
    387370        tmp_wsize = ostrcat(tmp_wsize, wsize, 1, 0);
     
    500483        setchoiceboxselection(skin_userauth, userauth);
    501484
    502         addchoicebox(skin_proxyauth, "0", "0");
     485        addchoicebox(skin_proxyauth, "0", _("no"));
    503486        addchoicebox(skin_proxyauth, "1", _("yes"));
    504487        setchoiceboxselection(skin_proxyauth, proxyauth);
     
    14231406                                        tmpstr5 = ostrcat("", tmp_check, 0, 0);
    14241407                                        ret5 = strsplit(tmpstr5, "\\:", &count5);
    1425                                         tmp_proxyip = ostrcat("", (&ret5[0])->part, 0, 0);
    1426                                         tmp_proxyport = ostrcat("", (&ret5[1])->part, 0, 0);
     1408                                        if(count5 > 0)
     1409                                                tmp_proxyip = ostrcat("", (&ret5[0])->part, 0, 0);
     1410                                        if(count5 > 1)
     1411                                                tmp_proxyport = ostrcat("", (&ret5[1])->part, 0, 0);
    14271412                                        free(ret5); ret5 = NULL;
    14281413
     
    14741459                                                        tmp_options2 = ostrcat("", (&ret3[7])->part, 0, 0);
    14751460
    1476                                                         if(string_find(",nonempty,ssl_try",(&ret2[1])->part)){
    1477                                                                 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0);
     1461                                                        if(count2 > 1 && string_find(",nonempty,ssl_try",(&ret2[1])->part)){
     1462                                                                if(count3 > 8)
     1463                                                                        tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0);
    14781464                                                                tmp_usessl = ostrcat("", "1", 0, 0);
    1479                                                         } else if(string_find(",nonempty,ssl_control",(&ret2[1])->part)){
    1480                                                                 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0);
     1465                                                        } else if(count2 > 1 && string_find(",nonempty,ssl_control",(&ret2[1])->part)){
     1466                                                                if(count3 > 8)
     1467                                                                        tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0);
    14811468                                                                tmp_usessl = ostrcat("", "1", 0, 0);
    1482                                                         } else if(string_find(",nonempty,ssl",(&ret2[1])->part)){
    1483                                                                 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0);
     1469                                                        } else if(count2 > 1 && string_find(",nonempty,ssl",(&ret2[1])->part)){
     1470                                                                if(count3 > 8)
     1471                                                                        tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0);
    14841472                                                                tmp_usessl = ostrcat("", "1", 0, 0);
    14851473                                                        }
     
    14881476                                }
    14891477
    1490                                 if(string_find("@",(&ret2[2])->part)){
     1478                                if(count2 > 2 && string_find("@",(&ret2[2])->part)){
    14911479                                        tmp_userauth = ostrcat("", "1", 0, 0);
    14921480                                        debug(70, "foundf ftpuser with userauth");
     
    15001488                                        tmpstr9 = ostrcat("", (&ret8[0])->part, 0, 0);
    15011489                                        ret9 = strsplit(tmpstr9, "/\\:", &count9);
    1502                                         tmp_user = ostrcat("", (&ret9[1])->part, 0, 0);
    1503                                         tmp_pass = ostrcat("", (&ret9[2])->part, 0, 0);
     1490                                        if(count9 > 1)
     1491                                                tmp_user = ostrcat("", (&ret9[1])->part, 0, 0);
     1492                                        if(count9 > 2)
     1493                                                tmp_pass = ostrcat("", (&ret9[2])->part, 0, 0);
    15041494
    15051495                                        tmp_check = ostrcat("", (&ret8[1])->part, 0, 0);
     
    15081498                                        tmpstr10 = ostrcat("", tmp_check, 0, 0);
    15091499                                        ret10 = strsplit(tmpstr10, "\\:", &count10);
    1510                                         tmp_ipaddresse = ostrcat("", (&ret10[0])->part, 0, 0);
     1500                                        if(count10 > 0)
     1501                                                tmp_ipaddresse = ostrcat("", (&ret10[0])->part, 0, 0);
    15111502
    15121503                                        struct splitstr* ret11 = NULL;
     
    15141505                                        tmpstr11 = ostrcat("", (&ret10[1])->part, 0, 0);
    15151506                                        ret11 = strsplit(tmpstr11, "/", &count11);
    1516                                         tmp_ftpport = ostrcat("", (&ret11[0])->part, 0, 0);
    1517                                         tmp_sharedir = ostrcat("", (&ret11[1])->part, 0, 0);
     1507                                        if(count11 > 0)
     1508                                                tmp_ftpport = ostrcat("", (&ret11[0])->part, 0, 0);
     1509                                        if(count11 > 1)
     1510                                                tmp_sharedir = ostrcat("", (&ret11[1])->part, 0, 0);
    15181511
    15191512                                        free(ret9); ret9 = NULL;
     
    15211514                                        free(ret11); ret11 = NULL;
    15221515                                } else {
    1523                                         debug(70, "foundf ftpuser without userauth");
     1516                                        debug(70, "found ftpuser without userauth");
    15241517                                        struct splitstr* ret12 = NULL;
    15251518                                        int count12 = 0;
    15261519                                        tmpstr12 = ostrcat("", (&ret2[2])->part, 0, 0);
    1527                                         ret12= strsplit(tmpstr12, "/\\:", &count12);
    1528 
    1529                                         tmp_ipaddresse = ostrcat("", (&ret12[1])->part, 0, 0);
    1530                                         tmp_ftpport = ostrcat("", (&ret12[2])->part, 0, 0);
    1531                                         tmp_sharedir = ostrcat("", (&ret12[3])->part, 0, 0);
     1520                                        ret12= strsplit(tmpstr12, "/\\:", &count12);;
     1521                                        if(count12 > 1)
     1522                                                tmp_ipaddresse = ostrcat("", (&ret12[1])->part, 0, 0);
     1523                                        if(count12 > 2)
     1524                                                tmp_ftpport = ostrcat("", (&ret12[2])->part, 0, 0);
     1525                                        if(count12 > 3)
     1526                                                tmp_sharedir = ostrcat("", (&ret12[3])->part, 0, 0);
    15321527                                        free(ret12); ret12 = NULL;
    15331528                                }
     
    15351530                                tmp_sharename = ostrcat("", (&ret2[0])->part, 0, 0);
    15361531
    1537                                 if(ostrcmp((&ret2[0])->part, input_sharename) == 0){
     1532                                if(count2 > 0 && ostrcmp((&ret2[0])->part, input_sharename) == 0){
    15381533                                        update = 0;
    15391534                                } else {
     
    15461541                                sharelist = ostrcat(sharelist, " (", 1, 0);
    15471542                                sharelist = ostrcat(sharelist, tmp_ipaddresse, 1, 0);
    1548                                 sharelist = ostrcat(sharelist, ": /", 1, 0);
     1543                                sharelist = ostrcat(sharelist, ":", 1, 0);
     1544                                sharelist = ostrcat(sharelist, tmp_ftpport, 1, 0);
     1545                                sharelist = ostrcat(sharelist, "/", 1, 0);
    15491546                                sharelist = ostrcat(sharelist, tmp_sharedir, 1, 0);
    15501547                                sharelist = ostrcat(sharelist, ")\n", 1, 0);
Note: See TracChangeset for help on using the changeset viewer.