slabbi / uddeIM

udde Instant Messages (uddeIM) - Instant Messages System for Mambo and Joomla
12 stars 9 forks source link

issue in mod_uddeim when user is logged out (includes new test version 5.6 with config 2.9) #105

Open joomod opened 1 month ago

joomod commented 1 month ago

I found an old error in the uddeim notfier module (mod_uddeim) the error comes from the site/uddeim.php when pfrontend is enabled

when a user is logged out by the system (by time, so may be the static site just shows logged in) and the ajaxcheck in the module is activated it calls uddeim.php with task ajaxGetNewMessages

as uddeim.php before running the task checks if pfronend is enabled and userid=0 (guest) will result in exit this call, but running the pfrontend plugin, which means, that in the module output view a formular for a new message in raw format is displayed.

so to skip this behavior, the pfrontend check should only run if task NOT = ajaxGetNewMessages

after including this the result is as expected (a Note: you are not logged in).

so I corrected the uddeim.php for this.

in the com_uddeim56 package also the two other request where included: 1) a new config (v2.9) where you can select if you allow prefilled text in a new message link. 2) updated autocomplete setup, so there is no more "disable" in the system tab 3) some minor changes to prevent php8.2 errors on array_intersect

com_uddeim56_j50.zip

this update is not yet published in the main branch

please test it

jojo12 commented 1 month ago

how can I test? I want to test after all

a new config (v2.9) where you can select if you allow prefilled text in a new message link.

joomod commented 1 month ago

if you have installed and enabled in config then you can write this urls

default is this (where recip should be a valid user id) yourpage.com/index.php?option=com_uddeim&task=new&recip=63 (opens the compose page with selected user 63)

now you may write this /index.php?option=com_uddeim&task=new&recip=63&pm=Frage zu deinem Forumpost you may also use bbcodes: eg. &pm=[b]Frage zu deinem Forumpost[/b]

so now the "Frage zu deinem Forumpost" should appear at beginning of the textarea input field

jojo12 commented 1 month ago

Hi, it works fine. But a question: in the config, I have the setting to use realname. But in the PM TO field is then the username! I think this should be changed equal to the settings! I think, this is a bug.

jojo12 commented 1 month ago

now you may write this /index.php?option=com_uddeim&task=new&recip=63&pm=Frage zu deinem Forumpost you may also use bbcodes: eg. &pm=[b]Frage zu deinem Forumpost[/b]

This is not working!

joomod commented 1 month ago

basicly you are right with realname/username, but the use of realname is limited to be unique. the script checks if a realname is unique, and IF NOT skips back to use the username, so just look if the desired realname is not used twice or more.

joomod commented 1 month ago

now you may write this /index.php?option=com_uddeim&task=new&recip=63&pm=Frage zu deinem Forumpost you may also use bbcodes: eg. &pm=[b]Frage zu deinem Forumpost[/b]

This is not working!

what is not working? just tested and the text displays [b]Frage zu deinem Forumpost[/b] so the bbcode is shown correctly in the textarea (or have you full test it with sending, a then there is no bold?)

jojo12 commented 1 month ago

basicly you are right with realname/username, but the use of realname is limited to be unique. the script checks if a realname is unique, and IF NOT skips back to use the username, so just look if the desired realname is not used twice or more.

you're right. This works!

jojo12 commented 1 month ago

[b]Frage zu deinem Forumpost[/b] in the email, there is [b] and [/b] , even after sending. in the PM, it's first not bold, but when I click on it, then it gets bold.

joomod commented 1 month ago

basicly you are right with realname/username, but the use of realname is limited to be unique. the script checks if a realname is unique, and IF NOT skips back to use the username, so just look if the desired realname is not used twice or more.

you're right. This works!

you may test edit includes.db.php (line 158) within if ($cnt>1) {....} from
$value = $database->loadResult(); to $value .= ' ['.$database->loadResult().']'; (Notice the .= !!! (dot equal) so you will get name [username] displayed

or if you prefer you may edit this line to $value .= ' ['.$id.']' (2nd query could be skipped) so you get name [xxx] wher xxx = id

joomod commented 1 month ago

[b]Frage zu deinem Forumpost[/b] in the email, there is [b] and [/b] , even after sending. in the PM, it's first not bold, but when I click on it, then it gets bold.

I think this is quite ok for a common rarely used option :)

jojo12 commented 1 month ago

I want to use it in JEM Eventlist for a PM to the author of an event (Inside JEM I have now to try how I can add the event title, date and venue to make it clear for which event is the question in the PM). But I have to resolve it there. Thanks a lot.

joomod commented 1 month ago

I think your event also will have unique ID (with this you can resolve title, date etc.) so best you look for this ID

joomod commented 1 month ago

what happened to your post with the add. info about runname? I have it in my email, but nothing here???

jojo12 commented 1 month ago

what happened to your post with the add. info about runname? I have it in my email, but nothing here??? I don't understand.

I did not use runname, I used recip=

joomod commented 1 month ago

what happened to your post with the add. info about runname? I have it in my email, but nothing here??? I don't understand.

I did not use runname, I used recip=

i didn't mean for now, but on friday i got an email about you post explaining add. info for the use of runame with params hiding the lists but I didn't see this post here??

jojo12 commented 1 month ago

Yes I remember: It was the problem: The realname is known, and in the email and PM was username. even when the TO field is hidden. So I was interested, if it is possible to hide the username (or realname) in the field to. So the email/PM goes out, without the name visible. auf deutsch: wenn ich TO field verstecke, sieht der Ersteller der PM immer noch den usernamen, bzw. realnamen. grafik

joomod commented 1 month ago

d.h. dir wäre es am liebsten wenn z'B nur die userid angezeigt werden würden (ich glaube gar nichts anzeigen wäre auch irritierend)

jojo12 commented 1 month ago

Nein, wenn ichs mir überlege, dann ist es gut so. Es kam von daher, dass wegen zweier identischer Realnamen, der username angezeigt wurde. Ich wollte nicht zusätzliche Infos rausgeben: entweder arbeite ich mit Realnamen oder Usernamen. Sorry für das Ungemach.

jojo12 commented 1 month ago

for me it works fine! Can be closed