[SOLVED] Make sure the user module directory (within protected/modules/ folder) starts with an undercase: "User" should be changed to "user".
I am using the yii-user extension and it worked fine until I uploaded it to my web server. On localhost, user registration works (saw new accounts in the database), but it never sent the activation email. I found out this wasn’t a problem with the extension itself because the default contact page also never sends an email to me, but did when I tried it on my server.
So on the web server, the About and Contact pages work, but when I click on either Login or Register, I get a CException with this error message:
I’ve searched online extensively trying to find out what the problem is / how to fix it, but it’s very frustrating that all the answers I’ve found refer to the yii-user-management extension, not yii-user!
I’ll provide code snippets from my project when necessary, I just don’t know which parts you guys need to see. The stack traces are exactly the same for both the Registration and Login page errors, except for stacks #3 and #4 where they have different controllers (“user/regisration” vs “user/login”):
Stack trace:
#0 /f5/spartanworker/protected/yii/framework/YiiBase.php(196): YiiBase::import("user.UserModule", true)
#1 /f5/spartanworker/protected/yii/framework/base/CModule.php(282): YiiBase::createComponent("user.UserModule", "user", null, array("hash" => "md5", "sendActivationMail" => true, "loginNotActiv" => false, "activeAfterRegister" => false, ...))
#2 /f5/spartanworker/protected/yii/framework/web/CWebApplication.php(337): CModule->getModule("user")
#3 /f5/spartanworker/protected/yii/framework/web/CWebApplication.php(276): CWebApplication->createController("user/registration")
#4 /f5/spartanworker/protected/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("user/registration")
#5 /f5/spartanworker/protected/yii/framework/base/CApplication.php(180): CWebApplication->processRequest()
#6 /f5/spartanworker/public/thearc/index.php(15): CApplication->run()
I guess it’s worth noting that the yii framework directory location is different on my server compared to localhost, but I take care of that while uploading:
$yii=dirname(__FILE__).'/../yii/framework/yii.php'; //localhost
//$yii=dirname(__FILE__).'/../../protected/yii/framework/yii.php'; //on server
Even though this might deserve a separate post, I’d like to hear the main differences between yii-user and yii-user-management extensions, specifically when it comes to adding new modules - which one is more flexible? I want to stick with yii-user, but if there is any compelling reason to use the other extension, I’ll consider it.