[sork] SORK - passwd and MySQL Cyrus

Milan Rip xRipM at seznam.cz
Mon Aug 18 12:45:52 PDT 2003


Hi all,
last few hours I've spent with patching passwd (passwd-RELENG-2003-08-18) to allow me change passwords stored in MySQL throught HORDE (horde-2.2.3) web site.

I think it should be cool for other users (using Mysql, Cyrus, Postfix & Horde+IMP) when this will be a part of passwd - sork.

Because of I`m not familier with patch at this time, changes are described bellow as plain text.
By
Milan Jezdik, mail> xripm at seznam dot cz
please, let me know if somebody help this :)

Change in passwd/lib/Driver.php , function comparePasswords in switch structure add this>
case 'cyrus':
	if ($encrypted == crypt($plaintext, $encrypted)) {
		return true;
	}
	break;

Change in passwd/lib/Driver.php , function function comparePasswords in switch structure add this>
case 'cyrus':
	$newPassword = crypt($newPassword, substr(md5(rand()),0,2));
	break;

Than in passwd/config/backends.php could be support like this>

$backends['sql'] = array (
    'name' => 'Horde Authentication',
    'preferred' => '',
    'password policy' => array(
        'minLength' => 3,
        'maxLength' => 8,
        'maxSpace' => 0,
        'minUpper' => 1,
        'minLower' => 1,
        'minNumeric' => 1
    ),
    'driver' => 'sql',
    'params' => array(
        'phptype'    => 'mysql',
        'hostspec'   => 'localhost',
        'username'   => 'mail',
        'password'   => 'secret',
        'encryption' => 'cyrus',
        'database'   => 'mail',
        'table'      => 'accountuser',
        'user_col'   => 'username',
        'pass_col'   => 'password'
    )
);

____________________________________________________________
Nemá počítadlo kalorií, nemá kompas, nemá zrcátko - ale za tu cenu ho
budete chtí! Samsung C100 za 1977 Kč http://ad2.seznam.cz/redir.cgi?isntance=58377%26url=http://www.oskarmobil.cz/handsets/hs_view1.php3?nob=1?=cz&hs_id=69&ii=1


More information about the sork mailing list