|
@@ -1,8 +1,16 @@
|
|
from django.contrib.auth.models import User
|
|
from django.contrib.auth.models import User
|
|
from django.shortcuts import render_to_response, get_object_or_404
|
|
from django.shortcuts import render_to_response, get_object_or_404
|
|
|
|
+from django.views.generic.detail import DetailView
|
|
|
|
|
|
from coin.vpn.models import VPNSubscription
|
|
from coin.vpn.models import VPNSubscription
|
|
|
|
|
|
|
|
+
|
|
|
|
+class VPNView(DetailView):
|
|
|
|
+ def get_object(self):
|
|
|
|
+ return get_object_or_404(VPNSubscription, pk=self.args[0],
|
|
|
|
+ administrative_subscription__member__user=self.request.user)
|
|
|
|
+
|
|
|
|
+
|
|
def generate_password(request, vpn_id):
|
|
def generate_password(request, vpn_id):
|
|
"""This generates a random password, saves it in hashed form, and returns
|
|
"""This generates a random password, saves it in hashed form, and returns
|
|
it to the user in cleartext.
|
|
it to the user in cleartext.
|