ufcms:yii based cms system programming notes

Note: ufcms is simply means a cms for freely generating websites which is builton top of the popular Yii framework,

it is targetedto be a high performance,full functionality stack content management system for websites like blogging/eCommerce/sns etc.

the demo site powered by ufcms is

http://ufcms.techbrood.com(studio homepage like website)

http://www.techbrood.com(blog like website)

[2012.12.22]

1)q: @domain/admin return 403

a: add rewrite rules to .htaccess file2)q: @domain/admin return "PermissionDenied" a: it is caused by AuthManager->checkAccess(Yii::app->user() returns the old session kept but with the wrong role as probably role has been changed from db, just clear your local cookie will fix it. if still not work, please clear you categories cache under protected/runtime/cached/categories.php, if still not work, pls check your db table categories, to see if there is a user root category and a record with an alias as ‘administrators’, make sure these two records exist, then clean ur categories cache.if still not work, pls check if somebody changed the administrator category id, if so, you have to change the associated user record in user_categories table.3)q: @domain/gii return 403a: add rewrite rule to .htaccess, rewrite /gii to index.php?r=gii; add ipfilter to gii module in your config as by default gii is only accessable from local server.4)q: @domain/image.php?thumb=uploads/media/trade/deal_6_70x70_1356109812.jpg crash

a: the yimage name is uppercase, need to be renamed to lowercase, and the exif_imagetype function lead to a crash on some servers.

5)q: build a restful service(POST), and implemented a test interface by using curl(POST) for that restful api, it works on local machine but not for linux vhost

a: in my case, it was caused by DNS issue, i named the vhost as for example, open.yourdomain.com, but forget to add dns record to /etc/hosts file, thus the curl post request will be deliver to unknown host, the worst case is in case you have a production env open.yourdomain.com, your test data will probably go into production enviroment.

6)q: when i choose the category, the fiter didn’t work

a: it was probably caused by categoryId is not added to search rules array in your model’s rules() method. or you might use the catergory_id as one of the comparision expressions which is not expected and will always return the same result sets.

7)q: @mkdir($path,777,1) only created the first directory,failed to create child directories

a: the problem is the mode is wrong, should be changed to 0777

8)q: image file only returns partial content

a: the problem is caused by nginx/fastcgi parameters(file buffer size), set file_buffer_size to 64k and file_buffer to 4 64k will solve the problem in most cases

9)q: when upgrade the ufcms to use yii-1.1.13 version, when i enter pages using CGridView, i got a js error saying something like "unrecognized var ‘page’,’size’"

a: this was cause by outdated gridview jquery script. please check if you are using below script version:

https://github.com/yiisoft/yii/blob/master/framework/zii/widgets/assets/gridview/jquery.yiigridview.js#L76

and pls note that if you have extended CGridView for example FGridView, and clone a jquery.yiigridview.js file, then remember to replace that file too.

10)q: when i access index.php, it redirect to User/admin/user/login, and returns 404 error

a: make sure index.php exists, and check pages_translated has the correct home page record with correct Locale, this table will be used for generating view table: view_pages, u can see how view_pages was created simply by executing "select create view view_pages;", the view_pages will be used in DefaultController->actionIndex() for checking whether the pages is valid or not.

11)q: error happens while regenerating acl list, it says: CErrorHandler and its behaviors do not have a method or closure named "getUserExceptions"

a: the getUserExceptions function is defined in our customized error handler, but in this case it seems the customized error handler has been replaced by default one, these application customized components for overriding default behavior of Yii core components are loaded and set within the CApplication::config(…) function, via a magic method CComponent::__set(…). in my case, acl regenerating function calls the Yii::app()->getModule($moduleId) to reinitialize all loaded modules, gii module especially set components by itself in init() function so then overrides our loaded one. the solution is to bypass the gii module when generating acl list.

12)q:how to render/normalize errors of the controller returns?

a: this is done in protected/core/extensions/ControllerBase,ControllerBase::getErrors(), simliar mechanism is used for rendering messages

13)q:how to customize the backend management access url for security

a: modify app server(ex: apache) vhost rewrite rule, modify .htaccess rewrite rule as well, then modify a little bit base/Url,UrlManager::init() function

by iefreer

切忌贪婪,恨不得一次玩遍所有传说中的好景点,

ufcms:yii based cms system programming notes

相关文章:

你感兴趣的文章:

标签云: