コード例 #1
0
function is_jpeg_photo($server_id, $attr_name)
{
    // easy quick check
    if (0 == strcasecmp($attr_name, 'jpegPhoto') || 0 == strcasecmp($attr_name, 'photo')) {
        return true;
    }
    // go to the schema and get the Syntax OID
    require_once realpath('schema_functions.php');
    $schema_attr = get_schema_attribute($server_id, $attr_name);
    if (!$schema_attr) {
        return false;
    }
    $oid = $schema_attr->getSyntaxOID();
    $type = $schema_attr->getType();
    if (0 == strcasecmp($type, 'JPEG')) {
        return true;
    }
    if ($oid == '1.3.6.1.4.1.1466.115.121.1.28') {
        return true;
    }
    return false;
}
コード例 #2
0
$num_current_values = is_array($current_values) ? count($current_values) : 1;
$is_object_class = 0 == strcasecmp($attr, 'objectClass') ? true : false;
$is_jpeg_photo = 0 == strcasecmp($attr, 'jpegPhoto') ? true : false;
if (is_server_read_only($server_id)) {
    pla_error($lang['no_updates_in_read_only_mode']);
}
check_server_id($server_id) or pla_error($lang['bad_server_id']);
have_auth_info($server_id) or pla_error($lang['not_enough_login_info']);
if ($is_object_class) {
    // fetch all available objectClasses and remove those from the list that are already defined in the entry
    $schema_oclasses = get_schema_objectclasses($server_id);
    foreach ($current_values as $oclass) {
        unset($schema_oclasses[strtolower($oclass)]);
    }
} else {
    $schema_attr = get_schema_attribute($server_id, $attr);
}
?>

<?php 
include 'header.php';
?>

<body>

<h3 class="title">
	<?php 
echo $lang['add_new'];
?>
	<b><?php 
echo htmlspecialchars($attr);