RELEASE 1.0.1

This commit is contained in:
Deon George
2009-06-30 20:40:33 +10:00
parent eccabca011
commit 5f261ded38
18 changed files with 326 additions and 261 deletions

View File

@@ -1,6 +1,6 @@
<?php
/*
$Id: createlm.php,v 1.2 2005/10/23 01:05:41 wurley Exp $
$Id: createlm.php,v 1.3 2006/04/29 07:29:10 wurley Exp $
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2004 Roland Gruber
@@ -133,6 +133,14 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
array( 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8),
array( 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11)));
/**
* Fixes too large numbers
*/
function x($i) {
if ($i < 0) return 4294967296 - $i;
else return $i;
}
/**
* @param integer count
* @param array $data
@@ -335,7 +343,11 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
# Support functions
# Ported from SAMBA/source/lib/md4.c:F,G and H respectfully
function F($X, $Y, $Z) {
return ($X&$Y) | ((~$X)&$Z);
$ret = (($X&$Y) | ((~((int)$X))&$Z));
if ($this->x($ret) > 4294967296) {
$ret = (2*4294967296) - $this->x($ret);
}
return $ret;
}
function G($X, $Y, $Z) {
@@ -468,6 +480,9 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
$sum[1] &= 0xffff;
$sum[0] &= 0xffff;
$ret = ($sum[0]<<16) | $sum[1];
if ($this->x($ret) > 4294967296) {
$ret = (2*4294967296) - $this->x($ret);
}
return $ret;
}
@@ -493,7 +508,14 @@ var $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5
# Renamed to prevent clash with SAMBA/source/libsmb/smbdes.c:lshift
function md4lshift($x, $s) {
$x &= 0xFFFFFFFF;
return ((($x<<$s)&0xFFFFFFFF) | $this->unsigned_shift_r($x, (32-$s)));
if ($this->x($x) > 4294967296) {
$x = (2*4294967296) - $this->x($x);
}
$ret = ((($x<<$s)&0xFFFFFFFF) | $this->unsigned_shift_r($x, (32-$s)));
if ($this->x($ret) > 4294967296) {
$ret = (2*4294967296) - $this->x($ret);
}
return $ret;
}
/**

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/functions.php,v 1.290 2006/02/25 13:12:05 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/functions.php,v 1.292 2006/05/13 12:52:27 wurley Exp $
/**
* A collection of functions used throughout phpLDAPadmin.
@@ -85,6 +85,9 @@ function pretty_print_dn( $dn ) {
if (DEBUG_ENABLED)
debug_log('pretty_print_dn(): Entered with (%s)',1,$dn);
if (! is_dn_string($dn))
pla_error(sprintf(_('DN "%s" is not an LDAP distinguished name.'),htmlspecialchars($dn)));
$dn = pla_explode_dn( $dn );
foreach( $dn as $i => $element ) {
$element = htmlspecialchars($element);
@@ -1012,7 +1015,7 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true ) {
?>
<center>
<table class="error"><tr><td class="img"><img src="images/warning.png" /></td>
<table class="error"><tr><td class="img"><img src="images/warning.png" alt="Warning" /></td>
<td><center><h2><?php echo _('Error');?></h2></center>
<?php echo $msg; ?>
<br />
@@ -1118,7 +1121,7 @@ function pla_error_handler( $errno, $errstr, $file, $lineno ) {
$errstr = preg_replace("/\s+/"," ",$errstr);
if( $errno == E_NOTICE ) {
echo sprintf(_('<center><table class=\'notice\'><tr><td colspan=\'2\'><center><img src=\'images/warning.png\' height=\'12\' width=\'13\' />
echo sprintf(_('<center><table class=\'notice\'><tr><td colspan=\'2\'><center><img src=\'images/warning.png\' height=\'12\' width=\'13\' alt="Warning" />
<b>You found a non-fatal phpLDAPadmin bug!</b></td></tr><tr><td>Error:</td><td><b>%s</b> (<b>%s</b>)</td></tr><tr><td>File:</td>
<td><b>%s</b> line <b>%s</b>, caller <b>%s</b></td></tr><tr><td>Versions:</td><td>PLA: <b>%s</b>, PHP: <b>%s</b>, SAPI: <b>%s</b>
</td></tr><tr><td>Web server:</td><td><b>%s</b></td></tr>
@@ -1262,7 +1265,7 @@ function draw_jpeg_photos($ldapserver,$dn,$attr_name='jpegPhoto',$draw_delete_bu
$img_height = $height;
}
printf('<img %s%s%s src="view_jpeg_photo.php?file=%s" /><br />',
printf('<img %s%s%s src="view_jpeg_photo.php?file=%s" alt="Photo" /><br />',
($fixed_width ? '' : 'width="'.$img_width.'" '),
($fixed_height ? '' : 'height="'.$img_height.'"'),
($img_html_attrs ? $img_html_attrs : ''),basename($jpeg_filename));
@@ -1637,7 +1640,7 @@ function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none
$title = _('Click to popup a dialog to select an entry (DN) graphically');
printf('<a href="%s" title="%s"><img class="chooser" src="images/find.png" /></a>',$href,$title);
printf('<a href="%s" title="%s"><img class="chooser" src="images/find.png" alt="Find" /></a>',$href,$title);
if ($include_choose_text)
printf('<span class="x-small"><a href="%s" title="%s">%s</a></span>',$href,$title,_('browse'));
}
@@ -1659,6 +1662,8 @@ function draw_chooser_link( $form_element, $include_choose_text=true, $rdn="none
* </code>
*/
function pla_explode_dn($dn,$with_attributes=0) {
if (DEBUG_ENABLED)
debug_log('pla_explode_dn(): Entered with (%s,%s)',1,$dn,$with_attributes);
$dn = addcslashes(dn_escape($dn),'<>');
# split the dn
@@ -1683,6 +1688,8 @@ function pla_explode_dn($dn,$with_attributes=0) {
* Parse a DN and escape any special characters
*/
function dn_escape($dn) {
$olddn = $dn;
# Check if the RDN has a comma and escape it.
while (preg_match('/([^\\\\]),(\s*[^=]*\s*),/',$dn))
$dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*),/','$1\\\\2C$2,',$dn);
@@ -1690,7 +1697,7 @@ function dn_escape($dn) {
$dn = preg_replace('/([^\\\\]),(\s*[^=]*\s*)([^,])$/','$1\\\\2C$2$3',$dn);
if (DEBUG_ENABLED)
debug_log('dn_escape(): Entered with (%s), Returning (%s)',1,$dn,$dn);
debug_log('dn_escape(): Entered with (%s), Returning (%s)',1,$olddn,$dn);
return $dn;
}
@@ -2783,7 +2790,7 @@ function draw_date_selector_link( $attr ) {
$href = "javascript:dateSelector('$attr');";
$title = _('Click to popup a dialog to select a date graphically');
printf('<a href="%s" title="%s"><img class="chooser" src="images/calendar.png" id="f_trigger_%s" style="cursor: pointer;" /></a>',$href,$title,$attr);
printf('<a href="%s" title="%s"><img class="chooser" src="images/calendar.png" id="f_trigger_%s" style="cursor: pointer;" alt="Calendar" /></a>',$href,$title,$attr);
}
function no_expire_header() {

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/schema_functions.php,v 1.90 2006/01/03 20:39:59 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/schema_functions.php,v 1.91 2006/04/29 06:49:32 wurley Exp $
/**
* Classes and functions for fetching and parsing schema from an LDAP server.
@@ -145,6 +145,7 @@ class ObjectClass extends SchemaItem {
/**
* Creates a new ObjectClass object given a raw LDAP objectClass string.
* @todo: Unfortunately, some schemas are not well defined - eg: dNSDomain. Where the schema definition is not case consistent with the attribute definitions. This causes us some problems, which we need to resolve.
*/
function ObjectClass($raw_ldap_schema_string,$ldapserver) {
if (DEBUG_ENABLED)

View File

@@ -1,5 +1,5 @@
<?php
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/server_functions.php,v 1.44 2006/02/25 14:04:12 wurley Exp $ */
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/server_functions.php,v 1.45 2006/05/13 12:52:27 wurley Exp $ */
/**
* Classes and functions for LDAP server configuration and capability
@@ -2334,7 +2334,7 @@ class LDAPserver {
*/
function getLoggedInPass() {
if (DEBUG_ENABLED)
debug_log('%s:getLoggedInPass(): Entered with ()',17,get_class($this));
debug_log('%s::getLoggedInPass(): Entered with ()',17,get_class($this));
if (! $this->auth_type)
return false;
@@ -2387,6 +2387,9 @@ class LDAPserver {
# Set default return
$return = false;
if (DEBUG_ENABLED)
debug_log('%s::getLoggedInDN(): auth_type is [%s]',66,get_class($this),$this->auth_type);
if ($this->auth_type) {
switch ($this->auth_type) {
case 'cookie':
@@ -2419,7 +2422,7 @@ class LDAPserver {
}
if (DEBUG_ENABLED)
debug_log('%s:getLoggedInDN(): Entered with (), Returning (%s)',17,get_class($this),$return);
debug_log('%s::getLoggedInDN(): Entered with (), Returning (%s)',17,get_class($this),$return);
return $return;
}

View File

@@ -1,5 +1,5 @@
<?php
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/template_functions.php,v 1.34 2006/02/25 12:47:57 wurley Exp $ */
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/template_functions.php,v 1.35 2006/04/29 06:49:32 wurley Exp $ */
/**
* Classes and functions for the template engine.ation and capability
@@ -464,7 +464,7 @@ class Templates {
U: Make the result upper case.
*/
case 'autoFill' :
list($attr,$string) = split(',',$arg);
list($attr,$string) = preg_split('(([^,]+),(.*))',$arg,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
preg_match_all('/%(\w+)(\|[0-9]*-[0-9]*)?(\/[klTU]+)?%/U',$string,$matchall);
//print"<PRE>";print_r($matchall); //0 = highlevel match, 1 = attr, 2 = subst, 3 = mod

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/tree_functions.php,v 1.23 2006/01/03 20:39:59 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/tree_functions.php,v 1.25 2006/05/13 12:52:27 wurley Exp $
/**
* @package phpLDAPadmin
@@ -89,7 +89,9 @@ function draw_server_tree() {
$logged_in_dn_array = explode(',',$logged_in_branch);
}
$logged_in_dn_array[] = $ldapserver->getDNBase($logged_in_dn);
$bases = $ldapserver->getDNBase($logged_in_dn);
if (is_array($bases) && count($bases))
$logged_in_dn_array[] = $bases;
$rdn = $logged_in_dn;
@@ -190,9 +192,6 @@ function draw_server_tree() {
$icon = isset($tree['browser'][$base_dn]['icon']) ? $tree['browser'][$base_dn]['icon'] : get_icon($ldapserver,$base_dn);
# Shall we draw the "mass-delete" checkbox?
if ($ldapserver->isMassDeleteEnabled())
printf('<td><input type="checkbox" name="mass_delete[%s]" /></td>',htmlspecialchars($base_dn));
if ($config->GetValue('appearance','tree_plm')) {
$tree_plm .= sprintf(".|%s|%s|%s|%s|%s|%s\n",
@@ -200,6 +199,11 @@ function draw_server_tree() {
} else {
echo '<tr>';
# Shall we draw the "mass-delete" checkbox?
if ($ldapserver->isMassDeleteEnabled())
printf('<td><input type="checkbox" name="mass_delete[%s]" /></td>',htmlspecialchars($base_dn));
printf('<td class="expander"><a href="%s"><img src="%s" alt="%s" /></a></td>',$expand_href,$expand_img,$expand_alt);
printf('<td class="icon"><a href="%s" target="right_frame"><img src="images/%s" alt="img" /></a></td>',$edit_href,$icon);
printf('<td class="rdn" colspan="98"><nobr><a href="%s" target="right_frame">%s</a>',$edit_href,pretty_print_dn($base_dn));