Revision
76394
Author
wsiegrist@apple.com
Date
2011-02-21 20:35:28 -0800 (Mon, 21 Feb 2011)

Log Message

Sync up content changes to match current site. Add initial auth_logic methods.

Modified Paths

Diff

Modified: branches/gsoc10-mpwa/mpwa/app/controllers/application_controller.rb (76393 => 76394)


--- branches/gsoc10-mpwa/mpwa/app/controllers/application_controller.rb	2011-02-22 02:43:20 UTC (rev 76393)
+++ branches/gsoc10-mpwa/mpwa/app/controllers/application_controller.rb	2011-02-22 04:35:28 UTC (rev 76394)
@@ -6,18 +6,49 @@
 class ApplicationController < ActionController::Base
   helper :all # include all helpers, all the time
   protect_from_forgery # See ActionController::RequestForgeryProtection for details
+  helper_method :current_user_session, :current_user
 
   $trac_url = 'http://trac.macports.org/'
   $svn_url = 'http://svn.macports.org/repository/macports/'
   $downloads_url = 'http://distfiles.macports.org/MacPorts/'
   $guide_url = 'http://guide.macports.org'
-  $latest_version = '1.9.1'
+  $latest_version = '1.9.2'
   $snowleopard_dmg = "#{$downloads_url}Macports-#{$latest_version}-10.6-SnowLeopard.dmg"
   $leopard_dmg = "#{$downloads_url}Macports-#{$latest_version}-10.5-Leopard.dmg"
-  $tiger_dmg = "#{$downloads_url}Macports-#{$latest_version}-10.4-Tiger.dmg"
+  $tiger_dmg = "#{$downloads_url}Macports-1.9.1-10.4-Tiger.dmg"
   $bz2_tarball = "#{$downloads_url}MacPorts-#{$latest_version}.tar.bz2"
   $gz_tarball = "#{$downloads_url}MacPorts-#{$latest_version}.tar.gz"
   $checksums = "#{$downloads_url}MacPorts-#{$latest_version}.chk.txt"
 
   $updated = Port.all(:order => 'updated_at DESC', :limit => 1).try(:first).try(:updated_at) || Time.at(0)
+
+  private
+  def current_user_session
+    return @current_user_session if defined?(@current_user_session)
+    @current_user_session = UserSession.find
+  end
+
+  def current_user
+    return @current_user if defined?(@current_user)
+    @current_user = current_user_session && current_user_session.record
+  end
+
+  def require_user
+    unless current_user
+      store_location
+      flash[:notice] = "You must be logged in to access this page"
+      render :file => 'static/unauth.html', :status => :unauthorized
+      return false
+    end
+  end
+
+  def require_no_user
+    if current_user
+      store_location
+      flash[:notice] = "You must be logged out to access this page"
+      #redirect_to account_url
+      return false
+    end
+  end
+
 end

Modified: branches/gsoc10-mpwa/mpwa/app/views/pages/index.html.erb (76393 => 76394)


--- branches/gsoc10-mpwa/mpwa/app/views/pages/index.html.erb	2011-02-22 02:43:20 UTC (rev 76393)
+++ branches/gsoc10-mpwa/mpwa/app/views/pages/index.html.erb	2011-02-22 04:35:28 UTC (rev 76394)
@@ -4,13 +4,13 @@
 
   <p>The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the <%= link_to 'Mac OS X', 'http://www.apple.com/macosx/' %> operating system. To that end we provide the command-line driven MacPorts software package under a <%= link_to 'BSD License', 'http://opensource.org/licenses/bsd-license.php' %>, and through it easy access to thousands of ports that <%= link_to 'greatly simplify', "#{$guide_url}#introduction" %> the task of <%= link_to 'compiling and installing', "#{$guide_url}#using" %> open-source software on your Mac.</p>
 
-  <p>We provide a single software tree that attempts to track the latest release of every software title (port) we distribute, without splitting them into &#8220;stable&#8221; Vs. &#8220;unstable&#8221; branches, targetting mainly the current Mac OS X release (10.6, A.K.A Snow Leopard) and the immediately previous one (10.5, A.K.A. Leopard). There are currently <%= link_to "<b>#{Port.count}</b> ports", categories_path %> in our tree, distributed among <%= Category.count %> different categories, and more are being added on a regular basis.</p>
+  <p>We provide a single software tree that attempts to track the latest release of every software title (port) we distribute, without splitting them into &#8220;stable&#8221; Vs. &#8220;unstable&#8221; branches, targeting mainly the current Mac OS X release (10.6, A.K.A Snow Leopard) and the immediately previous one (10.5, A.K.A. Leopard). There are currently <%= link_to "<b>#{Port.count}</b> ports", categories_path %> in our tree, distributed among <%= Category.count %> different categories, and more are being added on a regular basis.</p>
 
   <h3 class="subhdr">Getting started</h3>
 
   <p>For information on installing MacPorts please see the <%= link_to 'installation', install_path %> section of this site and explore the myriad of download options we provide and our base system requirements.</p>
 
-  <p>If you run into any problems installing and/or using MacPorts we also have many options to help you, depending on how you wish to get <%= link_to 'get in touch with us', contact_path %>. Other important help resources are our online documentation, A.K.A <a href="<?php print $guide_url; ?>"> The MacPorts Guide</a>, and our Trac <%= link_to 'Wiki server &amp; bug tracker', $trac_url %>.</p>
+  <p>If you run into any problems installing and/or using MacPorts we also have many options to help you, depending on how you wish to get <%= link_to 'get in touch with us', contact_path %>. Other important help resources are our online documentation, A.K.A <a href="<?php print $guide_url; ?>"> The MacPorts Guide</a>, and our Trac <%= link_to 'Wiki server & bug tracker', $trac_url %>.</p>
 
   <p><b>Latest MacPorts <%= link_to 'release', install_path %>: <%= $latest_version %></b></p>
 
@@ -30,4 +30,4 @@
 
   <p>Browse over to our generous landlord's homepage, <%= link_to 'Mac OS Forge', 'http://www.macosforge.org' %>, for information on other related projects.</p>
 
-</div>
\ No newline at end of file
+</div>

Modified: branches/gsoc10-mpwa/mpwa/app/views/pages/install.html.erb (76393 => 76394)


--- branches/gsoc10-mpwa/mpwa/app/views/pages/install.html.erb	2011-02-22 02:43:20 UTC (rev 76393)
+++ branches/gsoc10-mpwa/mpwa/app/views/pages/install.html.erb	2011-02-22 04:35:28 UTC (rev 76394)
@@ -107,11 +107,13 @@
 
   <ul>
     <li><%= link_to 'Tcl', 'http://www.tcl.tk' %> (8.4 or 8.5), with threads.</li>
-    <li><%= link_to 'GNUstep', 'http://gnustep.org' %> (Base), for Foundation.</li>
     <li><b>mtree</b> for directory hierarchy.</li>
     <li><%= link_to 'rsync', 'http://rsync.samba.org' %> for syncing the ports.</li>
     <li><%= link_to 'cURL', 'http://curl.haxx.se' %> for downloading distfiles.</li>
-    <li><%= link_to 'OpenSSL', 'http://www.openssl.org' %> or <%= link_to 'libmd', 'http://martin.hinner.info/libmd' %> for checksums.</li>
+    <li><%= link_to 'libmd', 'http://martin.hinner.info/libmd' %> for checksums.</li>
+    <li><%= link_to 'SQLite', 'http://www.sqlite.org/' %> for the port registry.</li>
+    <li><%= link_to 'GNUstep', 'http://gnustep.org/' %> (Base), for Foundation (optional, can be disabled via configure args).</li> 
+    <li><%= link_to 'OpenSSL', 'http://www.openssl.org' %> for signature verification (currently trunk only).
   </ul>
 
   <p>Normally you must install from <%= link_to 'source', '#source' %> or from an <%= link_to 'SVN checkout', '#svn' %> to run MacPorts on any of these platforms. Experimental packaging is available for the FreeBSD (.tbz package), Fedora (.rpm package) and Ubuntu (.deb package) operating systems.</p>
@@ -122,4 +124,4 @@
 
   <p>If any of these resources do not answer your questions or if you need any kind of extended support, there are many ways to <%= link_to 'contact us', contact_path %>!</p>
 
-</div>
\ No newline at end of file
+</div>

Modified: branches/gsoc10-mpwa/mpwa/config/application.rb (76393 => 76394)


--- branches/gsoc10-mpwa/mpwa/config/application.rb	2011-02-22 02:43:20 UTC (rev 76393)
+++ branches/gsoc10-mpwa/mpwa/config/application.rb	2011-02-22 04:35:28 UTC (rev 76394)
@@ -23,7 +23,7 @@
     config.encoding = "utf-8"
 
     # Configure sensitive parameters which will be filtered from the log file.
-    config.filter_parameters += [:password]
+    config.filter_parameters += [:password, :password_confirmation]
 
     config.middleware.use Rack::Recaptcha, :public_key => '', :private_key => ''
   end

Modified: branches/gsoc10-mpwa/mpwa/public/stylesheets/macports.css (76393 => 76394)


--- branches/gsoc10-mpwa/mpwa/public/stylesheets/macports.css	2011-02-22 02:43:20 UTC (rev 76393)
+++ branches/gsoc10-mpwa/mpwa/public/stylesheets/macports.css	2011-02-22 04:35:28 UTC (rev 76394)
@@ -195,7 +195,6 @@
 }
 
 #categories > ul > li {
-    margin-bottom: 40px;
 }
 
 #categories ul > li  {
@@ -217,6 +216,7 @@
     font-size: 90%;
     clear: both;
     text-align: center;
+    padding-top: 20px;
 }
 
 #footer img {