本文整理汇总了PHP中Subscriber::saveSubscriberUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscriber::saveSubscriberUser方法的具体用法?PHP Subscriber::saveSubscriberUser怎么用?PHP Subscriber::saveSubscriberUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscriber
的用法示例。
在下文中一共展示了Subscriber::saveSubscriberUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: saveUserRegister
/**
* @param $model
* @return bool
* <Jason>
* <pmhai90@gmail.com>
*/
public static function saveUserRegister($model)
{
if (isset($_POST['Users'])) {
$model->attributes = $_POST['Users'];
$model->validate(array('email', 'title', 'first_name', 'last_name', 'phone', 'area_code_id', 'password_hash', 'password_confirm'));
// $model->validate();
// if ok validate then do something
if (!$model->hasErrors()) {
$model->email = ActiveRecord::clearHtml($model->email);
//$model->email_temp = ActiveRecord::clearHtml($model->email);
$model->title = ActiveRecord::clearHtml($model->title);
$arr_email = explode('@', $model->email);
$model->username = $arr_email[0];
$model->first_name = ActiveRecord::clearHtml($model->first_name);
$model->last_name = ActiveRecord::clearHtml($model->last_name);
$model->phone = ActiveRecord::clearHtml($model->phone);
$model->area_code_id = ActiveRecord::clearHtml($model->area_code_id);
// if(MyFunctionCustom::checkCountryFilter()) {
// $model->status=STATUS_PENDING_USER;
// } else {
// $model->status=STATUS_BLOCK_IP;
// }
$model->created_date = date('Y-m-d H:i:s');
$model->last_logged_in = date('Y-m-d H:i:s');
$model->role_id = ROLE_REGISTER_MEMBER;
$model->application_id = FE;
$model->login_attemp = 0;
//$model->verify_code = ActiveRecord::generateVerifyCode();
$model->temp_password = $_POST['Users']['password_hash'];
$model->scenario = NULL;
$model->save();
$model->password_hash = md5($_POST['Users']['password_hash']);
$model->verify_code = sha1(mt_rand(10000, 99999) . time() . $model->email);
$model->update(array('password_hash', 'verify_code'));
MyFunctionCustom::sendMailAfterRegister($model);
if ($model->is_subscriber) {
Subscriber::saveSubscriberUser($model->id);
}
//Added subcriber
return true;
}
}
return false;
}
示例3: 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();
}