~fusonic/chive/1.1

« back to all changes in this revision

Viewing changes to protected/models/LoginForm.php

  • Committer: Matthias Burtscher
  • Date: 2010-02-12 09:12:35 UTC
  • Revision ID: matthias.burtscher@fusonic.net-20100212091235-jqxrb62klx872ajc
* Updated Yii to 1.1.0
* Removed CodePress and CodeMirror
* Updated jQuery and some plugins
* Cleaned some code ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * You should have received a copy of the GNU General Public
20
20
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21
21
 */
 
22
 
 
23
 
22
24
class LoginForm extends CFormModel
23
25
{
 
26
        
24
27
        public $username;
25
28
        public $password;
26
29
        public $rememberMe;
27
30
        public $host = 'localhost';
28
31
 
29
32
        /**
30
 
         * Declares the validation rules.
31
 
         * The rules state that username and password are required,
32
 
         * and password needs to be authenticated.
 
33
         * @see         CFormModel::rules();
33
34
         */
34
35
        public function rules()
35
36
        {
42
43
        }
43
44
 
44
45
        /**
45
 
         * Declares attribute labels.
 
46
         * @see         CFormModel::attributeLabels()
46
47
         */
47
48
        public function attributeLabels()
48
49
        {
59
60
         */
60
61
        public function authenticate($attribute,$params)
61
62
        {
62
 
                if(!$this->hasErrors())  // we only want to authenticate when no input errors
 
63
                if(!$this->hasErrors())
63
64
                {
64
65
                        $identity = new UserIdentity($this->username,$this->password, $this->host);
65
66
 
71
72
                        {
72
73
                                $this->addError(null, $identity->errorMessage);
73
74
                        }
74
 
 
75
75
                }
76
76
        }
77
 
}
 
77
        
 
78
}
 
 
b'\\ No newline at end of file'