|
From: <al...@us...> - 2008-09-02 21:48:01
|
Revision: 666
http://sciret.svn.sourceforge.net/sciret/?rev=666&view=rev
Author: alpeb
Date: 2008-09-02 21:47:53 +0000 (Tue, 02 Sep 2008)
Log Message:
-----------
reverted previous commit. That didn't work out
Modified Paths:
--------------
trunk/index.php
trunk/models/User.php
trunk/models/Users.php
Modified: trunk/index.php
===================================================================
--- trunk/index.php 2008-09-02 20:56:40 UTC (rev 665)
+++ trunk/index.php 2008-09-02 21:47:53 UTC (rev 666)
@@ -95,8 +95,8 @@
Zend_Session::start();
$auth = Zend_Auth::getInstance();
+$users = new Users();
if ($auth->hasIdentity()) {
- $users = new Users();
$user = $auth->getStorage()->read();
$user->init();
if ($user->app == 'monkeys') {
@@ -110,7 +110,7 @@
$user->setTable($users);
} else {
// guest user
- $user = new User();
+ $user = $users->createRow();
}
Zend_Registry::set('user', $user);
Modified: trunk/models/User.php
===================================================================
--- trunk/models/User.php 2008-09-02 20:56:40 UTC (rev 665)
+++ trunk/models/User.php 2008-09-02 21:47:53 UTC (rev 666)
@@ -21,30 +21,6 @@
public $app = 'sciret';
public $publicId;
- /**
- * These are here to be able to have default values when instantiating
- * an anonymous User object without having a connection to the DB
- * (during install)
- */
- public $id = 0;
- public $admin = 0;
- public $password_changed = '0000-00-00';
- public $startBrowsing = 'all';
- public $articlesPerPage = 10;
- public $dateFormat = 'Month Day, Year';
- public $language = '';
- public $navigationType = 'catAndSubCats';
- public $hiddenCategories = '';
- public $preferences;
- private $_defaultPreferences = array(
- 'startBrowsing' => 'all',
- 'articlesPerPage' => 10,
- 'dateFormat' => 'Month Day, Year',
- 'language' => '', // set in the constructor
- 'navigationType' => 'catAndSubCats',
- 'hiddenCategories' => '',
- );
-
var $langArr;
var $skipTranslations = false;
var $rtlLanguages = array('Hebrew');
@@ -53,12 +29,6 @@
private $_preferencesArr;
- public function __construct($config = array())
- {
- $this->preferences = serialize($this->_defaultPreferences);
- parent::__construct($config);
- }
-
public function init()
{
if ($this->id) {
Modified: trunk/models/Users.php
===================================================================
--- trunk/models/Users.php 2008-09-02 20:56:40 UTC (rev 665)
+++ trunk/models/Users.php 2008-09-02 21:47:53 UTC (rev 666)
@@ -8,14 +8,19 @@
public function createRow()
{
- /**
- * we instantiate an anonymous user obj just to get the default field values
- */
- $user = new User();
+ $preferences = array(
+ 'startBrowsing' => 'all',
+ 'articlesPerPage' => 10,
+ 'dateFormat' => 'Month Day, Year',
+ 'language' => '', // set in the constructor
+ 'navigationType' => 'catAndSubCats',
+ 'hiddenCategories' => '',
+ );
+
return parent::createRow(array(
- 'password_changed' => $user->password_changed,
- 'admin' => $user->admin,
- 'preferences' => $user->preferences,
+ 'password_changed' => '0000-00-00',
+ 'admin' => 0,
+ 'preferences' => serialize($preferences),
));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|