diff options
| author | astaf <astaf@proxy.ccwn.org.ccwn.org> | 2013-05-17 13:03:26 +0200 |
|---|---|---|
| committer | astaf <astaf@proxy.ccwn.org.ccwn.org> | 2013-05-17 13:03:26 +0200 |
| commit | 79c88ea008f5cf34fc77a05fa2059e63298b223f (patch) | |
| tree | e352c5a35ac8cb1e0795b82e36467d77856236bf | |
| parent | a96e3f0a649b5331a7d76124d37c0b6907abcc4b (diff) | |
| parent | d194c328d395547e091195e867dc5e45c62f016f (diff) | |
Merge branch 'master' of ssh://proxy:9044/home/ccwn/git-repos/admin.astaf.de
| -rw-r--r-- | protected/components/Format.php | 3 | ||||
| -rw-r--r-- | protected/components/UserIdentity.php | 3 | ||||
| -rw-r--r-- | protected/models/AngebotVerein.php | 2 |
3 files changed, 6 insertions, 2 deletions
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 @@ <?php class Format { public static function currency($value, $currency = 'EUR') { + if ($value <=0) {
+ return "?,?? €";
+ } return Yii::app()->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; 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), |
