Yii skeleton app

You might want to change this to



$criteria->order = User::model()->tableName.`created` DESC';


Just a couple of things to make it even better:

  • You might want to make email unique too in User model.

  • Perhaps you can encapsulate all messages an labels with Yii::t() to enhance multilingual options.

  • Showing captcha after 3 failed logins - to block brute force login scripts

Uppercase/lowercase issue with TextEditor module when using caseSensitive=>false (and Linux).

According to the manual, module name should be all lowercase, and only UCFirst (TexteditModule etc).

Sorry…

I can't get it to work.

module and controller are named it Textedit now

but http://localhost/yii…extedit/loadRaw does not work

'loadRaw' can't be used, action must be UCFirst -> actionloadraw. The url will be all lowercased. Got it working now, but you need to change a lot (TextEditController -> TexteditController, directory names all lowercase, so module name too, all calls to module too etc.)

HaPpY cAmElCaSiNg… Not really funny in Linux ;)

One other thing: if you use any Yii caching, be sure to flush it to prevent Yii remembering wrong paths.

Quote

That's weird.. Anyways this should fix it:

http://code.google.c…rce/detail?r=56

The result is the same as r=55.

Quote

CDbException

Description

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created' in order clause is ambiguous

Source File

/var/www/html/yii/framework/db/CDbCommand.php(284)

Quote

#0 /var/www/html/yii/framework/db/CDbCommand.php(218): CDbCommand->queryInternal('fetchAll', 2)

#1 /var/www/html/yii/framework/db/ar/CActiveFinder.php(484): CDbCommand->queryAll()

#2 /var/www/html/yii/framework/db/ar/CActiveFinder.php(333): CJoinElement->runQuery(Object(CJoinQuery))

#3 /var/www/html/yii/framework/db/ar/CActiveFinder.php(93): CJoinElement->find(Object(CDbCriteria))

#4 /var/www/html/yii/demos/skeleton-app/protected/controllers/UserController.php(65): CActiveFinder->findAll(Object(CDbCriteria))

This exception comes from here(>>>), in protected/controllers/UserController.php.



        public function actionList() {


                $criteria = new CDbCriteria;





                $pages = new CPagination(User::model()->count($criteria));


                $pages->pageSize = 25;


                $pages->applyLimit($criteria);





                $sort = new CSort('user');


                $sort->attributes = array(


                        'user.username'=>'username',


                        'user.group_id'=>'group_id',


                        'user.email'=>'email',


                        'user.created'=>'created',


                        'user.email_confirmed'=>'email_confirmed',


                );


                $sort->applyOrder($criteria);


                $criteria->order = '`created` DESC';


>>>             $users=User::model()->with('group')->findAll($criteria);





                //The user list supports AJAX.  Not sure if this is a good thing in this case,                            


                //but I'll leave it as an example                                                                         


                if (Yii::app()->request->isAjaxRequest)


                        $this->renderPartial('listPage', compact('users', 'pages', 'sort'));


                else


                        $this->render('list', compact('users', 'pages', 'sort'));


        }


You are not using r56 by looking at the code you just gave me

Ok, the case sensitivity problems should be fixed now.

Quote

You are not using r56 by looking at the code you just gave me

Oh my mistake :-[. Since the difference of r56 is only one line, I changed that portion by hand, but actually I failed to do it. After changing that portion, the exception never happens. Thanks!

Though an exception does not happen when I clicked the user button, another exception happens when I clicked username in userlist. Exception follows.

Quote

PHP Error

Description

YiiBase::include(Post.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory

Source File

/var/www/html/yii/framework/YiiBase.php(297)

00285:      * Class autoload loader.

00286:      * This method is provided to be invoked within an __autoload() magic method.

00287:      * @param string class name

00288:      */

00289:    public static function autoload($className)

00290:    {

00291:        // use include so that the error PHP file may appear

00292:        if(isset(self::$_coreClasses[$className]))

00293:            include(YII_PATH.self::$_coreClasses[$className]);

00294:        else if(isset(self::$_classes[$className]))

00295:            include(self::$_classes[$className]);

00296:        else

00297: include($className.'.php');

00298:    }

00299:

00300:    /**

00301:      * Writes a trace message.

00302:      * This method will only log a message when the application is in debug mode.

00303:      * @param string message to be logged

00304:      * @param string category of the message

00305:      * @see log

00306:      */

00307:    public static function trace($msg,$category='application')

00308:    {

00309:        if(YII_DEBUG)

#0 /var/www/html/yii/framework/YiiBase.php(297): autoload()

#1 unknown(0): autoload()

#2 /var/www/html/yii/demos/skeleton-app/protected/controllers/UserController.php(80): spl_autoload_call()

Ah, it's broken for me too.  I'll look into it after school.

Well I fixed a bug with the sorting, not sure if it was the same one, but could you test it?

See the diff in the user controller.

admin / admin login isn't working =)

You mean on the demo?? ahha.  Someone probably changed the password.  It's not really secure that way… lol.  I'll fix it.

Quote

You mean on the demo?? ahha.  Someone probably changed the password.  It's not really secure that way... lol.  I'll fix it.

Should probably just remove the password change access from the demo. >.>

Yeah I know, but it's just a demo & I don't really have time & don't want to maintain a separate branch for the demo.  I'll do it when I get around to it…

sorry, i was checking the demo and edited the admin account… i thought it wouldn't commit the changes. It's changed now, back to admin/admin.

Yeah, no need to apologize.  It's only natural, I expect it to happen every once in a while.

Sorry, the case sensitivity is NOT fixed.  Tortoise SVN did something that I did not expect when I renamed the files…  I'll fix it when I can.

EDIT:  ok, fixed now (could someone check this though?)

Ok, now the case sensitivity should be fixed for real (as shown in the edit in the above post).  Also, I implanted WebUser::flash() as shown here:

http://code.google.c…rce/detail?r=75