diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index e4be4d6a..49ddba2d 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -372,10 +372,14 @@ table.schema_oclasses td { padding-left: 5px; } +table.schema_attr { + border: 1px solid black; +} + table.schema_attr th { - background-color: #016; + background-color: #F3F3F3; padding: 5px; - color: white; + color: black; font-weight: bold; font-size: 125%; } @@ -419,14 +423,14 @@ ul.schema li small a { } h4.schema_oclass { - background: #016; + background: #F3F3F3; padding: 5px; margin: 0px; margin-top: 8px; font-weight: normal; border: 1px solid black; font-size: 140%; - color: white; + color: black; } h4.schema_oclass_sub { @@ -440,311 +444,3 @@ h4.schema_oclass_sub { font-size: 80%; } -table.tree tr.login td { -} - -table.tree td.links { - padding: 0px; - font-size: 10px; - padding-left: 12px; - font-size: 10px; -} - -table.tree td.links a { - font-size: 10px; -} - -table.tree { - border: 0px; -} - -table.tree img { - border: 0px; -} - -table.tree td { - padding: 2px; - border: 0px solid black; -} - -table.tree tr { -} - -table.tree tr.server td.icon { - width: 14px; -} - -table.tree tr.server td { - padding-top: 15px; - padding-bottom: 0px; - vertical-align: top; - font-size: 20px; - text-align: left; -} - -table.tree td.icon { - text-align: center; - padding: 0px; - width: 14px; - font-size: 1px; -} - -table.tree td.rdn { - width: 500px; -} - -table.tree td.rdn a { - text-decoration: none; - color: black; -} - -table.tree td.rdn a:hover { - text-decoration: none; - color: blue; -} - -table.tree td.create { -} - -table.tree td.create a { - text-decoration: none; - color: black; -} - -table.tree td.create a:hover { - text-decoration: none; - color: blue; -} - - -table.tree td.spacer { - width: 22px; -} - -table.tree td.expander { - text-align: center; - width: 22px; - max-width: 22px; - min-width: 22px; -} - -table.tree td span.count { - color: gray; - font-size: 85%; -} - -h3.tree_title { - text-align: center; - margin: 0px; - padding: 10px; - color: white; - background-color: #018; - border: 1px solid black; - font-weight: normal; - font-size: 150%; -} - -h3.tree_subtitle { - text-align: center; - margin: 0px; - margin-bottom: 15px; - font-size: 75%; - color: white; - border-bottom: 1px solid black; - border-left: 1px solid black; - border-right: 1px solid black; - background: #018; - padding: 4px; - font-weight: normal; -} - -table.tree_edit_dn { - border-collapse: collapse; - border-spacing: 0px; - empty-cells: show; - width: 500px; -} - -table.tree_edit_dn input { - margin: 1px; -} - -table.tree_edit_dn input.val { - font-size: 14px; - width: 350px; - font-family: arial, helvetica, sans-serif; - background-color: white; -} - -table.tree_edit_dn textarea.val { - font-size: 14px; - width: 350px; - font-family: arial, helvetica, sans-serif; - background-color: white; -} - -table.tree_edit_dn tr td { - padding: 4px; - padding-right: 0px; -} - -table.tree_edit_dn tr td.attr { - background-color: #eee; - vertical-align: top; -} - -table.tree_edit_dn tr td.heading { - border-top: 3px solid #ccc; - font-weight: bold; -} - -table.tree_edit_dn tr td.attr_note { - text-align: right; - background-color: #eee; -} - -table.tree_edit_dn tr td.attr a { - text-decoration: none; - color: black; -} - -table.tree_edit_dn tr td.attr a:hover { - text-decoration: underline; - color: #016; -} - -table.tree_edit_dn tr td.val { - text-align: left; - vertical-align: middle; - padding-bottom: 10px; - padding-left: 80px; -} - - -/** When an attr is updated, it is highlighted to indicate such */ -table.tree_edit_dn tr.updated_attr td.attr { - border-top: 1px dashed green; - border-left: 1px dashed green; - background-color: #ded; -} - -table.tree_edit_dn tr.updated_attr td.attr_note { - border-top: 1px dashed green; - border-right: 1px dashed green; - background-color: #ded; -} - -/** An extra row that sits at the bottom of recently modified attrs to encase them in dashes */ -table.tree_edit_dn tr.updated_attr td.bottom { - border-top: 1px dashed green; -} - -/** Formatting for the value cell when it is the attribute that has been recently modified */ -table.tree_edit_dn tr.updated_attr td.val { - border-left: 1px dashed green; - border-right: 1px dashed green; -} - -/* Neede to prevent sub-tables (like the one in which jpegPhotos are displayed) - * from drawing borders as well. */ -table.tree_edit_dn tr.updated_attr td table td { - border: 0px; -} - -table.tree_edit_dn tr.updated_attr a { -} - -table.tree_edit_dn tr.mod_dn { - background: #def; -} - -table.tree_edit_dn tr.row1 { - background: #eee; -} - -table.tree_edit_dn tr.row2 { - background: #ccc; -} - -form.tree_edit_dn { - margin: 0px; - padding: 0px; -} - -table.tree_edit_dn_menu { - font-size: 75%; -} - -table.tree_edit_dn_menu td.icon { - width: 16px; - text-align: center; -} - -span.tree_hint { - font-size: small; - font-weight: normal; - color: #888; -} - -table.tree_confirm th { - background-color: #016; - padding: 5px; - color: white; - font-weight: normal; -} - -table.tree_confirm tr td { - padding: 4px; -} - -table.tree_confirm tr.spacer { - background-color: #ddd; -} - -table.tree_confirm tr.even { - background-color: #ccc; -} - -table.tree_confirm tr.odd { - background-color: #eee; -} - -table.tree_confirm tr td.heading { - text-align: right; - font-size: 75%; -} - -table.tree_confirm td.icon { - text-align: center; -} - -table.tree_delete_confirm { - width: 76%; - background-color: #ddf; - padding: 20px; - text-align: left; -} - -table.tree_create { - font-size: 75%; -} - -table.tree_create td.heading { - vertical-align: top; - padding: 10px; -} - -table.export_form { - font-size: 75%; - width: 400px; - border-spacing: 10px; - border-collapse: separate; -} - -table.export_form tr td { - text-align: left; - vertical-align: top; - padding: 4px; -} - - diff --git a/lam/templates/tree/add_attr.php b/lam/templates/tree/add_attr.php deleted file mode 100644 index eee6e2e8..00000000 --- a/lam/templates/tree/add_attr.php +++ /dev/null @@ -1,170 +0,0 @@ -LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage("ERROR", _('You left the attribute value blank. Please go back and try again.'), ''); - echo ""; - exit; -} - -// special case for binary attributes (like jpegPhoto and userCertificate): -// we must go read the data from the file and override $val with the binary data -// Secondly, we must check if the ";binary" option has to be appended to the name -// of the attribute. - -if( $is_binary_val ) { - if (( 0 == $_FILES['val']['size'] ) || (! is_uploaded_file( $_FILES['val']['tmp_name'] ))) { - echo $_SESSION['header']; - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage("ERROR", _('File upload failed!'), ''); - echo ""; - exit; - } - $file = $_FILES['val']['tmp_name']; - $f = fopen( $file, 'r' ); - $binary_data = fread( $f, filesize( $file ) ); - fclose( $f ); - $val = $binary_data; - - if( is_binary_option_required( $attr ) ) - $attr .=";binary"; -} - -// Automagically hash new userPassword attributes according to the -// chosen in config.php. -if( 0 == strcasecmp( $attr, 'userpassword' ) ) { - $val = pwd_hash($val); -} -elseif(0 == strcasecmp( $attr , 'sambalmpassword') ) { - $val = lmPassword($val); -} -elseif (0 == strcasecmp( $attr , 'sambantpassword' )) { - $val = ntPassword($val); -} - -$ds = $_SESSION['ldap']->server(); -$new_entry = array( $attr => $val ); -$result = @ldap_mod_add( $ds, $dn, $new_entry ); - -if( $result ) - header( "Location: edit.php?dn=$encoded_dn&modified_attrs[]=$encoded_attr" ); -else { - echo $_SESSION['header']; - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage("ERROR", _('Failed to add the attribute.'), ldap_error($ds)); - echo ""; - exit; -} - -// check if we need to append the ;binary option to the name -// of some binary attribute - -function is_binary_option_required( $attr ){ - - // list of the binary attributes which need the ";binary" option - $binary_attributes_with_options = array( - // Superior: Ldapv3 Syntaxes (1.3.6.1.4.1.1466.115.121.1) - '1.3.6.1.4.1.1466.115.121.1.8' => "userCertificate", - '1.3.6.1.4.1.1466.115.121.1.8' => "caCertificate", - '1.3.6.1.4.1.1466.115.121.1.10' => "crossCertificatePair", - '1.3.6.1.4.1.1466.115.121.1.9' => "certificateRevocationList", - '1.3.6.1.4.1.1466.115.121.1.9' => "authorityRevocationList", - // Superior: Netscape Ldap attributes types (2.16.840.1.113730.3.1) - '2.16.840.1.113730.3.1.40' => "userSMIMECertificate" - ); - - // quick check by attr name (short circuits the schema check if possible) - //foreach( $binary_attributes_with_options as $oid => $name ) - //if( 0 == strcasecmp( $attr, $name ) ) - //return true; - - $schema_attr = get_schema_attribute( $attr ); - if( ! $schema_attr ) - return false; - - $syntax = $schema_attr->getSyntaxOID(); - if( isset( $binary_attributes_with_options[ $syntax ] ) ) - return true; - - return false; -} - -?> diff --git a/lam/templates/tree/add_attr_form.php b/lam/templates/tree/add_attr_form.php deleted file mode 100644 index c971647d..00000000 --- a/lam/templates/tree/add_attr_form.php +++ /dev/null @@ -1,199 +0,0 @@ -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; - -$dn = $_GET['dn']; -$encoded_dn = rawurlencode( $dn ); -$rdn = get_rdn( $dn ); -?> - - - -

-

:

- -getMustAttrNames( $schema_oclasses ), - $schema_oclass->getMayAttrNames( $schema_oclasses ), - $avail_attrs ); -} - -$avail_attrs = array_unique( $avail_attrs ); -$avail_attrs = array_filter( $avail_attrs, "not_an_attr" ); -sort( $avail_attrs ); - -$avail_binary_attrs = array(); -foreach( $avail_attrs as $i => $attr ) { - if( is_attr_binary( $attr ) ) { - $avail_binary_attrs[] = $attr; - unset( $avail_attrs[ $i ] ); - } -} - -?> - -
-
- - - - - 0 ) { ?> - -
-
-
- - - - - -
- - -
-
- -
-
- - - - - 0 ) { ?> - -
- - -
- - - - " . _('Your PHP configuration has disabled file uploads. Please check php.ini before proceeding.') . "
"; - else - echo "
" . sprintf( _('Maximum file size: %s'), ini_get( 'upload_max_filesize' ) ) . "
"; - ?> -
- - -
-
- - - - -
- - - - $values ) - if( 0 == strcasecmp( $attr, $x ) ) - return false; - return true; -} - - -?> diff --git a/lam/templates/tree/add_oclass.php b/lam/templates/tree/add_oclass.php deleted file mode 100644 index 6a9aeace..00000000 --- a/lam/templates/tree/add_oclass.php +++ /dev/null @@ -1,101 +0,0 @@ - $new_oclass ); - -if( is_array( $new_attrs ) && count( $new_attrs ) > 0 ) - foreach( $new_attrs as $attr => $val ) { - $new_entry[ $attr ] = $val; - } - -$ds = $_SESSION['ldap']->server(); -$add_res = @ldap_mod_add( $ds, $dn, $new_entry ); - -if( ! $add_res ) -{ - echo $_SESSION['header']; - - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage('ERROR', _("Was unable to modify attributes from DN: %s."), ldap_error( $ds ), array($dn)); - echo ""; -} -else -{ - header( "Location: edit.php?dn=$encoded_dn&modified_attrs[]=objectclass" ); -} - -?> diff --git a/lam/templates/tree/add_oclass_form.php b/lam/templates/tree/add_oclass_form.php deleted file mode 100644 index 844601f2..00000000 --- a/lam/templates/tree/add_oclass_form.php +++ /dev/null @@ -1,170 +0,0 @@ - $junk ) - $current_attrs[] = strtolower($attr); - -// grab the required attributes for the new objectClass -$schema_oclasses = get_schema_objectclasses(); -$must_attrs = array(); -foreach($new_oclass as $oclass_name) { - $oclass = get_schema_objectclass($oclass_name); - if($oclass) - $must_attrs = array_merge($must_attrs, $oclass->getMustAttrNames($schema_oclasses)); -} -$must_attrs = array_unique( $must_attrs ); - -// We don't want any of the attr meta-data, just the string -//foreach( $must_attrs as $i => $attr ) - //$must_attrs[$i] = $attr->getName(); - -// build a list of the attributes that this new objectClass requires, -// but that the object does not currently contain -$needed_attrs = array(); -foreach( $must_attrs as $attr ) { - $attr = get_schema_attribute($attr); - //echo "
"; var_dump( $attr ); echo "
"; - // First, check if one of this attr's aliases is already an attribute of this entry - foreach( $attr->getAliases() as $alias_attr_name ) - if( in_array( strtolower( $alias_attr_name ), $current_attrs ) ) - // Skip this attribute since it's already in the entry - continue; - if( in_array( strtolower($attr->getName()), $current_attrs ) ) - continue; - - // We made it this far, so the attribute needs to be added to this entry in order - // to add this objectClass - $needed_attrs[] = $attr; -} - -if( count( $needed_attrs ) > 0 ) -{ - echo $_SESSION['header']; - - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - ?> - - -

-

- -
- -
- - - - - - - $attr ) { ?> - - - - -
getName()); ?>
-
-
-
-
- - - - - server(); - $add_res = @ldap_mod_add( $ds, $dn, array( 'objectClass' => $new_oclass ) ); - if( ! $add_res ) { - echo $_SESSION['header']; - - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage('ERROR', _("Was unable to modify attributes from DN: %s."), ldap_error( $ds ), array($dn)); - echo ""; - } - else - header( "Location: edit.php?dn=$encoded_dn&modified_attrs[]=objectClass" ); - -} - -?> diff --git a/lam/templates/tree/add_value.php b/lam/templates/tree/add_value.php deleted file mode 100644 index 51cfb636..00000000 --- a/lam/templates/tree/add_value.php +++ /dev/null @@ -1,104 +0,0 @@ -server(); - -// special case for binary attributes: -// we must go read the data from the file. -if( $is_binary_val ) -{ - $file = $_FILES['new_value']['tmp_name']; - $f = fopen( $file, 'r' ); - $binary_value = fread( $f, filesize( $file ) ); - fclose( $f ); - $new_value = $binary_value; -} - -$new_entry = array( $attr => $new_value ); - -$add_result = @ldap_mod_add( $ds, $dn, $new_entry ); - -if( ! $add_result ) { - echo $_SESSION['header']; - - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage('ERROR', _('Adding attribute failed!'), ldap_error( $ds )); - echo ""; - exit; -} - -header( "Location: edit.php?dn=$encoded_dn&modified_attrs[]=$encoded_attr" ); - -?> diff --git a/lam/templates/tree/add_value_form.php b/lam/templates/tree/add_value_form.php deleted file mode 100644 index 8dededca..00000000 --- a/lam/templates/tree/add_value_form.php +++ /dev/null @@ -1,202 +0,0 @@ -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; - -$dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null; -$encoded_dn = rawurlencode( $dn ); -if( null != $dn ) { - $rdn = get_rdn( $dn ); -} else { - $rdn = null; -} -$attr = $_GET['attr']; -$encoded_attr = rawurlencode( $attr ); -$current_values = get_object_attr( $dn, $attr ); -$num_current_values = ( is_array($current_values) ? count($current_values) : 1 ); -$is_object_class = ( 0 == strcasecmp( $attr, 'objectClass' ) ) ? true : false; -$is_jpeg_photo = is_jpeg_photo( $attr ); //( 0 == strcasecmp( $attr, 'jpegPhoto' ) ) ? true : false; - -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(); - foreach( $current_values as $oclass ) - unset( $schema_oclasses[ strtolower( $oclass ) ] ); -} else { - $schema_attr = get_schema_attribute( $attr ); -} - -?> - - - -

- : - -

-

- :

- -" . htmlspecialchars($attr); ?> - - - - -

- -

- - - - - - - - - -
-
- - - -
- -

- -
- - - - > - - - - - - - - - - - getMaxLength() ) - echo "maxlength=\"" . $schema_attr->getMaxLength() . "\" "; - ?>name="new_value" size="40" value="" /> - - - - -
- - getDescription() ) { ?> - : getDescription(); ?>
- - - getType() ) { ?> - : getType(); ?>
- - - getMaxLength() ) { ?> - : getMaxLength() ); ?>
- - -
- - - - - diff --git a/lam/templates/tree/collapse.php b/lam/templates/tree/collapse.php deleted file mode 100644 index 39683912..00000000 --- a/lam/templates/tree/collapse.php +++ /dev/null @@ -1,70 +0,0 @@ - diff --git a/lam/templates/tree/create.php b/lam/templates/tree/create.php deleted file mode 100644 index 267d9c1e..00000000 --- a/lam/templates/tree/create.php +++ /dev/null @@ -1,189 +0,0 @@ - $val ) { - if( $val == '' ) { - echo $_SESSION['header']; - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - - StatusMessage("ERROR", _('You left the value blank for required attribute: %s.'), '', array(htmlspecialchars($attr))); - - echo ""; - exit; - } - $new_entry[ $attr ][] = $val; - } -} - -if( isset( $attrs ) && is_array( $attrs ) ) { - foreach( $attrs as $i => $attr ) { - if( is_attr_binary( $attr ) ) { - if( isset( $_FILES['vals']['name'][$i] ) && $_FILES['vals']['name'][$i] != '' ) { - // read in the data from the file - $file = $_FILES['vals']['tmp_name'][$i]; - $f = fopen( $file, 'r' ); - $binary_data = fread( $f, filesize( $file ) ); - fclose( $f ); - $val = $binary_data; - $new_entry[ $attr ][] = $val; - } - } else { - $val = isset( $vals[$i] ) ? $vals[$i] : ''; - if( '' !== trim($val) ) - $new_entry[ $attr ][] = $val; - } - } -} - -$new_entry['objectClass'] = $object_classes; -if( ! in_array( 'top', $new_entry['objectClass'] ) ) - $new_entry['objectClass'][] = 'top'; - -foreach( $new_entry as $attr => $vals ) { - if( ! is_attr_binary( $attr ) ) - if( is_array( $vals ) ) { - foreach( $vals as $i => $v ) { - $new_entry[ $attr ][ $i ] = $v; - } - } - else { - $new_entry[ $attr ] = $vals; - } -} - -//echo "
"; var_dump( $new_dn );print_r( $new_entry ); echo "
"; - -$ds = $_SESSION['ldap']->server(); - -// Check the user-defined custom call back first -$add_result = @ldap_add( $ds, $new_dn, $new_entry ); -if( $add_result ) -{ - $redirect_url = "edit.php?dn=" . rawurlencode( $new_dn ); - - if( array_key_exists( 'tree', $_SESSION ) ) - { - $tree = $_SESSION['tree']; - $tree_icons = $_SESSION['tree_icons']; - - if( isset( $tree[$container] ) ) { - $tree[$container][] = $new_dn; - sort( $tree[$container] ); - $tree_icons[$new_dn] = get_icon( $new_dn ); - } - - $_SESSION['tree'] = $tree; - $_SESSION['tree_icons'] = $tree_icons; - session_write_close(); - } - - ?> - \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - // print link if refresh does not work - echo "

\n"; - echo "" . _("Click here if you are not directed to the next page.") . "\n"; - echo "

\n"; - echo "\n"; - echo "\n"; - } - ?> - -LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - - StatusMessage("ERROR", _("LAM was unable to create account %s! An LDAP error occured."), ldap_error($ds), array($new_dn)); - - echo "\n"; - } - -?> diff --git a/lam/templates/tree/create_form.php b/lam/templates/tree/create_form.php deleted file mode 100644 index 510388ea..00000000 --- a/lam/templates/tree/create_form.php +++ /dev/null @@ -1,146 +0,0 @@ -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -?> - - - -

-

-

-
- - - - - - - - - - - -
- : - - - - - -
- - $template ) { - $i++; - // Balance the columns properly - if( ( count( $templates ) % 2 == 0 && $i == intval( $count / 2 ) ) || - ( count( $templates ) % 2 == 1 && $i == intval( $count / 2 ) + 1 ) ) - echo "
"; - // Check and see if this template should be shown in the list - $isValid = false; - if( isset($template['regexp'] ) ) { - if( @preg_match( "/".$template['regexp']."/i", $container ) ) { - $isValid = true; - } - } else { - $isValid = true; - } - - ?> - - - - - - - -
/> - -
-
-
- -
- - - diff --git a/lam/templates/tree/creation_template.php b/lam/templates/tree/creation_template.php deleted file mode 100644 index 6cbf6f8f..00000000 --- a/lam/templates/tree/creation_template.php +++ /dev/null @@ -1,97 +0,0 @@ - $template ) { - if( $template['handler'] == 'custom.php' ) { - $template = $id; - break; - } - } -} - -$template_id = $template; -$template = isset( $templates[$template] ) ? $templates[$template_id] : null; -$ds = $_SESSION['ldap']->server(); - -echo $_SESSION['header']; - -echo "LDAP Account Manager\n"; -echo "\n"; -echo "\n"; - -?> - - -

-

''

- -\n"; - -?> diff --git a/lam/templates/tree/delete.php b/lam/templates/tree/delete.php deleted file mode 100644 index 013ebefc..00000000 --- a/lam/templates/tree/delete.php +++ /dev/null @@ -1,116 +0,0 @@ -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -echo ""; - -$dn = $_POST['dn']; -$encoded_dn = rawurlencode( $dn ); - -$ds = $_SESSION['ldap']->server(); - -$del_result = @ldap_delete( $ds, $dn ); - -if( $del_result ) -{ - // kill the DN from the tree browser session variable and - // refresh the tree viewer frame (left_frame) - - if( array_key_exists( 'tree', $_SESSION ) ) - { - $tree = $_SESSION['tree']; - if( isset( $tree ) && is_array( $tree ) ) { - - // does it have children? (it shouldn't, but hey, you never know) - if( isset( $tree[$dn] ) ) - unset( $tree[$dn] ); - - // search and destroy - foreach( $tree as $tree_dn => $subtree ) - foreach( $subtree as $key => $sub_tree_dn ) - if( 0 == strcasecmp( $sub_tree_dn, $dn ) ) - unset( $tree[$tree_dn][$key] ); - $_SESSION['tree'] = $tree; - } - } - - ?> - - - -
-
-
- - "; diff --git a/lam/templates/tree/delete_attr.php b/lam/templates/tree/delete_attr.php deleted file mode 100644 index 07ec6c46..00000000 --- a/lam/templates/tree/delete_attr.php +++ /dev/null @@ -1,87 +0,0 @@ -server(); -$res = @ldap_modify( $ds, $dn, $update_array ); -if( $res ) { - $redirect_url = "edit.php?dn=$encoded_dn"; - foreach( $update_array as $attr => $junk ) { - $redirect_url .= "&modified_attrs[]=$attr"; - } - header( "Location: $redirect_url" ); -} -else { - echo $_SESSION['header']; - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage("ERROR", _('Could not perform ldap_modify operation.'), ldap_error($ds)); - echo ""; - exit; -} - -?> diff --git a/lam/templates/tree/delete_form.php b/lam/templates/tree/delete_form.php deleted file mode 100644 index a5c8d924..00000000 --- a/lam/templates/tree/delete_form.php +++ /dev/null @@ -1,184 +0,0 @@ -0 ? true : false; - -echo $_SESSION['header']; - -echo "LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -?> - - - -

-

:

- - - -


- - - - - -
- -

- -
-
- -
-
- -
-
- - - - - - -
-
-
- - -
-
-
-
- - -
-
-
-

- -
-
-
- - -
- - - -
- - - -
- -
-
-:
-
- - - - - - -
-
-
- - -
- -
-
-
- - -
-
-
- -
- -
- - - - - - diff --git a/lam/templates/tree/download_binary_attr.php b/lam/templates/tree/download_binary_attr.php deleted file mode 100644 index 921ca0c6..00000000 --- a/lam/templates/tree/download_binary_attr.php +++ /dev/null @@ -1,88 +0,0 @@ -server(); - -$search = @ldap_read( $ds, $dn, "(objectClass=*)", array($attr)); -if( ! $search ) { - echo $_SESSION['header']; - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - StatusMessage("ERROR", _('Encountered an error while performing search.'), ldap_error($ds)); - echo ""; - exit; -} -$entry = ldap_first_entry( $ds, $search ); -$attrs = ldap_get_attributes( $ds, $entry ); -$attr = ldap_first_attribute( $ds, $entry ); -$values = ldap_get_values_len( $ds, $entry, $attr ); -$count = $values['count']; - -// Dump the binary data to the browser -header( "Content-type: octet-stream" ); -header( "Content-disposition: attachment; filename=$attr" ); -header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); -header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); -echo $values[$value_num]; - -?> diff --git a/lam/templates/tree/edit.php b/lam/templates/tree/edit.php deleted file mode 100644 index 0b3b53a9..00000000 --- a/lam/templates/tree/edit.php +++ /dev/null @@ -1,544 +0,0 @@ -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -?> - - -

-

:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 ) { ?> - - - - - - $attr ) { - $modified_attrs[$i] = strtolower( $attr ); - } -} -?> - -
- -
">">
- - - -
- - - $vals ) { - $counter++; - $schema_href = "../schema/schema.php?view=attributes&viewvalue=" . real_attr_name($attr); - ?> - - - - - - \n"; -} - -?> - - - - - - - - - - -\n"; - echo "
- - - - -
- 1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?> - "> ()
- -
- \n"; - } - } ?> -
(" . _('No internal attributes') . ")
(" . _('This entry has no attributes') . ")
"; - echo ""; - die(); -} - -uksort( $attrs, 'sortAttrs' ); -foreach( $attrs as $attr => $vals ) { - - flush(); - - $schema_attr = get_schema_attribute( $attr, $dn ); - if( $schema_attr ) - $attr_syntax = $schema_attr->getSyntaxOID(); - else - $attr_syntax = null; - - if( 0 == strcasecmp( $attr, 'dn' ) ) - continue; - - // Setup the $attr_note, which will be displayed to the right of the attr name (if any) - $attr_note = ''; - - $attr_note = ""; - $attr_display = $attr; - - // is this attribute required by an objectClass? - $required_by = ''; - if( $schema_attr ) - foreach( $schema_attr->getRequiredByObjectClasses() as $required ) - if( in_array( strtolower( $required ), arrayLower( $attrs['objectClass'] ) ) ) { - $required_by .= $required . ' '; - } - if( $required_by ) { - if( trim( $attr_note ) ) - $attr_note .= ', '; - $attr_note .= "" . _('required') . " "; - } - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - \n"; - if( $is_modified_attr ) - echo ''; - continue; - } - - - /* - * Is this attribute binary? - */ - if( is_attr_binary( $attr ) ) { - $href = "download_binary_attr.php?dn=$encoded_dn&attr=$attr"; - ?> - - -
- 1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?> - "> ()
- -
- - - - -
- - - - '; - continue; - } - - - /* - * Note: at this point, the attribute must be text-based (not binary or jpeg) - */ - - - /* - * Is this a userPassword attribute? - */ - if( 0 == strcasecmp( $attr, 'userpassword' ) ) { - $user_password = $vals[0]; - $enc_type = get_enc_type( $user_password ); - - ?> - - - - - - -
- - - - -
- - - - '; - continue; - } - - /* - * Is this a boolean attribute? - */ - if( is_attr_boolean( $attr) ) { - $val = $vals[0]; - ?> - - - - - - - - '; - continue; - } - - /* - * End of special case attributes (non plain text). - */ - - - /* - * This is a plain text attribute, to be displayed and edited in plain text. - */ - foreach( $vals as $i => $val ) { - - $input_name = "new_values[" . htmlspecialchars( $attr ) . "][$i]"; - // We smack an id="..." tag in here that doesn't have [][] in it to allow the - // draw_chooser_link() to identify it after the user clicks. - $input_id = "new_values_" . htmlspecialchars($attr) . "_" . $i; - - ?> - - - - - - type == 'structural') { - echo "$val (" . - _('structural') . ")
"; - ?> - - - - - - - - - - - - - - - - - - - -
- - - - getIsSingleValue() && checkIfWriteAccessIsAllowed() ) - { - $add_href = "add_value_form.php?dn=$encoded_dn&attr=" . rawurlencode( $attr ); - echo "
(" . - _('add value') . ")
\n"; - } - - ?> - - - - - - - - - $vals ) */ ?> - -
- - - - - - - - - - - - -
- - -
- -\n"; -?> diff --git a/lam/templates/tree/expand.php b/lam/templates/tree/expand.php deleted file mode 100644 index eca78c96..00000000 --- a/lam/templates/tree/expand.php +++ /dev/null @@ -1,83 +0,0 @@ - diff --git a/lam/templates/tree/export.php b/lam/templates/tree/export.php deleted file mode 100644 index 786aa8f1..00000000 --- a/lam/templates/tree/export.php +++ /dev/null @@ -1,133 +0,0 @@ -setOutputFormat($br); - -// prevent script from bailing early for long search -@set_time_limit( 0 ); - -// send the header -if( $save_as_file ) - header( "Content-type: application/download" ); -else - header( "Content-type: text/plain" ); -header( "Content-Disposition: filename=$friendly_rdn.".$exporters[$exporter_id]['extension'] ); -header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); -header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); -header( "Cache-Control: post-check=0, pre-check=0", false ); - -// and export -$exporter->export(); -?> diff --git a/lam/templates/tree/export_form.php b/lam/templates/tree/export_form.php deleted file mode 100644 index 4a3fc27d..00000000 --- a/lam/templates/tree/export_form.php +++ /dev/null @@ -1,191 +0,0 @@ - 'UNIX (Linux, BSD)', - 'mac' => 'Macintosh', - 'win' => 'Windows' -); - -$available_scopes = array( - 'base' => _('Base (base DN only)'), - 'one' => _('One (one level beneath base)'), - 'sub' => _('Sub (entire subtree)') -); - - -echo $_SESSION['header']; - -echo "LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -?> - - -

-
-
-
- - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - -
- $desc ) { - $id = htmlspecialchars( $id ); - $desc = htmlspecialchars( $desc ); ?> - - />
- - -
 />
 
-
-
- - - -
-
- - - $exporter){?> - - /> -
- - - -
-
-
- - $desc ) { - $id = htmlspecialchars( $id ); - $desc = htmlspecialchars( $desc ); - ?> - - />
- - -
-
-
-
- -
-
-
-
- - - -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; - -$dn = $_POST['dn']; -$encoded_dn = rawurlencode( $dn ); -$rdn = get_rdn( $dn ); - -$ds = $_SESSION['ldap']->server(); - -echo "\n"; -echo "

" . sprintf( _('Deleting %s'), htmlspecialchars($rdn) ) . "

\n"; -echo "

" . _('Recursive delete progress') . "

"; -echo "

"; -echo "\n"; -flush(); - -// prevent script from bailing early on a long delete -@set_time_limit( 0 ); - -$del_result = pla_rdelete( $dn ); -echo "
\n"; -if( $del_result ) -{ - // kill the DN from the tree browser session variable and - // refresh the tree viewer frame (left_frame) - - if( array_key_exists( 'tree', $_SESSION ) ) - { - $tree = $_SESSION['tree']; - - // does it have children? (it shouldn't, but hey, you never know) - if( isset( $tree[$dn] ) ) - unset( $tree[$dn] ); - - // Get a tree in the session if not already gotten - initialize_session_tree(); - - // search and destroy from the tree sesssion - foreach( $tree as $tree_dn => $subtree ) - foreach( $subtree as $key => $sub_tree_dn ) - if( 0 == strcasecmp( $sub_tree_dn, $dn ) ) - unset( $tree[$tree_dn][$key] ); - } - - $_SESSION['tree'] = $tree; - - ?> - - - - ' . htmlspecialchars( $dn ) . '' ); - -} else { - StatusMessage("ERROR", _('Failed to delete entry %s'), '', array(htmlspecialchars($dn))); -} - -echo ""; - -exit; - - -function pla_rdelete( $dn ) -{ - $children = get_container_contents( $dn ); - global $ds; - $ds = $_SESSION['ldap']->server(); - - if( ! is_array( $children ) || count( $children ) == 0 ) { - echo "" . sprintf( _('Deleting %s'), htmlspecialchars( $dn ) ) . "..."; - flush(); - if( @ldap_delete( $ds, $dn ) ) { - echo " " . _('Success') . "
\n"; - return true; - } else { - StatusMessage("ERROR", _('Failed to delete entry %s'), '', array(htmlspecialchars($dn))); - } - } else { - foreach( $children as $child_dn ) { - pla_rdelete( $child_dn ); - } - echo "" . sprintf( _('Deleting %s'), htmlspecialchars( $dn ) ) . "..."; - flush(); - if( @ldap_delete( $ds, $dn ) ) { - echo " " . _('Success') . "
\n"; - return true; - } else { - StatusMessage("ERROR", _('Failed to delete entry %s'), '', array(htmlspecialchars($dn))); - } - } - return false; -} diff --git a/lam/templates/tree/refresh.php b/lam/templates/tree/refresh.php deleted file mode 100644 index 57781d5d..00000000 --- a/lam/templates/tree/refresh.php +++ /dev/null @@ -1,90 +0,0 @@ -get_Suffix('tree'); -$tree_icons[ $base_dn ] = get_icon( $base_dn ); - -// get all the icons and container contents for all expanded entries -if( isset($tree) && is_array( $tree ) ) -{ - foreach( $tree as $dn => $children ) - { - $tree[$dn] = get_container_contents( $dn, 0, '(objectClass=*)' ); - if( is_array( $tree[$dn] ) ) { - foreach( $tree[$dn] as $child_dn ) - $tree_icons[$child_dn] = get_icon( $child_dn ); - sort( $tree[ $dn ] ); - } - } -} -else -{ - header( "Location: tree.php" ); -} - -$_SESSION['tree'] = $tree; -$_SESSION['tree_icons'] = $tree_icons; -session_write_close(); - -header( "Location: tree.php" ); - - -?> diff --git a/lam/templates/tree/tree.php b/lam/templates/tree/tree.php deleted file mode 100644 index bf1f0433..00000000 --- a/lam/templates/tree/tree.php +++ /dev/null @@ -1,197 +0,0 @@ -, so if I wanted to scroll to - * dc=example,dc=com for server 3, the URL would be: - * tree.php#3_dc%3Dexample%2Cdc%3Dcom - * - * @package lists - * @subpackage tree - * @author David Smith - * @author Roland Gruber - */ - -/** security functions */ -include_once('../../lib/security.inc'); -/** tree functions */ -include_once('../../lib/tree.inc'); -/** access to configuration */ -include_once('../../lib/config.inc'); -/** LDAP functions */ -include_once('../../lib/ldap.inc'); - -// start session -startSecureSession(); - -setlanguage(); - -// This allows us to display large sub-trees without running out of time. -@set_time_limit( 0 ); - -// do we not have a tree and tree icons yet? Build a new one. -initialize_session_tree(); - -// get the tree and tree icons. -$tree = $_SESSION['tree']; -$tree_icons = $_SESSION['tree_icons']; - - -echo $_SESSION['header']; - -echo "LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -?> - - - - - - - -
-"; print_r( $tree ); -?> - - - - -'; - - for( $i=0; $i<=$level; $i++ ) { - echo '' . "\n"; - } - - // is this node expanded? (deciding whether to draw "+" or "-") - if( isset( $tree[$dn] ) ) { ?> - - - - - - - - - - + - - - $limit ) - $child_count = $limit . '+'; - } ?> - - - img - - - - - - () - - - - - - 10 ) - draw_create_link( $rdn, $level, $encoded_dn ); - foreach( $tree[$dn] as $dn ) - draw_tree_html( $dn, $level+1 ); - // Always draw the "create new" link at the bottom of the listing - draw_create_link( $rdn, $level, $encoded_dn ); - } -} - -function draw_create_link( $rdn, $level, $encoded_dn ) -{ - if (!checkIfWriteAccessIsAllowed()) { - return; - } - // print the "Create New object" link. - $create_html = ""; - $create_href = "create_form.php?container=$encoded_dn"; - $create_html .= ''; - for( $i=0; $i<=$level; $i++ ) { - $create_html .= ''; - } - $create_html .= ''; - $create_html .= '' . _('Create new entry') . ''; - $create_html .= '' . - _('Create new entry') . ''; - $create_html .= ''; - echo $create_html; -} - -?> diff --git a/lam/templates/tree/tree_view.php b/lam/templates/tree/tree_view.php deleted file mode 100644 index cf78dc5a..00000000 --- a/lam/templates/tree/tree_view.php +++ /dev/null @@ -1,85 +0,0 @@ -get_Suffix('tree'); - -// init tree -if (! isset($_SESSION['tree'])) { - initialize_session_tree(); - $tree = $_SESSION['tree']; - $tree_icons = $_SESSION['tree_icons']; - $contents = get_container_contents($dn, 0, '(objectClass=*)'); - usort( $contents, 'pla_compare_dns' ); - $tree[$dn] = $contents; - - foreach( $contents as $c ) - $tree_icons[$c] = get_icon( $c ); - - $_SESSION['tree'] = $tree; - $_SESSION['tree_icons'] = $tree_icons; -} - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "LDAP Account Manager"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "This page requires a browser that can show frames!"; -echo ""; -echo ""; - -echo ""; - -?> \ No newline at end of file diff --git a/lam/templates/tree/update.php b/lam/templates/tree/update.php deleted file mode 100644 index 7aba5036..00000000 --- a/lam/templates/tree/update.php +++ /dev/null @@ -1,113 +0,0 @@ - ''. For example, to - * delete the 'sn' attribute from an entry, the update array would look like this: - * Array ( - * sn => '' - * ) - * - * On success, redirect to edit.php - * On failure, echo an error. - * - * @package lists - * @subpackage tree - * @author David Smith - * @author Roland Gruber - */ - -/** security functions */ -include_once('../../lib/security.inc'); -/** tree functions */ -include_once('../../lib/tree.inc'); -/** access to configuration */ -include_once('../../lib/config.inc'); -/** LDAP functions */ -include_once('../../lib/ldap.inc'); - -// start session -startSecureSession(); - -// die if no write access -if (!checkIfWriteAccessIsAllowed()) die(); - -setlanguage(); - -$dn = $_POST['dn']; -$encoded_dn = rawurlencode( $dn ); -$update_array = $_POST['update_array']; - -// check for delete attributes (indicated by the attribute entry appearing like this: attr => '' -foreach( $update_array as $attr => $val ) - if( ! is_array( $val ) ) - if( $val == '' ) { - $update_array[ $attr ] = array(); - } - else { - $update_array[ $attr ] = $val; - } - else { - foreach( $val as $i => $v ) { - $update_array[ $attr ][ $i ] = $v; - } - } - -$ds = $_SESSION['ldap']->server(); -$res = @ldap_modify( $ds, $dn, $update_array ); -if( $res ) -{ - $redirect_url = "edit.php?dn=$encoded_dn"; - foreach( $update_array as $attr => $junk ) - $redirect_url .= "&modified_attrs[]=$attr"; - header( "Location: $redirect_url" ); -} -else -{ - echo $_SESSION['header']; - - echo "LDAP Account Manager\n"; - echo "\n"; - echo "\n"; - echo ""; - StatusMessage('ERROR', _("Was unable to modify attributes from DN: %s."), ldap_error( $ds ), array($dn)); - echo ""; -} - -?> diff --git a/lam/templates/tree/update_confirm.php b/lam/templates/tree/update_confirm.php deleted file mode 100644 index 4ed4ddf9..00000000 --- a/lam/templates/tree/update_confirm.php +++ /dev/null @@ -1,263 +0,0 @@ -LDAP Account Manager\n"; -echo "\n"; -echo "\n"; -?> - -

-

:

- $old_val ) -{ - // Did the user delete the field? - if( ! isset( $new_values[ $attr ] ) ) { - $update_array[ $attr ] = ''; - } - // did the user change the field? - elseif( $old_val != $new_values[ $attr ] ) { - - $new_val = $new_values[ $attr ]; - - // special case for userPassword attributes - if( 0 == strcasecmp( $attr, 'userPassword' ) && $new_val != '' ) { - $new_val = pwd_hash($new_val, true, $_POST['enc_type'] ); - $password_already_hashed = true; - } - // special case for samba password - else if (( 0 == strcasecmp($attr,'sambaNTPassword') || 0 == strcasecmp($attr,'sambaLMPassword')) && trim($new_val[0]) != '' ){ - if ( 0 == strcasecmp($attr,'sambaNTPassword')) { - $new_val = ntPassword($new_val[0]); - } - else { - $new_val = lmPassword($new_val[0]); - } - } - $update_array[ $attr ] = $new_val; - } -} - -// special case check for a new enc_type for userPassword (not otherwise detected) -if( isset( $_POST['enc_type'] ) && - ! isset( $password_already_hashed ) && - $_POST['enc_type'] != $_POST['old_enc_type'] && - $_POST['enc_type'] != 'clear' && - $_POST['new_values']['userpassword'] != '' ) { - - $new_password = pwd_hash( $_POST['new_values']['userpassword'], true, $_POST['enc_type'] ); - $update_array[ 'userpassword' ] = $new_password; -} - -// strip empty vals from update_array and ensure consecutive indices for each attribute -foreach( $update_array as $attr => $val ) { - if( is_array( $val ) ) { - foreach( $val as $i => $v ) - if( null == $v || 0 == strlen( $v ) ) - unset( $update_array[$attr][$i] ); - $update_array[$attr] = array_values( $update_array[$attr] ); - } -} - -// at this point, the update_array should look like this (example): -// Array ( -// cn => Array( -// [0] => 'Dave', -// [1] => 'Bob' ) -// sn => 'Smith', -// telephoneNumber => '555-1234' ) -// This array should be ready to be passed to ldap_modify() - -?> - 0 ) { ?> - -
-
- -
-
- - - - - - - - - $new_val ) { $counter++ ?> - - - - \n\n"; - } - - ?> - -
- "; - else - if( 0 == strcasecmp( $attr, 'userPassword' ) && ( is_null( get_enc_type( $old_values[ $attr ] ) ) ) ) { - echo preg_replace( '/./', '*', $old_values[ $attr ] ) . "
"; - } - else { - echo nl2br( htmlspecialchars( $old_values[ $attr ] ) ) . "
"; - } - echo "
"; - - // is this a multi-valued attribute? - if( is_array( $new_val ) ) { - foreach( $new_val as $i => $v ) { - if( $v == '' ) { - // remove it from the update array if it's empty - unset( $update_array[ $attr ][ $i ] ); - $update_array[ $attr ] = array_values( $update_array[ $attr ] ); - } else { - echo nl2br( htmlspecialchars( $v ) ) . "
"; - } - } - - // was this a multi-valued attribute deletion? If so, - // fix the $update_array to reflect that per update_confirm.php's - // expectations - if( $update_array[ $attr ] == array( 0 => '' ) || $update_array[ $attr ] == array() ) { - $update_array[ $attr ] = ''; - echo '' . _('[attribute deleted]') . ''; - } - } - else - if( $new_val != '' ) - if( 0 == strcasecmp( $attr, 'userPassword' ) && ( is_null( get_enc_type( $new_values[ $attr ] ) ) ) ) { - echo preg_replace( '/./', '*', $new_val ) . "
"; - } - else { - echo htmlspecialchars( $new_val ) . "
"; - } - else - echo '' . _('[attribute deleted]') . ''; - echo "
-
- - - - - - -
- -
- - $val ) { ?> - - $v ) { ?> - - - - - - - - - -
-
- -
- - -
-
-
- - - - -
- -

-
- - - - - - -