Your current user_id is kmgoddard, try components/UserIndentity and set up you code:
class UserIdentity extends CUserIdentity
{
private $_id;
/**
* Authenticates a user.
* The example implementation makes sure if the username and password
* are both 'demo'.
* In practical applications, this should be changed to authenticate
* against some persistent user identity storage (e.g. database).
* @return boolean whether authentication succeeds.
*/
public function authenticate()
{
$users = Users::model()->findByattributes(array('username'=>$this->username));
if($users == null)
{
$this->errorCode=self::ERROR_UNKNOWN_IDENTITY;
}else
{
if(md5($this->password) != $users->password)
{
$this->errorCode=self::ERROR_PASSWORD_INVALID;
}else
{
$this->errorCode=self::ERROR_NONE;
$this->_id = $users->id;
}
}
return !$this->errorCode;
}
public function getId()
{
return $this->_id;
}
}
Preacher, on 27 October 2011 - 10:10 AM, said:
I get the following error when I first fun
http://mysite/cmms/cal
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'kmgoddard' in 'where clause'. The SQL statement executed was: SELECT * FROM `events_helper` `t` WHERE user_id=kmgoddard
added my username to:
protected function renderContent()
{
$isAdmin = true; // check admin privileges
if (true == $isAdmin)
$users = array(// create you own users list