Exemple #1
0
def wifi():
  cmds = []
  dir = os.getcwd()
  cmd = ''
  cmdpre = 'cd /root && /root/scripts/action config "'
  cmdsuf = '" && cd %s'%(dir)
  opt = ''
  if 'essid' in form:
    essid = form['essid'].value
    #cmds.append('cd /root && /root/scripts/action config WIFI_SSID=%s && cd %s'%(essid,dir))
    cmd = '%s%sWIFI_SSID=%s'%(cmd,opt,essid)
    opt = '&'
  currenc = gen.currval('WIFI_SEC').replace('"','')
  if ('newenc' in form):
    newenc = form['newenc'].value
    if newenc != currenc:
      cmd='%s%sWIFI_SEC=%s'%(cmd,opt,newenc.upper())
      opt = '&'

  if 'pass' in form:
    if 'newenc' in form:
      enc = form['newenc'].value
    else:
      enc = gen.currval('WIFI_SEC')
    passph = form['pass'].value
    cmd = '%s%sWIFI_PASS=%s'%(cmd,opt,passph)

  if cmd != '':
    cmd = '%s%s%s'%(cmdpre,cmd,cmdsuf)
    sql.insert('cmd','cmd',[0,cmd])
  else:
    print "<p>Nothing to update"
    return
  exec_cmd('Wireless Settings ')
Exemple #2
0
def wifi():
    cmds = []
    dir = os.getcwd()
    cmd = ''
    cmdpre = 'cd /root && /root/scripts/action config "'
    cmdsuf = '" && cd %s' % (dir)
    opt = ''
    if 'essid' in form:
        essid = form['essid'].value
        #cmds.append('cd /root && /root/scripts/action config WIFI_SSID=%s && cd %s'%(essid,dir))
        cmd = '%s%sWIFI_SSID=%s' % (cmd, opt, essid)
        opt = '&'
    currenc = gen.currval('WIFI_SEC').replace('"', '')
    if ('newenc' in form):
        newenc = form['newenc'].value
        if newenc != currenc:
            cmd = '%s%sWIFI_SEC=%s' % (cmd, opt, newenc.upper())
            opt = '&'

    if 'pass' in form:
        if 'newenc' in form:
            enc = form['newenc'].value
        else:
            enc = gen.currval('WIFI_SEC')
        passph = form['pass'].value
        cmd = '%s%sWIFI_PASS=%s' % (cmd, opt, passph)

    if cmd != '':
        cmd = '%s%s%s' % (cmdpre, cmd, cmdsuf)
        sql.insert('cmd', 'cmd', [0, cmd])
    else:
        print "<p>Nothing to update"
        return
    exec_cmd('Wireless Settings ')
Exemple #3
0
def priv_options():
  gen.login_refresh()
  gen.print_header(': Private Browsing')
  priv = gen.currval('PRIVACY_MODE')
  priv = priv.replace('"','')
  priv = priv.replace('\n','')
  if priv.upper() != 'ON':
    print '\
    <p>No privacy options available\
    '
    return
  print '\
  <form action="done.py" method="post">\
  <input type = hidden name="key" value = "privacy" />\
  \
  How long do you want private browsing enabled?\
  <input type=radio name="dur" value="5">5 minutes\
  <input type=radio name="dur" value="15">15 minutes\
  <input type=radio name="dur" value="30">30 minutes\
   \
  <p><input type="submit" value="Submit" id="submit"/>\
  </form>\
  '
  gen.print_footer()
  print '\
Exemple #4
0
def priv_options():
    gen.login_refresh()
    gen.print_header(': Private Browsing')
    priv = gen.currval('PRIVACY_MODE')
    priv = priv.replace('"', '')
    priv = priv.replace('\n', '')
    if priv.upper() != 'ON':
        print '\
    <p>No privacy options available\
    '

        return
    print '\
  <form action="done.py" method="post">\
  <input type = hidden name="key" value = "privacy" />\
  \
  How long do you want private browsing enabled?\
  <input type=radio name="dur" value="5">5 minutes\
  <input type=radio name="dur" value="15">15 minutes\
  <input type=radio name="dur" value="30">30 minutes\
   \
  <p><input type="submit" value="Submit" id="submit"/>\
  </form>\
  '

    gen.print_footer()
    print '\
Exemple #5
0
#!/usr/bin/env python
import cgi
import cgitb
import gen

cgitb.enable()


if gen.login_check() == False:
    gen.login_redirect()

else:
    gen.login_refresh()
    gen.print_header(": Wireless")

    curressid = gen.currval("WIFI_SSID")
    currpass = gen.currval("WIFI_PASS")
    currenc = gen.currval("WIFI_SEC")
    noenc, wepenc, wpaenc, wpa2enc = gen.encval(currenc)

    print '\
  <form action="done.py" method="post">\
  <input type = hidden name="key" value = "wifi" />\
  \
  What type of encryption?\
  <input type=radio name="newenc" value="None" %s >None\
  <input type=radio name="newenc" value="WEP" %s >WEP\
  <input type=radio name="newenc" value="WPA" %s >WPA\
  <input type=radio name="newenc" value="WPA2" %s >WPA2\
   \
  <p>New Name for Wireless Network (Current Name: %s) <input type="text" name="essid" />\
Exemple #6
0
#!/usr/bin/env python
import cgi
import cgitb
import gen

cgitb.enable()

if gen.login_check() == False:
    gen.login_redirect()

else:
    gen.login_refresh()
    gen.print_header(': Wireless')

    curressid = gen.currval('WIFI_SSID')
    currpass = gen.currval('WIFI_PASS')
    currenc = gen.currval('WIFI_SEC')
    noenc, wepenc, wpaenc, wpa2enc = gen.encval(currenc)

    print '\
  <form action="done.py" method="post">\
  <input type = hidden name="key" value = "wifi" />\
  \
  What type of encryption?\
  <input type=radio name="newenc" value="None" %s >None\
  <input type=radio name="newenc" value="WEP" %s >WEP\
  <input type=radio name="newenc" value="WPA" %s >WPA\
  <input type=radio name="newenc" value="WPA2" %s >WPA2\
   \
  <p>New Name for Wireless Network (Current Name: %s) <input type="text" name="essid" />\
   \