Пример #1
0
 def start(self, args):
     _exec = CONFIG['fs'] + ' "'
     if type(args) == str:
         if not args.find("://") != -1:
             os.system(
                 "zenity --warning --text='%s!\n%s.' --no-wrap --icon-name=myconnector"
                 % (_("Enter the connection protocol"),
                    _("Or select from the list in the advanced options")))
             return 1
         else:
             command = _exec + args + '"'
             server = args
     else:
         try:
             protocol, server = args["server"].split("://")
         except:
             server = args["server"]
             try:
                 protocol = args["type"]
             except KeyError:
                 options.msg_error(
                     _("The FS connection configuration file is corrupted - the type is missing!"
                       ), options.log.exception)
                 return 1
         command = _exec + protocol + "://"
         if args.get("domain", ""): command += "%s;" % args["domain"]
         if args.get("user", ""): command += "%s@" % args["user"]
         command += server
         if args.get("folder", ""): command += "/%s" % args["folder"]
         command += '"'
     options.log.info("%s %s. %s:", _("Connecting to a file server"),
                      server, _("Launch Command"))
     options.log.info(command)
     os.system(command + STD_TO_LOG)
Пример #2
0
 def start(self, args):
     if x2goCheck():
         if type(args) == str:
             command = "pyhoca-cli -N --add-to-known-hosts --server %s" % args
             options.log.info("X2GO: %s %s", _("Connecting to the server"),
                              args)
             options.log.info(command)
         else:
             server = args["server"]
             username = args.get("username", "")
             command = "pyhoca-cli -N --add-to-known-hosts --server %s" % server
             if username: command += " --user %s" % args["username"]
             if args.get("port", "22"):
                 command += " --port %s" % args["port"]
             if args.get("session", "MATE"):
                 command += " --command %s" % args["session"]
             geometry = args.get("geometry", "fullscreen")
             if geometry: command += " --geometry %s" % args["geometry"]
             if args.get("printers", "False") == "True":
                 command += " --printing"
             if args.get("sound", "False") == "True":
                 command += " --sound pulse"
             options.log.info("X2GO: %s %s. %s:",
                              _("Connecting to the server"), server,
                              _("Launch Command"))
             options.log.info(command)
             password = args.get("passwd", "")
             if not password:
                 password = keyring.get_password(server, username)
             if password:
                 password = escape(password)
             else:
                 new_username, password = passwd(server, username)
                 if new_username == username or not new_username:
                     pass
                 else:
                     command = command.replace("--user %s" % username,
                                               "--user %s" % new_username)
             command += " --password %s" % password
         if password != False:  #if there is not password
             os.system(command + STD_TO_LOG)
             if enableLog:
                 signal.signal(signal.SIGCHLD,
                               signal.SIG_IGN)  # without zombie
                 Popen([MAINFOLDER + "/myconnector-check-x2go-errors"])
     else:
         options.msg_error(
             _("The 'pyhoca-cli' client for X2GO is not installed!"),
             options.log.warning)
Пример #3
0
 def start(self, args):
     if vmwareCheck():
         if type(args) == str:
             command = 'vmware-view -q -s ' + args
             options.log.info("VMware: %s %s",
                              _("Connecting to the server"), args)
             options.log.info(command)
         else:
             command = 'vmware-view -q -s %s' % args["server"]
             if args.get("username", ""):
                 command += " -u %s" % args["username"]
             if args.get("domain", ""): command += " -d %s" % args["domain"]
             if args.get("fullscreen", "False") == "True":
                 command += " --fullscreen"
             options.log.info("VMware:  %s %s",
                              _("Connecting to the server"), args["server"])
             options.log.info(command)
             if args.get("passwd", ""):
                 command += " -p %s" % escape(args["passwd"])
         os.system(command + STD_TO_LOG)
     else:
         options.msg_error("VMware Horizon Client %s!" % _("not installed"),
                           options.log.warning)
Пример #4
0
 def start(self, args):
     if freerdpCheck():
         freerdpVersion = freerdpCheckVersion()
         if freerdpVersion > "1.2":
             for key in CONFIGS["RDP1"]:
                 if not key in args: args[key] = CONFIGS["RDP1"][key]
             server = args["server"]
             username = args.get("username", "")
             command = "xfreerdp /v:%s /t:'%s'" % (server,
                                                   args.get("name", server))
             if username: command += " /u:%s" % escape(username)
             if args.get("domain", ""): command += " /d:%s" % args["domain"]
             if args.get("fullscreen", "True") == "True":
                 if freerdpCheckFloatbar():
                     command += " /f /floatbar:sticky:off"
                 else:
                     command += " /f"
             if args.get("clipboard", "True") == "True":
                 command += " +clipboard"
             if args.get("resolution", ""):
                 command += " /size:%s" % args["resolution"]
             if args.get("color", ""): command += " /bpp:%s" % args["color"]
             if args.get("folder", ""):
                 command += " /drive:SharedFolder,'%s'" % args["folder"]
             if args.get("gserver", ""):
                 command += " /g:%s" % args["gserver"]
             if args.get("guser", ""): command += " /gu:%s" % args["guser"]
             if args.get("gdomain", ""):
                 command += " /gd:%s" % args["gdomain"]
             if args.get("gpasswd", ""):
                 command = "GATEPWD='%s' && %s" % (args["gpasswd"], command)
                 command += " /gp:$GATEPWD"
             if args.get("admin", "False") == "True": command += " /admin"
             if args.get("smartcards", "False") == "True": command += SCARD
             if args.get("printers", "False") == "True":
                 command += " /printer"
             if args.get("sound", "False") == "True":
                 command += " /sound:sys:alsa"
             if args.get("microphone", "False") == "True":
                 command += " /microphone:sys:alsa"
             if args.get("multimon", "False") == "True":
                 command += " /multimon"
             if args.get("compression", "False") == "True":
                 command += " +compression /compression-level:%s" % args.get(
                     "compr_level", "0")
             if args.get("fonts", "False") == "True": command += " +fonts"
             if args.get("aero", "False") == "True": command += " +aero"
             if args.get("drag", "False") == "True":
                 command += " +window-drag"
             if args.get("animation", "False") == "True":
                 command += " +menu-anims"
             if args.get("theme", "False") == "False": command += " -themes"
             if args.get("wallpapers", "False") == "False":
                 command += " -wallpaper"
             if args.get("nsc", "False") == "True": command += " /nsc"
             if args.get("jpeg", "False") == "True":
                 command += " /jpeg /jpeg-quality:%s" % args.get(
                     "jpeg_quality", "80.0")
             if args.get("usb",
                         "False") == "True" and os.path.exists(USBPATH):
                 command += " /drive:MEDIA,%s" % USBPATH
             if args.get("workarea", "False") == "True":
                 command += " /workarea"
             if args.get("span", "False") == "True": command += " /span"
             if args.get("desktop", "False") == "True":
                 command += " /drive:Desktop,%s" % DESKFOLDER
             if args.get("downloads", "False") == "True":
                 command += " /drive:Downloads,%s" % DOWNFOLDER
             if args.get("documents", "False") == "True":
                 command += " /drive:Documents,%s" % DOCSFOLDER
             if args.get("gdi", "False") == "True": command += " /gdi:hw"
             else: command += " /gdi:sw"
             if args.get("certignore", "True") == "True":
                 command += " /cert-ignore"
             if args.get("reconnect", "True") == "True":
                 command += " +auto-reconnect"
             if args.get("glyph", "False") == "True":
                 command += " +glyph-cache"
             if args.get("userparams", ""):
                 command += " %s" % args["userparams"]
             disable_nla = args.get("disable_nla", "True")
             if disable_nla == "True": command += " -sec-nla"
             security = args.get("security", "False")
             if security != "False":
                 command += " /sec:%s" % security
             password = args.get("passwd", "")
             options.log.info("FreeRDP: %s %s. %s:",
                              _("Connecting to the server"), server,
                              _("Launch Command"))
             options.log.info(command)
             if not password:
                 password = keyring.get_password(server, username)
             if not password and disable_nla != "True":
                 new_username, password = passwd(server, username)
                 if new_username == username or not new_username:
                     pass
                 else:
                     command = command.replace(
                         "/u:%s" % escape(username),
                         "/u:%s" % escape(new_username))
             if password:
                 command += " /p:%s" % escape(password)
             if password == "":
                 command += " /p:"  #support empty password
             if password != False:  #if there is password
                 os.system(command + STD_TO_LOG)
                 if enableLog:
                     signal.signal(signal.SIGCHLD,
                                   signal.SIG_IGN)  # without zombie
                     Popen([
                         MAINFOLDER + "/myconnector-check-xfreerdp-errors"
                     ])
         else:
             options.msg_error(
                 "%s FreeRDP (%s) %s!" %
                 (_("Version"), freerdpVersion,
                  _("does not meet the minimum requirements")),
                 options.log.warning)
     else:
         options.msg_error("FreeRDP %s!" % _("not installed"),
                           options.log.warning)
Пример #5
0
def _missCitrix():
    """Message for user, if Citrix Receiver not installed"""
    options.msg_error("Citrix Receiver/Workspace %s!" % _("not installed"),
                      options.log.warning)