Edmond Posted February 14, 2013 Share Posted February 14, 2013 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... CExceptionCSecurityManager and its behaviors do not have a method or closure named "computeHMAC". Link to comment Share on other sites More sharing options...
Jonathon Posted February 14, 2013 Share Posted February 14, 2013 My bad I thought you said "doesn't exist" Link to comment Share on other sites More sharing options...
Edmond Posted February 15, 2013 Author Share Posted February 15, 2013 So that's why it's confusing me... Anyone got the same problem? Link to comment Share on other sites More sharing options...
Edmond Posted February 15, 2013 Author Share Posted February 15, 2013 Anyway, I chose the option $pass = hash_hmac('sha256', $pass, Yii::app()->params['encryptionKey']); This worked. Link to comment Share on other sites More sharing options...
Larry Posted February 15, 2013 Share Posted February 15, 2013 I'll double check it myself to see. Could you post the exact code you were using? Link to comment Share on other sites More sharing options...
Luis Posted February 15, 2013 Share Posted February 15, 2013 the same for me, same CException Link to comment Share on other sites More sharing options...
Larry Posted February 15, 2013 Share Posted February 15, 2013 Thanks, Luis. Could you post the exact code you're using? Link to comment Share on other sites More sharing options...
Luis Posted February 15, 2013 Share Posted February 15, 2013 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(); }--------------ERRORCExceptionCSecurityManager 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}".', Link to comment Share on other sites More sharing options...
Larry Posted February 15, 2013 Share Posted February 15, 2013 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. Link to comment Share on other sites More sharing options...
Luis Posted February 15, 2013 Share Posted February 15, 2013 Thanks Larry, The Yii Book is really great, I'm waiting for the oncomming chapters Link to comment Share on other sites More sharing options...
Larry Posted February 15, 2013 Share Posted February 15, 2013 Thank you very much. And thanks for your patience. I know it's coming more slowly than people would prefer (including myself). Link to comment Share on other sites More sharing options...
Antonio Conte Posted February 16, 2013 Share Posted February 16, 2013 Did you guys look at the YII requirements script? I would guess you are failing the test for HMAC support. You need that extension installed. Link to comment Share on other sites More sharing options...
Recommended Posts