diff options
author | morgamic@mozilla.com <morgamic@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5> | 2007-02-28 10:52:43 (GMT) |
---|---|---|
committer | morgamic@mozilla.com <morgamic@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5> | 2007-02-28 10:52:43 (GMT) |
commit | 2faeb1fe33c14aa546359bb9b2bdb9a25b07dbfb (patch) | |
tree | 104b750a1713955b31bd142c0dbe2b8134fc1329 /site/app/app_controller.php | |
parent | a4463fde75d2ae444a9a6460a3c46304946ad671 (diff) |
Fixed addonStatus setting. Missed this because there were not any tests.
git-svn-id: http://svn.mozilla.org/addons/trunk@2361 4eb1ac78-321c-0410-a911-ec516a8615a5
Diffstat (limited to 'site/app/app_controller.php')
-rw-r--r-- | site/app/app_controller.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/site/app/app_controller.php b/site/app/app_controller.php index 39cc30f..d011966 100644 --- a/site/app/app_controller.php +++ b/site/app/app_controller.php @@ -58,7 +58,14 @@ class AppController extends Controller */ function _checkSandbox() { + + // The current status according the to the controller. + // In places, this is pulled and used in IN() clauses, + // so this should always be an array, if though it's annoying. $this->status = array(STATUS_PUBLIC); + + // Whether or not a user has agreed to the sandbox terms, + // according to their session data. Default is false. $this->sandboxAccess = false; if ($this->Session->check('User')) { @@ -77,7 +84,16 @@ class AppController extends Controller if ($this->sandboxAccess) $this->status = array(STATUS_SANDBOX, STATUS_PENDING, STATUS_NOMINATED); } - $this->set('addonStatus', $this->status); + + // This is either PUBLIC or SANDBOX and is used for view switching. + // Since morgamic is a jerk we have to check the status array. + if (in_array(STATUS_SANDBOX,$this->status)) { + $this->set('addonStatus', STATUS_SANDBOX); + } else { + $this->set('addonStatus', STATUS_PUBLIC); + } + + // This is a boolean for our controllers. $this->set('sandboxAccess', $this->sandboxAccess); } |