myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3026] trunk/app: auto-sleep users at the point o


From: noreply
Subject: [myexperiment-hackers] [3026] trunk/app: auto-sleep users at the point of activation and removed the ability to update profile before activation
Date: Wed, 13 Jun 2012 09:31:09 +0000 (UTC)

Revision
3026
Author
dgc
Date
2012-06-13 09:31:09 +0000 (Wed, 13 Jun 2012)

Log Message

auto-sleep users at the point of activation and removed the ability to update profile before activation

Modified Paths

Diff

Modified: trunk/app/controllers/application_controller.rb (3025 => 3026)


--- trunk/app/controllers/application_controller.rb	2012-06-13 09:15:08 UTC (rev 3025)
+++ trunk/app/controllers/application_controller.rb	2012-06-13 09:31:09 UTC (rev 3026)
@@ -26,7 +26,7 @@
   include ActionView::Helpers::NumberHelper
   
   def check_for_sleeper
-    if logged_in?
+    if request.method != :get && logged_in?
       if current_user.account_status == "sleep"
         current_user.update_attribute(:account_status, "recheck")
       end

Modified: trunk/app/controllers/profiles_controller.rb (3025 => 3026)


--- trunk/app/controllers/profiles_controller.rb	2012-06-13 09:15:08 UTC (rev 3025)
+++ trunk/app/controllers/profiles_controller.rb	2012-06-13 09:31:09 UTC (rev 3026)
@@ -76,6 +76,8 @@
     # maintain legal value for "null avatar"
     (params[:profile][:picture_id] = nil) if (params[:profile][:picture_id].to_i == 0)
     
+    raise "Cannot update profile until user is activated" unless @profile.owner.activated_at
+
     respond_to do |format|
       if @profile.update_attributes(params[:profile])
         flash[:notice] = 'Profile was successfully updated.'

Modified: trunk/app/models/user.rb (3025 => 3026)


--- trunk/app/models/user.rb	2012-06-13 09:15:08 UTC (rev 3025)
+++ trunk/app/models/user.rb	2012-06-13 09:31:09 UTC (rev 3026)
@@ -158,7 +158,10 @@
       self.unconfirmed_email = nil
       
       # Activate user if not previously activated
-      self.activated_at = Time.now unless self.activated?
+      unless self.activated?
+        self.activated_at = Time.now
+        self.account_status = "sleep"
+      end
       
       return self.save
     else

reply via email to

[Prev in Thread] Current Thread [Next in Thread]