Changeset 5685

Show
Ignore:
Timestamp:
02/24/10 21:37:16 (3 years ago)
Author:
blogic
Message:

use proper uci packages

Location:
luci2/cbi2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci2/cbi2/luci.uci

    r5684 r5685  
    11config luci luci 
    22    option root /lib/luci2/ 
    3     option socket /tmp/luci2-socket23 
     3    option socket /tmp/luci2-socket 
    44    option lang en 
     5 
     6config user user 
     7#   option  'admin' 'admin' 
     8    option  'admin' '$1$5CpqkCO0$P9BNVRqNTajfArljexEG40' 
     9 
     10config session session 
  • luci2/cbi2/session.c

    r5684 r5685  
    4141            session[i] += 'A' - 36; 
    4242    } 
    43     ctx = ucix_init(cbictx, "zepttho", 1); 
    44     ucix_add_option_int(ctx, "zepttho", "session", session, time(0)); 
    45     ucix_save(ctx, "zepttho"); 
     43    ctx = ucix_init(cbictx, "luci", 1); 
     44    ucix_add_option_int(ctx, "luci", "session", session, time(0)); 
     45    ucix_save(ctx, "luci"); 
    4646    ucix_cleanup(ctx); 
    4747    return session; 
     
    5454    if((t > 0) && ((time(0) - t) > session_timeout)) 
    5555    { 
    56         ucix_revert(ctx, "zepttho", "session", key); 
     56        ucix_revert(ctx, "luci", "session", key); 
    5757        t = 0; 
    5858    } 
     
    6262{ 
    6363    struct uci_context *ctx; 
    64     ctx = ucix_init(cbictx, "zepttho", 1); 
     64    ctx = ucix_init(cbictx, "luci", 1); 
    6565    uci_set_savedir(ctx, "/var/state/"); 
    66     ucix_for_each_section_option(ctx, "zepttho", "session", session_expire_cb, ctx); 
    67     ucix_save(ctx, "zepttho"); 
     66    ucix_for_each_section_option(ctx, "luci", "session", session_expire_cb, ctx); 
     67    ucix_save(ctx, "luci"); 
    6868    ucix_cleanup(ctx); 
    6969} 
     
    7676    if(!auth) 
    7777        goto out; 
    78     ctx = ucix_init(cbictx, "zepttho", 1); 
     78    ctx = ucix_init(cbictx, "luci", 1); 
    7979    uci_set_savedir(ctx, "/var/state/"); 
    80     t = ucix_get_option_int(ctx, "zepttho", "session", auth, 0); 
     80    t = ucix_get_option_int(ctx, "luci", "session", auth, 0); 
    8181    if(t) 
    8282    { 
    83         ucix_revert(ctx, "zepttho", "session", auth); 
    84         ucix_add_option_int(ctx, "zepttho", "session", auth, time(0)); 
    85         ucix_save(ctx, "zepttho"); 
     83        ucix_revert(ctx, "luci", "session", auth); 
     84        ucix_add_option_int(ctx, "luci", "session", auth, time(0)); 
     85        ucix_save(ctx, "luci"); 
    8686    } 
    8787    ucix_cleanup(ctx); 
     
    100100    if(!sauth) 
    101101        goto out; 
    102     ctx = ucix_init(cbictx, "zepttho", 1); 
     102    ctx = ucix_init(cbictx, "luci", 1); 
    103103    uci_set_savedir(ctx, "/var/state/"); 
    104     t = ucix_get_option_int(ctx, "zepttho", "session", sauth, 0); 
     104    t = ucix_get_option_int(ctx, "luci", "session", sauth, 0); 
    105105    if(t) 
    106106    { 
    107107        printf("logoff session %s\n", sauth); 
    108         ucix_revert(ctx, "zepttho", "session", sauth); 
    109         ucix_save(ctx, "zepttho"); 
     108        ucix_revert(ctx, "luci", "session", sauth); 
     109        ucix_save(ctx, "luci"); 
    110110    } 
    111111    ucix_cleanup(ctx); 
     
    123123    if(!pass) 
    124124        return ret; 
    125     ctx = ucix_init(cbictx, "user", 0); 
    126     passwd = ucix_get_option(ctx, "user", "user", "admin"); 
     125    ctx = ucix_init(cbictx, "luci", 0); 
     126    passwd = ucix_get_option(ctx, "luci", "user", "admin"); 
    127127    ucix_cleanup(ctx); 
    128128    if(passwd) 
     
    148148        close(fd); 
    149149        sprintf(salt, "$1$%02X$", buf); 
    150         ucictx = ucix_init(cbictx, "user", 1); 
    151         ucix_add_option(ucictx, "user", "user", "admin", crypt(passwd1, salt)); 
    152         ucix_commit(ucictx, "user"); 
     150        ucictx = ucix_init(cbictx, "luci", 1); 
     151        ucix_add_option(ucictx, "luci", "user", "admin", crypt(passwd1, salt)); 
     152        ucix_commit(ucictx, "luci"); 
    153153        ucix_cleanup(ucictx); 
    154154        return 0;