本文整理汇总了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();
}