[Kolab-devel] Re: steffen: server/kolab-webadmin/kolab-webadmin/php/admin/include ldap.class.php, 1.17, 1.18 menu.php, 1.8, 1.9
Bernhard Reiter
bernhard at intevation.de
Mon Dec 13 11:59:19 CET 2004
On Monday 13 December 2004 10:35, cvs at intevation.de wrote:
> Author: steffen
>
> Update of
> /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include In
> directory doto:/tmp/cvs-serv12184/kolab-webadmin/php/admin/include
>
> Modified Files:
> ldap.class.php menu.php
> Log Message:
> Fix for Issue277 (no login af account deleted)
>
> Index: ldap.class.php
> ===================================================================
> RCS file:
> /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include/lda
>p.class.php,v retrieving revision 1.17
> retrieving revision 1.18
> diff -u -d -r1.17 -r1.18
> --- ldap.class.php 19 Nov 2004 01:32:26 -0000 1.17
> +++ ldap.class.php 13 Dec 2004 09:35:29 -0000 1.18
> @@ -1,6 +1,6 @@
> <?php
> /*
> - * Copyright (c) 2004 KlarÀlvdalens Datakonsult AB
> + * Copyright (c) 2004 KlarÀlvdalens Datakonsult AB
> *
> * Written by Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
> *
> @@ -21,6 +21,24 @@
> require_once('session_vars.php');
> require_once('debug.php');
>
> +/* We dont have any better place to put this right now... */
> +function str_rand($length = 8, $seeds =
> 'abcdefghijklmnopqrstuvwxyz0123456789') { + $str = '';
> + $seeds_count = strlen($seeds);
> +
> + // Seed
> + //list($usec, $sec) = explode(' ', microtime());
> + //$seed = (float) $sec + ((float) $usec * 100000);
> + //mt_srand($seed);
> +
> + // Generate
> + for ($i = 0; $length > $i; $i++) {
> + $str .= $seeds{mt_rand(0, $seeds_count - 1)};
Where are you seeding mt_rand?
My php documentation says you should use mt_srand once.
> + }
> +
> + return $str;
> + }
> +
> class KolabLDAP {
> function KolabLDAP() {
> $this->is_bound = false;
> @@ -327,8 +345,12 @@
> $kolab_obj = $this->read( 'k=kolab,'.$_SESSION['base_dn'] );
> if( !$kolab_obj ) return false;
> $delete_template = array();
> - $delete_template['kolabDeleteflag'] = $kolab_obj['kolabHost'];
> + $delete_template['kolabDeleteflag'] = $kolab_obj['kolabHost'];
> unset($delete_template['kolabDeleteflag']['count']);
> + // Write random garbage into passwd field to lock the user out
> + $delete_template['userPassword'] = '{sha}'.base64_encode( pack('H*',
> + sha1( str_rand( 32 ) )));
> +
> if( !ldap_modify($this->connection,$dn,$delete_template) ) {
> return false;
> }
>
> Index: menu.php
> ===================================================================
> RCS file:
> /kolabrepository/server/kolab-webadmin/kolab-webadmin/php/admin/include/men
>u.php,v retrieving revision 1.8
> retrieving revision 1.9
> diff -u -d -r1.8 -r1.9
> --- menu.php 30 Nov 2004 15:30:02 -0000 1.8
> +++ menu.php 13 Dec 2004 09:35:30 -0000 1.9
> @@ -96,7 +96,7 @@
> 'url' => 'erfrakon.php' ),
> array( 'name' => _('Intevation'),
> 'url' => 'intevation.php' ),
> - array( 'name' => _('Klarälvdalens Datakonsult'),
> + array( 'name' => _('KlarÀlvdalens Datakonsult'),
> 'url' => 'kdab.php' ),
I might have changed to to ä soemwhere because the UTF variant does not
work on the pages that come as latin-1. So are you sure this is fixed now?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2145 bytes
Desc: signature
URL: <http://lists.kolab.org/pipermail/devel/attachments/20041213/f3310a22/attachment.p7s>
More information about the devel
mailing list