本文整理匯總了PHP中Subscriber::updateSubscriberUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subscriber::updateSubscriberUser方法的具體用法?PHP Subscriber::updateSubscriberUser怎麽用?PHP Subscriber::updateSubscriberUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Subscriber
的用法示例。
在下文中一共展示了Subscriber::updateSubscriberUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionMyprofile
// $this->render('admin_user/myprofile',
// array('model'=>$mUser)
// );
//
// } catch (Exception $exc) {
// echo $exc->getMessage();
// }
// }
/**
* <Jason>
* <My profile of normal user>
*/
public function actionMyprofile()
{
try {
if (Yii::app()->user->role_id == ROLE_AGENT) {
$this->redirect(Yii::app()->createAbsoluteUrl('member/agent/myprofile'));
}
$this->pageTitle = 'My Profile - ' . Yii::app()->params['title'];
$this->layout = 'application.views.layouts.layout_user';
$mUser = Users::model()->findByPk(Yii::app()->user->id);
$mUser->scenario = 'myprofile';
if (isset($_POST['Users'])) {
$mUser->attributes = $_POST['Users'];
if ($mUser->validate()) {
if ($_POST['Users']['newpassword'] != null && $_POST['Users']['password_confirm'] != null) {
if ($mUser->password_hash == md5($_POST['Users']['newpassword'])) {
$mUser->addError('newpassword', 'New password cannot be duplicate with current password.');
} else {
$mUser->password_hash = md5(trim($_POST['Users']['newpassword']));
$mUser->temp_password = $_POST['Users']['newpassword'];
}
}
if (!$mUser->getErrors()) {
$mUser->is_subscriber = $_POST['Users']['is_subscriber'];
if ($mUser->is_subscriber) {
Subscriber::saveSubscriberUser($mUser->id);
} else {
Subscriber::updateSubscriberUser($mUser->id);
}
if ($mUser->save('title', 'first_name', 'password_hash', 'temp_password', 'last_name', 'phone', 'country_id', 'address', 'address2', 'postal_code', 'issubcriber')) {
Yii::app()->user->setFlash('success', "My Profile has changed!");
示例2: defaultScope
$criteria->compare('t.last_name', $this->last_name, true);
$criteria->compare('t.created_date', $this->created_date, true);
$criteria->compare('t.role_id', $this->role_id);
$criteria->compare('t.application_id', 1);
// $criteria->addCondition('t.role_id<>2');
$criteria->addNotInCondition('t.role_id', array(ROLE_MANAGER, ROLE_ADMIN));
$criteria->compare('t.status', $this->status);
$criteria->compare('t.phone', $this->phone, true);
return new CActiveDataProvider($this, array('criteria' => $criteria));
}
public function defaultScope()
{
return array();
}