From dd091ab9df674479c611a8cb1010b691b7d4532d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 29 Jul 2011 16:51:23 +0000 Subject: [PATCH] new PLA release --- .../tree/templates/creation/custom.php | 311 ------------------ .../templates/creation/new_ou_template.php | 111 ------- lam/templates/tree/templates/templates.inc | 56 ---- 3 files changed, 478 deletions(-) delete mode 100644 lam/templates/tree/templates/creation/custom.php delete mode 100644 lam/templates/tree/templates/creation/new_ou_template.php delete mode 100644 lam/templates/tree/templates/templates.inc diff --git a/lam/templates/tree/templates/creation/custom.php b/lam/templates/tree/templates/creation/custom.php deleted file mode 100644 index 42f57a79..00000000 --- a/lam/templates/tree/templates/creation/custom.php +++ /dev/null @@ -1,311 +0,0 @@ - - -

- -
- - - - - - - - - - - - - - - - - - - - - -
:
- -
-
- - "; - exit; - } - - $oclasses = isset( $_POST['object_classes'] ) ? $_POST['object_classes'] : null; - if( count( $oclasses ) == 0 ) { - StatusMessage("ERROR", _('You did not select any object classes for this object. Please go back and do so.'), ''); - echo ""; - exit; - } - $dn = trim( $container ) ? $rdn . ',' . $container : $rdn; - - // incrementally build up the all_attrs and required_attrs arrays - $schema_oclasses = get_schema_objectclasses(); - $required_attrs = array(); - $all_attrs = array(); - foreach( $oclasses as $oclass_name ) { - $oclass = get_schema_objectclass( $oclass_name ); - if( $oclass ) { - $required_attrs = array_merge( $required_attrs, - $oclass->getMustAttrNames( $schema_oclasses ) ); - $all_attrs = array_merge( $all_attrs, - $oclass->getMustAttrNames( $schema_oclasses ), - $oclass->getMayAttrNames( $schema_oclasses ) ); - } - } - - $required_attrs = array_unique( $required_attrs ); - $all_attrs = array_unique( $all_attrs ); - remove_aliases( $required_attrs); - remove_aliases( $all_attrs); - sort( $required_attrs ); - sort( $all_attrs ); - - // if for some reason "ObjectClass" ends up in the list of - // $all_attrs or $required_attrs, remove it! This is a fix - // for bug 927487 - foreach( $all_attrs as $i => $attr_name ) - if( 0 == strcasecmp( $attr_name, 'objectClass' ) ) { - unset( $all_attrs[$i] ); - $all_attrs = array_values( $all_attrs ); - break; - } - - foreach( $required_attrs as $i => $attr_name ) - if( 0 == strcasecmp( $attr_name, 'objectClass' ) ) { - unset( $required_attrs[$i] ); - $required_attrs = array_values( $required_attrs ); - break; - } - - // remove binary attributes and add them to the binary_attrs array - $binary_attrs = array(); - foreach( $all_attrs as $i => $attr_name ) { - if( is_attr_binary( $attr_name ) ) { - unset( $all_attrs[ $i ] ); - $binary_attrs[] = $attr_name; - } - } - - // If we trim any attrs out above, then we will have a gap in the index - // sequence and will get an "undefined index" error below. This prevents - // that from happening. - $all_attrs = array_values( $all_attrs ); - - // add the required attribute based on the RDN provided by the user - // (ie, if the user specifies "cn=Bob" for their RDN, make sure "cn" is - // in the list of required attributes. - $rdn_attr = trim( substr( $rdn, 0, strpos( $rdn, '=' ) ) ); - $rdn_value = trim( substr( $rdn, strpos( $rdn, '=' ) + 1 ) ); - $rdn_value = @pla_explode_dn( $rdn ); - $rdn_value = @explode( '=', $rdn_value[0], 2 ); - $rdn_value = @$rdn_value[1]; - if( in_array( $rdn_attr, $all_attrs ) && ! in_array( $rdn_attr, $required_attrs ) ) - $required_attrs[] = $rdn_attr; - ?> - -

- -
- - - - - - - - - \n"; - } else - - foreach( $required_attrs as $count => $attr ) { ?> - - - - - - - - - - - - - - - - - - - - - - 0 ) { ?> - - - - - - - - - -
(" . _('none') . ")
" - name="required_attrs[]" - value="" size="40" /> -
 
()
-
-
- -
-
- -$attr_display\n"; - } - return $attr_select_html; -} - -/** -* Returns option values. -*/ -function get_binary_attr_select_html( $binary_attrs, $highlight_attr=null ) -{ - $binary_attr_select_html = ""; - if( ! is_array( $binary_attrs ) ) - return null; - if( count( $binary_attrs ) == 0 ) - return null; - foreach( $binary_attrs as $a ) { - $attr_display = htmlspecialchars( $a ); - $binary_attr_select_html .= ""; - $attr1 = get_schema_attribute( $attr_name1 ); - if( null == $attr1 ) - continue; - if( $attr1->isAliasFor( $attr_name2 ) ) { - //echo "* Removing attribute ". $attribute_list[ $k ] . "
"; - unset( $attribute_list[ $k ] ); - } - } - } - $attribute_list = array_values( $attribute_list ); -} -?> - diff --git a/lam/templates/tree/templates/creation/new_ou_template.php b/lam/templates/tree/templates/creation/new_ou_template.php deleted file mode 100644 index 3c6a720b..00000000 --- a/lam/templates/tree/templates/creation/new_ou_template.php +++ /dev/null @@ -1,111 +0,0 @@ - - -

- - - - - - - -
- - - - - - - - - - - - - - -
:
: -

-
- - -"; - exit(); - } - - ?> -
- - - - - - - - - - - -
-
-
- - - - -
-
-
- - - diff --git a/lam/templates/tree/templates/templates.inc b/lam/templates/tree/templates/templates.inc deleted file mode 100644 index 891ea876..00000000 --- a/lam/templates/tree/templates/templates.inc +++ /dev/null @@ -1,56 +0,0 @@ - _('Organizational unit'), - 'icon' => '../../graphics/ou.png', - 'handler' => 'new_ou_template.php'); - -$templates[] = array( - 'desc' => _('Custom'), - 'icon' => '../../graphics/object.png', - 'handler' => 'custom.php'); - - -?> \ No newline at end of file