Jump to content

flydev

Members
  • Posts

    1,350
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by flydev

  1. Bumping an old topic but I have the exact same question. Their control panel can be set to english ?
  2. A small contribution: Add an option to have ability to use Self-Signed Certificate on a given SMTP server with WireMailSmtp and PHP >= 5.6 What PHP say - source : https://secure.php.net/manual/en/migration56.openssl.php HOWTO: ----------- 1) In file smtp.php, class smtp_class, we add a member variable and a small function : /* Allow self signed certificate */ var $smtp_certificate = false; Function AllowSelfSignedCertificate($allow = false) { $version=explode(".",function_exists("phpversion") ? phpversion() : "3.0.7"); $php_version=intval($version[0])*1000000+intval($version[1])*1000+intval($version[2]); if($php_version<5006000) return; if($allow) { stream_context_set_option($this->connection, 'ssl', 'verify_peer', false); stream_context_set_option($this->connection, 'ssl', 'allow_self_signed', true); } else { stream_context_set_option($this->connection, 'ssl', 'verify_peer', true); stream_context_set_option($this->connection, 'ssl', 'allow_self_signed', false); } } and, in the Connect() method, call the function just in before we check for the result of stream_socket_enable_crypto : Find : $this->OutputDebug('Starting TLS cryptograpic protocol'); if(!($success = stream_socket_enable_crypto($this->connection, 1, STREAM_CRYPTO_METHOD_TLS_CLIENT))) Replace to $this->OutputDebug('Starting TLS cryptograpic protocol'); $this->AllowSelfSignedCertificate($this->smtp_certificate); if(!($success = stream_socket_enable_crypto($this->connection, 1, STREAM_CRYPTO_METHOD_TLS_CLIENT)) 2) In the file smtp_message.php, class smtp_message_class, add a member variable : /* Allow Self Signed Certificate */ var $smtp_certificate = 0; In the method StartSendingMessage() , assign the new member variable: $this->smtp->smtp_certificate = $this->smtp_certificate; 3) In the file WireMailSmtpAdaptator, class hnsmtp, add a member variable : private $smtp_certificate = false; and in the method set_var_val(), add a case smtp_certificate for our checkbox : Find : case 'smtp_ssl': case 'smtp_start_tls': case 'smtp_debug': case 'smtp_html_debug': Replace : case 'smtp_certificate': case 'smtp_ssl': case 'smtp_start_tls': case 'smtp_debug': case 'smtp_html_debug': In the class constructor, add : $this->emailMessage->smtp_certificate = $this->smtp_certificate; 4) In the WireMailSmtpConfig.php file, add a field : add : $field = $modules->get('InputfieldCheckbox'); $field->attr('name', 'smtp_certificate'); $field->label = __('PHP >= 5.6 - Allow self signed certificate'); $field->attr('value', $data['smtp_certificate']); $field->attr('checked', $data['smtp_certificate'] ? 'checked' : ''); $fieldset->add($field); 5) In the WireMailSmtp.module file, add a settings to the getDefaultdata() : Find : 'valid_recipients' => '' // email addresses of valid recipients. String that we convert to array at runtime. Add after (take care of comma ','): 'smtp_certificate' => 0 // allow or not self signed certificate (PHP >= 5.6) Result : Hope it help. Sorry for my english
  3. We are all falling in love with PW good luck dude
  4. and giving the option dateFormat directly to the function, it works for you ? exemple: $page->comments->renderAll(array('dateFormat' => 'm/d/y g:ia',));
  5. About The exception Invalid email address (processwire@localhost); She is triggered when we leave empty the configuration field "Notifications From Email". Just finished to give a try at your solution (with PW3) and everything work fine. No idea about formatting the time output atm. Have you tried editing your field in the configuration page ? It say :
  6. I was trying to reproduce @Zahari issue but I ran into another problem with email settings, I got an exception : Exception: Invalid email address (processwire@localhost) (in \pw\wire\core\WireMail.php line 81) WireMailSmtp is installed and correctly configured. Any idea ?
  7. Thanks you guys I got it. Elegant solution there
  8. Hello, I have a PHP script being called by AJAX request. At this moment everything work perfectly, but my script is in the root directory, bootstraping PW. request = $.post('/public_html/pw/contactus.php', serializedData); My question is, it is possible to put this PHP script in my templates directory and call it from there ? (if I hardcode the path I get a 403 HTTP error and doing that can cause problem between dev environment and production); How I should code my path in the Javascript code ?
  9. I am just finishing a new website with PW and Bootstrap v4 alpha and it work very well. Uikit could be the best alternative imo.
  10. Thanks for this - If I can help improve the translation, let me know. merci encore.
  11. Thanks you two times kongondo. I also figure that my params for the `foreach` loop was inverted
  12. Hi and thanks for this modules sir. For days, I follow https://web.archive.org/web/20150227095218/http://www.kongondo.com/tutorials, the docs, the forum and the source at https://github.com/kongondo/Blog/blob/master/MarkupBlog.module. Time for me now to ask help. I would like to know what is the best way to get only posts's title, for example to show them in list in the footer of a page ? Note: I have a newbie's experience with ProcessWire <div class="col-sm-4"> <h3>Recents</h3> <?php $blog = $modules->get('MarkupBlog'); $posts = $pages->find("template=blog-post, limit=5"); foreach ($post as $posts) { var_dump($post); } ?> </div>
×
×
  • Create New...