Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Edmond

Password Hash Method In Book Does Not Work, Got Error.

Recommended Posts

I followed the book in page 208 -209, chapter 9.

 

But when I tested it, I got this error, I looked up in the documentation, this method exists... 

 

 

CException

CSecurityManager and its behaviors do not have a method or closure named "computeHMAC".

Share this post


Link to post
Share on other sites

thankyou Larry, the code:

 

------------config/main.php

    // application components
    'components'=>array(
        'user'=>array(
            // enable cookie-based authentication
            'allowAutoLogin'=>true,
        ),
        
        'securityManager' => array(
        'hashAlgorithm' => 'sha256',
        'validationKey' => 'lvkj23mn5;9 cjl;sd;ij25KJE5r'),

        
--------------model
    protected function beforeSave(){
        $this->password = Yii::app()->securityManager->computeHMAC($this->password);
        return parent::beforeSave();
    }

--------------ERROR
CException

CSecurityManager and its behaviors do not have a method or closure named "computeHMAC".

C:\wamp\www\yii-1-1-13\framework\base\CComponent.php(265)
265         throw new CException(Yii::t('yii','{class} and its behaviors do not have a method or closure named "{name}".',

Share this post


Link to post
Share on other sites

Thanks, Luis! I'm going back through the entire book so far as part of the next update and I'll give this a look-see.

Share this post


Link to post
Share on other sites

Thank you very much. And thanks for your patience. I know it's coming more slowly than people would prefer (including myself).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...