Permalink
Browse files

Added a change password form

Also added helpful links on the setup page.
This is 0.0.2.
  • Loading branch information...
1 parent 4b2f593 commit 729d3eae7618253ace39f8235929ab819ab9855a @asquared committed Jun 12, 2012
View
@@ -2,7 +2,7 @@ require 'rake'
Gem::Specification.new do |s|
s.name = 'concerto_client'
- s.version = '0.0.1'
+ s.version = '0.0.2'
s.date = '2012-06-12'
s.summary = 'Concerto Client Tools'
s.description = 'Client-side tools for Concerto digital signage'
@@ -25,6 +25,8 @@ class ConcertoConfigServer < Sinatra::Base
IPAddress.parse("::1")
]
+ set :haml, { :format => :html5, :layout => :main }
+
helpers do
# Get the return value of the method on obj if obj supports the method.
# Otherwise return the empty string.
@@ -146,7 +148,7 @@ def validate_url(url)
if network_ok
# Everything's up and running, we just don't know what
# our URL should be.
- haml :setup, :layout => :main
+ haml :setup
else
# The network settings are not sane, we don't have an IP.
# Redirect the user to the network configuration page to
@@ -175,7 +177,7 @@ def validate_url(url)
# render a page indicating that the concerto_url is no good.
# this page redirects to / every 5 seconds
get '/problem' do
- haml :problem, :layout => :main
+ haml :problem
end
get '/netconfig' do
@@ -198,8 +200,7 @@ def validate_url(url)
haml :netsettings, :locals => {
:connection_method => cm,
:addressing_method => am
- },
- :format => :html5, :layout => :main
+ }
end
# Given the name of a class, pick a class out of a list of allowed classes.
@@ -278,6 +279,23 @@ def do_assign(params, instance)
# Back to the network form.
redirect '/netconfig' # as a get request
end
+
+ get '/password' do
+ protected!
+ haml :password
+ end
+
+ post '/password' do
+ protected!
+
+ if params[:newpass] != params[:newpass_confirm]
+ # something something error handling something
+ redirect '/password'
+ end
+
+ ConcertoConfig::ConfigStore.write_config('password', params[:newpass])
+ redirect '/setup'
+ end
end
ConcertoConfigServer.run!
@@ -0,0 +1,9 @@
+%form{:method=>'post'}
+ %p
+ %label{:for=>'newpass'} New Password
+ %input{:type=>'password', :name=>'newpass'}
+ %p
+ %label{:for=>'newpass_confirm'} Confirm Password
+ %input{:type=>'password', :name=>'newpass_confirm'}
+ %p
+ %input{:type=>'submit', :value=>'Change Password'}
@@ -1,18 +1,25 @@
%h1 Welcome to Concerto Player
%p
- You're seeing this because your Concerto player has not yet been configured.
- We need the URL of your Concerto instance before we can get up and running.
+ You're seeing this because your Concerto player has not yet been configured.
+ We need the URL of your Concerto instance before we can get up and running.
%form{:method=>'post'}
- %p
- %label{:for=>'url'} URL
- %input{:type=>'text', :name=>'url'}
- %input{:type=>'submit', :value=>'Here it is!'}
+ %p
+ %label{:for=>'url'} URL
+ %input{:type=>'text', :name=>'url'}
+ %input{:type=>'submit', :value=>'Here it is!'}
%p
- The IPv4 address of this screen appears to be:
- =my_ip
+ The IPv4 address of this screen appears to be:
+ =my_ip
%p
- ==This page can be accessed remotely via http://#{my_ip}/setup
+ ==This page can be accessed remotely via http://#{my_ip}/setup
%p
- Username is root, default password is 'default'.
+ Username is root, default password is 'default'.
+%p
+ Also, you may want to
+ %a{:href=>'/netconfig'} change network settings
+ or
+ %a{:href=>'/password'} change the configuration password.
+
+

0 comments on commit 729d3ea

Please sign in to comment.