Location: PHPKode > projects > LDAP User Management System > lums-0.6/lib/extras.php
<?php
function LUMS_callfun_gr2en_cn($L_info)
{
	if (!isset($L_info['cn;lang-el']))
		return array('notset','');
	if ($L_info['cn;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['cn;lang-el']));
}
function LUMS_callfun_gr2en_sn($L_info)
{
	if (!isset($L_info['sn;lang-el']))
		return array('notset','');
	if ($L_info['sn;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['sn;lang-el']));
}
function LUMS_callfun_gr2en_givenname($L_info)
{
	if (!isset($L_info['givenname;lang-el']))
		return array('notset','');
	if ($L_info['givenname;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['givenname;lang-el']));
}

function LUMS_callfun_gr2en_description($L_info)
{
	if (!isset($L_info['description;lang-el']))
		return array('notset','');
	if ($L_info['description;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['description;lang-el']));
}

function LUMS_callfun_gr2en_kedkecompanyname($L_info)
{
	if (!isset($L_info['kedkecompanyname;lang-el']))
		return array('notset','');
	if ($L_info['kedkecompanyname;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['kedkecompanyname;lang-el']));
}

function LUMS_callfun_gr2en_kedkecompanypostaladdress($L_info)
{
	if (!isset($L_info['kedkecompanypostaladdress;lang-el']))
		return array('notset','');
	if ($L_info['kedkecompanypostaladdress;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['kedkecompanypostaladdress;lang-el']));
}

function LUMS_callfun_gr2en_kedkepersonfathername($L_info)
{
	if (!isset($L_info['kedkepersonfathername;lang-el']))
		return array('notset','');
	if ($L_info['kedkepersonfathername;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['kedkepersonfathername;lang-el']));
}

function LUMS_callfun_gr2en_kedkepersonmaidenname($L_info)
{
	if (!isset($L_info['kedkepersonmaidenname;lang-el']))
		return array('notset','');
	if ($L_info['kedkepersonmaidenname;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['kedkepersonmaidenname;lang-el']));
}

function LUMS_callfun_gr2en_postaladdress($L_info)
{
	if (!isset($L_info['postaladdress;lang-el']))
		return array('notset','');
	if ($L_info['postaladdress;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['postaladdress;lang-el']));
}

function LUMS_callfun_gr2en_kedkepersonofficialpostaladdress($L_info)
{
	if (!isset($L_info['kedkepersonofficialpostaladdress;lang-el']))
		return array('notset','');
	if ($L_info['kedkepersonofficialpostaladdress;lang-el'] == '')
		return array('empty','');
	return array('ok',LUMS_trans_elot743($L_info['kedkepersonofficialpostaladdress;lang-el']));
}

function LUMS_callfun_orgdn2o($L_info)
{
	if (!isset($L_info['kedkepersonorgdn']))
		return array('notset','');
	if ($L_info['kedkepersonorgdn'] == '')
		return array('empty','');
	$orgdn = $L_info['kedkepersonorgdn'];
	$attrs_array = array('description');

	$info = LUMS_ldap_search('','',$orgdn,'base','(objectclass=*)',$attrs_array);
	if (!is_array($info)){
		if (!$info)
			return array('error','Organization not found');
		else
			return array('error',$info);
	}
	if ($info[0]['description'][0] == '')
		return array('error','organization description not set');

	return array('ok',$info[0]['description'][0]);
}

function LUMS_callfun_orgdn2oGR($L_info)
{
	if (!isset($L_info['kedkepersonorgdn']))
		return array('notset','');
	if ($L_info['kedkepersonorgdn'] == '')
		return array('empty','');
	$orgdn = $L_info['kedkepersonorgdn'];
	$attrs_array = array('description;lang-el');

	$info = LUMS_ldap_search('','',$orgdn,'base','(objectclass=*)',$attrs_array);
	if (!is_array($info)){
		if (!$info)
			return array('error','Organization not found');
		else
			return array('error',$info);
	}
	if ($info[0]['description;lang-el'][0] == '')
		return array('error','organization description not set');

	return array('ok',iconv('UTF-8', 'ISO-8859-7', $info[0]['description;lang-el'][0]));
}

function LUMS_checktypefun_birthyear($value)
{
	$date = getdate();
	$year = $date[year] - 10;
	if (isset($value) && !is_array($value)){
		if (is_numeric($value) && $value > 1850 && $value < $year){
			return 1;
		}
	}

	return 0;
}

#$LUMS_Config[Object][parent][operations][preadd] = 'LUMS_operations_parent_preadd';
#$LUMS_Config[Object][parent][operations][postadd] = 'LUMS_operations_parent_postadd';
#$LUMS_Config[Object][parent][operations][premodify] = 'LUMS_operations_parent_premodify';
#$LUMS_Config[Object][parent][operations][postmodify] = 'LUMS_operations_parent_postmodify';
#$LUMS_Config[Object][parent][operations][prerename] = 'LUMS_operations_parent_prerename';
#$LUMS_Config[Object][parent][operations][postrename] = 'LUMS_operations_parent_postrename';
#$LUMS_Config[Object][parent][operations][predelete] = 'LUMS_operations_parent_predelete';
#$LUMS_Config[Object][parent][operations][postdelete] = 'LUMS_operations_parent_postdelete';

function LUMS_operations_parent_preadd($L_conn, $L_entrydn, $L_info)
{
	return 1;
}


function LUMS_operations_parent_postadd($L_conn, $L_entrydn, $L_info)
{
	return 1;
}

function LUMS_operations_parent_premodify($L_conn, $L_entrydn, $L_change_info)
{
	return 1;
}

function LUMS_operations_parent_postmodify($L_conn, $L_entrydn, $L_change_info)
{
	return 1;
}

function LUMS_operations_parent_prerename($L_conn, $L_entrydn, $L_info)
{
	#$L_info = array($L_newrdn, $L_newparent, $L_deleteoldrdn);

	return 1;
}
function LUMS_operations_parent_postrename($L_conn, $L_entrydn, $L_info)
{
	#$L_info = array($L_newrdn, $L_newparent, $L_deleteoldrdn);

	return 1;
}

function LUMS_operations_parent_predelete($L_conn, $L_entrydn, $L_info)
{
	#$L_info = '';

	return 1;
}

function LUMS_operations_parent_postdelete($L_conn, $L_entrydn, $L_info)
{
	#$L_info = '';

	return 1;
}

?>
Return current item: LDAP User Management System