moved in_array_ignore_case to account.inc

This commit is contained in:
Roland Gruber 2006-07-17 17:45:14 +00:00
parent 3d0191f553
commit 48cbd62917
2 changed files with 15 additions and 15 deletions

View File

@ -81,6 +81,21 @@ function array_delete($values, $array) {
}
/**
* Checks if a string exists in an array, ignoring case.
*/
function in_array_ignore_case( $needle, $haystack )
{
if( ! is_array( $haystack ) )
return false;
if( ! is_string( $needle ) )
return false;
foreach( $haystack as $element )
if( is_string( $element ) && 0 == strcasecmp( $needle, $element ) )
return true;
return false;
}
/**
* This function will return a password with max. 8 characters.
*

View File

@ -1089,21 +1089,6 @@ function is_dn_attr( $attr_name )
return false;
}
/**
* Checks if a string exists in an array, ignoring case.
*/
function in_array_ignore_case( $needle, $haystack )
{
if( ! is_array( $haystack ) )
return false;
if( ! is_string( $needle ) )
return false;
foreach( $haystack as $element )
if( is_string( $element ) && 0 == strcasecmp( $needle, $element ) )
return true;
return false;
}
function get_enc_type( $user_password )
{
/* Capture the stuff in the { } to determine if this is crypt, md5, etc. */