<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * 重设用户的密码
 *
 * @author yzxh24
 */
class ResetPasswordAction extends BaseAction
{
    public function run()
    {
        $password = trim($_POST['password']);
        $model = Manager::model()->find('id=:id',array('id'=>intval($_GET['id'])));
        if (empty($model))
        {
            throw new CException('不存在的用户');
        }
        $model->password = $password;
        $model->save();
        
        $this->getController()->redirect(array('list'));
    }
}