/**
  * Deletes an existing User model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $model = $this->findModel(User::className(), $id);
     self::checkAccess(RbacController::delete_profile, ['user' => $model]);
     $model->delete();
     return $this->redirect(['list']);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLastReplyUser()
 {
     if (empty($this->last_reply_user)) {
         return null;
     }
     return $this->hasOne(User::className(), ['username' => 'last_reply_user']);
 }
예제 #3
0
 public function getUser()
 {
     if ($this->_user === null) {
         $this->_user = Yii::createObject(User::className());
     }
     return $this->_user;
 }
예제 #4
0
 public function rules()
 {
     return [[['phone', 'email', 'password'], 'filter', 'filter' => 'trim'], [['phone', 'email', 'password'], 'required', 'on' => 'default'], [['phone', 'email'], 'required', 'on' => 'phoneAndEmailFinish'], [['phone'], 'required', 'on' => 'phoneFinish'], ['password', 'string', 'min' => 6, 'max' => 255], ['phone', 'unique', 'targetClass' => User::className(), 'message' => 'Этот номер уже занят.'], ['phone', function ($attribute, $params) {
         $this->phone = str_replace('_', '', $this->phone);
         if (iconv_strlen($this->phone) != 16) {
             $this->addError($attribute, 'Пример: 7 (XXX) XXX-XXXX');
         }
     }], ['email', 'email'], ['email', 'unique', 'targetClass' => User::className(), 'message' => 'Эта почта уже занята.'], ['status', 'default', 'value' => User::STATUS_ACTIVE, 'on' => 'default'], ['status', 'in', 'range' => [User::STATUS_NOT_ACTIVE, User::STATUS_ACTIVE]], ['status', 'default', 'value' => User::STATUS_NOT_ACTIVE, 'on' => 'emailActivation']];
 }
예제 #5
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [['username', 'filter', 'filter' => 'trim'], ['username', 'required'], ['username', 'unique', 'targetClass' => User::className(), 'filter' => function ($query) {
         if (!$this->getModel()->isNewRecord) {
             $query->andWhere(['not', ['id' => $this->getModel()->id]]);
         }
     }], ['username', 'string', 'min' => 2, 'max' => 255], ['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'unique', 'targetClass' => User::className(), 'filter' => function ($query) {
         if (!$this->getModel()->isNewRecord) {
             $query->andWhere(['not', ['id' => $this->getModel()->id]]);
         }
     }], ['password', 'required', 'on' => 'create'], ['password', 'string', 'min' => 6], [['status'], 'integer'], [['roles'], 'each', 'rule' => ['in', 'range' => ArrayHelper::getColumn(\Yii::$app->authManager->getRoles(), 'name')]]];
 }
예제 #6
0
 /**
  * 用户登录
  */
 public function actionLogin()
 {
     if (!Yii::$app->user->isGuest) {
         return $this->goHome();
     }
     $model = new LoginForm();
     $model->userClass = User::className();
     if ($model->load(Yii::$app->request->post()) && $model->login()) {
         return $this->goHome();
     } else {
         return $this->renderPartial('login', ['model' => $model]);
     }
 }
예제 #7
0
 /**
  * @inheritdoc
  */
 public function getAuthor()
 {
     return $this->hasOne(\common\models\User::className(), ['id' => 'author_id']);
 }
예제 #8
0
파일: Post.php 프로젝트: pramana08/app-cms
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPostAuthor()
 {
     return $this->hasOne(User::className(), ['id' => 'post_author']);
 }
예제 #9
0
 public function getUsers()
 {
     return $this->hasMany(User::className(), ['estado_id' => 'id']);
 }
예제 #10
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUserRelease()
 {
     return $this->hasOne(User::className(), ['id' => 'user_release']);
 }
예제 #11
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSender0()
 {
     return $this->hasOne(User::className(), ['id' => 'sender']);
 }
예제 #12
0
 public function getAnggota()
 {
     return $this->hasOne(\common\models\User::className(), ['id' => 'user_id']);
 }
예제 #13
0
echo Url::to(['report/index']);
?>
">
                Go to Graphic <i class="fa fa-arrow-circle-right"></i>
            </a>
        </div>
    </div><!-- ./col -->
</div>
<hr>
<div class="row">
    <!-- Left col -->
    <section class="col-lg-9 connectedSortable ui-sortable">                                    

        <!-- Chat box -->
        <?php 
echo \sintret\chat\ChatRoom::widget(['url' => Url::to(['/ajax/send-chat']), 'userModel' => \common\models\User::className(), 'userField' => 'avatarImage']);
?>
        <!-- To Do List -->        
        <?php 
echo \sintret\todolist\ListView::widget(['url' => Url::to(['/ajax/todolist'])]);
?>

    </section><!-- /.Left col -->
    <div class="col-md-3">
        <?php 
$phone = [];
$users = common\models\User::find()->where(['status' => common\models\User::STATUS_ACTIVE])->all();
if ($users) {
    foreach ($users as $user) {
        if ($user->phone) {
            $invite[] = "{ id : '{$user->phone}', invite_type : 'PHONE' }";
예제 #14
0
 /**
  * Возвращает автора статьи
  * @return \common\models\User
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'created_by']);
 }
예제 #15
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdUserCreate()
 {
     return $this->hasOne(User::className(), ['id' => 'id_user_create']);
 }
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['email', 'captcha'], 'trim'], [['email', 'captcha'], 'required'], ['email', 'email'], ['email', 'exist', 'targetClass' => User::className(), 'filter' => ['status' => User::STATUS_ACTIVE], 'message' => '未找到使用该邮箱的用户!'], [['captcha'], 'captcha', 'captchaAction' => 'site/password-reset-captcha']];
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLikedOrDislikedBy0()
 {
     return $this->hasOne(User::className(), ['id' => 'likedOrDislikedBy']);
 }
예제 #18
0
파일: Feed.php 프로젝트: awebc/web_xbf
 public function getAuthor()
 {
     return $this->hasOne(User::className(), ['id' => 'author_id'])->select('id,username,icon');
 }
예제 #19
0
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'submitter']);
 }
예제 #20
0
 /**
  * @return string
  */
 public function getUserClass()
 {
     if (!$this->_userClass) {
         $this->_userClass = $this->client_id === Client::MASTER_ID ? Tech::className() : User::className();
     }
     return $this->_userClass;
 }
예제 #21
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPi()
 {
     return $this->hasOne(User::className(), ['id' => 'pi_id']);
 }
예제 #22
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAuthors()
 {
     return $this->hasOne(User::className(), ['ID' => 'author']);
     //bizdeki bir kayıt 1 kayıta denk geliyor ilişkiler
 }
예제 #23
0
파일: Ruta.php 프로젝트: no7kpo/denm
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdrelevadors()
 {
     return $this->hasMany(User::className(), ['id' => 'idrelevador'])->viaTable('ruta_relevador', ['idruta' => 'id']);
 }
예제 #24
0
파일: Topic.php 프로젝트: Kulkow/mainsite
 public function getEditor()
 {
     return $this->hasOne(User::className(), ['id' => 'editor']);
 }
예제 #25
0
파일: Logistics.php 프로젝트: wxzuan/wxzuan
 public function getUser()
 {
     //同样第一个参数指定关联的子表模型类名
     //
     return $this->hasOne(User::className(), ['user_id' => 'publis_user_id']);
 }
예제 #26
0
 public function getUserEgreso()
 {
     return $this->hasOne(\common\models\User::className(), ['id' => 'egr_id_user'])->from(\common\models\User::tableName() . ' uegr');
 }
예제 #27
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUpdatedBy()
 {
     return $this->hasOne(User::className(), ['id' => 'updated_by']);
 }
예제 #28
0
 public function getUserUpdatedBy()
 {
     return $this->hasOne(\common\models\User::className(), ['id' => 'updated_by']);
 }
예제 #29
0
 /**
  * @return ActiveQuery
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'user_id']);
 }
예제 #30
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMediaAuthor()
 {
     return $this->hasOne(User::className(), ['id' => 'media_author']);
 }