Code Monkey home page Code Monkey logo

Comments (6)

lgund avatar lgund commented on June 23, 2024

I am sure that the code in the functionsPost isn´t the best solution. But that will be just once executed and works normally very well. If you would change id int(11) NOT NULL to id int(8) NOT NULL I am sure the database will be created. You can find it on line 647. I will update the installer with the next version so we can support pgsql again.

If there are other sql syntax errors please let it me know.

from ts3-webinterface.

 avatar commented on June 23, 2024

Thanks for your reply. Having a real migration system makes things easier for you, was just a hint :-)

I think datetime should be timestamp etc. Hoping for the next version 👍

from ts3-webinterface.

lgund avatar lgund commented on June 23, 2024

I can’t really test it. Is it possible to get a pgsql database from you?

from ts3-webinterface.

 avatar commented on June 23, 2024

I think you can go with the following, although it is not tested:

CREATE TABLE ticket_answer
  (
     id        INT8 NOT NULL,
     ticketid  INT NOT NULL,
     pk        VARCHAR(40) NOT NULL,
     msg       TEXT NOT NULL,
     moderator TEXT NOT NULL,
     dateaded  TIMESTAMP NOT NULL
  );

CREATE TABLE ticket_tickets
  (
     id           SERIAL NOT NULL,
     pk           VARCHAR(40) NOT NULL,
     subject      TEXT NOT NULL,
     msg          TEXT NOT NULL,
     department   TEXT NOT NULL,
     status       TEXT NOT NULL,
     dateaded     TIMESTAMP NOT NULL,
     dateclosed   TIMESTAMP NOT NULL,
     dateactivity TIMESTAMP NOT NULL,
     PRIMARY KEY (id)
  );

CREATE TABLE main_mails
  (
     id           VARCHAR(100) NOT NULL,
     headline     VARCHAR(100) NOT NULL,
     mail_subject VARCHAR(255) NOT NULL,
     mail_body    TEXT NOT NULL,
     PRIMARY KEY (id)
  ); 

EDIT:

I tried installing it with this schema. Tables are being created.

The step after this produces an error (500).

php fpm output:

PHP message: PHP Fatal error:  Uncaught Error: Call to a member function errorInfo() on boolean in /srv/http/domain.tld/htdocs/ts3web/install/functionsPost.php:137
Mär 31 17:24:18 nginx[11556]: Stack trace:
Mär 31 17:24:18 nginx[11556]: #0 {main}
Mär 31 17:24:18 nginx[11556]:   thrown in /srv/http/domain.tld/htdocs/ts3web/install/functionsPost.php on line 137

If I comment in errorInfo it will take me to the next step but without a redirect. Manually deleting the install/ folder works, but the main page index will tell me there is no database connection. The insert is not working and the config editing is also not working 100%.

If you like to support other databases, you should rewrite the entire install routine. Simplify it: just one file where admin types in db connection and initial user. Then something like php install.php. Delete this file afterwards. Done. Or if you like, a web interface for it. But this is more friendly code-wise and to debug. And you don't have to waste time to maintain the install things. They will just work. Best: use migration tool like phpmig.

Are all DB queries prepared statements? I didn't look at them entirely. So at least injections won't be a problem?

I would also think about using an ORM like eloquent or doctrine for your custom entities which are not related to ts3. Otherwise it might happen that you have to write extra lines of code for each "supported" database. ORM will just do that for you. It will ease developing.

I don't want to offend you, but your code is hardly readable at all. This begins at spacing, german variable names etc. You really have to refactor it. Take this as a hint for further projects. I also think that the "stable" git tag is completly misleading. It is not stable at all. At least this holds true for the install routine. It's not robust and I think that it wasn't tested. You might also consider using docker and docker-compose to test different environments fast (like psql).

PS: A config option for disabling sending usage data to your server is also the correct way in the future. Otherwise you have to deal with german law in May. "AGB" are not enough. The new law forces that you provide an option to completly disable it or at least explicitly list when, what and why data is being sent and why the app needs it and a reason why it would not function without it.

PPS: Can you also provide a version without using CDNs? This might be interesting if you didn't knew it already.

PPPS: Sorry for the long post. 👍

from ts3-webinterface.

lgund avatar lgund commented on June 23, 2024

First of all thanks for the feedback. I know what you want to tell me but in v1 it will not be rewritten cause I am currently finishing the last steps of v2. I will update v1 so that pgsql will be work successfull and in v2 I will make it better 👍 .

Are all DB queries prepared statements? I didn't look at them entirely. So at least injections won't be a problem?

All Information where the user has a input field will be prepared to be secure for sqli.

I don't want to offend you, but your code is hardly readable at all. This begins at spacing, german variable names etc. You really have to refactor it. Take this as a hint for further projects

That´s strange. I tried to comment all lines and the spaces looks fine in my editor. I am using notepad++. But the Teamspeak Control that I am also curring working will be more userfrindly cause I am using there vs code with there documentation comments.

A config option for disabling sending usage data to your server is also the correct way in the future. Otherwise you have to deal with german law in May. "AGB" are not enough. The new law forces that you provide an option to completly disable it or at least explicitly list when, what and why data is being sent and why the app needs it and a reason why it would not function without it.

That´s true. This option was just removed cause it will just give you a hint of a newer version. There will be no user data sended.

from ts3-webinterface.

 avatar commented on June 23, 2024

Ok 👍

I did implement my own simple interface (ts3web). So you don't have to add support for PSQL just for me. Maybe it is easier to drop PSQL support entirely for the old version.

Greetings
varakh

PS: I will close this.

from ts3-webinterface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.