Example #1
0
 public function save_signature()
 {
     $user = User::findIdentity(Yii::$app->user->id);
     $user->signature = Functions::clear_text($this->signature);
     if ($user->save()) {
         return Html::decode($user->signature);
     }
     return false;
 }
Example #2
0
 public function save_age_date()
 {
     $user = User::findIdentity(Yii::$app->user->id);
     if ($user->age_date != $this->age_date) {
         $user->age_date = $this->age_date;
         if ($user->save()) {
             return Functions::get_is_age_from_date($this->age_date);
         }
     }
     return false;
 }
Example #3
0
 /**
  * Signs user up.
  *
  * @return User|null the saved model or null if saving fails
  */
 public function signup()
 {
     if ($this->validate()) {
         $user = new User();
         $user->username = $this->username;
         $user->email = $this->email;
         $user->setPassword($this->password);
         $user->generateAuthKey();
         $user->ip = Functions::ip2int(Yii::$app->request->userIP);
         $user->agent = Yii::$app->request->userAgent;
         if ($user->save()) {
             return $user;
         }
     }
     return null;
 }
Example #4
0
?>
</span>
            </div>
            <div class="row profile-info-rows profile-info-rows profile-info-rows">
                <?php 
echo Functions::get_date_time($model->created_at);
?>
            </div>
            <div class="row profile-info-rows profile-info-rows profile-info-rows profile-info-rows">
                <?php 
echo Functions::get_date_time($model->updated_at);
?>
            </div>
            <div class="row profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows">
                <?php 
echo Functions::int2ip($model->ip);
?>
            </div>
            <div class="row profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows">
                <?php 
echo $agent_info["platform"];
?>
            </div>
            <div class="row profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows">
                <?php 
echo $agent_info["browser"];
?>
 <?php 
echo explode('.', $agent_info["version"])[0];
?>