Skip to content

Instantly share code, notes, and snippets.

View wrossmann's full-sized avatar
👺
¯\_(ツ)_/¯

Wade Rossmann wrossmann

👺
¯\_(ツ)_/¯
  • Victoria, BC
View GitHub Profile
@wrossmann
wrossmann / DoveadmAuth.php
Created November 28, 2013 00:47
Quick, dirty, simple PHP to use `doveadm auth` to validate a user's plaintext password against the stored hash without exposing the password through shell commands. Note: This assumes that you already have dovecot's auth backend set up and working. Also, there does not appear to be a simple way to feed in a pre-computed hash, it will only use th…
<?php
class DoveadmAuth {
public static function auth($username, $password) {
$descriptors = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('pipe', 'w'),
);
$cwd = sys_get_temp_dir();
@Ocramius
Ocramius / Foo.php
Last active March 12, 2021 14:14
Self hydrating object proxy in PHP Provides faster hydration by removing the need for reflection.
<?php
class Foo
{
protected $foo;
protected $bar;
protected $baz;
}