Rev 15542 | Rev 16628 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15542 | Rev 15704 | ||
---|---|---|---|
Line 997... | Line 997... | ||
997 | { |
997 | { |
998 | char buf[MAX_LINELEN+1]; |
998 | char buf[MAX_LINELEN+1]; |
999 | if(robot_access) return; |
999 | if(robot_access) return; |
1000 | ovlstrcpy(buf,"session=$wims_session.1&module=adm/trap"); |
1000 | ovlstrcpy(buf,"session=$wims_session.1&module=adm/trap"); |
1001 | _output_("<!-- "); exec_href(buf);_output_("Robot trapper, do not click!</a> -->"); |
1001 | _output_("<!-- "); exec_href(buf);_output_("Robot trapper, do not click!</a> -->"); |
1002 | _output_("<div class='wimstrap hide' |
1002 | _output_("<div class='wimstrap hide' aria-hidden='true'>");exec_href(buf); _output_("<span lang='en'>Robot trapper, do not go there!</span></a></div>"); |
1003 | } |
1003 | } |
1004 | 1004 | ||
1005 | /* set definitions in a file. Trusted modules only. */ |
1005 | /* set definitions in a file. Trusted modules only. */ |
1006 | void exec_setdef(char *p) |
1006 | void exec_setdef(char *p) |
1007 | { |
1007 | { |
Line 1765... | Line 1765... | ||
1765 | FILE *mailer;// need stdio.h */ |
1765 | FILE *mailer;// need stdio.h */ |
1766 | 1766 | ||
1767 | if(!trusted_module() || is_class_module) return; |
1767 | if(!trusted_module() || is_class_module) return; |
1768 | // searches for the first occurrence of \n |
1768 | // searches for the first occurrence of \n |
1769 | from=strchr(p,'\n'); if(from==NULL) return; |
1769 | from=strchr(p,'\n'); if(from==NULL) return; |
1770 | // |
1770 | // delimitate the 'To' string. |
1771 | *from++=0; p=find_word_start(p); |
1771 | *from++=0; p=find_word_start(p); |
1772 | if(*p==0) return; |
1772 | if(*p==0) return; |
1773 | 1773 | ||
1774 | subject=strchr(from,'\n'); if(subject==NULL) return; |
1774 | subject=strchr(from,'\n'); if(subject==NULL) return; |
1775 | // delimitate the |
1775 | // delimitate the 'From' string. |
1776 | *subject++=0; from=find_word_start(from); |
1776 | *subject++=0; from=find_word_start(from); |
1777 | if(*from!=0) snprintf(buf,sizeof(buf),"From:%s\n",from); |
1777 | if(*from!=0) snprintf(buf,sizeof(buf),"From:%s\n",from); |
1778 | else buf[0]=0; |
1778 | else buf[0]=0; |
1779 | body=strchr(subject,'\n'); if(body==NULL) return; |
1779 | body=strchr(subject,'\n'); if(body==NULL) return; |
1780 | |
1780 | // delimitate the 'Subject' string. |
1781 | *body++=0; subject=find_word_start(subject); |
1781 | *body++=0; subject=find_word_start(subject); |
1782 | 1782 | ||
1783 | for(pp=subject;*pp;pp++) if(*pp=='"' || *pp=='\n') *pp=' '; |
1783 | for(pp=subject;*pp;pp++) if(*pp=='"' || *pp=='\n') *pp=' '; |
1784 | 1784 | ||
1785 | charset=getvar("wims_main_font");if(charset==NULL) charset="windows-1252"; |
1785 | charset=getvar("wims_main_font");if(charset==NULL) charset="windows-1252"; |
Line 1788... | Line 1788... | ||
1788 | 1788 | ||
1789 | accessfile(mail_content,"w","%s/mail.eml",tmp_dir); |
1789 | accessfile(mail_content,"w","%s/mail.eml",tmp_dir); |
1790 | wrapexec=1; |
1790 | wrapexec=1; |
1791 | // you can add option '-vv' to make sendmail more verbose. |
1791 | // you can add option '-vv' to make sendmail more verbose. |
1792 | call_sh("cat %s/mail.eml | /usr/sbin/sendmail -t 2> %s/sendmail.log",tmp_dir,tmp_dir); |
1792 | call_sh("cat %s/mail.eml | /usr/sbin/sendmail -t 2> %s/sendmail.log",tmp_dir,tmp_dir); |
- | 1793 | ||
- | 1794 | /*mailer = popen("/usr/sbin/sendmail -tvv", "w"); |
|
- | 1795 | if (mailer == NULL){module_error("sendmail_popen_error");} |
|
- | 1796 | fprintf(mailer, "To:%s\nSubject:%s\nContent-Type: text/html;charset=\"windows-1252\"\n\n%s",p,subject,body); |
|
- | 1797 | status = pclose(mailer); |
|
- | 1798 | if (status == -1) { |
|
- | 1799 | // Error reported by pclose() |
|
- | 1800 | module_error("sendmail_error"); |
|
- | 1801 | }*/ |
|
- | 1802 | ||
- | 1803 | //call_sh("iconv -f %s -t UTF-8//TRANSLIT %s/mail.eml > %s/mail.eml", charset, tmp_dir, tmp_dir); |
|
- | 1804 | /*call_sh("mail %s -s \" %s \nContent-Type: text/html\" %s <%s/mail.eml; chmod og-rwx %s/mail.eml", |
|
- | 1805 | mail_opt, p1,p,tmp_dir,tmp_dir);*/ |
|
1793 | 1806 | ||
1794 | mail_log(p); |
1807 | mail_log(p); |
1795 | *p=0; |
1808 | *p=0; |
1796 | } |
1809 | } |
1797 | 1810 |