Exemplo n.º 1
0
 public function changePassword($newpassword)
 {
     $result = false;
     if ($this->userid != 0) {
         $uquery = $this->domainDA->execute('SELECT username FROM domain_users WHERE id=' . $this->userid);
         $squery = $this->rootDA->execute('SELECT id FROM domains WHERE domainid=' . $this->rootDA->formatText($uquery->getFields('username')));
         if ($squery->getNumberRows()) {
             $empty = '';
             $tmpdomain = new \Innomatic\Domain\Domain($this->rootDA, $uquery->getFields('username'), $empty);
             $result = $tmpdomain->changePassword($newpassword);
         } else {
             if (!empty($newpassword)) {
                 $upd .= 'UPDATE domain_users SET password = '******' WHERE id=' . $this->userid;
                 //$this->htp->changePassword( $uquery->getFields( 'username' ), $newpassword );
                 $result = $this->domainDA->execute($upd);
             }
         }
     }
     return $result;
 }