lot of updates

This commit is contained in:
Harry Bomrah committed 2012-04-30 14:33:12 +08:00
commit 1b7fb106f8
8 files changed
+28 -34

No files matched your search

+2
View File
@@ -136,8 +136,10 @@ var orbitDesktop = function(dom){
o.currentface = "home";
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
var groupWrapperWidth = 0;
$("div#desktop .group").each(function(){groupWrapperWidth+=$(this).outerWidth(true);});
$("div#desktop #group_wrapper").css("width",groupWrapperWidth);
$("div#desktop .g_col").sortable({
connectWith: ".g_col",
+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)
+3 -3
View File
@@ -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
@@ -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>