Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] How to acc...
 
Notifications
Clear all

[SOLVED] How to access classes from foreign script

6 Posts
2 Users
0 Reactions
1,915 Views
Louis Heredero
(@baryhobal)
Posts: 49
Active Member
Topic starter
 
[#7417]

Hello,
Working on creating tickets via a telegram bot, I need to fetch some data from the database so I use the API. This is all good but it's a bit slow since it has to make several requests. I was thinking about making the script act as a real user and directly connect to projeqtor so it can have access to all the classes and functions. However, even after looking around some files, I'm still not sure how the login is handled.
Is it possible to simulate real user login via a script (located in tool directory) and if yes, how ?


 
Posted : 17 Mar 2021 19H05
Louis Heredero
(@baryhobal)
Posts: 49
Active Member
Topic starter
 

A bit more precision,
The script is in tool/ but is called via a POST request from nodered so it doesn't have direct access to the classes and functions


 
Posted : 17 Mar 2021 19H51
babynus
(@babynus)
Posts: 14957
Main Contributor Admin
 

So you will have access as client, and cannot simulaite connected user on server side...
ProjeQtOr uses PHP Session (using cookies) to identify connexion.


 
Posted : 18 Mar 2021 13H00
Louis Heredero
(@baryhobal)
Posts: 49
Active Member
Topic starter
 

but wouldn't it be possible to create a new session as if it was my first visit on the page ? And I could save the PHP_SESSID to reuse the same session


 
Posted : 18 Mar 2021 14H34
babynus
(@babynus)
Posts: 14957
Main Contributor Admin
 

We do not manage this.
PHP does.
I'm not sure, for security reason, you can find a workaroud


 
Posted : 18 Mar 2021 16H27
Louis Heredero
(@baryhobal)
Posts: 49
Active Member
Topic starter
 

Nevermind, I got it working by copying what the API does. Thx for replying


 
Posted : 18 Mar 2021 23H16
Share:

Scroll to Top