*/
include_once(DIR_PATH . 'include/misc.php');
/**
* Determine if editing is allowed.
* You should probably edit this for your environment.
* Default is to allow editing only from localhost.
*
* @return int
*/
function directory_access_level() {
global $ldq_trusted_networks;
if($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
return 2;
}
foreach($ldq_trusted_networks as $allowed) {
if(IP_Match($allowed['network'], $allowed['mask'], $_SERVER['REMOTE_ADDR'])) {
return 2;
}
}
return 0;
}
/**
* Print a table with attributes, in the manner of HTML form elements, and
* their current values filled in.
*
* @var array $attrs Attributes to print.
* @var array $entry Current LDAP entry array
* @var boolean $printdescriptions
* @var string $mode
* @return void
*/
function directory_print_editable_attributes($attrs, $entry, $printdescriptions = true, $mode = 'edit') {
global $color, $editprofile_langs, $ldq_attributes, $orgs3, $charset, $ldq_base;
$toggle = false;
if($mode == 'add') {
echo '