21 lines
588 B
Ruby
21 lines
588 B
Ruby
class RegisteredSitesController < ApplicationController
|
|
|
|
def site_count_widget
|
|
count = RegisteredSite.count + 1800
|
|
{
|
|
"extras" => {
|
|
"total_sites" => count
|
|
}
|
|
}
|
|
end
|
|
def git_auth
|
|
user_ip = params['user_ip']
|
|
all_ips = RegisteredSite.all.collect{|v| [v.ip,v.real_ip]}.flatten.compact
|
|
puts user_ip
|
|
if all_ips.include?(user_ip) || user_ip == '118.163.60.152' || user_ip == '163.19.249.14' || user_ip == '203.72.2.177'
|
|
render :text=>'hello',:status=> 200
|
|
else
|
|
render :text=>'forbidden',:status=> 500
|
|
end
|
|
end
|
|
end |