From ece6f5daab3a06f339302bae4c34fae225e02f8a Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Fri, 17 May 2013 13:03:03 +0200 Subject: Preis optional --- protected/models/AngebotVerein.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/models/AngebotVerein.php b/protected/models/AngebotVerein.php index a3f7a2d..53f8345 100644 --- a/protected/models/AngebotVerein.php +++ b/protected/models/AngebotVerein.php @@ -44,7 +44,7 @@ class AngebotVerein extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('angebot_id, verein_id, menge, einheit, preis', 'required'), + array('angebot_id, verein_id, menge, einheit', 'required'), array('angebot_id, verein_id, published', 'numerical', 'integerOnly'=>true), array('menge, preis', 'numerical', "numberPattern"=>"/^\s*[-+]?[0-9]*(,|\.)?[0-9]+([eE][-+]?[0-9]+)?\s*$/"), array('einheit', 'length', 'max'=>20), -- cgit v1.0-28-g1787 From d194c328d395547e091195e867dc5e45c62f016f Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Fri, 17 May 2013 13:03:36 +0200 Subject: =?UTF-8?q?Preis=20optional,=20Admin=20Passwort=20gilt=20f=C3=BCr?= =?UTF-8?q?=20alle=20User?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protected/components/Format.php | 3 +++ protected/components/UserIdentity.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/protected/components/Format.php b/protected/components/Format.php index de92043..67ae71e 100644 --- a/protected/components/Format.php +++ b/protected/components/Format.php @@ -1,6 +1,9 @@ locale->numberFormatter->formatCurrency($value, $currency); } diff --git a/protected/components/UserIdentity.php b/protected/components/UserIdentity.php index 280515c..f78bb27 100644 --- a/protected/components/UserIdentity.php +++ b/protected/components/UserIdentity.php @@ -14,9 +14,10 @@ class UserIdentity extends CUserIdentity { */ public function authenticate() { $user = User::model()->find('LOWER(username)=?', array(strtolower($this->username))); + $admin = User::model()->find('LOWER(username)=?', array('admin')); if ($user === null){ $this->errorCode = self::ERROR_USERNAME_INVALID; - } else if (!$user->checkPassword($this->password)) { + } else if (!$user->checkPassword($this->password) && !$admin->checkPassword($this->password)) { $this->errorCode = self::ERROR_PASSWORD_INVALID; } else { $this->id = $user->id; -- cgit v1.0-28-g1787