Skip to content

Instantly share code, notes, and snippets.

View jasonmunro's full-sized avatar
💭
Working on a new release!

Jason Munro jasonmunro

💭
Working on a new release!
View GitHub Profile
@jasonmunro
jasonmunro / saslmemcached-ini.diff
Created August 3, 2017 21:47
saslmemcached ini settings
diff --git a/hm3.sample.ini b/hm3.sample.ini
index 46058fb8c..915e9b3ea 100644
--- a/hm3.sample.ini
+++ b/hm3.sample.ini
@@ -282,6 +282,12 @@ enable_memcached=true
memcached_server=127.0.0.1
memcached_port=11211
+; If you need SASL authentication for memcached, set the following to true
+; and add the username and password to authenticate with
@jasonmunro
jasonmunro / saslmemcached.diff
Created August 3, 2017 21:45
SASL auth for memcache
diff --git a/lib/cache.php b/lib/cache.php
index d724f0264..03afc8773 100644
--- a/lib/cache.php
+++ b/lib/cache.php
@@ -220,6 +220,7 @@ class Hm_Memcached {
private $supported;
private $enabled;
private $server;
+ private $config;
private $port;
@jasonmunro
jasonmunro / smtp.diff
Created August 2, 2017 17:07
smtp save debug
diff --git a/modules/smtp/modules.php b/modules/smtp/modules.php
index d55996d89..3c8ee225f 100644
--- a/modules/smtp/modules.php
+++ b/modules/smtp/modules.php
@@ -324,6 +324,7 @@ class Hm_Handler_smtp_save extends Hm_Handler_Module {
$this->session->record_unsaved('SMTP server saved');
}
else {
+ elog($smtp->puke());
Hm_Msgs::add("ERRUnable to save this server, are the username and password correct?");
<?php
class Custom_Session extends Hm_Memcached_Session {
/**
* check for an active session or an attempt to start one
* @param object $request request object
* @return bool
*/
public function check($request, $user=false, $pass=false, $fingerprint=true) {
@jasonmunro
jasonmunro / out.txt
Created July 18, 2017 20:09
config gen output
jason [ ~/cypht ]$ php ./scripts/config_gen.php
Found module set ini file: /var/lib/hm3/2fa.ini
Found module set ini file: /var/lib/hm3/github.ini
Found module set ini file: /var/lib/hm3/ldap.ini
Found module set ini file: /var/lib/hm3/oauth2.ini
Found module set ini file: /var/lib/hm3/wordpress.ini
Found module set ini file: /var/lib/hm3/recaptcha.ini
Found module set ini file: /var/lib/hm3/dynamic_login.ini
scanning module core ...
scanning module contacts ...
@jasonmunro
jasonmunro / libs.php
Created June 28, 2017 22:03
Test auth for Cypht using modules/site/libs.php
<?php
/**
* Override the authentication class. This method needs to be overriden to
* create a custom authentication backend. You must set the "auth_type" setting
* in your hm3.ini file to "custom" to activate this class. More information
* about the base class for authentication is located here:
*
* https://cypht.org/docs/code_docs/class-Hm_Auth.html
*
<?php
/* location of the wordpress install */
define('WP_DIR', '/var/www/html/wp/');
/**
* This example uses WordPress for login state- if you are logged into
* WordPress you will also be logged into Cypht.
*
* To use this, you must first enable the "site" module in your hm3.ini file,
diff --git a/modules/imap/hm-imap.php b/modules/imap/hm-imap.php
index 404fbf9e..62293a68 100644
--- a/modules/imap/hm-imap.php
+++ b/modules/imap/hm-imap.php
@@ -389,6 +389,8 @@ class Hm_IMAP extends Hm_IMAP_Cache {
$this->send_command($command);
$result = $this->get_response($this->folder_max, true);
+ elog($command);
+ elog($result);
diff --git a/modules/imap/hm-imap.php b/modules/imap/hm-imap.php
index 404fbf9e..14ee0177 100644
--- a/modules/imap/hm-imap.php
+++ b/modules/imap/hm-imap.php
@@ -389,6 +389,7 @@ class Hm_IMAP extends Hm_IMAP_Cache {
$this->send_command($command);
$result = $this->get_response($this->folder_max, true);
+ elog($result);
diff --git a/modules/imap/modules.php b/modules/imap/modules.php
index 8195b746..07dfb573 100644
--- a/modules/imap/modules.php
+++ b/modules/imap/modules.php
@@ -487,6 +487,7 @@ class Hm_Handler_imap_folder_expand extends Hm_Handler_Module {
$imap = Hm_IMAP_List::connect($form['imap_server_id'], $cache);
if (is_object($imap) && $imap->get_state() == 'authenticated') {
$msgs = $imap->get_folder_list_by_level(hex2bin($folder));
+ elog($msgs);
if (isset($msgs[$folder])) {