auto login encryption done…

This commit is contained in:
Harry Bomrah committed 2012-04-30 14:29:42 +08:00
1 parent c158375d02
commit aacd9da9fb
9 files changed
+28 -36

No files matched your search

+1 -1
View File
@@ -141,7 +141,7 @@ var orbitDesktop = function(dom){
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
var groupWrapperWidth = 0;
var groupWrapperHeight = 0;
$('div#desktop div.group').width(528);
$('div#desktop div.group').width(800);
$("div#desktop .element").mousedown(function(){
currentElement = $(this);
elementParent = $(this).parent();
+8 -2
View File
@@ -9,13 +9,19 @@ class OtheraccountsController< ApplicationController
@email = params['email']
@password = params['password']
@account = params['account']
OtherAccount.new(email: @email, encrypted_password: @password, type: @account)
OtherAccount.create(user_id: current_user.id, email: @email, encrypted_password: @password, type: @account)
a = Array.new
a << {"success"=>"true"}
render :json=>a.to_json
end
def gmail
@gmailaccount = OtherAccount.where(:type.all => ["gmail"],:user_id.all => [current_user.id])
@decrypted_password = @gmailaccount.first.encrypted_password.decrypt
@email = @gmailaccount.first.email
url = URI.parse("https://mail.google.com/mail/feed/atom")
req = Net::HTTP::Get.new(url.path)
req.basic_auth params['username'], params['password']
req.basic_auth @email, @decrypted_password
req.content_type = 'text/xml'
http = Net::HTTP.new(url.host, url.port)
@@ -1,15 +1,15 @@
class OtherAccount
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Encryptor
field :user_id
field :type
field :email
field :encrypted_password
attr_encrypted :encrypted_password, :key => 'rulingorbit.com', :encode => true
encrypts :encrypted_password, :mode => :symmetric, :password => 'rulingcom'
belongs_to :user
end
+1 -1
View File
@@ -17,7 +17,7 @@ class User
has_many :managing_apps,:class_name => "AppManager"
has_one :desktop, :autosave => true, :dependent => :destroy
has_many :otheraccount, :autosave => true, :dependent => :destroy
has_many :other_accounts, :autosave => true, :dependent => :destroy
belongs_to :role
has_and_belongs_to_many :sub_roles
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
@@ -10,7 +10,8 @@
<td valign="top"><label for="s_name1">Username</label><input type="text" /></td>
</tr>
<tr>
<td><label for="s_name1">Password</label><input type="password" /></td>
<td width="400"><label for="s_name1">Password</label><input type="password" /></td>
<td><a href="" id="connection_save_btn" class="setting_btn thmc1 thmtxt w1 hh2 hp" onclick='return false;' style='float:left;'>Connect</a></td>
</tr>
<tr>
<td rowspan="2"><img src="assets/facebook.png" alt=""></td>