Menu

#113 MAX_1.2: Notification of added document has wrong URL

OPT_1.X_(Max)
closed-fixed
None
5
2003-10-25
2003-10-24
No

When uploading a new document and you want to notify
other users, OPT sends an e-mail. The URL to the
document may not be correct, depending on your settings.

1. When you installed OPT in a subdirectory, say
www.site.com/OPT/, the final slash is not added between
the CRM_URL variable and the path. In many other
locations $CRM_URL is also used, and there a slash is
inserted oke, so I didn't want to change CRM_URL.
Instead, I modified the scripts.

2. These scripts had to be modified anyway, as I have
OPT running on a secure server (and blocked http access
to it), so the URL in the email was wrong anyway. Two
scripts used for document adding/sending email
notification did not check for the force_protocol variable.

So I modified the scripts add_doc.inc and edit_doc.inc,
both found in <install_dir>/opt/documents/Doc_List

I include the diff and if Guy think it's correct,
perhaps it can be added to the next release.

diff add_doc.inc.org add_doc.inc
123a124,127
> $PROTOCOL=get_setting("force_protocol");
> if (!$PROTOCOL) {
> $PROTOCOL="http";
> }
145c149
< "\"$p_n\"","$s[1] $s[2] $s[3]","$s[1]
$s[3]",$description,"http://$SERVER_NAME$CRM_URL?URL=".
---
> "\"$p_n\"","$s[1] $s[2] $s[3]","$s[1]
$s[3]",$description,"$PROTOCOL://$SERVER_NAME$CRM_URL/?URL=".
338a343,346
> $PROTOCOL=get_setting("force_protocol");
> if (!$PROTOCOL) {
> $PROTOCOL="http";
> }
360c368
< "\"$p_n\"","$s[1] $s[2] $s[3]","$s[1]
$s[3]",$description,"http://$SERVER_NAME$CRM_URL?URL=".
---
> "\"$p_n\"","$s[1] $s[2] $s[3]","$s[1]
$s[3]",$description,"$PROTOCOL://$SERVER_NAME$CRM_URL/?URL=".

and

diff edit_doc.inc.org edit_doc.inc
209a210,213
> $PROTOCOL=get_setting("force_protocol");
> if (!$PROTOCOL) {
> $PROTOCOL="http";
> }
231c235
< "\"$p_n\"","$s[1] $s[2] $s[3]","$s[1]
$s[3]",$description,"http://$SERVER_NAME$CRM_URL?URL=".
---
> "\"$p_n\"","$s[1] $s[2] $s[3]","$s[1]
$s[3]",$description,"$PROTOCOL://$SERVER_NAME$CRM_URL/?URL=".

BTW: edit_doc.inc was saved in DOS mode, I changed that
too on my server. On Linux this doesn't change much,
but it looks odd if one script is in dos and the other
in *nix format ;-))

I did the mod on OPT_MAX_1.2 FYI.

Best regards, Martin.

Discussion

  • Anonymous

    Anonymous - 2003-10-25
    • milestone: --> OPT_1.X_(Max)
    • assigned_to: nobody --> guy_davis
    • status: open --> closed-fixed
     
  • Anonymous

    Anonymous - 2003-10-25

    Logged In: YES
    user_id=22084

    I agree this was a problem so I corrected the two instance
    you found above as well all the others I could find (~15 or
    so). Thanks for pointing this out. Fixes will be in the
    next release.

     

Log in to post a comment.

MongoDB Logo MongoDB