Revision afedad4d ui/views.py

b/ui/views.py
87 87

  
88 88
def machines_connect(request):
89 89
    ip_address = request.GET.get('ip_address','')
90
    TODO = True
91
    if TODO: # TODO: check if we are on windows
90
    operating_system = request.GET.get('os','')
91
    if operating_system == 'windows': #check if we are on windows
92 92
        rdp_file = os.path.join(os.path.dirname(__file__), "static/") + 'synnefo-windows.rdp'
93 93
        connect_data = open(rdp_file, 'r').read()
94 94
        connect_data = connect_data + 'full address:s:' + ip_address + '\n'
95 95
        response = HttpResponse(connect_data, mimetype='application/x-rdp')
96 96
        response['Content-Disposition'] = 'attachment; filename=synnefo-windows.rdp'
97 97
    else:
98
        pass #no windows, no rdp
98
        response = HttpResponse("Try ssh maybe")  #no windows, no rdp
99 99
    return response
100 100

  
101 101

  

Also available in: Unified diff