prepare($sql) ->bindParam("01", strip_tags($login) ) ->execute(); $amout=$stmt->FetchRow(); return $amout[0]; } /** * funkcja sprawdzaja czy podane dane juz istnieja w tabeli uzytkownik * * @param string $login * * @return int $amout - ilosc powtarzajacych sie emaili */ public function CheckEmailRepeat($email) { $db = Registry::Get('db'); $sql = "SELECT count(email) FROM wp_preserve WHERE email=:01"; $stmt = $db->prepare($sql) ->bindParam("01", strip_tags($email) ) ->execute(); $amout=$stmt->FetchRow(); return $amout[0]; } public function CheckPassword($password,$hash) { // sprawdzanie czy haslo jest ok $db = Registry::Get('db'); $sql="SELECT count(login) FROM wp_preserve WHERE hash=:01 AND passwd=:02"; $stmt = $db->prepare($sql) ->bindParam("01",strip_tags($hash) ) ->bindParam("02",strip_tags($password) ) ->execute(); $amout=$stmt->FetchRow(); return $amout[0]; } public function ValidatePhotoForm(){ if ( $this->IsEmpty('name', 'Pole zdjęcia jest puste.')) { $this->IsNotEqualValue('error', 0, 'Wystąpił błąd serwera.'); if( $this->IsFile('tmp_name','Przesłanie pliku nie powioło się.')) { $this->IsGoodImageFormat('type','Format przesyłanego pliku nie jest poprawny.'); } $this->IsWithinRange('size','Przesyłany plik jast za duży.',0,ALLOWED_FILE_SIZE); } return $this->GetErrorList(); } } ?>