script-server
script-server copied to clipboard
Question- How do i get the username, each time the user trigger or click execute?
How do i get the username, each time the user trigger or click execute?
Hi @zfpang, I guess this is the way to go: https://github.com/bugy/script-server/wiki/Script-config#--default Most probably you would want to combine it with a https://github.com/bugy/script-server/wiki/Script-config#--constant
Scenario: User A execute Script B, and normally the action is recorded to a log file. User B execute Script B.
Is there any possible to get the User A without searching with the log file?
From where do you want to get the user? another script? Some other application? Or anything else
From this screen,
when user clicked execute, then the username who clicked will send out a notification to telegram bot .
${auth.username} should be available to your scripts to access, as the currently logged in UI user
On Wed, Aug 23, 2023, 11:20 PM zfpang @.***> wrote:
From this screen, [image: image] https://user-images.githubusercontent.com/142978229/262850899-890a92cb-27f0-4e2f-a241-917c19d83af8.png when user clicked execute, then the username who clicked will send out a notification to telegram bot .
— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/690#issuecomment-1690932453, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3HBI3WTNONDGBWK6JA7QBDXW3CALANCNFSM6AAAAAA33CTA5I . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@zfpang and how are you calling the telegram bot?
i using function as below.
So, you are doing it from the script itself. In this case this solution is the right way for you: https://github.com/bugy/script-server/issues/690#issuecomment-1689560103
You would need to pass username to the script, using this parameter configuration