Navigation Menu

Skip to content

Commit

Permalink
fixed identation
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkinglight committed Sep 10, 2011
1 parent b14fb98 commit 2c24820
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
16 changes: 8 additions & 8 deletions app/controllers/inside_vps_controller.rb
Expand Up @@ -175,21 +175,21 @@ def monitor_resources
#Private Methods start here
private
def distro_name(vps_id)
first_line = ""
file = File.open("/vz/private/#{vps_id}/etc/issue")
file.each_line {|line| first_line = line; break }
file.close
x = first_line.split(" ")
dist_name = x[0]
end
first_line = ""
file = File.open("/vz/private/#{vps_id}/etc/issue")
file.each_line {|line| first_line = line; break }
file.close
x = first_line.split(" ")
dist_name = x[0]
end

def get_conf
@conf = params[:conf]
end

def read_conf
cnf = Vps.new
@conf_file = cnf.read_conf_file(@vps_id)
@conf_file = cnf.read_conf_file(@vps_id)
end

def write_conf(output, to_action)
Expand Down
37 changes: 19 additions & 18 deletions app/models/user.rb
@@ -1,22 +1,23 @@
class User < ActiveRecord::Base
require "digest/sha1"
has_many :vpss
validates_uniqueness_of :username
validates_presence_of :username, :password, :activated, :country, :email, :name, :authority

def self.encrypt_password(password)
return Digest::SHA1.hexdigest(password)
end
def self.authunticate(username, password)
passwd = encrypt_password(password)
user = self.find_by_username(username)
if user
if user.password != passwd
user = nil
end
require "digest/sha1"
has_many :vpss
validates_uniqueness_of :username
validates_presence_of :username, :password, :activated, :country, :email, \
:name, :authority

def self.encrypt_password(password)
return Digest::SHA1.hexdigest(password)
end

def self.authunticate(username, password)
passwd = encrypt_password(password)
user = self.find_by_username(username)
if user
if user.password != passwd
user = nil
end
user
end

user
end

end

0 comments on commit 2c24820

Please sign in to comment.