123456789101112131415161718192021222324 |
- class VpnController < ApplicationController
- def openvpn
- return if @user.nil?
- @accounts = Account.where(:owner => @user["user"])
- end
- def get_openvpn_config
- if @user.nil?
- redirect_to "https://login.mephi.ru/login?service=#{url_for(:only_path => false)}.#{params[:format]}" if @user.nil?
- return
- end
- @account = Account.where(:login => params[:login].downcase, :owner => @user["user"]).first
- if @account.nil?
- render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
- end
- respond_to do |format|
- format.zip { send_data @account.GetOpenVPNConfigZip, :type => 'application/zip' }
- format.gz { send_data @account.GetOpenVPNConfigTarGz, :type => 'application/gzip' }
- end
- end
- end
|