Example #1
0
 function ajaxChangePassword($form)
 {
     $validate = Validator::string()->length(6, 40);
     $p1 = $form->password->value;
     $p2 = $form->password_confirmation->value;
     if ($validate->validate($p1) && $validate->validate($p2)) {
         if ($p1 == $p2) {
             $arr = explodeJid($this->user->getLogin());
             $cp = new ChangePassword();
             $cp->setTo($arr['server'])->setUsername($arr['username'])->setPassword($p1)->request();
         } else {
             RPC::call('Account.resetPassword');
             Notification::append(null, $this->__('account.password_not_same'));
         }
     } else {
         RPC::call('Account.resetPassword');
         Notification::append(null, $this->__('account.password_not_valid'));
     }
 }
Example #2
0
 function getUser()
 {
     $exp = explodeJid($this->username);
     return $exp['username'];
 }
Example #3
0
 public function getTrueName()
 {
     $truename = '';
     if (isset($this->rostername)) {
         $rostername = str_replace('\\40', '', $this->rostername);
     } else {
         $rostername = '';
     }
     if (isset($this->rostername) && $rostername != '' && !filter_var($rostername, FILTER_VALIDATE_EMAIL)) {
         $truename = $rostername;
     } elseif (isset($this->fn) && $this->fn != '' && !filter_var($this->fn, FILTER_VALIDATE_EMAIL)) {
         $truename = $this->fn;
     } elseif (isset($this->nickname) && $this->nickname != '' && !filter_var($this->nickname, FILTER_VALIDATE_EMAIL)) {
         $truename = $this->nickname;
     } elseif (isset($this->name) && $this->name != '' && !filter_var($this->name, FILTER_VALIDATE_EMAIL)) {
         $truename = $this->name;
     } else {
         $truename = explodeJid($this->jid);
         $truename = $truename['username'];
     }
     return $truename;
 }