<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/controllers/login_controller.rb</filename>
    </added>
    <added>
      <filename>app/helpers/login_helper.rb</filename>
    </added>
    <added>
      <filename>app/views/home/_footer.html.erb</filename>
    </added>
    <added>
      <filename>app/views/home/_header.html.erb</filename>
    </added>
    <added>
      <filename>app/views/home/_menu.html.erb</filename>
    </added>
    <added>
      <filename>app/views/layouts/login.html.erb</filename>
    </added>
    <added>
      <filename>app/views/login/login.html.erb</filename>
    </added>
    <added>
      <filename>public/images/main_bg.gif</filename>
    </added>
    <added>
      <filename>test/functional/login_controller_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -36,12 +36,16 @@ Report Bugs:
 
 http://railsdb.lighthouseapp.com/projects/12472-railsdb/overview
 
-Contact
+Contact:
 
 Greg Donald
 gdonald@gmail.com
 http://destiney.com/
 
+Contributors:
+Jacek Panachida
+jacek.panachida@gmail.com
+
 Ruby on Rails:
 
 For more information about Ruby on Rails see the RAILS_README.txt.</diff>
      <filename>README.txt</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,9 @@ class ApplicationController &lt; ActionController::Base
       @current_user = nil
       return
     end
-    @current_user = User.find( :first, :conditions =&gt; [ 'id = ?', session[:user_id] ] )
+    @current_user = User.find( :first,
+                               :conditions =&gt; [ 'id = ?',
+                                                session[:user_id] ] )
   end
 
   #</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 class DatabaseController &lt; ApplicationController
 
+  before_filter :check_perm
+
   require 'paginator'
   require 'export/dsv_exporter'
 
@@ -334,7 +336,7 @@ class DatabaseController &lt; ApplicationController
     checked_field_names = (params[:field].delete_if { |k,v| v == '0' }).keys
     rows = @table.find(:all, :select =&gt; &quot;#{checked_field_names.join(',')}&quot;)
     export_data = []
-    rows.each { |r| export_data &lt;&lt; r.values  }  
+    rows.each { |r| export_data &lt;&lt; r.values  }
     format = params[:format]
     delimiter = ','
     type = 'text/csv'
@@ -350,10 +352,20 @@ class DatabaseController &lt; ApplicationController
     exporter.header = params[:field].keys
     send_data exporter.export_as_text(export_data), :filename =&gt; &quot;#{@database.name}$#{params[:table]}.csv&quot;, :type =&gt; type
   end
-  
+
   private
 
   #
+  # Check site login
+  #
+  def check_perm
+    unless check_site_perm 'admin'
+      flash[:notice] = 'please login'
+      redirect_to :controller =&gt; :login
+    end
+  end
+
+  #
   # Finds a table row by table and id
   #
   def get_row( table, id )
@@ -404,5 +416,5 @@ class DatabaseController &lt; ApplicationController
                   :action     =&gt; :databases
     end
   end
-  
+
 end</diff>
      <filename>app/controllers/database_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,9 @@
 class HomeController &lt; ApplicationController
-  
-  before_filter :check_perm, :except =&gt; [ :login, :logout ]
 
-  filter_parameter_logging :password
-  
-  layout :get_layout
+  before_filter :check_perm
 
   def index
-  end
-
-  def top
-  end
-
-  def menu
-  end
-
-  def bottom
+    redirect_to :controller =&gt; :home, :action =&gt; :databases
   end
 
   def databases
@@ -289,33 +277,12 @@ class HomeController &lt; ApplicationController
     end
   end
 
-  def login
-    session[:user_id] = nil
-    if request.post?
-      user = User.authenticate( params[:login][:username], params[:login][:password] )
-      if user
-        session[:user_id] = user.id
-        uri = session[:uri]
-        session[:uri] = nil
-        flash[:notice] = 'login successful'
-        redirect_to uri || { :controller =&gt; 'home' }
-      else
-        flash[:notice] = 'login failed'
-      end
-    end
-  end
-
-  def logout
-    reset_session
-    redirect_to :controller =&gt; :home, :action =&gt; :login
-  end
-
   private
 
   def check_perm
     unless check_site_perm 'admin'
       flash[:notice] = 'please login'
-      redirect_to :controller =&gt; 'home', :action =&gt; 'login'
+      redirect_to :controller =&gt; :login
     end
   end
 
@@ -342,7 +309,7 @@ class HomeController &lt; ApplicationController
       redirect_to :controller =&gt; 'home', :action =&gt; 'permissions'
     end
   end
-  
+
   def get_driver( id )
     @driver = Driver.find( :first, :conditions =&gt; [ 'id = ?', id ] )
     if @driver.nil?
@@ -350,7 +317,7 @@ class HomeController &lt; ApplicationController
       redirect_to :controller =&gt; 'home', :action =&gt; 'drivers'
     end
   end
-  
+
   def get_database( id )
     @database = Database.find( :first, :conditions =&gt; [ 'id = ?', id ] )
     if @database.nil?
@@ -359,8 +326,4 @@ class HomeController &lt; ApplicationController
     end
   end
 
-  def get_layout
-    ( %w( index top menu bottom login ).include? self.action_name ) ? nil : 'application'
-  end
-  
 end</diff>
      <filename>app/controllers/home_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +0,0 @@
-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot;
-&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;
-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
-&lt;head&gt;
-&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;
-&lt;title&gt;&lt;%= SITE_TITLE %&gt;&lt;/title&gt;
-&lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;
-&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
-if(top.location != self.location) top.location = self.location;
-&lt;/script&gt;
-&lt;base target=&quot;main&quot; /&gt;
-&lt;/head&gt;
-&lt;frameset rows=&quot;60,*,18&quot; border=&quot;0&quot; frameborder=&quot;0&quot;&gt;
-&lt;frame src=&quot;&lt;%= url_for :controller =&gt; 'home', :action =&gt; 'top' %&gt;&quot; name=&quot;top&quot; border=&quot;0&quot; frameborder=&quot;0&quot; /&gt;
-&lt;frameset cols=&quot;160,*&quot; border=&quot;0&quot; frameborder=&quot;0&quot;&gt;
-&lt;frame src=&quot;&lt;%= url_for :controller =&gt; 'home', :action =&gt; 'menu' %&gt;&quot; name=&quot;menu&quot; border=&quot;0&quot; frameborder=&quot;0&quot; /&gt;
-&lt;frame src=&quot;&lt;%= url_for :controller =&gt; 'home', :action =&gt; 'databases' %&gt;&quot; name=&quot;main&quot; border=&quot;0&quot; frameborder=&quot;0&quot; /&gt;
-&lt;/frameset&gt;
-&lt;frame src=&quot;&lt;%= url_for :controller =&gt; 'home', :action =&gt; 'bottom' %&gt;&quot; name=&quot;bottom&quot; border=&quot;0&quot; frameborder=&quot;0&quot; /&gt;
-&lt;/frameset&gt;
-&lt;/html&gt;</diff>
      <filename>app/views/home/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -6,13 +6,25 @@
   &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
   &lt;%= javascript_include_tag :defaults %&gt;
   &lt;%= stylesheet_link_tag 'railsdb' %&gt;
-  &lt;base target=&quot;main&quot; /&gt;
   &lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;
 &lt;/head&gt;
 &lt;body&gt;
+&lt;div id=&quot;header&quot;&gt;
+&lt;%= render :partial =&gt; 'home/header' %&gt;
+&lt;/div&gt;
+&lt;div id=&quot;main&quot;&gt;
+&lt;div id=&quot;menu&quot;&gt;
+&lt;%= render :partial =&gt; 'home/menu' %&gt;
+&lt;/div&gt;
+&lt;div id=&quot;content&quot;&gt;
 &lt;% if flash[:notice] -%&gt;
 &lt;p class=&quot;error&quot;&gt;&lt;%= flash[:notice] %&gt;&lt;/p&gt;
 &lt;% end -%&gt;
 &lt;%= yield :layout %&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div id=&quot;footer&quot;&gt;
+&lt;%= render :partial =&gt; 'home/footer' %&gt;
+&lt;/div&gt;
 &lt;/body&gt;
 &lt;/html&gt;</diff>
      <filename>app/views/layouts/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -84,7 +84,7 @@ ActionController::Routing::Routes.draw do |map|
               :requirements =&gt; {  :id     =&gt; /[0-9]{1,11}/,
                                   :table  =&gt; /[\.0-9a-z\-_]{1,64}/,
                                   :field  =&gt; /[\.0-9a-z\-_]{1,64}/ }
-                                
+
   map.connect 'database/export/:id',
               :controller   =&gt; 'database',
               :action       =&gt; 'export_table',
@@ -142,8 +142,16 @@ ActionController::Routing::Routes.draw do |map|
               :action       =&gt; 'index',
               :requirements =&gt; { :id  =&gt; /[0-9]{1,11}/ }
 
+  map.connect 'logout',
+              :controller   =&gt; 'login',
+              :action       =&gt; 'logout'
+
+  map.connect 'login',
+              :controller   =&gt; 'login',
+              :action       =&gt; 'login'
+
   # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
-  map.root :controller =&gt; 'home'
+  map.root :controller =&gt; 'home', :action =&gt; 'databases'
 
   # See how all your routes lay out with &quot;rake routes&quot;
 </diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,8 @@
+body
+{
+  background-color:     #fff;
+}
+
 body, form
 {
   margin:               0;
@@ -20,8 +25,8 @@ h1
 
 h2
 {
-  padding:              0 0 0 10px;
-  margin:               8px 0 0 0;
+  padding:              8px 0 0 10px;
+  margin:               0 0 0 0;
 }
 
 a
@@ -74,8 +79,8 @@ a:hover
 
 p.error
 {
-    margin:              10px 0 0 0;
-    padding:             0 0 0 10px;
+    margin:              0 0 0 0;
+    padding:             10px 0 0 10px;
 }
 
 table.data, table.form
@@ -134,36 +139,37 @@ table.data thead a:hover
   background-color:     inherit;
 }
 
-#top
+#header
 {
-  width:                100%;
-  border-collapse:      collapse;
-  overflow:             hidden;
+  background-color:     #ccc;
 }
 
-#top td
+#header table
 {
-  padding:              0;
+  margin:               0 0 0 0;
+  width:                100%;
+  border-collapse:      collapse;
+  border-bottom:        1px solid #000;
 }
 
-#top .l, #top .a
+#header .l, #header .a
 {
   text-align:           right;
   padding:              5px 5px 1px 0;
 }
 
-#top .a
+#header .a
 {
   font-size:            17px;
 }
 
-#top .l
+#header .l
 {
   vertical-align:       bottom;
-  padding:              12px 5px 0 0;
+  padding:              12px 5px 3px 0;
 }
 
-#top .t
+#header .t
 {
   font-size:            25px;
   font-weight:          bold;
@@ -171,43 +177,56 @@ table.data thead a:hover
   padding:              0 0 5px 8px;
 }
 
-#bottom
+#main
+{
+  min-height:           480px;
+  background:           url(/images/main_bg.gif) repeat-y;
+}
+
+#footer table
 {
+  border-top:           1px solid #000;
   width:                100%;
 }
 
-#bottom td
+#footer table td
 {
   font-size:            11px;
   text-align:           right;
-  padding:              2px 2px 0 0;
+  padding:              2px 4px 0 0;
   vertical-align:       top;
   height:               11px;
 }
 
 #menu
 {
-  width:                100%;
+  float:                left;
   border-collapse:      collapse;
-  margin:               6px 0 0 0;
+  margin:               0 0 0 0;
 }
 
-#menu td
+#menu table
 {
+  margin:               4px 10px 0 0;
+}
+
+#menu table td
+{
+  width:                132px;
   text-align:           right;
-  padding:              5px 10px 0 0;
+  padding:              0 6px 2px 0;
 }
 
 #menu a
 {
   font-size:            15px;
-  color:                #ccc;
+  color:                #333;
   background-color:     inherit;
 }
 
 #menu a:hover
 {
-  color:                #fff;
+  color:                #000;
   background-color:     inherit;
 }
 </diff>
      <filename>public/stylesheets/railsdb.css</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/home/bottom.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/home/login.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/home/menu.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/home/top.html.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f3f79a1a321c763405632a02b6d70287ec270d26</id>
    </parent>
  </parents>
  <author>
    <name>Greg Donald</name>
    <email>gdonald@gmail.com</email>
  </author>
  <url>http://github.com/gdonald/railsdb/commit/690341aa901b3c321aa2304af016094a2484a6ae</url>
  <id>690341aa901b3c321aa2304af016094a2484a6ae</id>
  <committed-date>2008-06-22T12:56:11-07:00</committed-date>
  <authored-date>2008-06-22T12:56:11-07:00</authored-date>
  <message>get rid of frames</message>
  <tree>725ae9b1c7aafbe636432e95afadafc89438e3c0</tree>
  <committer>
    <name>Greg Donald</name>
    <email>gdonald@gmail.com</email>
  </committer>
</commit>
