Class: DmCore::Admin::AccountsController

Inherits:
AdminController
  • Object
show all
Includes:
PermittedParams
Defined in:
app/controllers/dm_core/admin/accounts_controller.rb

Instance Method Summary collapse

Methods included from PermittedParams

#account_params, #comment_params, #devise_sign_up_params, #user_params, #user_profile_direct_params, #user_profile_params

Instance Method Details

#analyticsObject




61
62
63
64
65
66
67
68
69
70
71
72
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 61

def analytics
  if put_or_post?
    @account.analytics_validation = true
    params[:account].delete(:preferred_sofort_project_password) if params[:account][:preferred_sofort_project_password].blank?
    params[:account].delete(:preferred_sofort_notification_password) if params[:account][:preferred_sofort_notification_password].blank?
    if @account.update_attributes()
      redirect_to(dm_core., notice: "Account was successfully updated.") and return
    else
      render action: "analytics"
    end
  end
end

#create_accountObject




22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 22

def 
  redirect_to dm_core.() unless is_sysadmin?

  @account = Account.new()
  @account.general_validation = true
  if @account.save
    redirect_to dm_core.(@account), notice: 'New Account/Site was successfully created.'
  else
    render action: :general
  end
end

#emailObject

PUT /admin/account or PUT /admin/account/.json




48
49
50
51
52
53
54
55
56
57
58
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 48

def email
  if put_or_post?
    @account.email_validation = true
    params[:account].delete(:preferred_smtp_password) if params[:account][:preferred_smtp_password].blank?
    if @account.update_attributes()
      redirect_to(dm_core., notice: "Account was successfully updated.") and return
    else
      render action: "email"
    end
  end
end

#generalObject




35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 35

def general
  if put_or_post?
    @account.general_validation = true
    if @account.update_attributes()
      redirect_to(dm_core., notice: "Account was successfully updated.") and return
    else
      render action: "general"
    end
  end
end

#mediaObject




87
88
89
90
91
92
93
94
95
96
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 87

def media
  if put_or_post?
    @account.media_validation = true
    if @account.update_attributes()
      redirect_to(dm_core., notice: "Account was successfully updated.") and return
    else
      render action: "media"
    end
  end
end

#metadataObject




75
76
77
78
79
80
81
82
83
84
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 75

def 
  if put_or_post?
    @account. = true
    if @account.update_attributes()
      redirect_to(dm_core., notice: "Account was successfully updated.") and return
    else
      render action: "metadata"
    end
  end
end

#new_accountObject




15
16
17
18
19
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 15

def 
  redirect_to dm_core.() unless is_sysadmin?
  @account = Account.new
  render action: :general
end

#showObject




10
11
12
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 10

def show
  redirect_to dm_core.(@account)
end