RELEASE 0.9.8
This commit is contained in:
43
templates/SUSE-posixGroup.xml
Normal file
43
templates/SUSE-posixGroup.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>Posix Group - SUSE</title>
|
||||
<!-- <regexp>^ou=.*,</regexp> -->
|
||||
<icon>images/ou.png</icon>
|
||||
<description>Posix Group - SUSE</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="posixGroup"></objectClass>
|
||||
<objectClass id="namedObject"></objectClass>
|
||||
</objectClasses>
|
||||
|
||||
<attributes>
|
||||
<attribute id="cn">
|
||||
<display>Group</display>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>GID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,gid)</presubmit>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="memberUid">
|
||||
<array>10</array>
|
||||
<display>Users</display>
|
||||
<helper>
|
||||
<location>side</location>
|
||||
<!-- <value>=php.DrawChooserLink(memberUid,0)</value> -->
|
||||
</helper>
|
||||
<hidden>0</hidden>
|
||||
<order>3</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
</attributes>
|
||||
</template>
|
71
templates/SUSE-sambaGroupMapping.xml
Normal file
71
templates/SUSE-sambaGroupMapping.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>Samba3 Group Mapping - SUSE</title>
|
||||
<!-- <regexp>^ou=.*,</regexp> -->
|
||||
<icon>images/ou.png</icon>
|
||||
<description>New Samba3 Group Mapping</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="posixGroup"></objectClass>
|
||||
<objectClass id="namedObject"></objectClass>
|
||||
<objectClass id="sambaGroupMapping"></objectClass>
|
||||
</objectClasses>
|
||||
|
||||
<attributes>
|
||||
<attribute id="cn">
|
||||
<display>Group</display>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="displayName">
|
||||
<display>Windows Name</display>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>GID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<order>3</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,gid)</presubmit>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="sambaSID">
|
||||
<display>Samba SID</display>
|
||||
<helper>
|
||||
<id>sidsuffix</id>
|
||||
<location>side</location>
|
||||
<value></value>
|
||||
</helper>
|
||||
<order>4</order>
|
||||
<page>1</page>
|
||||
<post>=php.Join(-,(%sambaSID%,%sidsuffix%))</post>
|
||||
<value>=php.PickList(/,(objectClass=sambaDomain),sambaSID,%sambaSID% (%sambaDomainName%))</value>
|
||||
</attribute>
|
||||
<attribute id="sambaGroupType">
|
||||
<default>2</default>
|
||||
<display>Samba Group Type</display>
|
||||
<order>5</order>
|
||||
<page>1</page>
|
||||
<spacer>1</spacer>
|
||||
<value id="2">Domain Group</value>
|
||||
<value id="4">Local Group</value>
|
||||
<value id="5">Well-known Group</value>
|
||||
</attribute>
|
||||
<attribute id="memberUid">
|
||||
<array>10</array>
|
||||
<display>Users</display>
|
||||
<helper>
|
||||
<location>side</location>
|
||||
<!-- <value>=php.DrawChooserLink(memberUid,0)</value> -->
|
||||
</helper>
|
||||
<hidden>0</hidden>
|
||||
<order>10</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
</attributes>
|
||||
</template>
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<!--This template doesnt work needs modification to the Engine.-->
|
||||
<template>
|
||||
<title>ldap_alias</title>
|
||||
<title>LDAP Alias</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail_alias.png</icon>
|
||||
<description>New LDAP Alias</description>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>courier_mail_account</title>
|
||||
<title>Courier Mail Account</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail_account.png</icon>
|
||||
<description>New Courier Mail Account</description>
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="uid">
|
||||
<display>t_uid</display>
|
||||
<display>User ID</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%uid%</onchange>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="mail">
|
||||
<display>t_email</display>
|
||||
<display>Email</display>
|
||||
<icon>images/mail.png</icon>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
@@ -37,7 +37,7 @@
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last name</display>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<onchange>autoFill:uid,%gidNumber|0-0/T%-%givenName|0-1/l%%sn/l%</onchange>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
@@ -50,31 +50,31 @@
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="uidNumber">
|
||||
<display>t_uid_number</display>
|
||||
<hint>t_auto_det</hint>
|
||||
<display>UID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<icon>images/terminal.png</icon>
|
||||
<order>6</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,uid)</presubmit>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<display>GID Number</display>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
<order>7</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixGroup),gidNumber,%cn%)</value>
|
||||
</attribute>
|
||||
<attribute id="homeDirectory">
|
||||
<display>t_home_dir</display>
|
||||
<display>Home Directory</display>
|
||||
<order>8</order>
|
||||
<page>1</page>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="userPassword">
|
||||
<display>t_password</display>
|
||||
<display>Password</display>
|
||||
<helper>
|
||||
<default>md5</default>
|
||||
<display>t_encryption</display>
|
||||
<display>Encryption</display>
|
||||
<id>enc</id>
|
||||
<location>side</location>
|
||||
<value>blowfish</value>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>courier_mail_alias</title>
|
||||
<title>Courier Mail Alias</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail_alias.png</icon>
|
||||
<description>New Courier Mail Alias</description>
|
||||
@@ -17,17 +17,17 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="cn">
|
||||
<display>t_common_name</display>
|
||||
<display>Common Name</display>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last name</display>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="mail">
|
||||
<display>t_email</display>
|
||||
<display>Email</display>
|
||||
<order>3</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
|
@@ -1,301 +1,278 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/custom.php,v 1.41.2.2 2005/10/22 04:49:28 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/custom.php,v 1.43.2.5 2005/12/11 08:21:03 wurley Exp $
|
||||
|
||||
// Common to all templates
|
||||
$rdn = isset( $_POST['rdn'] ) ? $_POST['rdn'] : null;
|
||||
$rdn = isset($_POST['rdn']) ? $_POST['rdn'] : null;
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
$ldapserver = $ldapservers->Instance($server_id);
|
||||
$step = isset($_POST['step']) ? $_POST['step'] : 1;
|
||||
|
||||
// Unique to this template
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
if (! $ldapserver->haveAuthInfo())
|
||||
pla_error(_('Not enough information to login to server. Please check your configuration.'));
|
||||
|
||||
if( ! $ldapserver->haveAuthInfo())
|
||||
pla_error( $lang['not_enough_login_info'] );
|
||||
|
||||
if( $step == 1 )
|
||||
{
|
||||
if ($step == 1) {
|
||||
$oclasses = $ldapserver->SchemaObjectClasses();
|
||||
if( ! $oclasses || ! is_array( $oclasses ) )
|
||||
pla_error( "Unable to retrieve the schema from your LDAP server. Cannot continue with creation." );
|
||||
?>
|
||||
|
||||
<h4><?php echo $lang['create_step1']; ?></h4>
|
||||
if (! $oclasses || ! is_array($oclasses))
|
||||
pla_error("Unable to retrieve the schema from your LDAP server. Cannot continue with creation.");
|
||||
|
||||
<form action="creation_template.php" method="post" name="creation_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
printf('<h4>%s</h4>',_('Step 1 of 2: Name and ObjectClass(es)'));
|
||||
echo '<form action="template_engine.php" method="post" name="creation_form">';
|
||||
echo '<input type="hidden" name="step" value="2" />';
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
|
||||
printf('<input type="hidden" name="template" value="%s" />',htmlspecialchars($_POST['template']));
|
||||
|
||||
<table class="create">
|
||||
<tr>
|
||||
<td class="heading"><acronym title="<?php echo $lang['relative_distinguished_name']; ?>"><?php echo $lang['rdn']; ?></acronym>:</td>
|
||||
<td><input type="text" name="rdn" value="<?php echo htmlspecialchars( $rdn ); ?>" size="30" /> <?php echo $lang['rdn_example']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'creation_form.container' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="heading"><?php echo $lang['objectclasses']; ?></td>
|
||||
<td>
|
||||
<select name="object_classes[]" multiple="true" size="15">
|
||||
<?php foreach( $oclasses as $name => $oclass ) {
|
||||
if( 0 == strcasecmp( "top", $name ) ) continue; ?>
|
||||
<option <?php if( $oclass->getType() == 'structural' ) echo 'style="font-weight: bold" '; ?>
|
||||
value="<?php echo htmlspecialchars($oclass->getName()); ?>">
|
||||
<?php echo htmlspecialchars($oclass->getName()); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
echo '<table class="create">';
|
||||
echo '<tr>';
|
||||
printf('<td class="heading"><acronym title="%s">%s</acronym>:</td>',_('Relative Distinguished Name'),_('RDN'));
|
||||
printf('<td><input type="text" name="rdn" value="%s" size="30" /> %s</td>',htmlspecialchars($rdn),_('(example: cn=MyNewPerson)'));
|
||||
|
||||
<?php if ($config->GetValue('appearance','show_hints')) { ?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<small>
|
||||
<img src="images/light.png" /><span class="hint"><?php echo $lang['hint_structural_oclass']; ?></span>
|
||||
</small>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
echo '</tr><tr>';
|
||||
printf('<td class="heading">%s</td>',_('Container'));
|
||||
printf('<td><input type="text" name="container" size="40" value="%s" />',htmlspecialchars($container));
|
||||
draw_chooser_link('creation_form.container');
|
||||
echo '</td>';
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="<?php echo $lang['proceed_gt']; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
if( $step == 2 )
|
||||
{
|
||||
strlen( trim( $rdn ) ) != 0 or
|
||||
pla_error( $lang['rdn_field_blank'] );
|
||||
echo '</tr><tr>';
|
||||
printf('<td class="heading">%s</td>',_('ObjectClasses'));
|
||||
echo '<td><select name="object_classes[]" multiple="true" size="15">';
|
||||
|
||||
strlen( trim( $container ) ) == 0 or dn_exists( $ldapserver, $container ) or
|
||||
pla_error( sprintf( $lang['container_does_not_exist'], htmlspecialchars( $container ) ) );
|
||||
foreach ($oclasses as $name => $oclass) {
|
||||
if (0 == strcasecmp('top',$name))
|
||||
continue;
|
||||
|
||||
printf('<option %s value="%s">%s</option>',
|
||||
($oclass->getType() == 'structural') ? 'style="font-weight: bold" ' : '',
|
||||
htmlspecialchars($oclass->getName()),htmlspecialchars($oclass->getName()));
|
||||
}
|
||||
|
||||
echo '</select>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
if ($config->GetValue('appearance','show_hints'))
|
||||
printf('<tr><td></td><td><small><img src="images/light.png" /><span class="hint">%s</span></small><br /></td></tr>',
|
||||
_('Hint: You must choose exactly one structural objectClass (shown in bold above)'));
|
||||
|
||||
printf('<tr><td></td><td><input type="submit" value="%s" /></td></tr>',_('Proceed >>'));
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
|
||||
} elseif ($step == 2) {
|
||||
strlen(trim($rdn)) != 0 or
|
||||
pla_error(_('You left the RDN field blank.'));
|
||||
|
||||
if (strlen(trim($container)) == 0 or
|
||||
(! $ldapserver->dnExists($container) && ! in_array("$rdn,$container",$ldapserver->getBaseDN())))
|
||||
pla_error(sprintf(_('The container you specified (%s) does not exist. Please try again.'),htmlspecialchars($container)));
|
||||
|
||||
$friendly_attrs = process_friendly_attr_table();
|
||||
$oclasses = isset( $_POST['object_classes'] ) ? $_POST['object_classes'] : null;
|
||||
if( count( $oclasses ) == 0 )
|
||||
pla_error( $lang['no_objectclasses_selected'] );
|
||||
$dn = trim( $container ) ? $rdn . ',' . $container : $rdn;
|
||||
$oclasses = isset($_POST['object_classes']) ? $_POST['object_classes'] : null;
|
||||
if (count($oclasses) == 0)
|
||||
pla_error(_('You did not select any ObjectClasses for this object. Please go back and do so.'));
|
||||
|
||||
// incrementally build up the all_attrs and required_attrs arrays
|
||||
$dn = trim($container) ? $rdn.','.$container : $rdn;
|
||||
|
||||
# incrementally build up the all_attrs and required_attrs arrays
|
||||
$schema_oclasses = $ldapserver->SchemaObjectClasses();
|
||||
$required_attrs = array();
|
||||
$all_attrs = array();
|
||||
foreach( $oclasses as $oclass_name ) {
|
||||
|
||||
foreach ($oclasses as $oclass_name) {
|
||||
$oclass = $ldapserver->getSchemaObjectClass($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 ) );
|
||||
}
|
||||
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, $ldapserver );
|
||||
remove_aliases( $all_attrs, $ldapserver );
|
||||
sort( $required_attrs );
|
||||
sort( $all_attrs );
|
||||
$required_attrs = array_unique($required_attrs);
|
||||
$all_attrs = array_unique($all_attrs);
|
||||
remove_aliases($required_attrs,$ldapserver);
|
||||
remove_aliases($all_attrs,$ldapserver);
|
||||
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;
|
||||
}
|
||||
# remove required attrs from optional attrs
|
||||
foreach ($required_attrs as $i => $attr_name) {
|
||||
$key = array_search($attr_name,$all_attrs);
|
||||
|
||||
if (is_numeric($key))
|
||||
unset($all_attrs[$key]);
|
||||
}
|
||||
|
||||
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
|
||||
# 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( $ldapserver, $attr_name ) ) {
|
||||
unset( $all_attrs[ $i ] );
|
||||
foreach ($all_attrs as $i => $attr_name) {
|
||||
if ($ldapserver->isAttrBinary($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 ) )
|
||||
/* 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;
|
||||
?>
|
||||
|
||||
<h4><?php echo $lang['create_step2']; ?></h4>
|
||||
|
||||
<form action="create.php" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( $dn ); ?>" />
|
||||
<input type="hidden" name="new_rdn" value="<?php echo htmlspecialchars( $rdn ); ?>" />
|
||||
<input type="hidden" name="container" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="object_classes" value="<?php echo rawurlencode(serialize($oclasses)); ?>" />
|
||||
|
||||
<table class="edit_dn" cellspacing="0">
|
||||
<tr><th colspan="2"><?php echo $lang['required_attrs']; ?></th></tr>
|
||||
<?php if( count( $required_attrs ) == 0 ) {
|
||||
echo "<tr class=\"row1\"><td colspan=\"2\"><center>(" . $lang['none'] . ")</center></td></tr>\n";
|
||||
} else
|
||||
|
||||
foreach( $required_attrs as $count => $attr ) { ?>
|
||||
<tr>
|
||||
<td class="attr"><b><?php
|
||||
|
||||
// is there a user-friendly translation available for this attribute?
|
||||
if( isset( $friendly_attrs[ strtolower( $attr ) ] ) ) {
|
||||
$attr_display = "<acronym title=\"" . sprintf( $lang['alias_for'], htmlspecialchars($attr) ) . "\">" .
|
||||
htmlspecialchars( $friendly_attrs[ strtolower( $attr ) ] ) . "</acronym>";
|
||||
} else {
|
||||
$attr_display = htmlspecialchars( $attr );
|
||||
}
|
||||
printf('<h4>%s</h4>',_('Step 2 of 2: Specify attributes and values'));
|
||||
|
||||
echo $attr_display;
|
||||
|
||||
?></b></td></tr>
|
||||
<tr>
|
||||
<td class="val"><input type="<?php echo (is_attr_binary( $ldapserver, $attr ) ? "file" : "text"); ?>"
|
||||
name="required_attrs[<?php echo htmlspecialchars($attr); ?>]"
|
||||
value="<?php echo ($attr == $rdn_attr ? htmlspecialchars($rdn_value) : '') ?>" size="40" />
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr><th colspan="2"><?php echo $lang['optional_attrs']; ?></th></tr>
|
||||
|
||||
<?php if( count( $all_attrs ) == 0 ) { ?>
|
||||
<tr><td colspan="2"><center>(<?php echo $lang['none']; ?>)</center></td></tr>
|
||||
<?php } else { ?>
|
||||
<?php for($i=0; $i<min( count( $all_attrs ), 10 ); $i++ ) { $attr = $all_attrs[$i] ?>
|
||||
<tr>
|
||||
<td class="attr"><select style="background-color: #ddd; font-weight: bold" name="attrs[<?php echo $i; ?>]"><?php echo get_attr_select_html( $all_attrs, $friendly_attrs, $attr ); ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="val"><input type="text" name="vals[<?php echo $i; ?>]" value="" size="40" />
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( count( $binary_attrs ) > 0 ) { ?>
|
||||
<tr><th colspan="2"><?php echo $lang['optional_binary_attrs']; ?></th></tr>
|
||||
<?php for( $k=$i; $k<$i+count($binary_attrs); $k++ ) { $attr = $binary_attrs[$k-$i]; ?>
|
||||
<tr><td class="attr"><select style="background-color: #ddd; font-weight: bold" name="attrs[<?php echo $k; ?>]"><?php echo get_binary_attr_select_html( $binary_attrs, $friendly_attrs, $attr );?></select></td></tr>
|
||||
<tr><td class="val"><input type="file" name="vals[<?php echo $k; ?>]" value="" size="25" /></td></tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
echo '<form action="create.php" method="post" enctype="multipart/form-data">';
|
||||
echo '<input type="hidden" name="step" value="2" />';
|
||||
printf('<input type="hidden" name="new_dn" value="%s" />',htmlspecialchars($dn));
|
||||
printf('<input type="hidden" name="new_rdn" value="%s" />',htmlspecialchars($rdn));
|
||||
printf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($container));
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
|
||||
printf('<input type="hidden" name="object_classes" value="%s" />',rawurlencode(serialize($oclasses)));
|
||||
|
||||
<tr><td>
|
||||
<center>
|
||||
<input type="submit" name="submit" value="<?php echo $lang['createf_create_object']; ?>" />
|
||||
</center>
|
||||
</td></tr>
|
||||
echo '<table class="edit_dn" cellspacing="0">';
|
||||
printf('<tr><th colspan="2">%s</th></tr>',_('Required Attributes'));
|
||||
|
||||
</table>
|
||||
if (count($required_attrs) == 0)
|
||||
printf('<tr class="row1"><td colspan="2"><center>(%s)</center></td></tr>',_('none'));
|
||||
else
|
||||
foreach ($required_attrs as $count => $attr) {
|
||||
echo '<tr>';
|
||||
|
||||
<?php }
|
||||
# is there a user-friendly translation available for this attribute?
|
||||
if (isset($friendly_attrs[strtolower($attr)]))
|
||||
$attr_display = sprintf('<acronym title='._('Note: \'%s\' is an alias for \'%s\'').'">%s</acronym>"',
|
||||
htmlspecialchars($attr),htmlspecialchars($friendly_attrs[strtolower($attr)]));
|
||||
else
|
||||
$attr_display = htmlspecialchars($attr);
|
||||
|
||||
printf('<td class="attr"><b>%s</b></td>',$attr_display);
|
||||
|
||||
function get_attr_select_html( $all_attrs, $friendly_attrs, $highlight_attr=null )
|
||||
{
|
||||
$attr_select_html = "";
|
||||
if( ! is_array( $all_attrs ) )
|
||||
return null;
|
||||
foreach( $all_attrs as $a ) {
|
||||
// is there a user-friendly translation available for this attribute?
|
||||
if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) {
|
||||
$attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" .
|
||||
htmlspecialchars($a) . ")";
|
||||
} else {
|
||||
$attr_display = htmlspecialchars( $a );
|
||||
echo '</tr><tr>';
|
||||
printf('<td class="val"><input type="%s" name="required_attrs[%s]" value="%s" size="40" />',
|
||||
($ldapserver->isAttrBinary($attr) ? 'file' : 'text'),
|
||||
htmlspecialchars($attr),($attr == $rdn_attr ? htmlspecialchars($rdn_value) : ''));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
printf('<tr><th colspan="2">%s</th></tr>',_('Optional Attributes'));
|
||||
|
||||
if (count($all_attrs) == 0)
|
||||
printf('<tr><td colspan="2"><center>(%s)</center></td></tr>',_('none'));
|
||||
else {
|
||||
for ($i=0;$i<min(count($all_attrs),10);$i++) {
|
||||
$attr = $all_attrs[$i];
|
||||
|
||||
printf('<tr><td class="attr"><select style="background-color: #ddd; font-weight: bold" name="attrs[%s]">%s</select></td></tr>',
|
||||
$i,get_attr_select_html($all_attrs,$friendly_attrs,$attr));
|
||||
printf('<tr><td class="val"><input type="text" name="vals[%s]" value="" size="40" /></tr>',$i);
|
||||
}
|
||||
$a = htmlspecialchars( $a );
|
||||
$attr_select_html .= "<option value=\"$a\"";
|
||||
if( 0 == strcasecmp( $highlight_attr, $a ) )
|
||||
$attr_select_html .= " selected";
|
||||
$attr_select_html .= ">$attr_display</option>\n";
|
||||
}
|
||||
return $attr_select_html;
|
||||
|
||||
if (count($binary_attrs) > 0) {
|
||||
printf('<tr><th colspan="2">%s</th></tr>',_('Optional Binary Attributes'));
|
||||
|
||||
for ($k=$i;$k<$i+count($binary_attrs);$k++) {
|
||||
$attr = $binary_attrs[$k-$i];
|
||||
|
||||
printf('<tr><td class="attr"><select style="background-color: #ddd; font-weight: bold" name="attrs[%s]">%s</select></td></tr>',
|
||||
$k,get_binary_attr_select_html($binary_attrs,$friendly_attrs,$attr));
|
||||
printf('<tr><td class="val"><input type="file" name="vals[%s]" value="" size="25" /></td></tr>',$k);
|
||||
}
|
||||
}
|
||||
|
||||
printf('<tr><td><center><input type="submit" name="submit" value="%s" /></center></td></tr>',_('Create Object'));
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
function get_binary_attr_select_html( $binary_attrs, $friendly_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 ) {
|
||||
// is there a user-friendly translation available for this attribute?
|
||||
if( isset( $friendly_attrs[ strtolower( $a ) ] ) ) {
|
||||
$attr_display = htmlspecialchars( $friendly_attrs[ strtolower( $a ) ] ) . " (" .
|
||||
htmlspecialchars( $a ) . ")";
|
||||
} else {
|
||||
$attr_display = htmlspecialchars( $a );
|
||||
}
|
||||
$binary_attr_select_html .= "<option";
|
||||
if( 0 == strcasecmp( $highlight_attr, $a ) )
|
||||
$binary_attr_select_html .= " selected";
|
||||
$binary_attr_select_html .= ">$attr_display</option>\n";
|
||||
}
|
||||
return $binary_attr_select_html;
|
||||
|
||||
function get_attr_select_html($all_attrs,$friendly_attrs,$highlight_attr=null) {
|
||||
$attr_select_html = "\n\n";
|
||||
|
||||
if (! is_array($all_attrs))
|
||||
return null;
|
||||
|
||||
foreach ($all_attrs as $a) {
|
||||
# is there a user-friendly translation available for this attribute?
|
||||
if (isset($friendly_attrs[strtolower($a)]))
|
||||
$attr_display = sprintf('%s (%s)',htmlspecialchars($friendly_attrs[strtolower($a)]),htmlspecialchars($a));
|
||||
else
|
||||
$attr_display = htmlspecialchars($a);
|
||||
|
||||
$a = htmlspecialchars($a);
|
||||
$attr_select_html .= sprintf('<option value="%s"',$a);
|
||||
|
||||
if (0 == strcasecmp($highlight_attr,$a))
|
||||
$attr_select_html .= ' selected';
|
||||
|
||||
$attr_select_html .= sprintf('>%s</option>',$attr_display);
|
||||
}
|
||||
|
||||
return $attr_select_html;
|
||||
}
|
||||
|
||||
function get_binary_attr_select_html($binary_attrs,$friendly_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) {
|
||||
# is there a user-friendly translation available for this attribute?
|
||||
if (isset($friendly_attrs[strtolower($a)]))
|
||||
$attr_display = sprintf('%s (%s)',htmlspecialchars($friendly_attrs[strtolower($a)]),htmlspecialchars($a));
|
||||
else
|
||||
$attr_display = htmlspecialchars($a);
|
||||
|
||||
$binary_attr_select_html .= '<option';
|
||||
|
||||
if (0 == strcasecmp($highlight_attr,$a))
|
||||
$binary_attr_select_html .= ' selected';
|
||||
|
||||
$binary_attr_select_html .= sprintf('>%s</option>',$attr_display);
|
||||
}
|
||||
|
||||
return $binary_attr_select_html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes attributes from the array that are aliases for eachother
|
||||
* Removes attributes from the array that are aliases for eachother
|
||||
* (just removes the second instance of the aliased attr)
|
||||
*/
|
||||
function remove_aliases( &$attribute_list, $ldapserver )
|
||||
{
|
||||
// remove aliases from the attribute_list array
|
||||
for( $i=0; $i<count( $attribute_list ); $i++ ) {
|
||||
if( ! isset( $attribute_list[ $i ] ) )
|
||||
continue;
|
||||
$attr_name1 = $attribute_list[ $i ];
|
||||
for( $k=0; $k<count( $attribute_list ); $k++ ) {
|
||||
if( ! isset( $attribute_list[ $k ] ) )
|
||||
continue;
|
||||
if( $i == $k )
|
||||
continue;
|
||||
$attr_name2 = $attribute_list[ $k ];
|
||||
//echo "Comparing $attr_name1 and $attr_name2<br>";
|
||||
$attr1 = $ldapserver->getSchemaAttribute($attr_name1);
|
||||
if( null == $attr1 )
|
||||
continue;
|
||||
if( $attr1->isAliasFor( $attr_name2 ) ) {
|
||||
//echo "* Removing attribute ". $attribute_list[ $k ] . "<br>";
|
||||
unset( $attribute_list[ $k ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
$attribute_list = array_values( $attribute_list );
|
||||
function remove_aliases(&$attribute_list,$ldapserver) {
|
||||
# remove aliases from the attribute_list array
|
||||
for ($i=0;$i<count($attribute_list);$i++) {
|
||||
if (! isset($attribute_list[$i]))
|
||||
continue;
|
||||
|
||||
$attr_name1 = $attribute_list[$i];
|
||||
$attr1 = $ldapserver->getSchemaAttribute($attr_name1);
|
||||
if (is_null($attr1))
|
||||
continue;
|
||||
|
||||
for ($k=0;$k<count($attribute_list);$k++) {
|
||||
|
||||
if (! isset($attribute_list[$k]))
|
||||
continue;
|
||||
|
||||
if ($i == $k)
|
||||
continue;
|
||||
|
||||
$attr_name2 = $attribute_list[$k];
|
||||
|
||||
if ($attr1->isAliasFor($attr_name2))
|
||||
unset($attribute_list[$k]);
|
||||
}
|
||||
}
|
||||
$attribute_list = array_values($attribute_list);
|
||||
}
|
||||
?>
|
||||
|
@@ -1,249 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_address_template.php,v 1.13 2004/12/20 14:12:33 uugdave Exp $
|
||||
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "ou=Addresses";
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
/*
|
||||
* Populates the common name field based on the last
|
||||
* name concatenated with the first name, separated
|
||||
* by a blank
|
||||
*/
|
||||
function autoFillCommonName( form )
|
||||
{
|
||||
var first_name;
|
||||
var last_name;
|
||||
var common_name;
|
||||
|
||||
first_name = form.first_name.value;
|
||||
last_name = form.last_name.value;
|
||||
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
common_name = first_name + ' ' + last_name;
|
||||
form.common_name.value = common_name;
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center><h2><?php echo $lang['t_new_address']; ?><br />
|
||||
<small>(InetOrgPerson)</small></h2>
|
||||
</center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="address_form" name="address_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/uid.png" /></td>
|
||||
<td class="heading"><?php echo $lang['t_name']; ?>:</td>
|
||||
<td>
|
||||
<input type="text" name="first_name"
|
||||
id="first_name" value="<?php echo $lang['t_first']; ?>" onChange="autoFillCommonName(this.form)" />
|
||||
<input type="text" name="last_name"
|
||||
id="last_name" value="<?php echo $lang['t_last']; ?>" onChange="autoFillCommonName(this.form)" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_common_name']; ?>:</td>
|
||||
<td><input type="text" name="common_name" id="common_name" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_organization']; ?>:</td>
|
||||
<td><input type="text" name="organization" id="organization" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/mail.png" /></td>
|
||||
<td class="heading"><?php echo $lang['t_address']; ?>:</td>
|
||||
<td><input type="text" name="street" id="street" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_city']; ?>:</td>
|
||||
<td><input type="text" name="city" id="city" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_postal_code']; ?>:</td>
|
||||
<td><input type="text" name="postal_code" id="postal_code" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/phone.png" /></td>
|
||||
<td class="heading"><?php echo $lang['t_work_phone']; ?>:</td>
|
||||
<td><input type="text" name="telephone_number" id="telephone_number" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_fax']; ?>:</td>
|
||||
<td><input type="text" name="fax_number" id="fax_number" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_mobile']; ?>:</td>
|
||||
<td><input type="text" name="mobile_number" id="mobile_number" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_email']; ?>:</td>
|
||||
<td><input type="text" name="email_address" id="email_address" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_container']; ?>:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'address_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="<?php echo $lang['proceed_gt']; ?>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$common_name = trim( $_POST['common_name'] );
|
||||
$first_name = trim( $_POST['first_name'] );
|
||||
$last_name = trim( $_POST['last_name'] );
|
||||
$organization = trim( $_POST['organization'] );
|
||||
$city = trim( $_POST['city'] );
|
||||
$postal_code = trim( $_POST['postal_code'] );
|
||||
$street = trim( $_POST['street'] );
|
||||
$telephone_number = trim( $_POST['telephone_number'] );
|
||||
$fax_number = trim( $_POST['fax_number'] );
|
||||
$mobile_number = trim( $_POST['mobile_number'] );
|
||||
$email_address = trim( $_POST['email_address'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
|
||||
/* Critical assertions */
|
||||
0 != strlen( $common_name ) or
|
||||
pla_error( $lang['t_err_cn_blank'] );
|
||||
|
||||
?>
|
||||
<center><h3><?php echo $lang['t_confim_creation']; ?></h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn=' . $common_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'inetOrgPerson' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($common_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="givenName" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="o" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($organization);?>" />
|
||||
<input type="hidden" name="attrs[]" value="l" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($city);?>" />
|
||||
<input type="hidden" name="attrs[]" value="postalCode" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($postal_code);?>" />
|
||||
<input type="hidden" name="attrs[]" value="street" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($street);?>" />
|
||||
<input type="hidden" name="attrs[]" value="telephoneNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($telephone_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="facsimileTelephoneNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($fax_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="mobile" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($mobile_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="mail" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($email_address);?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even">
|
||||
<td class="heading"><?php echo $lang['t_common_name']; ?>:</td>
|
||||
<td><b><?php echo htmlspecialchars( $common_name ); ?></b></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading"><?php echo $lang['t_first_name']; ?>:</td>
|
||||
<td><b><?php echo htmlspecialchars( $first_name ); ?></b></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading"><?php echo $lang['t_last_name']; ?>:</td>
|
||||
<td><b><?php echo htmlspecialchars( $last_name ); ?></b></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading"><?php echo $lang['t_organization']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $organization ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading"><?php echo $lang['t_city']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $city ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading"><?php echo $lang['t_postal_code']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $postal_code ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading"><?php echo $lang['t_street']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $street ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading"><?php echo $lang['t_work_phone']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $telephone_number ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading"><?php echo $lang['t_fax']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $fax_number ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading"><?php echo $lang['t_mobile']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $mobile_number ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading"><?php echo $lang['t_email']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $email_address ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading"><?php echo $lang['t_container']; ?>:</td>
|
||||
<td><?php echo htmlspecialchars( $container ); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="<?php echo $lang['t_create_address']; ?>" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
@@ -1,95 +0,0 @@
|
||||
<?php
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Change this to suit your needs
|
||||
$default_number_of_users = 10;
|
||||
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New Alias</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="posix_group_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'posix_group_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Alias To:</td>
|
||||
<td><input type="text" name="alias" size="40" value="" />
|
||||
<?php draw_chooser_link( 'posix_group_form.alias' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$container = trim( $_POST['container'] );
|
||||
$alias = trim( $_POST['alias'] );
|
||||
//$alias_slashed = ereg_replace(",", "\\,", $alias);
|
||||
$attribute_parts = explode(',', $alias);
|
||||
$attribute_name1 = $attribute_parts[0];
|
||||
$attribute_parts = explode('=', $attribute_name1);
|
||||
$attribute_type = $attribute_parts[0];
|
||||
$attribute_name = $attribute_parts[1];
|
||||
$alias_slashed = str_replace(',', '\,', $alias);
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
?>
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( $attribute_name1.','.$container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'alias', 'extensibleObject' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="aliasedObjectName" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($alias);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($attribute_type); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($attribute_name); ?>" />
|
||||
|
||||
<center>
|
||||
Really create this new Alias entry?<br />
|
||||
<br />
|
||||
|
||||
<table class="confirm">
|
||||
<tr class="odd"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
<tr class="even"><td>alias</td><td><b><?php echo htmlspecialchars( $alias ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Alias" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_dns_entry.php,v 1.10 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or die( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or die( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New DNS Entry</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="dns_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><acronym title="Domain Component">DC</acronym> Name:</td>
|
||||
<td><input type="text" name="dc_name" value="" /> <small>(hint: don't include "dc=")</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Associated Domain:</td>
|
||||
<td><input type="text" name="associateddomain" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'dns_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$dc_name = trim( $_POST['dc_name'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
$associateddomain = trim( $_POST['associateddomain'] );
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
?>
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'dc=' . $dc_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'dnsdomain', 'domainRelatedObject') ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="associatedDomain" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($associateddomain);?>" />
|
||||
<input type="hidden" name="attrs[]" value="objectClass" />
|
||||
<input type="hidden" name="vals[]" value="top" />
|
||||
<input type="hidden" name="attrs[]" value="domainComponent" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($dc_name);?>" />
|
||||
|
||||
<center>
|
||||
Really create this new <acronym title="Domain Component">DC</acronym> entry?<br />
|
||||
<br />
|
||||
|
||||
<table class="confirm">
|
||||
<tr class="even"><td>Name</td><td><b><?php echo htmlspecialchars($dc_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>Domain</td><td><b><?php echo htmlspecialchars($associateddomain); ?></b></td></tr>
|
||||
<tr class="even"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Entry" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,300 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "ou=Addresses";
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
/*
|
||||
* Populates the common name field based on the last
|
||||
* name concatenated with the first name, separated
|
||||
* by a blank
|
||||
*/
|
||||
function autoFillCommonName( form )
|
||||
{
|
||||
var first_name;
|
||||
var last_name;
|
||||
var common_name;
|
||||
|
||||
first_name = form.first_name.value;
|
||||
last_name = form.last_name.value;
|
||||
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
common_name = first_name + ' ' + last_name;
|
||||
form.common_name.value = common_name;
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center><h2>New Kolab Entry<br />
|
||||
<small>(extended InetOrgPerson)</small></h2>
|
||||
</center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="address_form" name="address_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/uid.png" /></td>
|
||||
<td class="heading">Name (First/Last):</td>
|
||||
<td>
|
||||
<input type="text" name="first_name"
|
||||
id="first_name" value="" onChange="autoFillCommonName(this.form)" />
|
||||
<input type="text" name="last_name"
|
||||
id="last_name" value="" onChange="autoFillCommonName(this.form)" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Common name:</td>
|
||||
<td><input type="text" name="common_name" id="common_name" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Email (uid):</td>
|
||||
<td><input type="text" name="email_address" id="email_address" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_password" id="user_password" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/ou.png" /></td>
|
||||
<td class="heading">Title:</td>
|
||||
<td><input type="text" name="title" id="title" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">E-Mail Alias:</td>
|
||||
<td><input type="text" name="alias" id="alias" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Organization:</td>
|
||||
<td><input type="text" name="organization" id="organization" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Organizational Unit:</td>
|
||||
<td><input type="text" name="ou" id="ou" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Room number:</td>
|
||||
<td><input type="text" name="roomnumber" id="roomnumber" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/mail.png" /></td>
|
||||
<td class="heading">Address:</td>
|
||||
<td><input type="text" name="street" id="street" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Post Box:</td>
|
||||
<td><input type="text" name="postofficebox" id="postofficebox" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">City:</td>
|
||||
<td><input type="text" name="city" id="city" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Postal code:</td>
|
||||
<td><input type="text" name="postal_code" id="postal_code" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Country:</td>
|
||||
<td><input type="text" name="country" id="country" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/phone.png" /></td>
|
||||
<td class="heading">Work phone:</td>
|
||||
<td><input type="text" name="telephone_number" id="telephone_number" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Fax:</td>
|
||||
<td><input type="text" name="fax_number" id="fax_number" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'address_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$common_name = trim( $_POST['common_name'] );
|
||||
$first_name = trim( $_POST['first_name'] );
|
||||
$last_name = trim( $_POST['last_name'] );
|
||||
$organization = trim( $_POST['organization'] );
|
||||
$city = trim( $_POST['city'] );
|
||||
$postal_code = trim( $_POST['postal_code'] );
|
||||
$street = trim( $_POST['street'] );
|
||||
$telephone_number = trim( $_POST['telephone_number'] );
|
||||
$fax_number = trim( $_POST['fax_number'] );
|
||||
$email_address = trim( $_POST['email_address'] );
|
||||
$uid = trim( $_POST['email_address'] );
|
||||
$alias = trim( $_POST['alias'] );
|
||||
$country = trim( $_POST['country'] );
|
||||
$ou = trim( $_POST['ou'] );
|
||||
$postofficebox = trim( $_POST['postofficebox'] );
|
||||
$roomnumber = trim( $_POST['roomnumber'] );
|
||||
$title = trim( $_POST['title'] );
|
||||
$user_password = trim( $_POST['user_password'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
|
||||
/* Critical assertions */
|
||||
0 != strlen( $common_name ) or
|
||||
pla_error( "You cannot leave the Common Name blank. Please go back and try again." );
|
||||
0 != strlen( $user_password ) or
|
||||
pla_error( "You cannot leave the Password blank. Please go back and try again." );
|
||||
0 != strlen( $email_address ) or
|
||||
pla_error( "You cannot leave the E-mail/UID blank. Please go back and try again." );
|
||||
|
||||
?>
|
||||
<center><h3>Confirm entry creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn=' . $common_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'inetOrgPerson' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($common_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="givenName" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="o" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($organization);?>" />
|
||||
<input type="hidden" name="attrs[]" value="l" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($city);?>" />
|
||||
<input type="hidden" name="attrs[]" value="postalCode" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($postal_code);?>" />
|
||||
<input type="hidden" name="attrs[]" value="street" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($street);?>" />
|
||||
<input type="hidden" name="attrs[]" value="telephoneNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($telephone_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="facsimileTelephoneNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($fax_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="mail" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($email_address);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="alias" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($alias);?>" />
|
||||
<input type="hidden" name="attrs[]" value="c" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($country);?>" />
|
||||
<input type="hidden" name="attrs[]" value="ou" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($ou);?>" />
|
||||
<input type="hidden" name="attrs[]" value="postOfficeBox" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($postofficebox);?>" />
|
||||
<input type="hidden" name="attrs[]" value="roomNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($roomnumber);?>" />
|
||||
<input type="hidden" name="attrs[]" value="title" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($title);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="userPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($user_password);?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even">
|
||||
<td class="heading">Common name:</td>
|
||||
<td><b><?php echo htmlspecialchars( $common_name ); ?></b></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">First name:</td>
|
||||
<td><b><?php echo htmlspecialchars( $first_name ); ?></b></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">Last name:</td>
|
||||
<td><b><?php echo htmlspecialchars( $last_name ); ?></b></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Organization:</td>
|
||||
<td><?php echo htmlspecialchars( $organization ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">City:</td>
|
||||
<td><?php echo htmlspecialchars( $city ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Postal code:</td>
|
||||
<td><?php echo htmlspecialchars( $postal_code ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">Street:</td>
|
||||
<td><?php echo htmlspecialchars( $street ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Work phone:</td>
|
||||
<td><?php echo htmlspecialchars( $telephone_number ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">Fax:</td>
|
||||
<td><?php echo htmlspecialchars( $fax_number ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">Email:</td>
|
||||
<td><?php echo htmlspecialchars( $email_address ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Container:</td>
|
||||
<td><?php echo htmlspecialchars( $container ); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Address" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
@@ -1,224 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_mozillaOrgPerson_template.php,v 1.2 2004/10/28 13:37:40 uugdave Exp $
|
||||
|
||||
/**
|
||||
* "Create new" template for Mozilla Address book entry (mozillaOrgPerson)
|
||||
* @author Christian Weiske <cweiske@cweiske.de>
|
||||
*/
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "ou=Addresses";
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
/**
|
||||
* Data definition incl. group names
|
||||
*/
|
||||
$arDataDef = array(
|
||||
'name' => array(
|
||||
'givenName' => 'Given name',
|
||||
'sn' => 'Last name',
|
||||
'cn' => 'Common name',
|
||||
'mozillanickname' => 'mozillaNickname'
|
||||
),
|
||||
'internet' => array(
|
||||
'mail' => 'Email',
|
||||
'mozillaSecondEmail' => 'Second email',
|
||||
// 'mozilla_AimScreenName' => 'Screen name',
|
||||
// 'mozillausehtmlmail' => 'Use HTML mail'
|
||||
),
|
||||
'Phones' => array(
|
||||
'telephoneNumber' => 'Work',
|
||||
'homePhone' => 'Home',
|
||||
'facsimileTelephoneNumber' => 'Fax',
|
||||
'pager' => 'Pager',
|
||||
'mobile' => 'Mobile'
|
||||
),
|
||||
'Home address' => array(
|
||||
'homePostalAddress' => 'Address',
|
||||
'mozillaHomePostalAddress2' => 'Address 2',
|
||||
'mozillaHomeLocalityName' => 'City',
|
||||
'mozillaHomeState' => 'State',
|
||||
'mozillaHomePostalCode' => 'ZIP',
|
||||
// 'mozillaHomeFriendlyCountryName' => 'friendly Country',
|
||||
'mozillaHomeCountryName' => 'Country',
|
||||
'mozillaHomeUrl' => 'Web page'
|
||||
),
|
||||
'Work address' => array(
|
||||
'title' => 'Title',
|
||||
'ou' => 'Department',
|
||||
'o' => 'Organization',
|
||||
'postalAddress' => 'Address',
|
||||
'mozillaPostalAddress2' => 'Address 2',
|
||||
'l' => 'City',
|
||||
'st' => 'State/Province',
|
||||
'postalCode' => 'ZIP',
|
||||
'c' => 'Country',
|
||||
'mozillaWorkUrl' => 'Web page'
|
||||
),
|
||||
'Other' => array(
|
||||
// 'custom1' => 'Custom 1',
|
||||
// 'custom2' => 'Custom 2',
|
||||
// 'custom3' => 'Custom 3',
|
||||
// 'custom4' => 'Custom 4',
|
||||
// 'description' => 'Notes'
|
||||
)
|
||||
/**/
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
/*
|
||||
* Populates the common name field based on the last
|
||||
* name concatenated with the first name, separated
|
||||
* by a blank
|
||||
*/
|
||||
function autoFillCommonName( form )
|
||||
{
|
||||
var first_name;
|
||||
var last_name;
|
||||
var common_name;
|
||||
|
||||
first_name = form.givenName.value;
|
||||
last_name = form.sn.value;
|
||||
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
common_name = last_name + ' ' + first_name;
|
||||
form.cn.value = common_name;
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center><h2>New Address Book Entry<br />
|
||||
<small>(MozillaOrgPerson)</small></h2>
|
||||
</center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="address_form" name="address_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<?php
|
||||
foreach( $arDataDef as $strGroupName => $arGroup)
|
||||
{
|
||||
echo '<tr class="spacer"><td colspan="3">' . htmlspecialchars( $strGroupName) . '</td></tr>' . "\r\n";
|
||||
foreach( $arGroup as $strId => $strName)
|
||||
{
|
||||
if( $strId == 'sn' || $strId == 'givenName') {
|
||||
$strAutoChange = ' onChange="autoFillCommonName(this.form)"';
|
||||
} else {
|
||||
$strAutoChange = '';
|
||||
}
|
||||
echo '<tr>' . "\r\n";
|
||||
echo '<td></td>' . "\r\n";
|
||||
echo '<td class="heading">' . htmlspecialchars( $strName) . '</td>' . "\r\n";
|
||||
echo '<td><input type="text" name="' . $strId . '" id="' . $strId . '" value=""' . $strAutoChange . ' /></td>' . "\r\n";
|
||||
echo '</tr>' . "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'address_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center"><br /><input type="submit" value="Proceed >>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$arData = array();
|
||||
foreach( $arDataDef as $arGroup) {
|
||||
foreach( $arGroup as $strId => $strName) {
|
||||
$arData[$strId] = trim( $_POST[$strId]);
|
||||
}
|
||||
}
|
||||
$container = $_POST['container'];
|
||||
|
||||
/* Critical assertions */
|
||||
0 != strlen( $arData['cn']) or
|
||||
pla_error( "You cannot leave the Common Name blank. Please go back and try again." );
|
||||
|
||||
?>
|
||||
<center><h3>Confirm entry creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn=' . $arData['cn'] . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'inetOrgPerson', 'mozillaOrgPerson' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<?php
|
||||
foreach( $arDataDef as $arGroup) {
|
||||
foreach( $arGroup as $strId => $strName) {
|
||||
echo '<input type="hidden" name="attrs[]" value="' . $strId . '" />' . "\r\n";
|
||||
echo '<input type="hidden" name="vals[]" value="' . htmlspecialchars( $arData[$strId]) . '" />' . "\r\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<?php
|
||||
$strEven = 'even';
|
||||
foreach( $arDataDef as $strGroupName => $arGroup)
|
||||
{
|
||||
echo '<tr class=""><th colspan="2">' . $strGroupName . '</th></tr>';
|
||||
foreach( $arGroup as $strId => $strName)
|
||||
{
|
||||
echo '<tr class="' . $strEven . '">' . "\r\n";
|
||||
echo ' <td class="heading">' . $strName . ':</td>' . "\r\n";
|
||||
echo ' <td><b>' . htmlspecialchars( $arData[$strId] ) . '</b></td>' . "\r\n";
|
||||
echo '</tr>' . "\r\n";
|
||||
$strEven = $strEven == 'even' ? 'odd' : 'even';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<tr class="<?php echo $strEven; ?>">
|
||||
<td class="heading">Container:</td>
|
||||
<td><?php echo htmlspecialchars( $container ); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Address" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -1,131 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_nt_machine.php,v 1.14 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
// A little config for this template
|
||||
$default_gid_number = 30000;
|
||||
$default_acct_flags = '[W ]';
|
||||
$default_cn = 'Root User';
|
||||
$default_home_dir = '/dev/null';
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
if( get_schema_objectclass( $ldapserver, 'sambaAccount' ) == null )
|
||||
pla_error( "Your LDAP server does not have schema support for the sambaAccount objectClass. Cannot continue." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New Samba NT Machine</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="machine_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/server.png" /></td>
|
||||
<td class="heading">Machine Name:</td>
|
||||
<td><input type="text" name="machine_name" value="" /> <small>(hint: don't include "$" at the end)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">UID Number:</td>
|
||||
<td><input type="text" name="uid_number" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" size="40" name="container" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'machine_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" />
|
||||
<br /><br /><br /><br /><br /><br /></td>
|
||||
</tr>
|
||||
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
This will create a new NT machine with:<br />
|
||||
<small>
|
||||
<ul>
|
||||
<li>gidNumber <b><?php echo htmlspecialchars( $default_gid_number ); ?></b></li>
|
||||
<li>acctFlags <b><?php echo str_replace(' ', " ", htmlspecialchars($default_acct_flags)); ?></b></li>
|
||||
<li>cn <b><?php echo htmlspecialchars($default_cn); ?></b></li>
|
||||
<li>in container <b><?php echo htmlspecialchars( $container ); ?></b></li>
|
||||
</ul>
|
||||
To change these values, edit the template file:
|
||||
<code>templates/creation/new_nt_machine.php</code><br />
|
||||
Note: You must have the samba schema installed on your LDAP server.
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$machine_name = trim( $_POST['machine_name'] );
|
||||
$uid_number = trim( $_POST['uid_number'] );
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
?>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $machine_name . '$,' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'sambaAccount', 'posixAccount', 'account' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_gid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($machine_name . '$');?>" />
|
||||
<input type="hidden" name="attrs[]" value="rid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars( decoct($uid_number));?>" />
|
||||
<input type="hidden" name="attrs[]" value="acctFlags" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_acct_flags);?>" />
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_cn);?>" />
|
||||
<input type="hidden" name="attrs[]" value="homeDirectory" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_home_dir);?>" />
|
||||
|
||||
<center>
|
||||
Realy create this new Samba machine?<br />
|
||||
<br />
|
||||
<table class="confirm">
|
||||
<tr class="even"><td>Name</td><td><b><?php echo htmlspecialchars($machine_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>UID</td><td><b><?php echo htmlspecialchars($uid_number); ?></b></td></tr>
|
||||
<tr class="even"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Machine" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,240 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$verify = isset( $_POST['verify'] ) ? $_POST['verify'] : false;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
<center><h2>New Organizational Role<br />
|
||||
<small>(organizationalRole)</small></h2></center>
|
||||
<?php
|
||||
|
||||
if ( !$verify ) {
|
||||
|
||||
?>
|
||||
<form action="creation_template.php" method="post" name="or_form">
|
||||
<input type="hidden" name="verify" value="true" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="6" /></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/uid.png" /></td>
|
||||
<td class="heading">Role <acronym title="Common Name">CN</acronym>:</td>
|
||||
<td colspan="4"><input type="text" name="or_name" /> <span class="hint">(hint: don't include "cn=")</span></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="6" /></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/phone.png" /></td>
|
||||
<td class="heading">Phone:</td>
|
||||
<td><input type="text" name="phone" id="phone" /></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Fax:</td>
|
||||
<td><input type="text" name="fax" id="fax" /></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="6" /></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td class="heading">Comments:</td>
|
||||
<td colspan="4"><textarea cols="40" name="description" id="description"></textarea></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="6" /></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/object.png" /></td>
|
||||
<td class="heading">Occupant <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td colspan="4"><table class="browse"><tr><td>
|
||||
<input type="text" name="occupant" id="occupant" size="40" value="<?php echo htmlspecialchars( get_logged_in_dn($server_id) ); ?>" /></td><td><center><?php draw_chooser_link( 'or_form.occupant' ); ?></center></td></tr></table></td>
|
||||
</tr>
|
||||
<tr><th colspan="6"><b>Street Address</b></th></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/mail.png" /></td>
|
||||
<td class="heading">Address:</td>
|
||||
<td><input type="text" name="street1" id="street1" /></td>
|
||||
<td class="icon"><img src="images/locality.png" /></td>
|
||||
<td class="heading">City:</td>
|
||||
<td><input type="text" name="city" id="city" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><input type="text" name="street2" id="street2" /></td>
|
||||
<td></td>
|
||||
<td class="heading">State:</td>
|
||||
<td><input type="text" name="state" id="state" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="heading">ZIP:</td>
|
||||
<td><input type="text" name="zip" id="zip" /></td>
|
||||
</tr>
|
||||
<tr><th colspan="6"><b>Mailing Address</b></th></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/mail.png" /></td>
|
||||
<td class="heading">Address:</td>
|
||||
<td><input type="text" name="mail_street1" id="mail_street1" /></td>
|
||||
<td class="icon"><img src="images/locality.png" /></td>
|
||||
<td class="heading">City:</td>
|
||||
<td><input type="text" name="mail_city" id="mail_city" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><input type="text" name="mail_street2" id="mail_street2" /></td>
|
||||
<td></td>
|
||||
<td class="heading">State:</td>
|
||||
<td><input type="text" name="mail_state" id="mail_state" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="heading">ZIP:</td>
|
||||
<td><input type="text" name="mail_zip" id="mail_zip" /></td>
|
||||
</tr>
|
||||
<tr><th colspan="6"><b>Registered Mail Address</b></th></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/mail.png" /></td>
|
||||
<td class="heading">Address:</td>
|
||||
<td><input type="text" name="reg_street1" id="reg_street1" /></td>
|
||||
<td class="icon"><img src="images/locality.png" /></td>
|
||||
<td class="heading">City:</td>
|
||||
<td><input type="text" name="reg_city" id="reg_city" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><input type="text" name="reg_street2" id="reg_street2" /></td>
|
||||
<td></td>
|
||||
<td class="heading">State:</td>
|
||||
<td><input type="text" name="reg_state" id="reg_state" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="heading">ZIP:</td>
|
||||
<td><input type="text" name="reg_zip" id="reg_zip" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="6" /></tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/folder.png" /></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td colspan="4"><table class="browse"><tr><td><input type="text" name="container" id="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" /></td><td><center><?php draw_chooser_link( 'or_form.container' ); ?></center></td></tr></table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
} elseif ( $verify ) {
|
||||
|
||||
$or_name = trim( $_POST['or_name'] );
|
||||
$phone = trim( $_POST['phone'] );
|
||||
$fax = trim( $_POST['fax'] );
|
||||
$description = trim( $_POST['description'] );
|
||||
$occupant = trim( $_POST['occupant'] );
|
||||
$street1 = trim( $_POST['street1'] );
|
||||
$street2 = trim( $_POST['street2'] );
|
||||
$city = trim( $_POST['city'] );
|
||||
$state = trim( $_POST['state'] );
|
||||
$zip = trim( $_POST['zip'] );
|
||||
$mail_street1 = trim( $_POST['mail_street1'] );
|
||||
$mail_street2 = trim( $_POST['mail_street2'] );
|
||||
$mail_city = trim( $_POST['mail_city'] );
|
||||
$mail_state = trim( $_POST['mail_state'] );
|
||||
$mail_zip = trim( $_POST['mail_zip'] );
|
||||
$reg_street1 = trim( $_POST['reg_street1'] );
|
||||
$reg_street2 = trim( $_POST['reg_street2'] );
|
||||
$reg_city = trim( $_POST['reg_city'] );
|
||||
$reg_state = trim( $_POST['reg_state'] );
|
||||
$reg_zip = trim( $_POST['reg_zip'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
dn_exists( $ldapserver, $occupant ) or
|
||||
pla_error( "The occupant you specified (" . htmlspecialchars( $occupant ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
0 != strlen( $or_name ) or
|
||||
pla_error( "You cannot leave the Organization Name blank. Please go back and try again." );
|
||||
|
||||
?>
|
||||
<center><h3>Confirm entry creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn=' . $or_name . ',' . $container ); ?>" />
|
||||
<!-- objectClasses -->
|
||||
<?php
|
||||
$object_classes = rawurlencode( serialize( array( 'organizationalRole' ) ) );
|
||||
?>
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($or_name); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="telephoneNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($phone); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="facsimileTelephoneNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($fax); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="description" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($description); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="roleOccupant" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($occupant); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="street" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars( $street1 . ((!empty($street2))?'$'.$street2:'') ); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="l" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($city); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="st" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($state); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="postalCode" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($zip); ?>" />
|
||||
<input type="hidden" name="attrs[]" value="postalAddress" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo (!empty($mail_street1)) ? htmlspecialchars( $mail_street1 . ((!empty($mail_street2))?'$'.$mail_street2:'') . ((!empty($mail_city)||!empty($mail_state)||!empty($mail_zip))?'$':'') . ((!empty($mail_city))?$mail_city:'') . ((!empty($mail_state))?', '.$mail_state:'') . ((!empty($mail_zip))?' '.$mail_zip:'') ) : '' ?>" />
|
||||
<input type="hidden" name="attrs[]" value="registeredAddress" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo (!empty($reg_street1)) ? htmlspecialchars( $reg_street1 . ((!empty($reg_street2))?'$'.$reg_street2:'') . ((!empty($reg_city)||!empty($reg_state)||!empty($reg_zip))?'$':'') . ((!empty($reg_city))?$reg_city:'') . ((!empty($reg_state))?', '.$reg_state:'') . ((!empty($reg_zip))?' '.$reg_zip:'') ) : '' ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Role <acronym title="Common Name">CN</acronym>:</td><td><b><?php echo htmlspecialchars($or_name); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Phone:</td><td><?php echo htmlspecialchars($phone); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Fax:</td><td><?php echo htmlspecialchars($fax); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Comments:</td><td><?php echo htmlspecialchars($description); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Occupant <acronym title="Distinguished Name">DN</acronym>:</td><td><?php echo htmlspecialchars($occupant); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Street:</td><td><?php echo htmlspecialchars($street1) . ((!empty($street2))?'<br />'.htmlspecialchars($street2):''); ?></td></tr>
|
||||
<tr class="even"><td class="heading">City:</td><td><?php echo htmlspecialchars($city); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">State:</td><td><?php echo htmlspecialchars($state); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Mailing Address:</td><td><?php echo (!empty($mail_street1)) ? htmlspecialchars($mail_street1) . ((!empty($mail_street2))?'<br />'.htmlspecialchars($mail_street2):'') . ((!empty($mail_city)||!empty($mail_state)||!empty($mail_zip))?'<br />':'') . ((!empty($mail_city))?htmlspecialchars($mail_city):'') . ((!empty($mail_state))?', '.htmlspecialchars($mail_state):'') . ((!empty($mail_zip))?' '.htmlspecialchars($mail_zip):'') : '' ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Registered Address:</td><td><?php echo (!empty($reg_street1)) ? htmlspecialchars($reg_street1) . ((!empty($reg_street2))?'<br />'.htmlspecialchars($reg_street2):'') . ((!empty($reg_city)||!empty($reg_state)||!empty($reg_zip))?'<br />':'') . ((!empty($reg_city))?htmlspecialchars($reg_city):'') . ((!empty($reg_state))?', '.htmlspecialchars($reg_state):'') . ((!empty($reg_zip))?' '.htmlspecialchars($reg_zip):'') : '' ?></td></tr>
|
||||
<tr class="even"><td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td><td><?php echo htmlspecialchars($container); ?></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Organizational Role" />
|
||||
</center>
|
||||
<?php
|
||||
}
|
||||
?>
|
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_ou_template.php,v 1.12 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template: which step of the ou creation process are we on
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New Organizational Unit</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="ou_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><acronym title="Organizational Unit">OU</acronym> Name:</td>
|
||||
<td><input type="text" name="ou_name" value="" /> <small>(hint: don't include "ou=")</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'ou_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="<?php echo $lang['proceed_gt']; ?>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$ou_name = trim( $_POST['ou_name'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
?>
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'ou=' . $ou_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'organizationalUnit' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="ou" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($ou_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
|
||||
<center>
|
||||
Really create this new <acronym title="Organizational Unit">OU</acronym>?<br />
|
||||
<br />
|
||||
|
||||
<table class="confirm">
|
||||
<tr class="even"><td>Name</td><td><b><?php echo htmlspecialchars($ou_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create OU" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
||||
|
@@ -1,120 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_posix_group_template.php,v 1.10 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Change this to suit your needs
|
||||
$default_number_of_users = 10;
|
||||
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New Posix Group</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="posix_group_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Posix Group Name:</td>
|
||||
<td><input type="text" name="posix_group_name" value="" /> <small>(example: MyGroup, do not include "cn=")</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><acronym title="Group Identification">GID</acronym> Number:</td>
|
||||
<td><input type="text" name="gid_number" value="" /> <small>(example: 2000)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'posix_group_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading" style="vertical-align:top">Users:</td>
|
||||
<td>
|
||||
<?php for( $i=0; $i<=$default_number_of_users; $i++ ) { ?>
|
||||
<input type="text" name="member_uids[<?php echo $i; ?>]" id="member_uids_<?php echo $i; ?>" value="" /><?php draw_chooser_link( "posix_group_form.member_uids_$i", false ); ?><br />
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$group_name = trim( $_POST['posix_group_name'] );
|
||||
$group_name or pla_error( "You left the group name blank. Please go back and give the group a name." );
|
||||
$container = trim( $_POST['container'] );
|
||||
$container or pla_error( "You left the container DN blank. Please go back and give the group a container DN." );
|
||||
$gid_number = trim( $_POST['gid_number'] );
|
||||
$gid_number or pla_error( "You left the group GID Number blank. Please go back and give the group a GID Number." );
|
||||
$uids = $_POST['member_uids'];
|
||||
$member_uids = array();
|
||||
foreach( $uids as $uid )
|
||||
if( '' != trim( $uid ) && ! in_array( $uid, $member_uids ) )
|
||||
$member_uids[] = $uid;
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
?>
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn='.$group_name.','.$container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'posixGroup' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($group_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($gid_number);?>" />
|
||||
<?php foreach( $member_uids as $uid ) { ?>
|
||||
<input type="hidden" name="attrs[]" value="memberUid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid);?>" />
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
Really create this new Posix Group entry?<br />
|
||||
<br />
|
||||
|
||||
<table class="confirm">
|
||||
<tr class="even"><td>Name</td><td><b><?php echo htmlspecialchars($group_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
<tr class="even"><td>gidNumber</td><td><b><?php echo htmlspecialchars( $gid_number ); ?></b></td></tr>
|
||||
<tr class="odd"><td>Member UIDs</td><td><b>
|
||||
<?php foreach( $member_uids as $i => $uid )
|
||||
echo htmlspecialchars($uid) . "<br />"; ?>
|
||||
</b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Group" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
@@ -1,169 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_postfix_account_template.php,v 1.2 2004/10/28 13:37:40 uugdave Exp $
|
||||
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "ou=Addresses";
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New Postfix Mail Account<br />
|
||||
<small>(CourierMailAccount)</small></h2>
|
||||
</center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="address_form" name="address_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td width="32"><img src="images/uid.png" /></td>
|
||||
<td class="heading">uid:</td>
|
||||
<td><input type="text" name="uid" id="uid" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Home Directory:</td>
|
||||
<td><input type="text" name="home_directory" id="home_directory" value="/home/" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Mailbox:</td>
|
||||
<td><input type="text" name="mailbox" id="mailbox" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td width="32"><img src="images/mail.png" /></td>
|
||||
<td class="heading">Email:</td>
|
||||
<td><input type="text" name="email_address" id="email_address2" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/lock.png" /></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_pass1" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_pass2" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Encryption:</td>
|
||||
<td><select name="encryption">
|
||||
<option>clear</option>
|
||||
<option>md5</option>
|
||||
<option>smd5</option>
|
||||
<option>crypt</option>
|
||||
<option>sha</option>
|
||||
<option>ssha</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'address_form.container' ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center"><br /><input type="submit" value="Proceed >>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$uid = trim( $_POST['uid'] );
|
||||
$home_directory = trim( $_POST['home_directory'] );
|
||||
$mailbox = trim( $_POST['mailbox'] );
|
||||
$email_address = trim( $_POST['email_address'] );
|
||||
$password1 = $_POST['user_pass1'];
|
||||
$password2 = $_POST['user_pass2'];
|
||||
$encryption = $_POST['encryption'];
|
||||
$container = trim( $_POST['container'] );
|
||||
|
||||
/* Critical assertions */
|
||||
$password1 == $password2 or
|
||||
pla_error( "Your passwords don't match. Please go back and try again." );
|
||||
|
||||
$password = password_hash( $password1, $encryption );
|
||||
?>
|
||||
<center><h3>Confirm entry creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $uid . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'courierMailAccount' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid);?>" />
|
||||
<input type="hidden" name="attrs[]" value="homeDirectory" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($home_directory);?>" />
|
||||
<input type="hidden" name="attrs[]" value="mailbox" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($mailbox);?>" />
|
||||
<input type="hidden" name="attrs[]" value="mail" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($email_address);?>" />
|
||||
<input type="hidden" name="attrs[]" value="userPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($password);?>" />
|
||||
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even">
|
||||
<td class="heading">uid:</td>
|
||||
<td><?php echo htmlspecialchars( $uid ); ?></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Home Directory:</td>
|
||||
<td><?php echo htmlspecialchars( $home_directory ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">Mailbox:</td>
|
||||
<td><?php echo htmlspecialchars( $mailbox ); ?></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Email:</td>
|
||||
<td><?php echo htmlspecialchars( $email_address ); ?></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td class="heading">Password:</td>
|
||||
<td>[secret]</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td class="heading">Container:</td>
|
||||
<td><?php echo htmlspecialchars( $container ); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Address" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Change this to suit your needs
|
||||
$default_number_of_users = 10;
|
||||
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<center><h2>New Postfix Alias</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="posix_group_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'posix_group_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Mail:</td>
|
||||
<td><input type="text" name="mail" id="mail" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Maildrop:</td>
|
||||
<td><input type="text" name="maildrop" id="maildrop" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$container = trim( $_POST['container'] );
|
||||
$mail = trim( $_POST['mail'] );
|
||||
$maildrop = trim( $_POST['maildrop'] );
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
?>
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'mail='.$mail.','.$container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'couriermailalias' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="mail" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($mail);?>" />
|
||||
<input type="hidden" name="attrs[]" value="maildrop" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($maildrop);?>" />
|
||||
|
||||
|
||||
<center>
|
||||
Really create this new Alias entry?<br />
|
||||
<br />
|
||||
|
||||
<table class="confirm">
|
||||
<tr class="odd"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
<tr class="even"><td>mail</td><td><b><?php echo htmlspecialchars( $mail ); ?></b></td></tr>
|
||||
<tr class="odd"><td>maildrop</td><td><b><?php echo htmlspecialchars( $maildrop ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Alias" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
@@ -1,173 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_security_object_template.php,v 1.5 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "ou=server";
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Unique to this template
|
||||
$step = isset( $_POST['step'] ) ? $_POST['step'] : 1;
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
/*
|
||||
* Pipulates the user name field based on the first letter
|
||||
* of the firsr name concatenated with the last name
|
||||
* all in lower case.
|
||||
*/
|
||||
function autoFillUserName( form )
|
||||
{
|
||||
var first_name;
|
||||
var last_name;
|
||||
var user_name;
|
||||
|
||||
first_name = form.first_name.value.toLowerCase();
|
||||
last_name = form.last_name.value.toLowerCase();
|
||||
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
user_name = first_name.substr( 0,1 ) + last_name;
|
||||
form.user_name.value = user_name;
|
||||
autoFillHomeDir( form );
|
||||
}
|
||||
|
||||
/*
|
||||
* Pipulates the home directory field based on the username provided
|
||||
*/
|
||||
function autoFillHomeDir( form )
|
||||
{
|
||||
var user_name;
|
||||
var hime_dir;
|
||||
|
||||
user_name = form.user_name.value.toLowerCase();
|
||||
|
||||
home_dir = '/home/';
|
||||
home_dir += user_name;
|
||||
|
||||
form.home_dir.value = home_dir;
|
||||
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center><h2>New Security Object</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="user_form" name="user_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo $_POST['template']; ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/uid.png" /></td>
|
||||
<td class="heading">User name:</td>
|
||||
<td><input type="text" name="user_name" id="user_name" value=""
|
||||
onChange="autoFillHomeDir(this.form)" onExit="autoFillHomeDir(this.form)" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/lock.png" /></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_pass1" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_pass2" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Encryption:</td>
|
||||
<td><select name="encryption">
|
||||
<option>clear</option>
|
||||
<option>md5</option>
|
||||
<option>crypt</option>
|
||||
<option>sha</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'user_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$user_name = trim( stripslashes( $_POST['user_name'] ) );
|
||||
// $first_name = trim( stripslashes( $_POST['first_name'] ) );
|
||||
// $last_name = trim( stripslashes( $_POST['last_name'] ) );
|
||||
$password1 = stripslashes( $_POST['user_pass1'] );
|
||||
$password2 = stripslashes( $_POST['user_pass2'] );
|
||||
$encryption = stripslashes( $_POST['encryption'] );
|
||||
// $login_shell = trim( stripslashes( $_POST['login_shell'] ) );
|
||||
// $uid_number = trim( stripslashes( $_POST['uid_number'] ) );
|
||||
// $gid_number = trim( stripslashes( $_POST['group'] ) );
|
||||
$container = trim( stripslashes( $_POST['container'] ) );
|
||||
// $home_dir = trim( stripslashes( $_POST['home_dir'] ) );
|
||||
|
||||
/* Critical assertions */
|
||||
$password1 == $password2 or
|
||||
pla_error( "Your passwords don't match. Please go back and try again." );
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
$password = password_hash( $password1, $encryption );
|
||||
|
||||
?>
|
||||
<center><h3>Confirm account creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $user_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'account','simpleSecurityObject' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($user_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="userPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($password);?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">User name:</td><td><b><?php echo htmlspecialchars( $user_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Password:</td><td>[secret]</td></tr>
|
||||
<tr class="odd"><td class="heading">Container:</td><td><?php echo htmlspecialchars( $container ); ?></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Account" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,169 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_POST['container'] ) ? $_POST['container'] : null;
|
||||
$server_id = isset( $_POST['server_id'] ) ? $_POST['server_id'] : false;
|
||||
|
||||
// Modify this array and add/remove the corresponding attributes below
|
||||
$object_classes = array( 'top', 'sendmailMTAAliasObject' );
|
||||
|
||||
// Get default cluster from container
|
||||
$dn_array = ldap_explode_dn($container, 0);
|
||||
$cluster_name = "";
|
||||
$host_name = "";
|
||||
foreach ($dn_array as $attr) {
|
||||
if (preg_match('/(.+)=(.+)/', $attr, $match)) {
|
||||
$attr = $match[1];
|
||||
$value = $match[2];
|
||||
|
||||
if (preg_match('/Cluster/i', $attr)) {
|
||||
$cluster_name = $value;
|
||||
}
|
||||
if (preg_match('/Host/i', $attr)) {
|
||||
$host_name = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
"sendmailMTAAliasGrouping" => "aliases"
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<?php if ($step == 1) { ?>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px">New Sendmail Alias</h2>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<form action="creation_template.php" method="post" name="sendmail_alias_form">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/object.png" /></td>
|
||||
<td class="heading">Sendmail cluster name:</td>
|
||||
<td><input type="text" name="sendmailMTACluster" id="sendmailMTACluster" value="<?php echo $cluster_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Sendmail host name:</td>
|
||||
<td><input type="text" name="sendmailMTAHost" id="sendmailMTAHost" value="<?php echo $host_name; ?>" /><small><i>Leave blank</i></small></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/mail.png" /></td>
|
||||
<td class="heading">Email alias:</td>
|
||||
<td><input type="text" name="sendmailMTAKey" id="sendmailMTAKey" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Recipient addresses:</td>
|
||||
<td><textarea name="sendmailMTAAliasValue" id="sendmailMTAAliasValue"></textarea></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'sendmail_alias_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $_REQUEST['sendmailMTACluster'] ) && ! trim($_REQUEST['sendmailMTAHost'])) {
|
||||
pla_error("Either Cluster name or Host name need to be specified.");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAKey']) ) {
|
||||
pla_error("Email alias is blank and must be specified");
|
||||
}
|
||||
|
||||
if (!trim($_REQUEST['sendmailMTAAliasValue']) ) {
|
||||
pla_error("Recipient address is blank and must be specified");
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm sendmail domain creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>"\>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'sendmailMTAKey=' . $_REQUEST['sendmailMTAKey'] ) . "," . $_REQUEST['container']; ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTACluster" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTACluster']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAHost" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAHost']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAKey" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAKey']);?>" />
|
||||
|
||||
<?php
|
||||
$values = preg_split('/\s+/', $_REQUEST['sendmailMTAAliasValue']);
|
||||
foreach ($values as $value) {
|
||||
?>
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAAliasValue" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($value);?>" />
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Sendmail cluster name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTACluster'] ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Sendmail host name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAHost'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Email alias:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAKey'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Recipient addresses:</td><td><b>
|
||||
<?php
|
||||
$values = preg_split('/\s+/m', $_REQUEST['sendmailMTAAliasValue']);
|
||||
foreach ($values as $value) {
|
||||
|
||||
echo htmlspecialchars( $value ) . "<br>\n";
|
||||
} ?>
|
||||
</b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Alias" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,118 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_POST['container'] ) ? $_POST['container'] : null;
|
||||
$server_id = isset( $_POST['server_id'] ) ? $_POST['server_id'] : false;
|
||||
|
||||
// Modify this array and add/remove the corresponding attributes below
|
||||
$object_classes = array( 'top', 'sendmailMTA' );
|
||||
|
||||
// Get default cluster from container
|
||||
$dn_array = ldap_explode_dn($container, 0);
|
||||
$cluster_name = "";
|
||||
$host_name = "";
|
||||
foreach ($dn_array as $attr) {
|
||||
if (preg_match('/(.+)=(.+)/', $attr, $match)) {
|
||||
$attr = $match[1];
|
||||
$value = $match[2];
|
||||
|
||||
if (preg_match('/Cluster/i', $attr)) {
|
||||
$cluster_name = $value;
|
||||
}
|
||||
if (preg_match('/Host/i', $attr)) {
|
||||
$host_name = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<?php if ($step == 1) { ?>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px">New Sendmail Cluster</h2>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<form action="creation_template.php" method="post" name="sendmail_cluster_form">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/object.png" /></td>
|
||||
<td class="heading">Sendmail cluster name:</td>
|
||||
<td><input type="text" name="sendmailMTACluster" id="sendmailMTACluster" value="<?php echo $cluster_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'sendmail_cluster_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $_REQUEST['sendmailMTACluster'] ) ) {
|
||||
pla_error("Cluster name must be specified.");
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm sendmail domain creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>"\>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'sendmailMTACluster=' . $_REQUEST['sendmailMTACluster'] ) . "," . $_REQUEST['container']; ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTACluster" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTACluster']);?>" />
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Sendmail cluster name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTACluster'] ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Cluster" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,141 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_POST['container'] ) ? $_POST['container'] : null;
|
||||
$server_id = isset( $_POST['server_id'] ) ? $_POST['server_id'] : false;
|
||||
|
||||
// Modify this array and add/remove the corresponding attributes below
|
||||
$object_classes = array( 'top', 'sendmailMTAClass' );
|
||||
|
||||
// Get default cluster from container
|
||||
$dn_array = ldap_explode_dn($container, 0);
|
||||
$cluster_name = "";
|
||||
$host_name = "";
|
||||
foreach ($dn_array as $attr) {
|
||||
if (preg_match('/(.+)=(.+)/', $attr, $match)) {
|
||||
$attr = $match[1];
|
||||
$value = $match[2];
|
||||
|
||||
if (preg_match('/Cluster/i', $attr)) {
|
||||
$cluster_name = $value;
|
||||
}
|
||||
if (preg_match('/Host/i', $attr)) {
|
||||
$host_name = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
'sendmailMTAClassName' => 'w',
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<?php if ($step == 1) { ?>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px">New Sendmail Domain</h2>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<form action="creation_template.php" method="post" name="sendmail_domain_form">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/object.png" /></td>
|
||||
<td class="heading">Sendmail cluster name:</td>
|
||||
<td><input type="text" name="sendmailMTACluster" id="sendmailMTACluster" value="<?php echo $cluster_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Sendmail host name:</td>
|
||||
<td><input type="text" name="sendmailMTAHost" id="sendmailMTAHost" value="<?php echo $host_name; ?>" /><small><i>Leave blank</i></small></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/mail.png" /></td>
|
||||
<td class="heading">Email domain:</td>
|
||||
<td><input type="text" name="sendmailMTAClassValue" id="sendmailMTAClassValue" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'sendmail_domain_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $_REQUEST['sendmailMTACluster'] ) && ! trim($_REQUEST['sendmailMTAHost'])) {
|
||||
pla_error("Either Cluster name or Host name need to be specified");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAClassValue']) ) {
|
||||
pla_error("Email domain is blank and must be specified");
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm sendmail domain creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>"\>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'sendmailMTAClassValue=' . $_REQUEST['sendmailMTAClassValue'] ) . "," . $_REQUEST['container']; ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTACluster" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTACluster']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAHost" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAHost']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAClassValue" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAClassValue']);?>" />
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Sendmail cluster name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTACluster'] ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Sendmail host name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAHost'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Email domain:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAClassValue'] ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Domain" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,213 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_POST['container'] ) ? $_POST['container'] : null;
|
||||
$server_id = isset( $_POST['server_id'] ) ? $_POST['server_id'] : false;
|
||||
|
||||
// Modify this array and add/remove the corresponding attributes below
|
||||
$object_classes = array( 'top', 'sendmailMTAMapObject' );
|
||||
|
||||
// Get default cluster from container
|
||||
$dn_array = ldap_explode_dn($container, 0);
|
||||
$cluster_name = "";
|
||||
$host_name = "";
|
||||
foreach ($dn_array as $attr) {
|
||||
if (preg_match('/(.+)=(.+)/', $attr, $match)) {
|
||||
$attr = $match[1];
|
||||
$value = $match[2];
|
||||
|
||||
if (preg_match('/Cluster/i', $attr)) {
|
||||
$cluster_name = $value;
|
||||
}
|
||||
if (preg_match('/Host/i', $attr)) {
|
||||
$host_name = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
'sendmailMTAMapName' => 'access',
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<?php if ($step == 1) { ?>
|
||||
|
||||
<script>
|
||||
function enableErrorEntry() {
|
||||
oError = document.getElementById('custom_error');
|
||||
|
||||
oError.disabled = false;
|
||||
}
|
||||
function disableErrorEntry() {
|
||||
oError = document.getElementById('custom_error');
|
||||
|
||||
oError.disabled = true;
|
||||
}
|
||||
|
||||
function setErrorEntry(oSelect) {
|
||||
sValue = oSelect.options[oSelect.selectedIndex].value;
|
||||
|
||||
if (sValue == "ERROR") {
|
||||
enableErrorEntry();
|
||||
} else {
|
||||
disableErrorEntry();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px">New Sendmail Relay</h2>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<form action="creation_template.php" method="post" name="sendmail_relay_form">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/object.png" /></td>
|
||||
<td class="heading">Sendmail cluster name:</td>
|
||||
<td><input type="text" name="sendmailMTACluster" id="sendmailMTACluster" value="<?php echo $cluster_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Sendmail host name:</td>
|
||||
<td><input type="text" name="sendmailMTAHost" id="sendmailMTAHost" value="<?php echo $host_name; ?>" /><small><i>Leave blank</i></small></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/server.png" /></td>
|
||||
<td class="heading">Host/Network/Address:</td>
|
||||
<td><input type="text" name="sendmailMTAKey" id="sendmailMTAKey" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Relay control:</td>
|
||||
<td>
|
||||
<select name="sendmailMTAMapValue" id="sendmailMTAMapValue" onchange="setErrorEntry(this);">
|
||||
<option value=""></option>
|
||||
<option value="RELAY">RELAY: Allow host/network/address to relay</option>
|
||||
<option value="OK">OK: Accept local mail but disallow relay</option>
|
||||
<option value="REJECT">REJECT: Reject messages</option>
|
||||
<option value="DISCARD">DISCARD: Discard messages</option>
|
||||
<option value="SKIP">SKIP: Apply default action to messages</option>
|
||||
<option value="ERROR">ERROR: Reject message with custom error</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Custom error</td>
|
||||
<td><input type="text" name="custom_error" id="custom_error" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'sendmail_relay_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Set custom error as enabled or disabled
|
||||
oSelect = document.getElementById("sendmailMTAMapValue");
|
||||
setErrorEntry(oSelect);
|
||||
</script>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $_REQUEST['sendmailMTACluster'] ) && ! trim($_REQUEST['sendmailMTAHost'])) {
|
||||
pla_error("Either Cluster name or Host name need to be specified");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAKey']) ) {
|
||||
pla_error("The Host/Network/Address is blank and must be specified");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAMapValue']) ) {
|
||||
pla_error("The relay control is blank and must be specified");
|
||||
}
|
||||
|
||||
if (!trim($_REQUEST['sendmailMTAMapValue']) == "ERROR" || ! trim($_REQUEST['custom_error'])) {
|
||||
pla_error("When specifying ERROR you must enter a custom error message");
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm sendmail domain creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>"\>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'sendmailMTAKey=' . $_REQUEST['sendmailMTAKey'] ) . "," . $_REQUEST['container']; ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTACluster" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTACluster']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAHost" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAHost']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAKey" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAKey']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAMapValue" />
|
||||
|
||||
<?php
|
||||
if ($_REQUEST['sendmailMTAMapValue'] == 'ERROR') {
|
||||
// we need to create map value using custom_error
|
||||
$map_value = "ERROR:" . $_REQUEST['custom_error'];
|
||||
} else {
|
||||
$map_value = $_REQUEST['sendmailMTAMapValue'];
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="hidden" name="vals[]" value="<?php echo $map_value; ?>" />
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Sendmail cluster name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTACluster'] ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Sendmail host name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAHost'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Host/Network/Address:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAKey'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Relay Control:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAMapValue'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Custom error:</td><td><b><?php echo htmlspecialchars( $_REQUEST['custom_error'] ); ?></b></td></tr>
|
||||
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Relay" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,141 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_POST['container'] ) ? $_POST['container'] : null;
|
||||
$server_id = isset( $_POST['server_id'] ) ? $_POST['server_id'] : false;
|
||||
|
||||
// Modify this array and add/remove the corresponding attributes below
|
||||
$object_classes = array( 'top', 'sendmailMTAClass' );
|
||||
|
||||
// Get default cluster from container
|
||||
$dn_array = ldap_explode_dn($container, 0);
|
||||
$cluster_name = "";
|
||||
$host_name = "";
|
||||
foreach ($dn_array as $attr) {
|
||||
if (preg_match('/(.+)=(.+)/', $attr, $match)) {
|
||||
$attr = $match[1];
|
||||
$value = $match[2];
|
||||
|
||||
if (preg_match('/Cluster/i', $attr)) {
|
||||
$cluster_name = $value;
|
||||
}
|
||||
if (preg_match('/Host/i', $attr)) {
|
||||
$host_name = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
'sendmailMTAClassName' => 'VirtHost',
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<?php if ($step == 1) { ?>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px">New Sendmail Virtual Domain</h2>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<form action="creation_template.php" method="post" name="sendmail_virthost_form">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/object.png" /></td>
|
||||
<td class="heading">Sendmail cluster name:</td>
|
||||
<td><input type="text" name="sendmailMTACluster" id="sendmailMTACluster" value="<?php echo $cluster_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Sendmail host name:</td>
|
||||
<td><input type="text" name="sendmailMTAHost" id="sendmailMTAHost" value="<?php echo $host_name; ?>" /><small><i>Leave blank</i></small></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Virtual email domain:</td>
|
||||
<td><input type="text" name="sendmailMTAClassValue" id="sendmailMTAClassValue" value="" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'sendmail_virthost_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $_REQUEST['sendmailMTACluster'] ) && ! trim($_REQUEST['sendmailMTAHost'])) {
|
||||
pla_error("Either Cluster name or Host name need to be specified.");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAClassValue']) ) {
|
||||
pla_error("Virtual email domain is blank and must be specified");
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm sendmail domain creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>"\>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'sendmailMTAClassValue=' . $_REQUEST['sendmailMTAClassValue'] ) . "," . $_REQUEST['container']; ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTACluster" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTACluster']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAHost" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAHost']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAClassValue" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAClassValue']);?>" />
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Sendmail cluster name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTACluster'] ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Sendmail host name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAHost'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Email domain:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAClassValue'] ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Virtual Domain" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,153 +0,0 @@
|
||||
<?php
|
||||
|
||||
// customize this to your needs
|
||||
$default_container = "";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_POST['container'] ) ? $_POST['container'] : null;
|
||||
$server_id = isset( $_POST['server_id'] ) ? $_POST['server_id'] : false;
|
||||
|
||||
// Modify this array and add/remove the corresponding attributes below
|
||||
$object_classes = array( 'top', 'sendmailMTAMapObject' );
|
||||
|
||||
// Get default cluster from container
|
||||
$dn_array = ldap_explode_dn($container, 0);
|
||||
$cluster_name = "";
|
||||
$host_name = "";
|
||||
foreach ($dn_array as $attr) {
|
||||
if (preg_match('/(.+)=(.+)/', $attr, $match)) {
|
||||
$attr = $match[1];
|
||||
$value = $match[2];
|
||||
|
||||
if (preg_match('/Cluster/i', $attr)) {
|
||||
$cluster_name = $value;
|
||||
}
|
||||
if (preg_match('/Host/i', $attr)) {
|
||||
$host_name = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
'sendmailMTAMapName' => 'virtuser',
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<?php if ($step == 1) { ?>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px">New Sendmail Virtual User</h2>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<form action="creation_template.php" method="post" name="sendmail_virtuser_form">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/object.png" /></td>
|
||||
<td class="heading">Sendmail cluster name:</td>
|
||||
<td><input type="text" name="sendmailMTACluster" id="sendmailMTACluster" value="<?php echo $cluster_name; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Sendmail host name:</td>
|
||||
<td><input type="text" name="sendmailMTAHost" id="sendmailMTAHost" value="<?php echo $host_name; ?>" /><small><i>Leave blank</i></small></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/mail.png" /></td>
|
||||
<td class="heading">Virtual email address:</td>
|
||||
<td><input type="text" name="sendmailMTAKey" id="sendmailMTAKey" value="" /><small><i>use @domain.com to map entire domain</i></small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Recipient address:</td>
|
||||
<td><input type="text" name="sendmailMTAMapValue" id="sendmailMTAMapValue" value="" /><small><i>use %1 to map user name port of address</i></small></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['container']; ?></td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'sendmail_virtuser_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $_REQUEST['sendmailMTACluster'] ) && ! trim($_REQUEST['sendmailMTAHost'])) {
|
||||
pla_error("Either Cluster name or Host name need to be specified");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAKey']) ) {
|
||||
pla_error("Virtual email address is blank and must be specified");
|
||||
}
|
||||
if (!trim($_REQUEST['sendmailMTAMapValue']) ) {
|
||||
pla_error("Recipient address is blank and must be specified");
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm sendmail domain creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="step" value="<?php echo $step + 1; ?>"\>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'sendmailMTAKey=' . $_REQUEST['sendmailMTAKey'] ) . "," . $_REQUEST['container']; ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTACluster" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTACluster']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAHost" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAHost']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAKey" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAKey']);?>" />
|
||||
|
||||
<input type="hidden" name="attrs[]" value="sendmailMTAMapValue" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($_REQUEST['sendmailMTAMapValue']);?>" />
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">Sendmail cluster name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTACluster'] ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Sendmail host name:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAHost'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Virtual email address:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAKey'] ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Recipient email address:</td><td><b><?php echo htmlspecialchars( $_REQUEST['sendmailMTAMapValue'] ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Virtual User" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,156 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_smb3_nt_machine.php,v 1.8 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
// Common to all templates
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
// get the available domains (see template_connfig.php for customization)
|
||||
$samba3_domains = get_samba3_domains();
|
||||
|
||||
$default_gid_number = 30000;
|
||||
$default_acct_flags = '[W ]';
|
||||
$default_home_dir = '/dev/null';
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
if( get_schema_objectclass( $ldapserver, 'sambaSamAccount' ) == null )
|
||||
pla_error( "Your LDAP server does not have schema support for the sambaSamAccount objectClass. Cannot continue." );
|
||||
|
||||
?>
|
||||
<script language="javascript">
|
||||
|
||||
function autoFillSambaRID( form ){
|
||||
var sambaSID;
|
||||
var uidNumber;
|
||||
|
||||
uidNumber = form.uid_number.value;
|
||||
sambaSID = (2 * uidNumber) + 1000;
|
||||
|
||||
form.samba3_rid.value = sambaSID;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<center><h2>New Samba 3 NT Machine</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="machine_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/server.png" /></td>
|
||||
<td class="heading">Machine Name:</td>
|
||||
<td><input type="text" name="machine_name" value="" /> <small>(hint: don't include "$" at the end)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">UID Number:</td>
|
||||
<td><input type="text" name="uid_number" value="" onChange="autoFillSambaRID(this.form);" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Sanba Sid:</td>
|
||||
<td><select name="samba3_domain_sid">
|
||||
<?php foreach($samba3_domains as $samba3_domain) ?>
|
||||
<option value="<?php echo $samba3_domain['sid'] ?>"><?php echo $samba3_domain['sid'] ?></option>
|
||||
</select> - <input type="text" name="samba3_rid" id="samba3_rid" value="" size="7"/></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" size="40" name="container" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'machine_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center"><br /><input type="submit" value="Proceed >>" />
|
||||
<br /><br /><br /><br /><br /><br /></td>
|
||||
</tr>
|
||||
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
This will create a new NT machine with:<br />
|
||||
<small>
|
||||
<ul>
|
||||
<li>gidNumber <b><?php echo htmlspecialchars( $default_gid_number ); ?></b></li>
|
||||
<li>acctFlags <b><?php echo str_replace(' ', " ", htmlspecialchars($default_acct_flags)); ?></b></li>
|
||||
<li>in container <b><?php echo htmlspecialchars( $container ); ?></b></li>
|
||||
</ul>
|
||||
To change these values, edit the template file:
|
||||
<code>templates/creation/new_nt_machine.php</code><br />
|
||||
Note: You must have the samba schema installed on your LDAP server.
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$machine_name = trim( $_POST['machine_name'] );
|
||||
$uid_number = trim( $_POST['uid_number'] );
|
||||
$samba3_domain_sid = trim( $_POST['samba3_domain_sid'] );
|
||||
$samba3_computer_rid = trim( $_POST['samba3_rid'] );
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
?>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $machine_name . '$,' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'sambaSamAccount', 'posixAccount', 'account' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_gid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($machine_name . '$');?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaSid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($samba3_domain_sid."-".$samba3_computer_rid);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaAcctFlags" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_acct_flags);?>" />
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($machine_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="homeDirectory" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_home_dir);?>" />
|
||||
|
||||
<center>
|
||||
Realy create this new Samba machine?<br />
|
||||
<br />
|
||||
<table class="confirm">
|
||||
<tr class="even"><td>Name</td><td><b><?php echo htmlspecialchars($machine_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>UID number</td><td><b><?php echo htmlspecialchars($uid_number); ?></b></td></tr>
|
||||
<tr class="even"><td>SambaSid</td><td><b><?php echo htmlspecialchars($samba3_domain_sid."-".$samba3_computer_rid); ?></b></td></tr>
|
||||
<tr class="odd"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Machine" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,473 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_smb3_user_template.php,v 1.25 2005/09/23 13:43:55 wurley Exp $
|
||||
|
||||
$samba3_domains = get_samba3_domains();
|
||||
|
||||
$default_container = "ou=Users";
|
||||
$default_home = "/home";
|
||||
|
||||
// Common to all templates
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
$now = time();
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
//check if the sambaSamAccount objectClass is availaible
|
||||
if( get_schema_objectclass( $ldapserver, 'sambaSamAccount' ) == null )
|
||||
pla_error( "Your LDAP server does not have schema support for the sambaSamAccount objectClass. Cannot continue." );
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
function autoFillUserName( form ) {
|
||||
var first_name;
|
||||
var last_name;
|
||||
var user_name;
|
||||
|
||||
first_name = form.first_name.value.toLowerCase();
|
||||
last_name = form.last_name.value.toLowerCase();
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
user_name = first_name.substr( 0,1 ) + last_name;
|
||||
form.user_name.value = user_name;
|
||||
autoFillHomeDir( form );
|
||||
}
|
||||
function autoFillHomeDir( form ){
|
||||
var user_name;
|
||||
var home_dir;
|
||||
|
||||
user_name = form.user_name.value.toLowerCase();
|
||||
|
||||
home_dir = '<?php echo $default_home; ?>/';
|
||||
home_dir += user_name;
|
||||
form.home_dir.value = home_dir;
|
||||
}
|
||||
function autoFillSambaRID( form ){
|
||||
var sambaRID;
|
||||
var uidNumber;
|
||||
|
||||
//check if the UID Number is a number
|
||||
if(!isNaN(form.uid_number.value)){
|
||||
uidNumber = form.uid_number.value;
|
||||
sambaRID = (2*uidNumber)+1000;
|
||||
form.samba3_user_rid.value = sambaRID;
|
||||
}
|
||||
// otherwise (re)set the samba rid value to an empty string
|
||||
else{
|
||||
form.samba3_user_rid.value = "";
|
||||
}
|
||||
}
|
||||
function autoFillSambaGroupRID( form ){
|
||||
var gidNumber;
|
||||
|
||||
gidNumber = form.gid_number.value;
|
||||
if( form.samba_group[0].checked ){
|
||||
form.custom_rid.value = "";
|
||||
}
|
||||
else {
|
||||
form.custom_rid.value = (2*gidNumber)+1001;
|
||||
}
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center><h2>New Samba3 User Account</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) {
|
||||
$base_dn = null;
|
||||
|
||||
if( isset( $samba_base_groups ) )
|
||||
$base_dn = $samba_base_groups;
|
||||
$posix_groups = get_posix_groups( $ldapserver , $base_dn );
|
||||
?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="user_form" name="user_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">UID Number:</td>
|
||||
<?php $next_uid_number = get_next_uid_number( $ldapserver ); ?>
|
||||
<td><input type="text" name="uid_number" value="<?php echo $next_uid_number; ?>" onChange="autoFillSambaRID(this.form)" />
|
||||
<?php if( false !== $next_uid_number ) echo "<small>(automatically determined)</small>"; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><i>Samba SID:</i></td>
|
||||
<td><select name="samba3_domain_sid">
|
||||
<?php foreach($samba3_domains as $samba3_domain) ?>
|
||||
<option value="<?php echo $samba3_domain['sid'] ?>"><?php echo $samba3_domain['sid'] ?></option>
|
||||
</select> - <input type="text" name="samba3_user_rid" id="samba3_user_rid" value="" size="7" onfocus="autoFillSambaRID(this.form)"/></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/uid.png" /></td>
|
||||
<td class="heading">First name:</td>
|
||||
<td><input type="text" name="first_name" id="first_name" value="" onChange="autoFillUserName(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Last name:</td>
|
||||
<td><input type="text" name="last_name" id="last_name" value="" onChange="autoFillUserName(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">User name:</td>
|
||||
<td><input type="text" name="user_name" id="user_name" value=""
|
||||
onChange="autoFillHomeDir(this.form)" onExit="autoFillHomeDir(this.form,this)" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/lock.png" /></td>
|
||||
<td class="heading">User Password:</td>
|
||||
<td><input type="password" name="user_pass1" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">User Password:</td>
|
||||
<td><input type="password" name="user_pass2" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Encryption:</td>
|
||||
<td><select name="encryption">
|
||||
<option>clear</option>
|
||||
<option>md5</option>
|
||||
<option>smd5</option>
|
||||
<option>crypt</option>
|
||||
<option>sha</option>
|
||||
<option>ssha</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td></td>
|
||||
<td class="heading">Samba Password:</td>
|
||||
<td>
|
||||
<div style="font-size: 90%;">
|
||||
<div>
|
||||
<input type="radio" name="samba_pass_mode" checked="true" value="1" />
|
||||
<span style="font-size: 90%;">Use Unix Password</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="samba_pass_mode" value="2" />
|
||||
<span style="font-size: 90%;">Null Password</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="samba_pass_mode" value="3" />
|
||||
<span style="font-size: 90%;">No Password</span>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td><input type="radio" name="samba_pass_mode" style="margin-left:0px;" value="4" /> <span style="font-size: 90%;">New Password :</span> </td>
|
||||
<td>
|
||||
<div><input type="password" name="samba_pass1" /></div>
|
||||
<div style="padding-top:3px"><input type="password" name="samba_pass2" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr valign="top" colspan="2">
|
||||
<td><input type="radio" name="samba_pass_mode" style="margin-left:0px;" value="5" /> <span style="font-size: 90%;">Existing Password :</span> </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td colspan="2" style="padding-left:25px;">
|
||||
<div>
|
||||
<span style="font-size:90%;">LM Password: </span>
|
||||
<span style="padding-left:20px;"><input type="text" name="lmpassword" /></span>
|
||||
</div>
|
||||
<div style="padding-top:3px;" >
|
||||
<span style="font-size: 90%;">NT Password: </span>
|
||||
<span style="padding-left:20px;"><input type="text" name="ntpassword" /></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/terminal.png" /></td>
|
||||
<td class="heading">Login Shell:</td>
|
||||
<td>
|
||||
<select name="login_shell">
|
||||
<option value="/bin/bash">/bin/bash</option>
|
||||
<option value="/bin/csh">/bin/csh</option>
|
||||
<option value="/bin/ksh">/bin/ksh</option>
|
||||
<option value="/bin/tcsh">/bin/tcsh</option>
|
||||
<option value="/bin/zsh">/bin/zsh</option>
|
||||
<option value="/bin/sh">/bin/sh</option>
|
||||
<option value="/bin/false">/bin/false</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'user_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<?php $posix_groups_found = ( count( $posix_groups )>0?1:0 );?>
|
||||
<td class="heading"><?php echo $posix_groups_found?"Unix Group":"GID Number"?>:</td>
|
||||
<td>
|
||||
<?php if( $posix_groups_found ){?>
|
||||
<select name="gid_number" onchange="autoFillSambaGroupRID( this.form )">
|
||||
<?php foreach ( $posix_groups as $dn => $attrs ){
|
||||
$group_name = ereg_replace('^.*=',"",get_rdn($dn));
|
||||
?>
|
||||
<option value="<?php echo $attrs['gidNumber'];?>"><?php echo $group_name;?> </option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?php }else{ ?><input type="text" name="gid_number" /><?php } ?>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td></td>
|
||||
<td class="heading">Windows Group:</td>
|
||||
<td>
|
||||
<div style="font-size: 90%">
|
||||
<div>
|
||||
<div><input type="radio" name="samba_group" value="1" checked="true" onchange="autoFillSambaGroupRID( this.form )" /> <span style="text-decoration:underline;">Built-In:</span></div>
|
||||
<div style="padding-top: 3px;">
|
||||
<select name="builtin_sid">
|
||||
<optgroup label="Local Group">
|
||||
<?php foreach( $built_in_local_groups as $sid => $name ){ ?>
|
||||
<option value="<?php echo $sid; ?>"><?php echo $name; ?> (<?php echo $sid; ?>)</option> <?php } ?>
|
||||
</optgroup>
|
||||
<optgroup label="Global Groups">
|
||||
<?php foreach($samba3_domains as $samba3_domain) { ?>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>-512">Domain Admins (<?php echo $samba3_domain['sid']; ?>-512)</option>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>-513">Domain Users (<?php echo $samba3_domain['sid']; ?>-513)</option>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>-514">Domain Guests (<?php echo $samba3_domain['sid']; ?>-514)</option>
|
||||
<?php } ?>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top:10px;">
|
||||
<div><input type="radio" name="samba_group" value="2" onchange="autoFillSambaGroupRID( this.form )" /> <span style="text-decoration:underline;">Custom:</span></div>
|
||||
<div style="padding-top:3px;">
|
||||
<select name="custom_domain_sid">
|
||||
<?php foreach($samba3_domains as $samba3_domain) { ?>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>"><?php echo $samba3_domain['sid']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="text" name="custom_rid" size="15" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Home Directory:</td>
|
||||
<td><input type="text" name="home_dir" value="" id="home_dir" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center"><br /><input type="submit" value="Proceed >>" /></td>
|
||||
</tr>
|
||||
<tr height="10"><td colspan="3"></td></tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><small><b>Note: </b></small></td>
|
||||
<td colspan="2"><small>To change the value(s) of the samba domain sid, please edit the file :<br /> <code>templates/template_config.php</code></small></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$user_name = trim( $_POST['user_name'] );
|
||||
$first_name = trim( $_POST['first_name'] );
|
||||
$last_name = trim( $_POST['last_name'] );
|
||||
$password1 = $_POST['user_pass1'];
|
||||
$password2 = $_POST['user_pass2'];
|
||||
$encryption = $_POST['encryption'];
|
||||
$login_shell = trim( $_POST['login_shell'] );
|
||||
$uid_number = trim( $_POST['uid_number'] );
|
||||
$gid_number = trim( $_POST['gid_number'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
$home_dir = trim( $_POST['home_dir'] );
|
||||
$samba3_primary_group_sid = NULL;
|
||||
$samba3_group = isset( $_POST['samba_group'] )? $_POST['samba_group'] : 0 ;
|
||||
switch($samba3_group){
|
||||
case 1:
|
||||
isset( $_POST['builtin_sid'] ) or pla_error("No built-in group selected. Please go back and try again" );
|
||||
$samba3_primary_group_sid = $_POST['builtin_sid'];
|
||||
break;
|
||||
case 2:
|
||||
! empty( $_POST['custom_rid'] ) or pla_error( "The value of the samba RID was not specified. Please go back and try again" );
|
||||
$samba3_primary_group_sid = $_POST['custom_domain_sid'] . "-" .$_POST['custom_rid'];
|
||||
break;
|
||||
default:
|
||||
pla_error( "No samba group select. Please go back and try again" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$samba3_user_rid = trim( $_POST['samba3_user_rid'] );
|
||||
$samba3_domain_sid = trim( $_POST['samba3_domain_sid'] );
|
||||
|
||||
$samba_password_mode = trim( $_POST['samba_pass_mode'] );
|
||||
|
||||
|
||||
$clearSambaPassword = "";
|
||||
$sambaLMPassword = "";
|
||||
$sambaNTPassword = "";
|
||||
$accountFlag= "[U ]";
|
||||
$sambaPasswordRequired = 0;
|
||||
$smb_passwd_creation_success = 0;
|
||||
|
||||
|
||||
/* Critical assertions */
|
||||
$password1 == $password2 or
|
||||
pla_error( "Your passwords don't match. Please go back and try again." );
|
||||
0 != strlen( $uid_number ) or
|
||||
pla_error( "You cannot leave the UID number blank. Please go back and try again." );
|
||||
is_numeric( $uid_number ) or
|
||||
pla_error( "You can only enter numeric values for the UID number field. Please go back and try again." );
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
switch($samba_password_mode){
|
||||
case 1:
|
||||
$clearSambaPassword = trim( $password1 );
|
||||
$sambaPasswordRequired = 1;
|
||||
break;
|
||||
case 2:
|
||||
$accountFlag= "[NU ]";
|
||||
break;
|
||||
case 3:
|
||||
// do nothing
|
||||
break;
|
||||
case 4:
|
||||
$_POST["samba_pass1"] == $_POST["samba_pass2"] or pla_error ( "Yours samba passwords don't match. Please go back and try again" );
|
||||
$clearSambaPassword = trim($_POST["samba_pass1"]);
|
||||
$sambaPasswordRequired = 1;
|
||||
break;
|
||||
case 5:
|
||||
if( $_POST["ntpassword"] != "" && $_POST["lmpassword"] !=""){
|
||||
$sambaLMPassword = $_POST["lmpassword"];
|
||||
$sambaNTPassword = $_POST["ntpassword"];
|
||||
$smb_passwd_creation_success = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$password = password_hash( $password1, $encryption );
|
||||
|
||||
if ( $sambaPasswordRequired ){
|
||||
$mkntPassword = new MkntPasswdUtil();
|
||||
if( $mkntPassword->createSambaPasswords( $clearSambaPassword ) ){
|
||||
$sambaLMPassword = $mkntPassword->getsambaLMPassword();
|
||||
$sambaNTPassword = $mkntPassword->getsambaNTPassword();
|
||||
$smb_passwd_creation_success = 1;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm account creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $user_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'account', 'posixAccount', 'shadowAccount' , 'sambaSamAccount' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="displayName" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name . ' ' . $last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gecos" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name . ' ' . $last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($gid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="homeDirectory" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($home_dir);?>" />
|
||||
<input type="hidden" name="attrs[]" value="loginShell" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($login_shell);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaAcctFlags" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo $accountFlag;?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaPrimaryGroupSID" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($samba3_primary_group_sid);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaSID" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo $samba3_domain_sid."-".$samba3_user_rid; ?>" />
|
||||
<input type="hidden" name="attrs[]" value="shadowLastChange" />
|
||||
<input type="hidden" name="vals[]" value="11778" />
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($user_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="userPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($password);?>" />
|
||||
<?php if( $smb_passwd_creation_success ){?>
|
||||
<input type="hidden" name="attrs[]" value="sambaLMPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($sambaLMPassword);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaNTPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($sambaNTPassword);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaPwdCanChange" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo $now ?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaPwdLastSet" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo $now ?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaPwdMustChange" />
|
||||
<input type="hidden" name="vals[]" value="2147483647" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">User name:</td><td><b><?php echo htmlspecialchars( $user_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">First name:</td><td><b><?php echo htmlspecialchars( $first_name ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Last name:</td><td><b><?php echo htmlspecialchars( $last_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">Login Shell:</td><td><?php echo htmlspecialchars( $login_shell); ?></td></tr>
|
||||
<tr class="even"><td class="heading">UID Number:</td><td><?php echo htmlspecialchars( $uid_number ); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Samba SID:</td><td><?php echo htmlspecialchars( $samba3_domain_sid."-".$samba3_user_rid ); ?></td></tr>
|
||||
<tr class="even"><td class="heading">GID Number:</td><td><?php echo htmlspecialchars( $gid_number ); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Samba Group Sid:</td><td><?php echo htmlspecialchars( $samba3_primary_group_sid ); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Container:</td><td><?php echo htmlspecialchars( $container ); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Home dir:</td><td><?php echo htmlspecialchars( $home_dir ); ?></td></tr>
|
||||
<tr class="even"><td class="heading">User Password:</td><td>[secret]</td></tr>
|
||||
<?php if( $smb_passwd_creation_success ){ ?>
|
||||
<tr class="odd"><td class="heading">Samba Password:</td><td>[secret]</td></tr>
|
||||
<tr class="even"><td class="heading">Password Last Set:</td><td><?php echo $now ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Password Can Change:</td><td><?php echo $now ?></td></tr>
|
||||
<tr class="even"><td class="heading">Password Must Change:</td><td><?php echo "2147483647" ?></td></tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Samba Account" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,257 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_smbgroup_template.php,v 1.14 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
// Common to all templates
|
||||
$rdn = isset( $_POST['rdn'] ) ? $_POST['rdn'] : null;
|
||||
$container = $_POST['container'];
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
// Change this to suit your needs
|
||||
$default_number_of_members = 4;
|
||||
|
||||
// get the available domains (see template_connfig.php for customization)
|
||||
$samba3_domains = get_samba3_domains();
|
||||
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
|
||||
if( get_schema_objectclass( $ldapserver, 'sambaGroupMapping' ) == null )
|
||||
pla_error( "Your LDAP server does not have schema support for the sambaGroupMapping objectClass. Cannot continue." );
|
||||
|
||||
?>
|
||||
<script language="javascript">
|
||||
/**
|
||||
* Populate the display name field from the group name field
|
||||
*/
|
||||
|
||||
function autoFillDisplayName( form ){
|
||||
var unix_group_name
|
||||
unix_group_name = form.unix_name.value;
|
||||
form.display_name.value = unix_group_name;
|
||||
}
|
||||
|
||||
function autoFillSambaGroupRID( form ){
|
||||
var gidNumber;
|
||||
|
||||
gidNumber = form.gid_number.value;
|
||||
if( form.samba_group[0].checked ){
|
||||
form.custom_rid.value = "";
|
||||
}
|
||||
else {
|
||||
form.custom_rid.value = (2*gidNumber)+1001;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<center><h2>New Samba Group Mapping</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" name="posix_group_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Unix Name:</td>
|
||||
<td><input type="text" name="unix_name" value="" onChange="autoFillDisplayName(this.form)"/> <small>(example: admins, do not include "cn=")</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Windows Name:</td>
|
||||
<td><input type="text" name="display_name" value="" /> </small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><acronym title="Group Identification">GID</acronym> Number:</td>
|
||||
<td><input type="text" name="gid_number" value="" onChange="autoFillSambaGroupRID(this.form)" /> <small>(example: 2000)</small></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><acronym title="Samba Security Identifier">SambaSID</acronym></td>
|
||||
<td><select name="samba3_domain_sid">
|
||||
<?php foreach($samba3_domains as $samba3_domain) ?>
|
||||
<option value="<?php echo $samba3_domain['sid'] ?>"><?php echo $samba3_domain['sid'] ?></option>
|
||||
</select> - <input type="text" name="samba3_rid" id="samba3_rid" value="" size="7"/></td>
|
||||
</tr>
|
||||
-->
|
||||
<tr valign="top">
|
||||
<td></td>
|
||||
<td class="heading">Samba Sid:</td>
|
||||
<td>
|
||||
<div style="font-size: 90%">
|
||||
<div>
|
||||
<div><input type="radio" name="samba_group" value="1" checked onchange="autoFillSambaGroupRID( this.form )" /> <span style="text-decoration:underline;">Built-In:</span></div>
|
||||
<div style="padding-top: 3px;">
|
||||
<select name="builtin_sid">
|
||||
<optgroup label="Local Group">
|
||||
<?php foreach( $built_in_local_groups as $sid => $name ){ ?>
|
||||
<option value="<?php echo $sid; ?>"><?php echo $name; ?> (<?php echo $sid; ?>)</option> <?php } ?>
|
||||
</optgroup>
|
||||
<optgroup label="Global Groups">
|
||||
<?php foreach($samba3_domains as $samba3_domain) { ?>
|
||||
<!-- <optgroup label="- <?php echo $samba3_domain['name'];?>"> -->
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>-512">Domain Admins (<?php echo $samba3_domain['sid']; ?>-512)</option>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>-513">Domain Users (<?php echo $samba3_domain['sid']; ?>-513)</option>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>-514">Domain Guests (<?php echo $samba3_domain['sid']; ?>-514)</option>
|
||||
<?php } ?>
|
||||
</optgroup>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top:10px;">
|
||||
<div><input type="radio" name="samba_group" value="2" onchange="autoFillSambaGroupRID( this.form )"> <span style="text-decoration:underline;">Custom:</span></div>
|
||||
<div style="padding-top:3px;">
|
||||
<select name="custom_domain_sid">
|
||||
<?php foreach($samba3_domains as $samba3_domain) { ?>
|
||||
<option value="<?php echo $samba3_domain['sid']; ?>"><?php echo $samba3_domain['sid']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<input type="text" name="custom_rid" size="15" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container <acronym title="Distinguished Name">DN</acronym>:</td>
|
||||
<td><input type="text" name="container" size="40" value="<?php echo htmlspecialchars( $container ); ?>" />
|
||||
<?php draw_chooser_link( 'posix_group_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><acronym title="Samba Group Type">SambaGroupType</acronym> :</td>
|
||||
<td>
|
||||
<select name="group_type_number">
|
||||
<!-- <option value="1">1 - User</option> -->
|
||||
<option value="2" selected>2 - Domain Group</option>
|
||||
<!-- <option value="3">3 - Domain</option> -->
|
||||
<option value="4">4 - Local Group</option>
|
||||
<option value="5">5 - Well-known Group</option>
|
||||
<!-- <option value="6">6 - Deleted Account</option>
|
||||
<option value="7">7 - Invalid Account</option>
|
||||
<option value="8">8 - Unknown</option> -->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Description:</td>
|
||||
<td><input type="text" name="description" value="" /> </small></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td></td>
|
||||
<td class="heading">Members:</td>
|
||||
<td><input type="text" name="member_uids[]" value="" /> <small>(example: dsmith)</small><br />
|
||||
<?php for( $i=1; $i<$default_number_of_members; $i++ ) { ?>
|
||||
<input type="text" name="member_uids[]" value="" /><br />
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$unix_name = trim( $_POST['unix_name'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
$gid_number = trim( $_POST['gid_number'] );
|
||||
$display_name = trim( $_POST['display_name'] );
|
||||
$group_type_number = trim( $_POST['group_type_number'] );
|
||||
$description = $_POST['description'];
|
||||
$uids = $_POST['member_uids'];
|
||||
$samba3_sid = NULL;
|
||||
$samba3_group = isset( $_POST['samba_group'] )? $_POST['samba_group'] : 0 ;
|
||||
switch($samba3_group){
|
||||
case 1:
|
||||
isset( $_POST['builtin_sid'] ) or pla_error("No built-in group selected. Please go back and try again" );
|
||||
$samba3_sid = $_POST['builtin_sid'];
|
||||
break;
|
||||
case 2:
|
||||
! empty( $_POST['custom_rid'] ) or pla_error( "The value of the samba RID was not specified. Please go back and try again" );
|
||||
$samba3_sid = $_POST['custom_domain_sid'] . "-" .$_POST['custom_rid'];
|
||||
break;
|
||||
default:
|
||||
pla_error( "No samba group select. Please go back and try again" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
$member_uids = array();
|
||||
foreach( $uids as $uid )
|
||||
if( '' != trim( $uid ) && ! in_array( $uid, $member_uids ) )
|
||||
$member_uids[] = $uid;
|
||||
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
?>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'cn='.$unix_name.','.$container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'posixGroup','sambaGroupMapping' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($unix_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($gid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="displayName" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($display_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaSid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($samba3_sid);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sambaGroupType" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($group_type_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="description" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($description);?>" />
|
||||
|
||||
<?php foreach( $member_uids as $uid ) { ?>
|
||||
<input type="hidden" name="attrs[]" value="memberUid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid);?>" />
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
Really create this new Posix Group entry?<br />
|
||||
<br />
|
||||
<table class="confirm">
|
||||
<tr class="even"><td>Common Name</td><td><b><?php echo htmlspecialchars($unix_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>Container</td><td><b><?php echo htmlspecialchars( $container ); ?></b></td></tr>
|
||||
<tr class="even"><td>display Name</td><td><b><?php echo htmlspecialchars($display_name); ?></b></td></tr>
|
||||
<tr class="odd"><td>gidNumber</td><td><b><?php echo htmlspecialchars( $gid_number ); ?></b></td></tr>
|
||||
<tr class="even"><td>sambaSID</td><td><b><?php echo htmlspecialchars($samba3_sid); ?></b></td></tr>
|
||||
<tr class="odd"><td>sambaGroupType</td><td><b><?php echo htmlspecialchars( $group_type_number ); ?></b></td></tr>
|
||||
<tr class="even"><td>description</td><td><b><?php echo htmlspecialchars( $description ); ?></b></td></tr>
|
||||
<tr class="odd"><td>Member UIDs</td><td><b>
|
||||
<?php foreach( $member_uids as $i => $uid )
|
||||
echo htmlspecialchars($uid) . "<br />"; ?>
|
||||
</b></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Group" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
||||
|
@@ -1,290 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_smbuser_template.php,v 1.18 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
$default_container = "ou=Users";
|
||||
$default_home = "/home";
|
||||
|
||||
// Common to all templates
|
||||
$server_id = $_POST['server_id'];
|
||||
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
//check if the sambaSamAccount objectClass is availaible
|
||||
if( get_schema_objectclass( $ldapserver, 'sambaAccount' ) == null )
|
||||
pla_error( "Your LDAP server does not have schema support for the sambaAccount objectClass. Cannot continue." );
|
||||
|
||||
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( "Not enough information to login to server. Please check your configuration." );
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
function autoFillUserName( form ) {
|
||||
var first_name;
|
||||
var last_name;
|
||||
var user_name;
|
||||
|
||||
first_name = form.first_name.value.toLowerCase();
|
||||
last_name = form.last_name.value.toLowerCase();
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
user_name = first_name.substr( 0,1 ) + last_name;
|
||||
|
||||
form.user_name.value = user_name;
|
||||
autoFillHomeDir( form );
|
||||
}
|
||||
function autoFillHomeDir( form ){
|
||||
var user_name;
|
||||
var home_dir;
|
||||
|
||||
user_name = form.user_name.value.toLowerCase();
|
||||
|
||||
home_dir = '<?php echo $default_home; ?>/';
|
||||
home_dir += user_name;
|
||||
form.home_dir.value = home_dir;
|
||||
|
||||
}
|
||||
function autoFillSambaRID( form ){
|
||||
var sambaRID;
|
||||
var uidNumber;
|
||||
|
||||
// TO DO:need to check if uidNumber is an integer
|
||||
uidNumber = form.uid_number.value;
|
||||
sambaRID = (2*uidNumber)+1000;
|
||||
form.samba_user_rid.value = sambaRID;
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center><h2>New Samba User Account</h2></center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="user_form" name="user_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_POST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">UID Number:</td>
|
||||
<td><input type="text" name="uid_number" value="" onChange="autoFillSambaRID(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><i>RID:</i></td>
|
||||
<td><input type="text" name="samba_user_rid" id="samba_user_rid" value="" size="7"/></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></tr>
|
||||
<tr>
|
||||
<td><img src="images/uid.png" /></td>
|
||||
<td class="heading">First name:</td>
|
||||
<td><input type="text" name="first_name" id="first_name" value="" onChange="autoFillUserName(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Last name:</td>
|
||||
<td><input type="text" name="last_name" id="last_name" value="" onChange="autoFillUserName(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">User name:</td>
|
||||
<td><input type="text" name="user_name" id="user_name" value=""
|
||||
onChange="autoFillHomeDir(this.form)" onExit="autoFillHomeDir(this.form)" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></tr>
|
||||
<tr>
|
||||
<td><img src="images/lock.png" /></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_pass1" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Password:</td>
|
||||
<td><input type="password" name="user_pass2" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Encryption:</td>
|
||||
<td>
|
||||
<input type="hidden" name="encryption" value="crypt"/>
|
||||
<i>crypt</i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></tr>
|
||||
<tr>
|
||||
<td><img src="images/terminal.png" /></td>
|
||||
<td class="heading">Login Shell:</td>
|
||||
<td>
|
||||
<select name="login_shell">
|
||||
<option value="/bin/bash">/bin/bash</option>
|
||||
<option value="/bin/csh">/bin/csh</option>
|
||||
<option value="/bin/ksh">/bin/ksh</option>
|
||||
<option value="/bin/tcsh">/bin/tcsh</option>
|
||||
<option value="/bin/zsh">/bin/zsh</option>
|
||||
<option value="/bin/sh">/bin/sh</option>
|
||||
<option value="/bin/false">/bin/false</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Container:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'user_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Unix Group:</td>
|
||||
<td><select name="group">
|
||||
<option value="1000">admins (1000)</option>
|
||||
<option value="2000">users (2000)</option>
|
||||
<option value="3000">staff (3000)</option>
|
||||
<option value="5000">guest (5000)</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Primary Group Id:</td>
|
||||
<td><input type="text" name="primary_group_id">
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading">Home Directory:</td>
|
||||
<td><input type="text" name="home_dir" value="" id="home_dir" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="Proceed >>" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$user_name = trim( $_POST['user_name'] );
|
||||
$first_name = trim( $_POST['first_name'] );
|
||||
$last_name = trim( $_POST['last_name'] );
|
||||
$password1 = $_POST['user_pass1'];
|
||||
$password2 = $_POST['user_pass2'];
|
||||
$encryption = $_POST['encryption'];
|
||||
$login_shell = trim( $_POST['login_shell'] );
|
||||
$uid_number = trim( $_POST['uid_number'] );
|
||||
$gid_number = trim( $_POST['group'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
$home_dir = trim( $_POST['home_dir'] );
|
||||
$samba_user_rid = trim( $_POST['samba_user_rid'] );
|
||||
$samba_primary_group_id = trim( $_POST['primary_group_id'] );
|
||||
|
||||
$sambaLMPassword="";
|
||||
$sambaNTPassword="";
|
||||
$smb_passwd_creation_success = 0;
|
||||
|
||||
/* Critical assertions */
|
||||
$password1 == $password2 or
|
||||
pla_error( "Your passwords don't match. Please go back and try again." );
|
||||
0 != strlen( $uid_number ) or
|
||||
pla_error( "You cannot leave the UID number blank. Please go back and try again." );
|
||||
is_numeric( $uid_number ) or
|
||||
pla_error( "You can only enter numeric values for the UID number field. Please go back and try again." );
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( "The container you specified (" . htmlspecialchars( $container ) . ") does not exist. " .
|
||||
"Please go back and try again." );
|
||||
|
||||
$password = password_hash( $password1, $encryption );
|
||||
|
||||
//build the mkntpwd command line string
|
||||
$sambaPassCommand = $mkntpwdCommand . " " . $password1;
|
||||
|
||||
// execute this command
|
||||
$sambaPassCommandOutput = shell_exec($sambaPassCommand);
|
||||
if($sambaPassCommandOutput){
|
||||
$sambaLMPassword = substr($sambaPassCommandOutput,0,strPos($sambaPassCommandOutput,':'));
|
||||
$sambaNTPassword = substr($sambaPassCommandOutput,strPos($sambaPassCommandOutput,':')+1);
|
||||
$smb_passwd_creation_success = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
<center><h3>Confirm account creation:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $user_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( array( 'top', 'account', 'posixAccount', 'shadowAccount' , 'sambaAccount' ) ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="displayName" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name . ' ' . $last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gecos" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name . ' ' . $last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($gid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="homeDirectory" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($home_dir);?>" />
|
||||
<input type="hidden" name="attrs[]" value="loginShell" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($login_shell);?>" />
|
||||
<input type="hidden" name="attrs[]" value="acctFlags" />
|
||||
<input type="hidden" name="vals[]" value="[U ]" />
|
||||
<input type="hidden" name="attrs[]" value="primaryGroupID" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($samba_primary_group_id);?>" />
|
||||
<input type="hidden" name="attrs[]" value="rid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo $samba_user_rid; ?>" />
|
||||
<input type="hidden" name="attrs[]" value="shadowLastChange" />
|
||||
<input type="hidden" name="vals[]" value="11778" />
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($user_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="userPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($password);?>" />
|
||||
<?php if( $smb_passwd_creation_success ){?>
|
||||
<input type="hidden" name="attrs[]" value="lmPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($sambaLMPassword);?>" />
|
||||
<input type="hidden" name="attrs[]" value="ntPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($sambaNTPassword);?>" />
|
||||
<!--
|
||||
<input type="hidden" name="attrs[]" value="pwdCanChange" />
|
||||
<input type="hidden" name="vals[]" value="0" />
|
||||
<input type="hidden" name="attrs[]" value="pwdLastSet" />
|
||||
<input type="hidden" name="vals[]" value="0" />
|
||||
<input type="hidden" name="attrs[]" value="pwdMustChange" />
|
||||
<input type="hidden" name="vals[]" value="2147483647" />
|
||||
-->
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading">User name:</td><td><b><?php echo htmlspecialchars( $user_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">First name:</td><td><b><?php echo htmlspecialchars( $first_name ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading">Last name:</td><td><b><?php echo htmlspecialchars( $last_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading">UID Number:</td><td><?php echo htmlspecialchars( $uid_number ); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Login Shell:</td><td><?php echo htmlspecialchars( $login_shell); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Rid</td><td><?php echo htmlspecialchars( $samba_user_rid ); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">GID Number:</td><td><?php echo htmlspecialchars( $gid_number ); ?></td></tr>
|
||||
<tr class="even"><td class="heading">Container:</td><td><?php echo htmlspecialchars( $container ); ?></td></tr>
|
||||
<tr class="odd"><td class="heading">Home dir:</td><td><?php echo htmlspecialchars( $home_dir ); ?></td></tr>
|
||||
<?php if( $smb_passwd_creation_success ){ ?>
|
||||
<tr class="even"><td class="heading">Password:</td><td>[secret]</td></tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<br /><input type="submit" value="Create Samba Account" />
|
||||
</center>
|
||||
|
||||
<?php } ?>
|
@@ -1,332 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/creation/Attic/new_user_template.php,v 1.26 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
/*
|
||||
* TODO Add a check: If the server is configured to use auto_uid_numbers AND the
|
||||
* mechanism is uidpool, update the uidpool when creating the entry. This may
|
||||
* need to be added to create.php (scary). Perahsp this could be a candidate
|
||||
* for the post-update event handler.
|
||||
*/
|
||||
|
||||
// customize this to your needs
|
||||
|
||||
// CHANGES MK
|
||||
// - unlink first name and attribute cn ("common name"), link it to givenname
|
||||
// - add field common name, to be filled from first and last name, link to cn
|
||||
// - to allow givenname, I added the objectClass 'inetOrgPerson'
|
||||
|
||||
$default_container = "ou=People";
|
||||
|
||||
// Common to all templates
|
||||
$container = isset( $_REQUEST['container'] ) ? $_REQUEST['container'] : null;
|
||||
$server_id = isset( $_REQUEST['server_id'] ) ? $_REQUEST['server_id'] : false;
|
||||
|
||||
// Set $redirect to pass this to create.php to have it redirect when done.
|
||||
$redirect = null;
|
||||
// For example, if you want to redirect back to the user creation form, set $redirect to this:
|
||||
//$redirect = "creation_template.php?server_id=$server_id&template=$template_id&container=" . urlencode( $container );
|
||||
|
||||
// Modify this array and add/remove the corresponding objectClasses below
|
||||
$object_classes = array( 'top', 'person', 'posixAccount', 'shadowAccount', 'inetOrgPerson');
|
||||
|
||||
// A list of default attributes/values to create with this new user
|
||||
$default_attributes = array(
|
||||
'shadowMin' => -1,
|
||||
'shadowMax' => 999999,
|
||||
'shadowWarning' => 7,
|
||||
'shadowInactive' => -1,
|
||||
'shadowExpire' => -1,
|
||||
'shadowFlag' => 0
|
||||
);
|
||||
|
||||
// Unique to this template
|
||||
$step = 1;
|
||||
if( isset($_POST['step']) )
|
||||
$step = $_POST['step'];
|
||||
|
||||
check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] . ": " . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
/*
|
||||
* Pipulates the user name field based on the first letter
|
||||
* of the firsr name concatenated with the last name
|
||||
* all in lower case.
|
||||
*/
|
||||
function autoFillUserName( form )
|
||||
{
|
||||
var first_name;
|
||||
var last_name;
|
||||
var user_name;
|
||||
|
||||
first_name = form.first_name.value.toLowerCase();
|
||||
last_name = form.last_name.value.toLowerCase();
|
||||
|
||||
if( last_name == '' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
user_name = first_name.substr( 0,1 ) + last_name;
|
||||
form.user_name.value = user_name;
|
||||
form.common_name.value = form.first_name.value + " " + form.last_name.value;
|
||||
autoFillHomeDir( form );
|
||||
}
|
||||
|
||||
/*
|
||||
* Populates the home directory field based on the username provided
|
||||
*/
|
||||
function autoFillHomeDir( form )
|
||||
{
|
||||
var user_name;
|
||||
var home_dir;
|
||||
|
||||
user_name = form.user_name.value.toLowerCase();
|
||||
|
||||
home_dir = '/home/';
|
||||
home_dir += user_name;
|
||||
|
||||
form.home_dir.value = home_dir;
|
||||
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<center>
|
||||
<h2 style="margin:0px"><?php echo $lang['t_new_user_account']; ?></h2>
|
||||
<?php if( show_hints() ) { ?>
|
||||
<small><img src="images/light.png" /><?php echo $lang['t_hint_customize']; ?></small><br />
|
||||
<?php } ?>
|
||||
<br />
|
||||
</center>
|
||||
|
||||
<?php if( $step == 1 ) { ?>
|
||||
|
||||
<form action="creation_template.php" method="post" id="user_form" name="user_form">
|
||||
<input type="hidden" name="step" value="2" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="template" value="<?php echo htmlspecialchars( $_REQUEST['template'] ); ?>" />
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/uid.png" /></td>
|
||||
<td class="heading"><?php echo $lang['t_first_name']; ?>:</td>
|
||||
<td><input type="text" name="first_name" id="first_name" value="" onChange="autoFillUserName(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_last_name']; ?>:</td>
|
||||
<td><input type="text" name="last_name" id="last_name" value="" onChange="autoFillUserName(this.form)" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_common_name']; ?>:</td>
|
||||
<td><input type="text" name="common_name" id="common_name" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_user_name']; ?>:</td>
|
||||
<td><input type="text" name="user_name" id="user_name" value=""
|
||||
onChange="autoFillHomeDir(this.form)" onExit="autoFillHomeDir(this.form)" /></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/lock.png" /></td>
|
||||
<td class="heading"><?php echo $lang['t_password']; ?>:</td>
|
||||
<td><input type="password" name="user_pass1" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_password']; ?>:</td>
|
||||
<td><input type="password" name="user_pass2" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_encryption']; ?>:</td>
|
||||
<td><select name="encryption">
|
||||
<option>clear</option>
|
||||
<option>md5</option>
|
||||
<option>smd5</option>
|
||||
<option>crypt</option>
|
||||
<option>sha</option>
|
||||
<option>ssha</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr class="spacer"><td colspan="3"></td></tr>
|
||||
<tr>
|
||||
<td><img src="images/terminal.png" /></td>
|
||||
<td class="heading"><?php echo $lang['t_login_shell']; ?>:</td>
|
||||
<!--<td><input type="text" name="login_shell" value="/bin/bash" /></td>-->
|
||||
<td>
|
||||
<select name="login_shell">
|
||||
<option>/bin/bash</option>
|
||||
<option>/bin/csh</option>
|
||||
<option>/bin/ksh</option>
|
||||
<option>/bin/tcsh</option>
|
||||
<option>/bin/zsh</option>
|
||||
<option>/bin/sh</option>
|
||||
<option>/bin/rssh</option>
|
||||
<option value="/bin/false">/bin/false (no login)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_container']; ?>:</td>
|
||||
<td><input type="text" name="container" size="40"
|
||||
value="<?php if( isset( $container ) )
|
||||
echo htmlspecialchars( $container );
|
||||
else
|
||||
echo htmlspecialchars( $default_container . ',' . $servers[$server_id]['base'] ); ?>" />
|
||||
<?php draw_chooser_link( 'user_form.container' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_home_dir']; ?>:</td>
|
||||
<td><input type="text" name="home_dir" value="/home/" id="home_dir" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
// determining the next available uidNumber may take a moment.
|
||||
// give them something to look at in the mean time
|
||||
flush();
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="heading"><?php echo $lang['t_uid_number']; ?>:</td>
|
||||
<?php $next_uid_number = ( auto_uid_numbers_enabled( $server_id ) ? get_next_uid_number( $ldapserver ) : false ); ?>
|
||||
<td><input type="text" name="uid_number" value="<?php echo $next_uid_number ?>" />
|
||||
<?php if( false !== $next_uid_number ) echo "<small>" . $lang['t_auto_det'] . "</small>"; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<?php
|
||||
$base_dn = null;
|
||||
if( isset( $base_posix_groups ) )
|
||||
$base_dn = $base_posix_groups;
|
||||
$posix_groups = get_posix_groups( $ldapserver, $base_dn );
|
||||
$posix_groups_found = ( count( $posix_groups ) ? true : false ); ?>
|
||||
<td class="heading"><?php echo $posix_groups_found ? $lang['t_group'] : $lang['t_gid_number'] ?>:</td>
|
||||
<td>
|
||||
<?php if( $posix_groups_found ){?>
|
||||
<select name="gid_number">
|
||||
<?php foreach ( $posix_groups as $dn => $attrs ){
|
||||
$group_name = ereg_replace('^.*=',"",get_rdn($dn));
|
||||
$gid_number = $attrs['gidNumber'];
|
||||
?>
|
||||
<option value="<?php echo $gid_number; ?>">
|
||||
<?php echo htmlspecialchars($group_name) . " ($gid_number)"; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<?php } else { ?><input type="text" name="gid_number" /><?php } ?>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><center><br /><input type="submit" value="<?php echo $lang['proceed_gt']; ?>" /></center></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
|
||||
<?php } elseif( $step == 2 ) {
|
||||
|
||||
$user_name = trim( $_POST['user_name'] );
|
||||
$first_name = trim( $_POST['first_name'] );
|
||||
$common_name = trim( $_POST['common_name'] );
|
||||
$last_name = trim( $_POST['last_name'] );
|
||||
$password1 = $_POST['user_pass1'];
|
||||
$password2 = $_POST['user_pass2'];
|
||||
$encryption = $_POST['encryption'];
|
||||
$login_shell = trim( $_POST['login_shell'] );
|
||||
$uid_number = trim( $_POST['uid_number'] );
|
||||
$gid_number = trim( $_POST['gid_number'] );
|
||||
$container = trim( $_POST['container'] );
|
||||
$home_dir = trim( $_POST['home_dir'] );
|
||||
|
||||
/* Critical assertions */
|
||||
if( ! trim( $user_name ) )
|
||||
pla_error( sprintf( $lang['t_err_field_blank'], $lang['t_user_name'] ) );
|
||||
$password1 == $password2 or
|
||||
pla_error( $lang['t_err_passwords'] );
|
||||
0 != strlen( $uid_number ) or
|
||||
pla_error( sprintf( $lang['t_err_field_blank'], $lang['t_uid_number'] ) );
|
||||
is_numeric( $uid_number ) or
|
||||
pla_error( sprintf( $lang['t_err_field_num'], $lang['t_uid_number'] ) );
|
||||
is_numeric( $gid_number ) or
|
||||
pla_error( sprintf( $lang['t_err_field_num'], $lang['t_gid_number'] ) );
|
||||
dn_exists( $ldapserver, $container ) or
|
||||
pla_error( sprintf( $lang['t_err_bad_container'], htmlspecialchars( $container ) ) );
|
||||
|
||||
$password = password_hash( $password1, $encryption );
|
||||
|
||||
|
||||
?>
|
||||
<center><h3><?php echo $lang['t_confirm_account_creation']; ?>:</h3></center>
|
||||
|
||||
<form action="create.php" method="post">
|
||||
<?php if( $redirect ) { ?>
|
||||
<input type="hidden" name="redirect" value="<?php echo htmlspecialchars($redirect); ?>" />
|
||||
<?php } ?>
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="new_dn" value="<?php echo htmlspecialchars( 'uid=' . $user_name . ',' . $container ); ?>" />
|
||||
|
||||
<!-- ObjectClasses -->
|
||||
<?php $object_classes = rawurlencode( serialize( $object_classes ) ); ?>
|
||||
|
||||
<input type="hidden" name="object_classes" value="<?php echo $object_classes; ?>" />
|
||||
|
||||
<!-- The array of attributes/values -->
|
||||
<input type="hidden" name="attrs[]" value="uid" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($user_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($first_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="sn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($last_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="cn" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($common_name);?>" />
|
||||
<input type="hidden" name="attrs[]" value="userPassword" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($password);?>" />
|
||||
<input type="hidden" name="attrs[]" value="loginShell" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($login_shell);?>" />
|
||||
<input type="hidden" name="attrs[]" value="uidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($uid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="gidNumber" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($gid_number);?>" />
|
||||
<input type="hidden" name="attrs[]" value="homeDirectory" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($home_dir);?>" />
|
||||
|
||||
<?php foreach( $default_attributes as $default_attr => $default_val ) { ?>
|
||||
|
||||
<!-- default attribute, auto-added based on $default_attributes array specified in new_user_template.php -->
|
||||
<input type="hidden" name="attrs[]" value="<?php echo htmlspecialchars($default_attr); ?>" />
|
||||
<input type="hidden" name="vals[]" value="<?php echo htmlspecialchars($default_val);?>" />
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<center>
|
||||
<table class="confirm">
|
||||
<tr class="even"><td class="heading"><?php echo $lang['t_user_name']; ?></td><td><b><?php echo htmlspecialchars( $user_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading"><?php echo $lang['t_first_name']; ?>:</td><td><b><?php echo htmlspecialchars( $first_name ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading"><?php echo $lang['t_last_name']; ?>:</td><td><b><?php echo htmlspecialchars( $last_name ); ?></b></td></tr>
|
||||
<tr class="even"><td class="heading"><?php echo $lang['t_common_name']; ?>:</td><td><b><?php echo htmlspecialchars( $common_name ); ?></b></td></tr>
|
||||
<tr class="odd"><td class="heading"><?php echo $lang['t_password']; ?>:</td><td><?php echo $lang['t_secret']; ?></td></tr>
|
||||
<tr class="even"><td class="heading"><?php echo $lang['t_login_shell']; ?>:</td><td><?php echo htmlspecialchars( $login_shell); ?></td></tr>
|
||||
<tr class="odd"><td class="heading"><?php echo $lang['t_uid_number']; ?>:</td><td><?php echo htmlspecialchars( $uid_number ); ?></td></tr>
|
||||
<tr class="even"><td class="heading"><?php echo $lang['t_gid_number']; ?>:</td><td><?php echo htmlspecialchars( $gid_number ); ?></td></tr>
|
||||
<tr class="odd"><td class="heading"><?php echo $lang['t_container']; ?>:</td><td><?php echo htmlspecialchars( $container ); ?></td></tr>
|
||||
<tr class="even"><td class="heading"><?php echo $lang['t_home_dir']; ?>:</td><td><?php echo htmlspecialchars( $home_dir ); ?></td></tr>
|
||||
</table>
|
||||
<br /><input type="submit" value="<?php echo $lang['t_create_account']; ?>" />
|
||||
</center>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>dns_entry</title>
|
||||
<title>DNS Entry</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/dc.png</icon>
|
||||
<description>New DNS Entry</description>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>address_book_inet</title>
|
||||
<title>Address Book Entry</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/user.png</icon>
|
||||
<description>t_new_address</description>
|
||||
<description>New Address Book Entry</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
@@ -15,14 +15,14 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="givenName">
|
||||
<display>t_first_name</display>
|
||||
<display>First name</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last name</display>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
@@ -34,50 +34,53 @@
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="o">
|
||||
<display>t_organization</display>
|
||||
<display>Organisation</display>
|
||||
<order>4</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="street">
|
||||
<display>t_street</display>
|
||||
<cols>50</cols>
|
||||
<display>Street</display>
|
||||
<icon>images/mail.png</icon>
|
||||
<order>4</order>
|
||||
<page>1</page>
|
||||
<rows>4</rows>
|
||||
<type>textarea</type>
|
||||
</attribute>
|
||||
<attribute id="l">
|
||||
<display>t_city</display>
|
||||
<display>City</display>
|
||||
<order>5</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="st">
|
||||
<display>t_state</display>
|
||||
<display>State</display>
|
||||
<order>6</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="postalCode">
|
||||
<display>t_postal_code</display>
|
||||
<display>Postal code</display>
|
||||
<order>7</order>
|
||||
<page>1</page>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="telephoneNumber">
|
||||
<display>t_work_phone</display>
|
||||
<display>Work phone</display>
|
||||
<icon>images/phone.png</icon>
|
||||
<order>8</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="facsimileTelephoneNumber">
|
||||
<display>t_fax</display>
|
||||
<display>Fax</display>
|
||||
<order>9</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="mobile">
|
||||
<display>t_mobile</display>
|
||||
<display>Mobile</display>
|
||||
<order>9</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="mail">
|
||||
<display>t_email</display>
|
||||
<display>Email</display>
|
||||
<order>10</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>kolab_user</title>
|
||||
<title>Kolab User Entry</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/user.png</icon>
|
||||
<description>t_new_address</description>
|
||||
<description>New Address Book Entry</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="givenName">
|
||||
<display>t_first_name</display>
|
||||
<display>First name</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<order>1</order>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last name</display>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<order>2</order>
|
||||
</attribute>
|
||||
@@ -31,14 +31,14 @@
|
||||
<order>3</order>
|
||||
</attribute>
|
||||
<attribute id="mail">
|
||||
<display>t_email</display>
|
||||
<display>Email</display>
|
||||
<order>4</order>
|
||||
</attribute>
|
||||
<attribute id="userPassword">
|
||||
<display>t_password</display>
|
||||
<display>Password</display>
|
||||
<helper>
|
||||
<default>md5</default>
|
||||
<display>t_encryption</display>
|
||||
<display>Encryption</display>
|
||||
<id>enc</id>
|
||||
<location>side</location>
|
||||
<value>blowfish</value>
|
||||
@@ -69,11 +69,11 @@
|
||||
<order>7</order>
|
||||
</attribute>
|
||||
<attribute id="o">
|
||||
<display>t_organization</display>
|
||||
<display>Organisation</display>
|
||||
<order>8</order>
|
||||
</attribute>
|
||||
<attribute id="ou">
|
||||
<display>organizational_unit</display>
|
||||
<display>Organisational unit</display>
|
||||
<order>9</order>
|
||||
</attribute>
|
||||
<attribute id="roomNumber">
|
||||
@@ -83,24 +83,24 @@
|
||||
</attribute>
|
||||
|
||||
<attribute id="street">
|
||||
<display>t_address</display>
|
||||
<display>Address</display>
|
||||
<icon>images/mail.png</icon>
|
||||
<order>11</order>
|
||||
</attribute>
|
||||
<attribute id="postOfficeBox">
|
||||
<display>Post Box</display>
|
||||
<display>Post box</display>
|
||||
<order>12</order>
|
||||
</attribute>
|
||||
<attribute id="l">
|
||||
<display>t_city</display>
|
||||
<display>City</display>
|
||||
<order>13</order>
|
||||
</attribute>
|
||||
<attribute id="st">
|
||||
<display>t_state</display>
|
||||
<display>State</display>
|
||||
<order>14</order>
|
||||
</attribute>
|
||||
<attribute id="postalCode">
|
||||
<display>t_postal_code</display>
|
||||
<display>Postal code</display>
|
||||
<order>15</order>
|
||||
</attribute>
|
||||
<attribute id="c">
|
||||
@@ -109,16 +109,16 @@
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="telephoneNumber">
|
||||
<display>t_work_phone</display>
|
||||
<display>Work phone</display>
|
||||
<icon>images/phone.png</icon>
|
||||
<order>17</order>
|
||||
</attribute>
|
||||
<attribute id="facsimileTelephoneNumber">
|
||||
<display>t_fax</display>
|
||||
<display>Fax</display>
|
||||
<order>18</order>
|
||||
</attribute>
|
||||
<attribute id="mobile">
|
||||
<display>t_mobile</display>
|
||||
<display>Mobile</display>
|
||||
<order>19</order>
|
||||
</attribute>
|
||||
</attributes>
|
||||
|
@@ -1,736 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/modification/Attic/default.php,v 1.84.2.1 2005/10/09 06:14:50 wurley Exp $
|
||||
|
||||
|
||||
/*
|
||||
* edit.php
|
||||
* Displays the specified dn from the specified server for editing
|
||||
*
|
||||
* Variables that come in as GET vars:
|
||||
* - dn (rawurlencoded)
|
||||
* - server_id
|
||||
* - modified_attrs (optional) an array of attributes to highlight as
|
||||
* they were changed by the last operation
|
||||
*/
|
||||
|
||||
/** If an entry has more children than this, stop searching and display this amount with a '+' */
|
||||
$max_children = 100;
|
||||
$today = date('U');
|
||||
$shadow_before_today_attrs = arrayLower(array('shadowLastChange','shadowMin'));
|
||||
$shadow_after_today_attrs = arrayLower(array('shadowMax','shadowExpire','shadowWarning','shadowInactive'));
|
||||
$shadow_format_attrs = array_merge($shadow_before_today_attrs, $shadow_after_today_attrs);
|
||||
|
||||
isset( $dn ) or $dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null;
|
||||
$encoded_dn = rawurlencode( $dn );
|
||||
$modified_attrs = isset( $_GET['modified_attrs'] ) ? $_GET['modified_attrs'] : false;
|
||||
isset( $server_id ) or $server_id = $_GET['server_id'];
|
||||
$ldapserver = $ldapservers->Instance($server_id);
|
||||
$show_internal_attrs = isset( $_GET['show_internal_attrs'] ) ? true : false;
|
||||
if( null != $dn ) {
|
||||
$rdn = pla_explode_dn( $dn );
|
||||
if( isset( $rdn[0] ) )
|
||||
$rdn = $rdn[0];
|
||||
else
|
||||
$rdn = null;
|
||||
} else {
|
||||
$rdn = null;
|
||||
}
|
||||
|
||||
check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
|
||||
//pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] );
|
||||
$friendly_attrs = process_friendly_attr_table();
|
||||
if( ! isset( $attrs ) )
|
||||
$attrs = get_object_attrs( $ldapserver, $dn, false, get_view_deref_setting() );
|
||||
|
||||
//pla_ldap_connect( $server_id ) or pla_error( $lang['could_not_connect'] );
|
||||
//$system_attrs = get_entry_system_attrs( $ldapserver, $dn, get_view_deref_setting() ); NEVER USED?
|
||||
dn_exists( $ldapserver, $dn ) or pla_error( sprintf( $lang['no_such_entry'], pretty_print_dn( $dn ) ) );
|
||||
|
||||
$server_name = $servers[$server_id]['name'];
|
||||
|
||||
include './header.php'; ?>
|
||||
<body>
|
||||
|
||||
<h3 class="title"><?php echo htmlspecialchars( ( $rdn ) ); ?></h3>
|
||||
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $server_name; ?></b> <?php echo $lang['distinguished_name'];?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
|
||||
|
||||
<table class="edit_dn_menu">
|
||||
|
||||
<tr>
|
||||
<?php $time = gettimeofday(); $random_junk = md5( strtotime( 'now' ) . $time['usec'] ); ?>
|
||||
<td class="icon"><img src="images/refresh.png" /></td>
|
||||
<td><a href="edit.php?server_id=<?php echo $server_id; ?>&dn=<?php echo $encoded_dn; ?>&random=<?php
|
||||
echo $random_junk; ?>"
|
||||
title="<?php echo $lang['refresh_this_entry']; ?>"><?php echo $lang['refresh_entry']; ?></a></td>
|
||||
|
||||
<td class="icon"><img src="images/save.png" /></td>
|
||||
<?php $export_url = "export_form.php?server_id=$server_id&dn=$encoded_dn&scope=base"; ?>
|
||||
<td><a href="<?php echo $export_url; ?>" title="<?php echo $lang['export_tooltip']; ?>"><?php echo $lang['export']; ?></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="icon"><img src="images/cut.png" /></td>
|
||||
<td><a href="copy_form.php?server_id=<?php echo $server_id; ?>&dn=<?php echo $encoded_dn?>"
|
||||
title="<?php echo $lang['copy_this_entry_tooltip']; ?>"><?php echo $lang['copy_this_entry']; ?></a></td>
|
||||
<?php if( $show_internal_attrs ) { ?>
|
||||
<td class="icon"><img src="images/tools-no.png" /></td>
|
||||
<td><a href="edit.php?server_id=<?php echo $server_id; ?>&dn=<?php echo $encoded_dn; ?>"><?php echo $lang['hide_internal_attrs']; ?></a></td>
|
||||
<?php } else { ?>
|
||||
<td class="icon"><img src="images/tools.png" /></td>
|
||||
<td><a href="edit.php?server_id=<?php echo $server_id; ?>&dn=<?php echo $encoded_dn; ?>&show_internal_attrs=true"><?php echo $lang['show_internal_attrs']; ?></a></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<?php if( ! is_server_read_only( $server_id ) ) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/trash.png" /></td>
|
||||
<td><a style="color: red" href="delete_form.php?server_id=<?php echo $server_id; ?>&dn=<?php echo $encoded_dn; ?>"
|
||||
title="<?php echo $lang['delete_this_entry_tooltip']; ?>"><?php echo $lang['delete_this_entry']; ?></a></td>
|
||||
<td class="icon"><img src="images/rename.png" /></td>
|
||||
<td><a href="rename_form.php?server_id=<?php echo $server_id; ?>&dn=<?php echo $encoded_dn; ?>"><?php echo $lang['rename']; ?></a></td>
|
||||
<?php if( show_hints() ) { ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td colspan="3"><span class="hint"><?php echo $lang['delete_hint']; ?></span></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/compare.png" /></td>
|
||||
<td><a href="<?php echo "compare_form.php?server_id=$server_id&dn=$encoded_dn"; ?>"><?php echo $lang['compare_with']; ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/star.png" /></td>
|
||||
<td><a href="<?php echo "create_form.php?server_id=$server_id&container=$encoded_dn"; ?>"><?php echo $lang['create_a_child_entry']; ?></a></td>
|
||||
<td class="icon"><img src="images/add.png" /></td>
|
||||
<td><a href="<?php echo "add_attr_form.php?server_id=$server_id&dn=$encoded_dn"; ?>"><?php echo $lang['add_new_attribute']; ?></a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php flush(); ?>
|
||||
<?php $children = get_container_contents( $ldapserver, $dn, $max_children, '(objectClass=*)', get_view_deref_setting() );
|
||||
|
||||
if( ($children_count = count( $children ) ) > 0 ) {
|
||||
if( $children_count == $max_children )
|
||||
$children_count = $children_count . '+';
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="icon"><img src="images/children.png" /></td>
|
||||
<td><a href="search.php?search=true&server_id=<?php echo $server_id; ?>&filter=<?php echo rawurlencode('objectClass=*'); ?>&base_dn=<?php echo $encoded_dn; ?>&form=advanced&scope=one"><?php
|
||||
if( $children_count == 1 )
|
||||
echo $lang['view_one_child'];
|
||||
else
|
||||
echo sprintf( $lang['view_children'], $children_count ); ?></a></td>
|
||||
<td class="icon"><img src="images/save.png" /></td>
|
||||
<?php $export_url = "export_form.php?server_id=$server_id&dn=$encoded_dn&scope=sub"; ?>
|
||||
<td><a href="<?php echo $export_url; ?>"
|
||||
title="<?php echo $lang['export_subtree_tooltip']; ?>"><?php echo $lang['export_subtree']; ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?> <?php if( show_hints() ) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td colspan="3"><span class="hint"><?php echo $lang['attr_schema_hint']; ?></span></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( is_server_read_only( $server_id ) ) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td><?php echo $lang['viewing_read_only']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( $modified_attrs ) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<?php if( count( $modified_attrs ) > 1 ) { ?>
|
||||
<td colspan="3"><?php echo sprintf( $lang['attrs_modified'], implode( ', ', $modified_attrs ) ); ?></td>
|
||||
<?php } else { ?>
|
||||
<td colspan="3"><?php echo sprintf( $lang['attr_modified'], implode( '', $modified_attrs ) ); ?></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php
|
||||
// lower-case all the modified attrs to remove ambiguity when searching the array later
|
||||
foreach( $modified_attrs as $i => $attr ) {
|
||||
$modified_attrs[$i] = strtolower( $attr );
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php flush(); ?>
|
||||
|
||||
<br />
|
||||
<table class="edit_dn">
|
||||
|
||||
<?php
|
||||
if( $show_internal_attrs ) {
|
||||
$counter = 0;
|
||||
foreach( get_entry_system_attrs( $ldapserver, $dn ) as $attr => $vals ) {
|
||||
$counter++;
|
||||
$schema_href = "schema.php?server_id=$server_id&view=attributes&viewvalue=" . real_attr_name($attr);
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="attr"><b><a title="<?php echo sprintf( $lang['attr_name_tooltip'], $attr ); ?>"
|
||||
href="<?php echo $schema_href; ?>"><?php echo htmlspecialchars( $attr ); ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="val">
|
||||
<?php
|
||||
if( is_attr_binary( $ldapserver, $attr ) ) {
|
||||
$href = "download_binary_attr.php?server_id=$server_id&dn=$encoded_dn&attr=$attr";
|
||||
?>
|
||||
<small>
|
||||
<?php echo $lang['binary_value']; ?><br />
|
||||
<?php if( count( $vals ) > 1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?>
|
||||
<a href="<?php echo $href . "&value_num=$i"; ?>"><img
|
||||
src="images/save.png" /> <?php echo $lang['download_value']; ?>(<?php echo $i; ?>)</a><br />
|
||||
<?php } } else { ?>
|
||||
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a><br />
|
||||
<?php }
|
||||
} else {
|
||||
foreach( $vals as $v ) {
|
||||
echo htmlspecialchars( $v );
|
||||
echo "<br />\n";
|
||||
}
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
if( $counter == 0 )
|
||||
echo "<tr><td colspan=\"2\">(" . $lang['no_internal_attributes'] . ")</td></tr>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php flush(); ?>
|
||||
|
||||
<!-- Table of attributes/values to edit -->
|
||||
|
||||
<?php if( ! is_server_read_only( $server_id ) ) { ?>
|
||||
<form action="update_confirm.php" method="post" name="edit_form">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
|
||||
<?php } ?>
|
||||
|
||||
<?php $counter=0; ?>
|
||||
|
||||
<?php
|
||||
|
||||
if( ! $attrs || ! is_array( $attrs ) ) {
|
||||
echo "<tr><td colspan=\"2\">(" . $lang['no_attributes'] . ")</td></tr>\n";
|
||||
echo "</table>";
|
||||
echo "</html>";
|
||||
die();
|
||||
}
|
||||
|
||||
uksort( $attrs, 'sortAttrs' );
|
||||
foreach( $attrs as $attr => $vals ) {
|
||||
|
||||
flush();
|
||||
|
||||
$schema_attr = get_schema_attribute( $ldapserver, $attr, $dn );
|
||||
if( $schema_attr )
|
||||
$attr_syntax = $schema_attr->getSyntaxOID();
|
||||
else
|
||||
$attr_syntax = null;
|
||||
|
||||
if( 0 == strcasecmp( $attr, 'dn' ) )
|
||||
continue;
|
||||
|
||||
// has the config.php specified that this attribute is to be hidden or shown?
|
||||
if( is_attr_hidden( $ldapserver, $attr))
|
||||
continue;
|
||||
|
||||
// Setup the $attr_note, which will be displayed to the right of the attr name (if any)
|
||||
$attr_note = '';
|
||||
|
||||
// is there a user-friendly translation available for this attribute?
|
||||
if( isset( $friendly_attrs[ strtolower( $attr ) ] ) ) {
|
||||
$attr_display = $friendly_attrs[ strtolower( $attr ) ];
|
||||
$attr_note = "<acronym title=\"" . sprintf( $lang['alias_for'], $attr_display, $attr ) . "\">alias</acronym>";
|
||||
} else {
|
||||
$attr_note = "";
|
||||
$attr_display = $attr;
|
||||
}
|
||||
|
||||
// is this attribute required by an objectClass?
|
||||
$required_by = '';
|
||||
if( $schema_attr )
|
||||
foreach( $schema_attr->getRequiredByObjectClasses() as $required )
|
||||
if( isset($attrs['objectClass']) && in_array( strtolower( $required ), arrayLower( $attrs['objectClass'] ) ) )
|
||||
$required_by .= $required . ' ';
|
||||
|
||||
// It seems that some LDAP servers (Domino) returns attributes in lower case?
|
||||
elseif( isset($attrs['objectclass']) && in_array( strtolower( $required ), arrayLower( $attrs['objectclass'] ) ) )
|
||||
$required_by .= $required . ' ';
|
||||
|
||||
if( $required_by ) {
|
||||
if( trim( $attr_note ) )
|
||||
$attr_note .= ', ';
|
||||
|
||||
$attr_note .= "<acronym title=\"" . sprintf( $lang['required_for'], $required_by ) . "\">" . $lang['required'] . "</acronym> ";
|
||||
}
|
||||
|
||||
// is this attribute required because its the RDN
|
||||
if (preg_match("/^${attr}=/",$rdn)) {
|
||||
if( trim( $attr_note ) )
|
||||
$attr_note .= ', ';
|
||||
|
||||
$attr_note .= " <acronym title=\"" . $lang['required_by_entry'] . "\">" . 'rdn' . "</acronym> ";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if( is_array( $modified_attrs ) && in_array( strtolower($attr), $modified_attrs ) )
|
||||
$is_modified_attr = true;
|
||||
else
|
||||
$is_modified_attr = false;
|
||||
?>
|
||||
|
||||
<?php if( $is_modified_attr ) { ?>
|
||||
<tr class="updated_attr">
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<?php } ?>
|
||||
|
||||
<td class="attr">
|
||||
<?php $schema_href="schema.php?server_id=$server_id&view=attributes&viewvalue=" . real_attr_name($attr); ?>
|
||||
<b>
|
||||
<a
|
||||
title="<?php echo sprintf( $lang['attr_name_tooltip'], $attr ) ?>"
|
||||
href="<?php echo $schema_href; ?>"><?php echo $attr_display; ?></a></b>
|
||||
</td>
|
||||
<td class="attr_note">
|
||||
<sup><small><?php echo $attr_note; ?></small></sup>
|
||||
<?php if( is_attr_read_only( $ldapserver, $attr ) ) { ?>
|
||||
<small>(<acronym title="<?php echo $lang['read_only_tooltip']; ?>"><?php echo $lang['read_only']; ?></acronym>)</small>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if( $is_modified_attr ) { ?>
|
||||
<tr class="updated_attr">
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<?php } ?>
|
||||
<td class="val" colspan="2">
|
||||
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Is this attribute a jpegPhoto?
|
||||
*/
|
||||
if( is_jpeg_photo( $ldapserver, $attr ) ) {
|
||||
|
||||
// Don't draw the delete buttons if there is more than one jpegPhoto
|
||||
// (phpLDAPadmin can't handle this case yet)
|
||||
if( $ldapserver->isReadOnly() || is_attr_read_only( $ldapserver, $attr ) )
|
||||
draw_jpeg_photos( $ldapserver, $dn, $attr, false );
|
||||
else
|
||||
draw_jpeg_photos( $ldapserver, $dn, $attr, true );
|
||||
|
||||
// proceed to the next attribute
|
||||
echo "</td></tr>\n";
|
||||
if( $is_modified_attr )
|
||||
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Is this attribute binary?
|
||||
*/
|
||||
if( is_attr_binary( $ldapserver, $attr ) ) {
|
||||
|
||||
|
||||
$href = "download_binary_attr.php?server_id=$server_id&dn=$encoded_dn&attr=$attr";
|
||||
?>
|
||||
|
||||
<small>
|
||||
<?php echo $lang['binary_value']; ?>
|
||||
<?php if (! strcasecmp( $attr, 'objectSid' ) ) {
|
||||
printf(' (%s)',binSIDtoText($vals[0]));
|
||||
} ?>
|
||||
<br />
|
||||
<?php if( count( $vals ) > 1 ) { for( $i=1; $i<=count($vals); $i++ ) { ?>
|
||||
<a href="<?php echo $href . "&value_num=$i"; ?>"><img
|
||||
src="images/save.png" /> <?php echo $lang['download_value']; ?>(<?php echo $i; ?>)</a><br />
|
||||
<?php } } else { ?>
|
||||
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a><br />
|
||||
<?php } ?>
|
||||
|
||||
<?php if( ! is_server_read_only( $server_id ) && ! is_attr_read_only( $ldapserver, $attr ) ) { ?>
|
||||
<a href="javascript:deleteAttribute( '<?php echo $attr; ?>' );"
|
||||
style="color:red;"><img src="images/trash.png" /> <?php echo $lang['delete_attribute']; ?></a>
|
||||
<?php } ?>
|
||||
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
if( $is_modified_attr )
|
||||
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Note: at this point, the attribute must be text-based (not binary or jpeg)
|
||||
*/
|
||||
|
||||
// If we this is the userPassword attribute, add the javascript so we can call check password later.
|
||||
if (! strcasecmp( $attr, 'userPassword' ) ) {
|
||||
$user_password = $vals[0]; ?>
|
||||
<script language="javascript">
|
||||
<!--
|
||||
function passwordComparePopup()
|
||||
{
|
||||
mywindow = open( 'password_checker.php', 'myname', 'resizable=no,width=450,height=200,scrollbars=1' );
|
||||
mywindow.location.href = 'password_checker.php?hash=<?php echo base64_encode($user_password); ?>&base64=true';
|
||||
if( mywindow.opener == null )
|
||||
mywindow.opener = self;
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<?php }
|
||||
|
||||
/*
|
||||
* If this server is in read-only mode or this attribute is configured as read_only,
|
||||
* simply draw the attribute values and continue.
|
||||
*/
|
||||
if( is_server_read_only( $server_id ) || is_attr_read_only( $ldapserver, $attr ) || (preg_match("/^${attr}=/",$rdn)) ) {
|
||||
if( is_array( $vals ) ) {
|
||||
foreach( $vals as $i => $val ) {
|
||||
if( trim( $val ) == "" )
|
||||
echo "<span style=\"color:red\">[" . $lang['empty'] . "]</span><br />\n";
|
||||
elseif( 0 == strcasecmp( $attr, 'userPassword' ) && obfuscate_password_display() )
|
||||
echo preg_replace( '/./', '*', $val ) . "<br />";
|
||||
|
||||
elseif( in_array(strtolower($attr), $shadow_format_attrs) ) {
|
||||
$shadow_date = shadow_date( $attrs, $attr);
|
||||
echo htmlspecialchars($val)." ";
|
||||
echo "<small>";
|
||||
if( ($today < $shadow_date) && in_array(strtolower($attr), $shadow_before_today_attrs) )
|
||||
echo '<span style="color:red">'.htmlspecialchars("(".strftime(get_date_format(),$shadow_date).")").'</span>';
|
||||
elseif( $today > $shadow_date && in_array(strtolower($attr), $shadow_after_today_attrs) )
|
||||
echo '<span style="color:red">'.htmlspecialchars("(".strftime(get_date_format(),$shadow_date).")").'</span>';
|
||||
else
|
||||
echo htmlspecialchars("(".strftime(get_date_format(),shadow_date( $attrs, $attr)).")");
|
||||
echo "</small>";
|
||||
} else
|
||||
echo htmlspecialchars( $val ) . "<br />";
|
||||
}
|
||||
} else {
|
||||
if( 0 == strcasecmp( $attr, 'userPassword' ) && obfuscate_password_display() )
|
||||
echo preg_replace( '/./', '*', $vals ) . "<br />";
|
||||
else
|
||||
echo $vals . "<br />"; ?>
|
||||
|
||||
|
||||
<?php }
|
||||
if (! strcasecmp( $attr, 'userPassword' ) ) {?>
|
||||
<small><a href="javascript:passwordComparePopup()"><?php echo $lang['t_check_pass']; ?></a></small>
|
||||
<?php }
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
if( $is_modified_attr )
|
||||
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Is this a userPassword attribute?
|
||||
*/
|
||||
if( 0 == strcasecmp( $attr, 'userpassword' ) ) {
|
||||
$user_password = $vals[0];
|
||||
$enc_type = get_enc_type( $user_password );
|
||||
|
||||
// Set the default hashing type if the password is blank (must be newly created)
|
||||
if( $user_password == '' ) {
|
||||
$enc_type = get_default_hash( $server_id );
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="hidden"
|
||||
name="old_values[userpassword]"
|
||||
value="<?php echo htmlspecialchars($user_password); ?>" />
|
||||
|
||||
<!-- Special case of enc_type to detect changes when user changes enc_type but not the password value -->
|
||||
<input size="38"
|
||||
type="hidden"
|
||||
name="old_enc_type"
|
||||
value="<?php echo ($enc_type==''?'clear':$enc_type); ?>" />
|
||||
|
||||
<?php if( obfuscate_password_display( $enc_type ) ) {
|
||||
echo htmlspecialchars( preg_replace( "/./", "*", $user_password ) );
|
||||
} else {
|
||||
echo htmlspecialchars( $user_password );
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
<input style="width: 260px"
|
||||
type="<?php
|
||||
if( obfuscate_password_display( $enc_type ) )
|
||||
echo 'password';
|
||||
else
|
||||
echo 'text';
|
||||
?>"
|
||||
name="new_values[userpassword]"
|
||||
value="<?php echo htmlspecialchars( $user_password ); ?>" />
|
||||
|
||||
<?php echo enc_type_select_list($enc_type); ?>
|
||||
|
||||
<br />
|
||||
|
||||
<small><a href="javascript:passwordComparePopup()"><?php echo $lang['t_check_pass']; ?></a></small>
|
||||
|
||||
</td></tr>
|
||||
|
||||
<?php
|
||||
if( $is_modified_attr )
|
||||
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Is this a boolean attribute?
|
||||
*/
|
||||
if( is_attr_boolean( $ldapserver, $attr) ) {
|
||||
$val = $vals[0];
|
||||
?>
|
||||
|
||||
<input type="hidden"
|
||||
name="old_values[<?php echo htmlspecialchars( $attr ); ?>]"
|
||||
value="<?php echo htmlspecialchars($val); ?>" />
|
||||
|
||||
<select name="new_values[<?php echo htmlspecialchars( $attr ); ?>]">
|
||||
<option value="TRUE"<?php echo ($val=='TRUE' ? ' selected' : ''); ?>>
|
||||
<?php echo $lang['true']; ?></option>
|
||||
<option value="FALSE"<?php echo ($val=='FALSE' ? ' selected' : ''); ?>>
|
||||
<?php echo $lang['false']; ?></option>
|
||||
<option value="">(<?php echo $lang['none_remove_value']; ?>)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if( $is_modified_attr )
|
||||
echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
|
||||
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;
|
||||
|
||||
?>
|
||||
|
||||
<!-- The old_values array will let update.php know if the entry contents changed
|
||||
between the time the user loaded this page and saved their changes. -->
|
||||
<input type="hidden"
|
||||
name="old_values[<?php echo htmlspecialchars( $attr ); ?>][<?php echo $i; ?>]"
|
||||
value="<?php echo htmlspecialchars($val); ?>" />
|
||||
<?php
|
||||
|
||||
// Is this value is a structural objectClass, make it read-only
|
||||
if( 0 == strcasecmp( $attr, 'objectClass' ) ) {
|
||||
?>
|
||||
<a
|
||||
title="<?php echo $lang['view_schema_for_oclass']; ?>"
|
||||
href="schema.php?server_id=<?php echo $server_id; ?>&view=objectClasses&viewvalue=<?php echo htmlspecialchars( $val ); ?>"><img
|
||||
src="images/info.png" /></a>
|
||||
<?php
|
||||
$schema_object = get_schema_objectclass( $ldapserver, $val);
|
||||
if ($schema_object->type == 'structural') {
|
||||
echo "$val <small>(<acronym title=\"" .
|
||||
sprintf( $lang['structural_object_class_cannot_remove'] ) . "\">" .
|
||||
$lang['structural'] . "</acronym>)</small><br />";
|
||||
?>
|
||||
<input type="hidden"
|
||||
name="<?php echo $input_name; ?>"
|
||||
id="<?php echo $input_id; ?>"
|
||||
value="<?php echo htmlspecialchars($val); ?>" />
|
||||
<?php
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if( is_dn_string( $val ) || is_dn_attr( $ldapserver, $attr ) ) { ?>
|
||||
<a
|
||||
title="<?php echo sprintf( $lang['go_to_dn'], htmlspecialchars($val) ); ?>"
|
||||
href="edit.php?server_id=<?php echo $server_id; ?>&dn=<?php echo rawurlencode($val); ?>"><img
|
||||
style="vertical-align: top" src="images/go.png" /></a>
|
||||
<?php } elseif( is_mail_string( $val ) ) { ?>
|
||||
<a
|
||||
href="mailto:<?php echo htmlspecialchars($val); ?>"><img
|
||||
style="vertical-align: center" src="images/mail.png" /></a>
|
||||
<?php } elseif( is_url_string( $val ) ) { ?>
|
||||
<a
|
||||
href="<?php echo htmlspecialchars($val); ?>"
|
||||
target="new"><img
|
||||
style="vertical-align: center" src="images/dc.png" /></a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if( is_multi_line_attr( $attr, $val, $server_id ) ) { ?>
|
||||
<textarea
|
||||
class="val"
|
||||
rows="3"
|
||||
cols="50"
|
||||
name="<?php echo $input_name; ?>"
|
||||
id="<?php echo $input_id; ?>"><?php echo htmlspecialchars($val); ?></textarea>
|
||||
<?php } else { ?>
|
||||
<input type="text"
|
||||
class="val"
|
||||
name="<?php echo $input_name; ?>"
|
||||
id="<?php echo $input_id; ?>"
|
||||
value="<?php echo htmlspecialchars($val); ?>" />
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php
|
||||
// draw a link for popping up the entry browser if this is the type of attribute
|
||||
// that houses DNs.
|
||||
if( is_dn_attr( $ldapserver, $attr ) )
|
||||
draw_chooser_link( "edit_form.$input_id", false );
|
||||
|
||||
// If this is a gidNumber on a non-PosixGroup entry, lookup its name and description for convenience
|
||||
if( 0 == strcasecmp( $attr, 'gidNumber' ) &&
|
||||
! in_array_ignore_case( 'posixGroup', get_object_attr( $ldapserver, $dn, 'objectClass' ) ) ) {
|
||||
$gid_number = $val;
|
||||
$search_group_filter = "(&(objectClass=posixGroup)(gidNumber=$val))";
|
||||
$group = pla_ldap_search( $ldapserver, $search_group_filter, null, array( 'dn', 'description' ) );
|
||||
if( count( $group ) > 0 ) {
|
||||
echo "<br />";
|
||||
$group = array_pop( $group );
|
||||
$group_dn = $group['dn'];
|
||||
$group_name = explode( '=', get_rdn( $group_dn ) );
|
||||
$group_name = $group_name[1];
|
||||
$href = "edit.php?server_id=$server_id&dn=" . urlencode( $group_dn );
|
||||
echo "<small>";
|
||||
echo "<a href=\"$href\">" . htmlspecialchars($group_name) . "</a>";
|
||||
$description = isset( $group['description'] ) ? $group['description'] : null;
|
||||
if( $description ) echo " (" . htmlspecialchars( $description ) . ")";
|
||||
echo "</small>";
|
||||
}
|
||||
}
|
||||
|
||||
// Show the dates for all the shadow attributes.
|
||||
if( in_array(strtolower($attr), $shadow_format_attrs) ) {
|
||||
if( ( $shadow_date = shadow_date( $attrs, $attr) ) !== false ) {
|
||||
echo "<br />";
|
||||
echo "<small>";
|
||||
if( ($today < $shadow_date) && in_array(strtolower($attr), $shadow_before_today_attrs) )
|
||||
echo '<span style="color:red">'.htmlspecialchars(strftime(get_date_format(),$shadow_date)).'</span>';
|
||||
elseif( $today > $shadow_date && in_array(strtolower($attr), $shadow_after_today_attrs) )
|
||||
echo '<span style="color:red">'.htmlspecialchars(strftime(get_date_format(),$shadow_date)).'</span>';
|
||||
else
|
||||
echo htmlspecialchars(strftime(get_date_format(),$shadow_date));
|
||||
echo "</small>";
|
||||
}
|
||||
} ?>
|
||||
|
||||
<br />
|
||||
|
||||
<?php } /* end foreach value */ ?>
|
||||
|
||||
<?php
|
||||
/* Draw the "add value" link under the list of values for this attributes */
|
||||
|
||||
if( ! is_server_read_only( $server_id ) &&
|
||||
( $schema_attr = get_schema_attribute( $ldapserver, $attr, $dn ) ) &&
|
||||
! $schema_attr->getIsSingleValue() )
|
||||
{
|
||||
$add_href = "add_value_form.php?server_id=$server_id&" .
|
||||
"dn=$encoded_dn&attr=" . rawurlencode( $attr );
|
||||
echo "<div class=\"add_value\">(<a href=\"$add_href\"
|
||||
title=\"" . sprintf( $lang['add_value_tooltip'], $attr ) . "\">" .
|
||||
$lang['add_value'] . "</a>)</div>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if( $is_modified_attr ) { ?>
|
||||
<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
|
||||
flush();
|
||||
|
||||
} /* End foreach( $attrs as $attr => $vals ) */ ?>
|
||||
|
||||
<?php if( ! is_server_read_only( $server_id ) ) { ?>
|
||||
<tr><td colspan="2"><center><input type="submit" value="<?php echo $lang['save_changes']; ?>" /></center></td></tr></form>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
?>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<?php /* If this entry has a binary attribute, we need to provide a form for it to submit when deleting it. */ ?>
|
||||
<script language="javascript">
|
||||
//<!--
|
||||
function deleteAttribute( attrName )
|
||||
{
|
||||
if( confirm( "<?php echo $lang['really_delete_attribute']; ?> '" + attrName + "'?" ) ) {
|
||||
document.delete_attribute_form.attr.value = attrName;
|
||||
document.delete_attribute_form.submit();
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute -->
|
||||
<form name="delete_attribute_form" action="delete_attr.php" method="post">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
|
||||
<input type="hidden" name="attr" value="FILLED IN BY JAVASCRIPT" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Given an attribute $x, this returns true if it is NOT already specified
|
||||
* in the current entry, returns false otherwise.
|
||||
*/
|
||||
function not_an_attr( $x )
|
||||
{
|
||||
global $attrs;
|
||||
//return ! isset( $attrs[ strtolower( $x ) ] );
|
||||
foreach( $attrs as $attr => $values )
|
||||
if( 0 == strcasecmp( $attr, $x ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
echo "</body>\n</html>";
|
||||
?>
|
@@ -1,142 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/modification/Attic/group_of_names.php,v 1.9 2005/03/05 06:27:08 wurley Exp $
|
||||
|
||||
|
||||
/*
|
||||
* group_of_names.php
|
||||
* Template for displaying a groupOfNames or groupOfUniqueNames object.
|
||||
*
|
||||
* Variables that come in as GET vars:
|
||||
* - dn
|
||||
* - server_id
|
||||
* - modified_attrs (optional) an array of attributes to highlight as
|
||||
* they were changed by the last operation
|
||||
*/
|
||||
|
||||
include './header.php';
|
||||
$members = get_object_attr( $ldapserver, $dn, 'uniqueMember' );
|
||||
$unique = true;
|
||||
$attr_name = 'uniqueMember';
|
||||
if( null == $members ) {
|
||||
$attr_name = 'member';
|
||||
$members = get_object_attr( $ldapserver, $dn, 'member' );
|
||||
$unique = false;
|
||||
}
|
||||
$rdn = get_rdn( $dn );
|
||||
$groupName = explode( '=', $rdn, 2 );
|
||||
$groupName = $groupName[1];
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
|
||||
// For removing elements from the member list.
|
||||
// This is overly complicated. Good luck figuring
|
||||
// out what it does. :) In fact, this thing is sooo
|
||||
// ugly that I'm not even sure it will work on
|
||||
// all browsers, but oh well... To understand it,
|
||||
// you'll have to understand how the old_values
|
||||
// and new_values array works when submitting
|
||||
// a form to update_confirm.php. So start there.
|
||||
function remove_member( dn )
|
||||
{
|
||||
//alert( 'Looking for ' + dn );
|
||||
var form = document.remove_member_form;
|
||||
for ( x=0; x<form.elements.length; x++ ) {
|
||||
var element = form.elements[x];
|
||||
if( dn == element.value ) {
|
||||
//alert( 'Found it at index: ' + x );
|
||||
element.value = '';
|
||||
form.submit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
|
||||
<form action="update_confirm.php" method="post" name="remove_member_form" style="margin:0">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="dn" value="<?php echo htmlspecialchars( $dn ); ?>" />
|
||||
<?php for( $i=0; $i<count($members); $i++) { $member=$members[$i]; ?>
|
||||
<input type="hidden" name="new_values[<?php echo $attr_name; ?>][<?php echo $i; ?>]" value="<?php echo htmlspecialchars( $member ); ?>" />
|
||||
<?php } ?>
|
||||
<?php for( $i=0; $i<count($members); $i++) { $member=$members[$i]; ?>
|
||||
<input type="hidden" name="old_values[<?php echo $attr_name; ?>][<?php echo $i; ?>]" value="<?php echo htmlspecialchars( $member ); ?>" />
|
||||
<?php } ?>
|
||||
</form>
|
||||
|
||||
<h3 class="title">Group: <b><?php echo htmlspecialchars( $groupName ); ?></b></h3>
|
||||
|
||||
<center><small>
|
||||
Using the <b>group of names</b> template.
|
||||
You may switch to the <a href="<?php echo $default_href; ?>">default template</a>
|
||||
</small></center>
|
||||
|
||||
<?php
|
||||
|
||||
echo '<h3>List of Members (' . ( $unique ? 'unique' : 'non-unique' ) . ')</h3>';
|
||||
if( ! is_array( $members ) || 0 == count( $members ) ) {
|
||||
echo "(none)";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
} else {
|
||||
echo "<ol>";
|
||||
for( $i=0; $i<count($members); $i++ ) {
|
||||
$member = $members[$i];
|
||||
echo "<li>";
|
||||
echo "<a href=\"edit.php?server_id=$server_id&dn=" . rawurlencode( $member );
|
||||
echo "&use_default_template=true\" title=\"Jump to this object\">";
|
||||
echo htmlspecialchars( $member ) . "</a>";
|
||||
echo " <small>(<a style=\"color:red\" href=\"javascript:remove_member( '" . htmlspecialchars( $member ) . "' );\" title=\"Remove this DN from the list\">remove</a>)</small>";
|
||||
|
||||
$member_cn = get_object_attr( $ldapserver, $member, 'cn' );
|
||||
$member_cn = @$member_cn[0];
|
||||
$member_sn = get_object_attr( $ldapserver, $member, 'sn' );
|
||||
$member_sn = @$member_sn[0];
|
||||
echo '<small>';
|
||||
// Don't display the SN if it is a subset of the CN
|
||||
if( false !== strpos( $member_cn, $member_sn ) )
|
||||
$member_sn = ' ';
|
||||
if( $member_sn && $member_cn )
|
||||
echo '<br /> Name: ' . htmlspecialchars( $member_cn . ' ' . $member_sn );
|
||||
$object_classes = get_object_attr( $ldapserver, $member, 'objectClass' );
|
||||
if( is_array( $object_classes ) )
|
||||
echo '<br /> objectClasses: ' . implode( ', ', $object_classes );
|
||||
echo '</small>';
|
||||
"</li>";
|
||||
}
|
||||
echo "</ol>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<script language="javascript">
|
||||
function isValidMember()
|
||||
{
|
||||
var newValue = document.add_member_form.new_value.value;
|
||||
if( trim( newValue ) == '' ) {
|
||||
alert( 'Your new member cannot be empty.' );
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="add_value.php" onSubmit="return isValidMember()" method="post" name="add_member_form">
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
<input type="hidden" name="dn" value="<?php echo htmlspecialchars( $dn ); ?>" />
|
||||
<input type="hidden" name="attr" value="<?php echo $attr_name; ?>" />
|
||||
|
||||
<div style="margin-left: 20px; border:1px solid gray; background-color: #eef; padding:5px; width: 300px">
|
||||
<small>Add a new member:</small><br />
|
||||
<input style="margin:0" type="text" name="new_value" size="35" style="font-size: 12px" value="" />
|
||||
<?php draw_chooser_link( 'add_member_form.new_value', false ); ?><br />
|
||||
<input type="submit" name="submit" value="Add" />
|
||||
</div>
|
||||
</form>
|
||||
|
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* samba_account.php
|
||||
* Template for displaying a sambasamaccount object.
|
||||
*
|
||||
* Variables that come in as GET vars:
|
||||
* - dn
|
||||
* - server_id
|
||||
* - modified_attrs (optional) an array of attributes to highlight as
|
||||
* they were changed by the last operation
|
||||
*
|
||||
* @package phpLDAPadmin
|
||||
*
|
||||
* @author The phpLDAPadmin development team
|
||||
**/
|
||||
|
||||
include './header.php';
|
||||
$rdn = get_rdn( $dn );
|
||||
$sambaAccount = explode( '=', $rdn, 2 );
|
||||
$sambaAccountRdn = $sambaAccount[1];
|
||||
$attrs = get_object_attrs( $ldapserver, $dn, false, get_view_deref_setting());
|
||||
?>
|
||||
<body>
|
||||
<h3 class="title"><?php echo $lang['samba_account'] . ': '; ?> <b><?php echo htmlspecialchars( $sambaAccountRdn ); ?></b></h3>
|
||||
<center><small>
|
||||
<?php echo $lang['using'] . ' <b>' . $lang['samba_account_lcase'] . '</b>' . $lang['template'] . '.'; ?>
|
||||
<?php echo $lang['switch_to'] . '<a href=' . $default_href . '>' . $lang['default_template'] . '</a>'; ?>
|
||||
</small></center>
|
||||
<h2 style="text-align:center;color:#016;text-decoration:underline;">TO DO</h2>
|
||||
</body>
|
||||
</html>
|
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/modification/Attic/user.php,v 1.5 2005/02/26 12:33:49 wurley Exp $
|
||||
|
||||
|
||||
/*
|
||||
* User modification template. All phpLDAPadmin templates can assume that the following
|
||||
* variables are defined externally for them:
|
||||
* $server_id
|
||||
* $dn
|
||||
* Other variables will need to be manually extracted from the $_GET or $_POST arrays.
|
||||
* It may also be assumed that all functions in functions.php and schema_functions.php
|
||||
* are available for use.
|
||||
*/
|
||||
|
||||
$rdn = get_rdn( $dn );
|
||||
$user_name = explode( '=', $rdn );
|
||||
$user_name = $user_name[1];
|
||||
$encoded_dn = rawurlencode( $dn );
|
||||
|
||||
$server_name = $servers[$server_id]['name'];
|
||||
|
||||
include './header.php';
|
||||
?>
|
||||
|
||||
<body>
|
||||
|
||||
<h3 class="title">Editing User: <b><?php echo htmlspecialchars( utf8_decode( $user_name ) ); ?></b></h3>
|
||||
<h3 class="subtitle">
|
||||
Server: <b><?php echo $server_name; ?></b>
|
||||
LDAP <acronym title="Distinguished Name">DN</acronym>:
|
||||
<b><?php echo htmlspecialchars( utf8_decode( $dn ) ); ?></b>
|
||||
</h3>
|
||||
|
||||
<center><small>
|
||||
Using the <b>user</b> template.
|
||||
You may switch to the <a href="<?php echo $default_href; ?>">default template</a>
|
||||
</small></center>
|
||||
|
||||
|
||||
<center><h1><tt>TODO: FinishMe</tt></h1></center>
|
@@ -1,28 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>address_book_moz</title>
|
||||
<title>Address Book Entry (mozillaOrgPerson)</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/user.png</icon>
|
||||
<description>t_new_address</description>
|
||||
<description>New Address Book Entry</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="inetOrgPerson"></objectClass>
|
||||
<objectClass id="mozillaOrgPerson"></objectClass>
|
||||
<objectClass id="mozillaAddressBookEntry"></objectClass>
|
||||
</objectClasses>
|
||||
|
||||
<attributes>
|
||||
<attribute id="givenName">
|
||||
<display>t_first_name</display>
|
||||
<display>First Name</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<onchange>autoFill:cn,%sn% %givenName%</onchange>
|
||||
<order>1</order>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last Name</display>
|
||||
<onchange>autoFill:cn,%sn% %givenName%</onchange>
|
||||
<order>2</order>
|
||||
</attribute>
|
||||
@@ -31,27 +31,26 @@
|
||||
<order>3</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaNickName">
|
||||
<display>mozillaNickname</display>
|
||||
<display>Nickname</display>
|
||||
<order>4</order>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="mail">
|
||||
<display>t_email</display>
|
||||
<icon>images/phone.png</icon>
|
||||
<order>5</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaSecondEmail">
|
||||
<display>Second email</display>
|
||||
<display>Additional email</display>
|
||||
<order>6</order>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="telephoneNumber">
|
||||
<display>t_work_phone</display>
|
||||
<display>Work Phone</display>
|
||||
<icon>images/phone.png</icon>
|
||||
<order>7</order>
|
||||
</attribute>
|
||||
<attribute id="homePhone">
|
||||
<display>Home</display>
|
||||
<display>Home Phone</display>
|
||||
<order>8</order>
|
||||
</attribute>
|
||||
<attribute id="facsimileTelephoneNumber">
|
||||
@@ -68,72 +67,72 @@
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="homePostalAddress">
|
||||
<display>Address</display>
|
||||
<display>Home Address</display>
|
||||
<order>12</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaHomePostalAddress2">
|
||||
<display>Address 2</display>
|
||||
<display>Home Address 2</display>
|
||||
<order>13</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaHomeLocalityName">
|
||||
<display>City</display>
|
||||
<display>Home City</display>
|
||||
<order>14</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaHomeState">
|
||||
<display>State</display>
|
||||
<display>Home State</display>
|
||||
<order>15</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaHomePostalCode">
|
||||
<display>ZIP</display>
|
||||
<display>Home ZIP/Postal Code</display>
|
||||
<order>16</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaHomeCountryName">
|
||||
<display>Country</display>
|
||||
<display>Home Country</display>
|
||||
<order>17</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaHomeUrl">
|
||||
<display>Web page</display>
|
||||
<display>Home Web page</display>
|
||||
<order>18</order>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="title">
|
||||
<display>Title</display>
|
||||
<display>Work Title</display>
|
||||
<order>19</order>
|
||||
</attribute>
|
||||
<attribute id="ou">
|
||||
<display>Department</display>
|
||||
<display>Work Department</display>
|
||||
<order>20</order>
|
||||
</attribute>
|
||||
<attribute id="o">
|
||||
<display>Organization</display>
|
||||
<display>Work Organization</display>
|
||||
<order>21</order>
|
||||
</attribute>
|
||||
<attribute id="postalAddress">
|
||||
<display>Address</display>
|
||||
<attribute id="street">
|
||||
<display>Work Address</display>
|
||||
<order>22</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaPostalAddress2">
|
||||
<display>Address 2</display>
|
||||
<attribute id="mozillaWorkStreet2">
|
||||
<display>Work Address 2</display>
|
||||
<order>23</order>
|
||||
</attribute>
|
||||
<attribute id="l">
|
||||
<display>City</display>
|
||||
<display>Work City</display>
|
||||
<order>24</order>
|
||||
</attribute>
|
||||
<attribute id="st">
|
||||
<display>State/Province</display>
|
||||
<display>Work State/Province</display>
|
||||
<order>25</order>
|
||||
</attribute>
|
||||
<attribute id="postalCode">
|
||||
<display>ZIP</display>
|
||||
<display>Work ZIP/Postal Code</display>
|
||||
<order>26</order>
|
||||
</attribute>
|
||||
<attribute id="c">
|
||||
<display>Country</display>
|
||||
<display>Work Country</display>
|
||||
<order>27</order>
|
||||
</attribute>
|
||||
<attribute id="mozillaWorkUrl">
|
||||
<display>Web page</display>
|
||||
<display>Work Web page</display>
|
||||
<order>28</order>
|
||||
</attribute>
|
||||
</attributes>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>organizational_role</title>
|
||||
<title>Organisational Role</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/o.png</icon>
|
||||
<description>New Organisational Role</description>
|
||||
@@ -20,12 +20,12 @@
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="telephoneNumber">
|
||||
<display>t_work_phone</display>
|
||||
<display>Work phone</display>
|
||||
<icon>images/phone.png</icon>
|
||||
<order>2</order>
|
||||
</attribute>
|
||||
<attribute id="facsimileTelephoneNumber">
|
||||
<display>t_fax</display>
|
||||
<display>Fax</display>
|
||||
<order>3</order>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
@@ -50,15 +50,15 @@
|
||||
<order>6</order>
|
||||
</attribute>
|
||||
<attribute id="l">
|
||||
<display>t_city</display>
|
||||
<display>City</display>
|
||||
<order>7</order>
|
||||
</attribute>
|
||||
<attribute id="st">
|
||||
<display>t_state</display>
|
||||
<display>State</display>
|
||||
<order>8</order>
|
||||
</attribute>
|
||||
<attribute id="postalCode">
|
||||
<display>t_postal_code</display>
|
||||
<display>Postal code</display>
|
||||
<order>9</order>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>organizational_unit</title>
|
||||
<title>Organisational Unit</title>
|
||||
<!-- <regexp>^o=.*,</regexp> -->
|
||||
<icon>images/ou.png</icon>
|
||||
<description>new_organizational_unit</description>
|
||||
<description>New Organisational Unit</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>ou</rdn>
|
||||
<visible>1</visible>
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="ou">
|
||||
<description>organizational_unit</description>
|
||||
<display>organizational_unit</display>
|
||||
<description>Organisational Unit</description>
|
||||
<display>Organisational Unit</display>
|
||||
<hint>don't include "ou="</hint>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>user_account</title>
|
||||
<title>User Account</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/user.png</icon>
|
||||
<description>t_new_user_account</description>
|
||||
<description>New User Account</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="givenName">
|
||||
<display>t_first_name</display>
|
||||
<display>First name</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last name</display>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<onchange>autoFill:uid,%gidNumber|0-0/T%-%givenName|0-1/l%%sn/l%</onchange>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
@@ -36,43 +36,43 @@
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="uid">
|
||||
<display>t_uid</display>
|
||||
<display>User ID</display>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
<order>4</order>
|
||||
<page>1</page>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="homeDirectory">
|
||||
<display>t_home_dir</display>
|
||||
<display>Home directory</display>
|
||||
<order>8</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="uidNumber">
|
||||
<display>t_uid_number</display>
|
||||
<hint>t_auto_det</hint>
|
||||
<display>UID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<icon>images/terminal.png</icon>
|
||||
<order>6</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,uid)</presubmit>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<display>GID Number</display>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
<order>7</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixGroup),gidNumber,%cn%)</value>
|
||||
</attribute>
|
||||
<attribute id="loginShell">
|
||||
<display>t_login_shell</display>
|
||||
<display>Login shell</display>
|
||||
<order>9</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixAccount),loginShell,%loginShell%)</value>
|
||||
</attribute>
|
||||
<attribute id="userPassword">
|
||||
<display>t_password</display>
|
||||
<display>Password</display>
|
||||
<helper>
|
||||
<default>md5</default>
|
||||
<display>t_encryption</display>
|
||||
<display>Encryption</display>
|
||||
<id>enc</id>
|
||||
<location>side</location>
|
||||
<value>blowfish</value>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>posix_group</title>
|
||||
<title>Posix Group</title>
|
||||
<!-- <regexp>^ou=.*,</regexp> -->
|
||||
<icon>images/ou.png</icon>
|
||||
<description>t_new_posixgroup</description>
|
||||
<description>New Posix Group</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>cn</rdn>
|
||||
<visible>1</visible>
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="cn">
|
||||
<display>t_group</display>
|
||||
<display>Group</display>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<hint>t_auto_det</hint>
|
||||
<display>GID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,gid)</presubmit>
|
||||
@@ -29,7 +29,7 @@
|
||||
</attribute>
|
||||
<attribute id="memberUid">
|
||||
<array>10</array>
|
||||
<display>users</display>
|
||||
<display>Users</display>
|
||||
<helper>
|
||||
<location>side</location>
|
||||
<!-- <value>=php.DrawChooserLink(memberUid,0)</value> -->
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="cn">
|
||||
<display>t_group</display>
|
||||
<display>Group</display>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
@@ -26,8 +26,8 @@
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<hint>t_auto_det</hint>
|
||||
<display>GID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<order>3</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,gid)</presubmit>
|
||||
@@ -57,7 +57,7 @@
|
||||
</attribute>
|
||||
<attribute id="memberUid">
|
||||
<array>10</array>
|
||||
<display>users</display>
|
||||
<display>Users</display>
|
||||
<helper>
|
||||
<location>side</location>
|
||||
<!-- <value>=php.DrawChooserLink(memberUid,0)</value> -->
|
||||
|
@@ -25,14 +25,14 @@
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="uidNumber">
|
||||
<display>t_uid_number</display>
|
||||
<hint>t_auto_det</hint>
|
||||
<display>UID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<order>2</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,uid)</presubmit>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<display>GID Number</display>
|
||||
<order>3</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixGroup),gidNumber,%cn%)</value>
|
||||
|
@@ -17,14 +17,14 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="givenName">
|
||||
<display>t_first_name</display>
|
||||
<display>First name</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
<attribute id="sn">
|
||||
<display>t_last_name</display>
|
||||
<display>Last name</display>
|
||||
<onchange>autoFill:cn,%givenName% %sn%</onchange>
|
||||
<onchange>autoFill:uid,%gidNumber|0-0/T%-%givenName|0-1/l%%sn/l%</onchange>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
@@ -38,15 +38,15 @@
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="uid">
|
||||
<display>t_uid</display>
|
||||
<display>User ID</display>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
<order>4</order>
|
||||
<page>1</page>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="uidNumber">
|
||||
<display>t_uid_number</display>
|
||||
<hint>t_auto_det</hint>
|
||||
<display>UID Number</display>
|
||||
<hint>Automatically determined</hint>
|
||||
<order>5</order>
|
||||
<page>1</page>
|
||||
<presubmit>=php.GetNextNumber(/,uid)</presubmit>
|
||||
@@ -65,10 +65,10 @@
|
||||
<value>=php.PickList(/,(objectClass=sambaDomain),sambaSID,%sambaSID% (%sambaDomainName%))</value>
|
||||
</attribute>
|
||||
<attribute id="userPassword">
|
||||
<display>t_password</display>
|
||||
<display>Password</display>
|
||||
<helper>
|
||||
<default>md5</default>
|
||||
<display>t_encryption</display>
|
||||
<display>Encryption</display>
|
||||
<id>enc</id>
|
||||
<location>side</location>
|
||||
<value>blowfish</value>
|
||||
@@ -106,26 +106,19 @@
|
||||
<type>password</type>
|
||||
</attribute>
|
||||
<attribute id="loginShell">
|
||||
<display>t_login_shell</display>
|
||||
<display>Login shell</display>
|
||||
<icon>images/terminal.png</icon>
|
||||
<order>10</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixAccount),loginShell,%loginShell%)</value>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<display>GID Number</display>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
<order>11</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixGroup),gidNumber,%cn%)</value>
|
||||
</attribute>
|
||||
<attribute id="gidNumber">
|
||||
<display>t_gid_number</display>
|
||||
<onchange>autoFill:homeDirectory,/home/users/%gidNumber|0-0/T%/%uid|3-%</onchange>
|
||||
<order>12</order>
|
||||
<page>1</page>
|
||||
<value>=php.PickList(/,(objectClass=posixGroup),gidNumber,%cn%)</value>
|
||||
</attribute>
|
||||
<attribute id="sambaPrimaryGroupSID">
|
||||
<display>Primary Group ID</display>
|
||||
<helper>
|
||||
@@ -140,7 +133,7 @@
|
||||
<value>=php.PickList(/,(objectClass=sambaGroupMapping),sambaSID,%sambaSID% (%cn%),sambaPrimaryGroupSID)</value>
|
||||
</attribute>
|
||||
<attribute id="homeDirectory">
|
||||
<display>t_home_dir</display>
|
||||
<display>Home directory</display>
|
||||
<order>14</order>
|
||||
<page>1</page>
|
||||
</attribute>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>sendmail_alias</title>
|
||||
<title>Sendmail Alias</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail.png</icon>
|
||||
<description>New Sendmail Alias</description>
|
||||
|
@@ -1,14 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>sendmail_domain</title>
|
||||
<title>Sendmail Domain</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail.png</icon>
|
||||
<description>New Sendmail Domain</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>sendmailMTACluster</rdn>
|
||||
<visible>1</visible>
|
||||
<invalid>1</invalid>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="sendmailMTAClass"></objectClass>
|
||||
|
@@ -1,14 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>sendmail_cluster</title>
|
||||
<title>Sendmail Cluster</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail.png</icon>
|
||||
<description>New Sendmail Cluster</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>sendmailMTACluster</rdn>
|
||||
<visible>1</visible>
|
||||
<invalid>1</invalid>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="sendmailMTA"></objectClass>
|
||||
|
@@ -2,14 +2,13 @@
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<!--This template doesnt work needs modification to the Engine.-->
|
||||
<template>
|
||||
<title>sendmail_relays</title>
|
||||
<title>Sendmail Relays</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail.png</icon>
|
||||
<description>New Sendmail Relays</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>sendmailMTACluster</rdn>
|
||||
<visible>1</visible>
|
||||
<invalid>1</invalid>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="sendmailMTAClass"></objectClass>
|
||||
|
@@ -1,14 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>sendmail_domain</title>
|
||||
<title>Sendmail Virtual Domain</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail.png</icon>
|
||||
<description>New Sendmail Domain</description>
|
||||
<askcontainer>1</askcontainer>
|
||||
<rdn>sendmailMTACluster</rdn>
|
||||
<visible>1</visible>
|
||||
<invalid>1</invalid>
|
||||
|
||||
<objectClasses>
|
||||
<objectClass id="sendmailMTAClass"></objectClass>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>sendmail_virt_users</title>
|
||||
<title>Sendmail Virtual Users</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/mail.png</icon>
|
||||
<description>New Sendmail Virtual User</description>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE template SYSTEM "template.dtd">
|
||||
<template>
|
||||
<title>simple_sec_object</title>
|
||||
<title>Simple Security Object</title>
|
||||
<!--<regexp>^ou=People,o=.*,</regexp>-->
|
||||
<icon>images/user.png</icon>
|
||||
<description>New Simple Security Object</description>
|
||||
@@ -16,17 +16,17 @@
|
||||
|
||||
<attributes>
|
||||
<attribute id="userid">
|
||||
<display>t_user_name</display>
|
||||
<display>User Name</display>
|
||||
<icon>images/uid.png</icon>
|
||||
<order>1</order>
|
||||
<page>1</page>
|
||||
<spacer>1</spacer>
|
||||
</attribute>
|
||||
<attribute id="userPassword">
|
||||
<display>t_password</display>
|
||||
<display>Password</display>
|
||||
<helper>
|
||||
<default>md5</default>
|
||||
<display>t_encryption</display>
|
||||
<display>Encryption</display>
|
||||
<id>enc</id>
|
||||
<location>side</location>
|
||||
<value>blowfish</value>
|
||||
|
@@ -23,9 +23,9 @@
|
||||
|
||||
<!-- Attributes Definition -->
|
||||
<!ELEMENT attributes (attribute*)>
|
||||
<!ELEMENT attribute (array?, default?, description?, display?, helper?, hidden?, hint?,
|
||||
<!ELEMENT attribute (array?, default?, cols?, description?, display?, helper?, hidden?, hint?,
|
||||
icon?, onchange*, order?, override?, page?, post?,
|
||||
presubmit?, spacer*, type?, value*, verify?)>
|
||||
presubmit?, rows?, spacer*, type?, value*, verify?)>
|
||||
<!ATTLIST attribute id CDATA #REQUIRED>
|
||||
|
||||
<!-- helper -->
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
<!-- Attribute Parameters -->
|
||||
<!ELEMENT array (#PCDATA)>
|
||||
<!ELEMENT cols (#PCDATA)>
|
||||
<!ELEMENT default (#PCDATA)>
|
||||
<!ELEMENT hidden (#PCDATA)>
|
||||
<!ELEMENT onchange (#PCDATA)>
|
||||
@@ -57,6 +58,7 @@
|
||||
<!ELEMENT page (#PCDATA)>
|
||||
<!ELEMENT post (#PCDATA)>
|
||||
<!ELEMENT presubmit (#PCDATA)>
|
||||
<!ELEMENT rows (#PCDATA)>
|
||||
<!ELEMENT spacer (#PCDATA)>
|
||||
<!ELEMENT type (#PCDATA)>
|
||||
<!ELEMENT verify (#PCDATA)>
|
||||
|
@@ -1,334 +0,0 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/template_config.php,v 1.34 2005/03/05 06:27:07 wurley Exp $
|
||||
|
||||
/**
|
||||
* General configuration file for templates.
|
||||
*
|
||||
* File Map:
|
||||
* 1 - Generic templates configuration
|
||||
* 2 - Samba template configuration
|
||||
* 3 - method used in template and other files
|
||||
*
|
||||
* @package phpLDAPadmin
|
||||
*/
|
||||
|
||||
/*######################################################################################
|
||||
## Templates for entry creation ##
|
||||
## ---------------------------- ##
|
||||
## ##
|
||||
## Fill in this array with templates that you can create to suit your needs. ##
|
||||
## Each entry defines a description (to be displayed in the template list) and ##
|
||||
## a handler, which is a file that will be executed with certain POST vars set. ##
|
||||
## See the templates provided here for examples of how to make your own template. ##
|
||||
## ##
|
||||
######################################################################################*/
|
||||
|
||||
|
||||
$templates = array();
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['user_account'], // 'User Account (posixAccount)',
|
||||
'icon' => 'images/user.png',
|
||||
'handler' => 'new_user_template.php' );
|
||||
// You can use the 'regexp' directive to restrict where
|
||||
// entries can be created for this template
|
||||
//'regexp' => '^ou=People,o=.*,c=.*$'
|
||||
//'regexp' => '^ou=People,dc=.*,dc=.*$'
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['address_book_inet'], // 'Address Book Entry (inetOrgPerson)',
|
||||
'icon' => 'images/user.png',
|
||||
'handler' => 'new_address_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['address_book_moz'], // 'Address Book Entry (mozillaOrgPerson)',
|
||||
'icon' => 'images/user.png',
|
||||
'handler' => 'new_mozillaOrgPerson_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['kolab_user'], // 'Kolab User Entry',
|
||||
'icon' => 'images/user.png',
|
||||
'handler' => 'new_kolab_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['organizational_unit'], // 'Organizational Unit',
|
||||
'icon' => 'images/ou.png',
|
||||
'handler' => 'new_ou_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['organizational_role'], // 'Organizational Role',
|
||||
'icon' => 'images/o.png',
|
||||
'handler' => 'new_organizationalRole.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['posix_group'], // 'Posix Group',
|
||||
'icon' => 'images/ou.png',
|
||||
'handler' => 'new_posix_group_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['samba_machine'], // 'Samba NT Machine',
|
||||
'icon' => 'images/nt_machine.png',
|
||||
'handler' => 'new_nt_machine.php' );
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['samba3_machine'], // 'Samba 3 NT Machine',
|
||||
'icon' => 'images/nt_machine.png',
|
||||
'handler' => 'new_smb3_nt_machine.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['samba3_user'], // 'Samba 3 User',
|
||||
'icon' => 'images/nt_user.png',
|
||||
'handler' => 'new_smb3_user_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['samba_user'], // 'Samba User',
|
||||
'icon' => 'images/nt_user.png',
|
||||
'handler' => 'new_smbuser_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['samba3_group'], // 'Samba 3 Group Mapping',
|
||||
'icon' => 'images/ou.png',
|
||||
'handler' => 'new_smbgroup_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['dns_entry'], // 'DNS Entry',
|
||||
'icon' => 'images/dc.png',
|
||||
'handler' => 'new_dns_entry.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['simple_sec_object'], // 'Simple Security Object',
|
||||
'icon' => 'images/user.png',
|
||||
'handler' => 'new_security_object_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['courier_mail_account'], // 'Courier Mail Account',
|
||||
'icon' => 'images/mail_account.png',
|
||||
'handler' => 'new_postfix_account_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['courier_mail_alias'], // 'Courier Mail Alias',
|
||||
'icon' => 'images/mail_alias.png',
|
||||
'handler' => 'new_postfix_alias_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['ldap_alias'], // 'LDAP Alias',
|
||||
'icon' => 'images/go.png',
|
||||
'handler' => 'new_alias_template.php' );
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['sendmail_cluster'], // 'Sendmail Cluster',
|
||||
'icon' => 'images/mail.png',
|
||||
'handler' => 'new_sendmail_cluster_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['sendmail_domain'], // 'Sendmail Domain',
|
||||
'icon' => 'images/mail.png',
|
||||
'handler' => 'new_sendmail_domain_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['sendmail_alias'], // 'Sendmail Alias',
|
||||
'icon' => 'images/mail.png',
|
||||
'handler' => 'new_sendmail_alias_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['sendmail_virt_dom'], // 'Sendmail Virtual Domain',
|
||||
'icon' => 'images/mail.png',
|
||||
'handler' => 'new_sendmail_virthost_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['sendmail_virt_users'], // 'Sendmail Virtual Users',
|
||||
'icon' => 'images/mail.png',
|
||||
'handler' => 'new_sendmail_virtuser_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['sendmail_relays'], // 'Sendmail Relays',
|
||||
'icon' => 'images/mail.png',
|
||||
'handler' => 'new_sendmail_relay_template.php' );
|
||||
|
||||
$templates[] =
|
||||
array( 'desc' => $lang['custom'], // 'Custom',
|
||||
'icon' => 'images/object.png',
|
||||
'handler' => 'custom.php' );
|
||||
|
||||
/*#####################################################################################
|
||||
## POSIX GROUP TEMPLATE CONFIGURATION ##
|
||||
## ---------------------------------- ##
|
||||
## ##
|
||||
#####################################################################################*/
|
||||
|
||||
// uncomment to set the base dn of posix groups
|
||||
// default is set to the base dn of the server
|
||||
//$base_posix_groups="ou=People,dc=example,dc=com";
|
||||
|
||||
|
||||
/*######################################################################################
|
||||
## SAMBA TEMPLATE CONFIGURATION ##
|
||||
## ---------------------------- ##
|
||||
## ##
|
||||
## In order to use the samba templates, you might edit the following properties: ##
|
||||
## 1 - $mkntpwdCommand : the path to the mkntpwd utility provided with/by Samba. ##
|
||||
## 2 - $samba3_domains : the domain name and the domain sid. ##
|
||||
## ##
|
||||
######################################################################################*/
|
||||
|
||||
// path 2 the mkntpwd utility (Customize)
|
||||
$mkntpwdCommand = "/usr/local/bin/mkntpwd";
|
||||
|
||||
// Default domains definition (Customize)
|
||||
// (use `net getlocalsid` on samba server)
|
||||
$samba3_domains = array();
|
||||
$samba3_domains[] =
|
||||
array(
|
||||
'name' => $lang['samba_domain_name'], // 'My Samba domain Name',
|
||||
'sid' => 'S-1-5-21-4147564533-719371898-3834029857'
|
||||
);
|
||||
|
||||
// The base dn of samba group. (CUSTOMIZE)
|
||||
//$samba_base_groups = "ou=Groups,ou=samba,dc=example,dc=org";
|
||||
|
||||
|
||||
//Definition of built-in local groups
|
||||
$built_in_local_groups = array(
|
||||
"S-1-5-32-544" => $lang['administrators'], // Administrators
|
||||
"S-1-5-32-545" => $lang['users'], // Users
|
||||
"S-1-5-32-546" => $lang['guests'], // Guests
|
||||
"S-1-5-32-547" => $lang['power_users'], // Power Users
|
||||
"S-1-5-32-548" => $lang['account_ops'], // Account Operators
|
||||
"S-1-5-32-549" => $lang['server_ops'], // Server Operators
|
||||
"S-1-5-32-550" => $lang['print_ops'], // Print Operators
|
||||
"S-1-5-32-551" => $lang['backup_ops'], // backup Operators
|
||||
"S-1-5-32-552" => $lang['replicator'] // Replicator
|
||||
);
|
||||
|
||||
|
||||
/*######################################################################################
|
||||
## Methods used in/by templates ##
|
||||
## ---------------------------- ##
|
||||
######################################################################################*/
|
||||
|
||||
/**
|
||||
* Return the name of the template to be used based on the object being edited.
|
||||
*
|
||||
* Returns the name of the template to use based on the DN and objectClasses of
|
||||
* an entry. If no specific modification template is available, simply return
|
||||
* 'default'. The caller should append '.php' and prepend 'templates/modification/'
|
||||
* to the returned string to get the file name.
|
||||
*
|
||||
* @param object $ldapserver Server Object the entry is in.
|
||||
* @param dn $dn Entry we will need a template for.
|
||||
*/
|
||||
|
||||
function get_template( $ldapserver, $dn ) {
|
||||
// fetch and lowercase all the objectClasses in an array
|
||||
$object_classes = get_object_attr( $ldapserver, $dn, 'objectClass', true );
|
||||
|
||||
if( $object_classes === null || $object_classes === false)
|
||||
return 'default';
|
||||
|
||||
foreach( $object_classes as $i => $class )
|
||||
$object_classes[$i] = strtolower( $class );
|
||||
|
||||
$rdn = get_rdn( $dn );
|
||||
|
||||
if( in_array( 'groupofnames', $object_classes ) ||
|
||||
in_array( 'groupofuniquenames', $object_classes ) )
|
||||
return 'group_of_names';
|
||||
|
||||
/*
|
||||
if( in_array( 'person', $object_classes ) &&
|
||||
in_array( 'posixaccount', $object_classes ) )
|
||||
return 'user';
|
||||
*/
|
||||
// TODO: Write other templates and criteria therefor
|
||||
// else if ...
|
||||
// return 'some other template';
|
||||
// else if ...
|
||||
// return 'some other template';
|
||||
// etc.
|
||||
|
||||
return 'default';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the domains info
|
||||
*
|
||||
*/
|
||||
|
||||
function get_samba3_domains(){
|
||||
global $samba3_domains;
|
||||
|
||||
// do the search for the sambadomainname object here
|
||||
// In the meantime, just return the domains defined in this config file
|
||||
check_samba_setting();
|
||||
return $samba3_domains;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utily class to get the samba passwords.
|
||||
* @package phpLDAPadmin
|
||||
*/
|
||||
|
||||
class MkntPasswdUtil{
|
||||
|
||||
var $clearPassword = NULL;
|
||||
var $sambaPassword ;
|
||||
|
||||
function MkntPasswdUtil(){
|
||||
$sambaPassword = array(
|
||||
"sambaLMPassword" => NULL,
|
||||
"sambaNTPassword" => NULL
|
||||
);
|
||||
}
|
||||
|
||||
function createSambaPasswords($password){
|
||||
global $mkntpwdCommand, $lang;
|
||||
|
||||
$this->clearPassword = $password;
|
||||
|
||||
file_exists ( $mkntpwdCommand ) && is_executable ( $mkntpwdCommand ) or pla_error( $lang['unable_smb_passwords'] );
|
||||
$sambaPassCommand = $mkntpwdCommand . " " . $password;
|
||||
|
||||
if($sambaPassCommandOutput = shell_exec($sambaPassCommand)){
|
||||
$this->sambaPassword['sambaLMPassword'] = trim( substr( $sambaPassCommandOutput , 0 , strPos( $sambaPassCommandOutput,':' ) ) );
|
||||
$this->sambaPassword['sambaNTPassword'] = trim( substr( $sambaPassCommandOutput, strPos( $sambaPassCommandOutput ,':' ) +1 ) );
|
||||
return true;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getSambaLMPassword(){
|
||||
return $this->sambaPassword['sambaLMPassword'];
|
||||
}
|
||||
|
||||
function getSambaNTPassword(){
|
||||
return $this->sambaPassword['sambaNTPassword'];
|
||||
}
|
||||
|
||||
function getSambaClearPassword(){
|
||||
return $this->clearPassword;
|
||||
}
|
||||
|
||||
function valueOf($key){
|
||||
return $this->sambaPassword[$key];
|
||||
}
|
||||
}
|
||||
|
||||
function check_samba_setting(){
|
||||
global $samba3_domains;
|
||||
|
||||
// check if the samba3_domains exist and is a array
|
||||
( isset($samba3_domains ) && is_array( $samba3_domains ) ) or pla_error($lang['err_smb_conf']);
|
||||
|
||||
// no definition for the samba domain
|
||||
if(empty($samba3_domains))
|
||||
pla_error($lang['err_smb_no_name_sid']);
|
||||
|
||||
else {
|
||||
// check if there is name or a sid declared for each domains
|
||||
foreach ($samba3_domains as $samba3_domain) {
|
||||
isset($samba3_domain['name']) or pla_error($lang['err_smb_no_name']);
|
||||
isset($samba3_domain['sid']) or pla_error($lang['err_smb_no_sid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/template_header.php,v 1.6 2005/09/04 18:41:34 wurley Exp $
|
||||
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/template_header.php,v 1.6.4.5 2005/12/09 14:32:37 wurley Exp $
|
||||
|
||||
/**
|
||||
* Header page for engine.
|
||||
* @package phpLDAPadmin
|
||||
@@ -15,75 +15,66 @@ $url_base = sprintf('server_id=%s&dn=%s',$ldapserver->server_id,$encoded_dn)
|
||||
|
||||
$export_href_base = sprintf('export_form.php?%s&scope=%s',$url_base,'base');
|
||||
$export_href_sub = sprintf('export_form.php?%s&scope=%s',$url_base,'sub');
|
||||
$refresh_href = sprintf('edit.php?%s&random=%s',$url_base,$random_junk);
|
||||
$refresh_href = sprintf('template_engine.php?%s&random=%s',$url_base,$random_junk);
|
||||
$copy_href = sprintf('copy_form.php?%s',$url_base);
|
||||
$intattr_href = sprintf('edit.php?%s&show_internal_attrs=true',$url_base);
|
||||
$intattr_href = sprintf('template_engine.php?%s&show_internal_attrs=true',$url_base);
|
||||
$delete_href = sprintf('delete_form.php?%s',$url_base);
|
||||
$rename_href = sprintf('rename_form.php?%s',$url_base);
|
||||
$compare_href = sprintf('compare_form.php?%s',$url_base);
|
||||
$create_href = sprintf('create_form.php?server_id=%s&container=%s',$ldapserver->server_id,$encoded_dn);
|
||||
$addattr_href = sprintf('add_attr_form.php?%s',$url_base);
|
||||
?>
|
||||
|
||||
<body>
|
||||
echo '<body>';
|
||||
|
||||
<?php if ($dn) { ?>
|
||||
<h3 class="title"><?php echo htmlspecialchars($rdn); ?></h3>
|
||||
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> <?php echo $lang['distinguished_name'];?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
|
||||
if ($dn) {
|
||||
$actionlayout = '<td class="icon"><img src="images/%s" /></td><td><a href="%s" title="%s">%s</a></td>';
|
||||
$hintlayout = '<td class="icon"><img src="images/light.png" /></td><td colspan="3"><span class="hint">%s</span></td>';
|
||||
|
||||
<table class="edit_dn_menu">
|
||||
<tr>
|
||||
<td class="icon"><img src="images/refresh.png" /></td>
|
||||
<td><a href="<?php echo $refresh_href; ?>" title="<?php echo $lang['refresh_this_entry']; ?>"><?php echo $lang['refresh_entry']; ?></a></td>
|
||||
<td class="icon"><img src="images/save.png" /></td>
|
||||
<td><a href="<?php echo $export_href_base; ?>" title="<?php echo $lang['export_tooltip']; ?>"><?php echo $lang['export']; ?></a></td>
|
||||
</tr>
|
||||
printf('<h3 class="title">%s</h3>',htmlspecialchars($rdn));
|
||||
printf('<h3 class="subtitle">%s: <b>%s</b> %s: <b>%s</b></h3>',
|
||||
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn));
|
||||
|
||||
<tr>
|
||||
<td class="icon"><img src="images/cut.png" /></td>
|
||||
<td><a href="<?php echo $copy_href; ?>" title="<?php echo $lang['copy_this_entry_tooltip']; ?>"><?php echo $lang['copy_this_entry']; ?></a></td>
|
||||
echo "\n";
|
||||
|
||||
<?php if ($show_internal_attrs) { ?>
|
||||
<td class="icon"><img src="images/tools-no.png" /></td>
|
||||
<td><a href="<?php echo $refresh_href; ?>"><?php echo $lang['hide_internal_attrs']; ?></a></td>
|
||||
echo '<table class="edit_dn_menu"><tr>';
|
||||
printf($actionlayout,'refresh.png',$refresh_href,_('Refresh this entry'),_('Refresh'));
|
||||
printf($actionlayout,'save.png',$export_href_base,_('Save a dump of this object'),_('Export'));
|
||||
echo '</tr><tr>';
|
||||
|
||||
<?php } else { ?>
|
||||
<td class="icon"><img src="images/tools.png" /></td>
|
||||
<td><a href="<?php echo $intattr_href; ?>"><?php echo $lang['show_internal_attrs']; ?></a></td>
|
||||
<?php } ?>
|
||||
printf($actionlayout,'cut.png',$copy_href,_('Copy this object to another location, a new DN, or another server'),_('Copy or move this entry'));
|
||||
|
||||
</tr>
|
||||
if ($show_internal_attrs)
|
||||
printf($actionlayout,'tools-no.png',$refresh_href,'',_('Hide internal attributes'));
|
||||
|
||||
<?php if (! $ldapserver->isReadOnly()) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/trash.png" /></td>
|
||||
<td><a style="color: red" href="<?php echo $delete_href; ?>" title="<?php echo $lang['delete_this_entry_tooltip']; ?>"><?php echo $lang['delete_this_entry']; ?></a></td>
|
||||
<td class="icon"><img src="images/rename.png" /></td>
|
||||
<td><a href="<?php echo $rename_href; ?>"><?php echo $lang['rename']; ?></a></td>
|
||||
</tr>
|
||||
else
|
||||
printf($actionlayout,'tools.png',$intattr_href,'',_('Show internal attributes'));
|
||||
|
||||
<?php if ($config->GetValue('appearance','show_hints')) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td colspan="3"><span class="hint"><?php echo $lang['delete_hint']; ?></span></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
echo '</tr>';
|
||||
|
||||
<tr>
|
||||
<td class="icon"><img src="images/compare.png" /></td>
|
||||
<td><a href="<?php echo $compare_href; ?>"><?php echo $lang['compare_with']; ?></a></td>
|
||||
</tr>
|
||||
if (! $ldapserver->isReadOnly()) {
|
||||
echo '<tr>';
|
||||
printf($actionlayout,'trash.png',$delete_href,_('You will be prompted to confirm this decision'),_('Delete this entry'));
|
||||
printf($actionlayout,'rename.png',$rename_href,'',_('Rename'));
|
||||
echo '</tr>';
|
||||
|
||||
<tr>
|
||||
<td class="icon"><img src="images/star.png" /></td>
|
||||
<td><a href="<?php echo $create_href; ?>"><?php echo $lang['create_a_child_entry']; ?></a></td>
|
||||
<td class="icon"><img src="images/add.png" /></td>
|
||||
<td><a href="<?php echo $addattr_href; ?>"><?php echo $lang['add_new_attribute']; ?></a></td>
|
||||
</tr>
|
||||
<?php }
|
||||
if ($config->GetValue('appearance','show_hints')) {
|
||||
echo '<tr>';
|
||||
printf($hintlayout,_('Hint: To delete an attribute, empty the text field and click save.'));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
printf($actionlayout,'compare.png',$compare_href,'',_('Compare with another entry'));
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
printf($actionlayout,'star.png',$create_href,'',_('Create a child entry'));
|
||||
printf($actionlayout,'add.png',$addattr_href,'',_('Add new attribute'));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
flush();
|
||||
$children = get_container_contents($ldapserver,$dn,$max_children,'(objectClass=*)',$config->GetValue('deref','view'));
|
||||
$children = $ldapserver->getContainerContents($dn,$max_children,'(objectClass=*)',$config->GetValue('deref','view'));
|
||||
|
||||
if (($children_count = count($children)) > 0) {
|
||||
if ($children_count == $max_children)
|
||||
@@ -91,122 +82,94 @@ $addattr_href = sprintf('add_attr_form.php?%s',$url_base);
|
||||
|
||||
$child_href = sprintf('search.php?server_id=%s&search=true&filter=%s&base_dn=%s&form=advanced&scope=one',
|
||||
$ldapserver->server_id,rawurlencode('objectClass=*'),$encoded_dn);
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="icon"><img src="images/children.png" /></td>
|
||||
<td><a href="<?php echo $child_href; ?>"><?php if( $children_count == 1 ) echo $lang['view_one_child']; else echo sprintf( $lang['view_children'], $children_count ); ?></a></td>
|
||||
<td class="icon"><img src="images/save.png" /></td>
|
||||
<td><a href="<?php echo $export_href_sub; ?>" title="<?php echo $lang['export_subtree_tooltip']; ?>"><?php echo $lang['export_subtree']; ?></a></td>
|
||||
</tr>
|
||||
echo '<tr>';
|
||||
printf($actionlayout,'children.png',$child_href,'',($children_count == 1) ? _('View 1 child') : sprintf(_('View %s children'),$children_count));
|
||||
printf($actionlayout,'save.png',$export_href_sub,_('Save a dump of this object and all of its children'),_('Export subtree'));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
if ($config->GetValue('appearance','show_hints')) {
|
||||
echo '<tr>';
|
||||
printf($hintlayout,_('Hint: To view the schema for an attribute, click the attribute name.'));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
<?php if ($config->GetValue('appearance','show_hints')) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td colspan="3"><span class="hint"><?php echo $lang['attr_schema_hint']; ?></span></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
if ($ldapserver->isReadOnly()) {
|
||||
echo '<tr>';
|
||||
printf($hintlayout,_('Viewing entry in read-only mode.'));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
<?php if ($ldapserver->isReadOnly()) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
<td><?php echo $lang['viewing_read_only']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
if ($modified_attrs) {
|
||||
echo '<tr>';
|
||||
printf($hintlayout,
|
||||
($children_count == 1) ? sprintf(_('An attribute (%s) was modified and is highlighted below.'),implode('',$modified_attrs)) :
|
||||
sprintf(_('Some attributes (%s) were modified and are highlighted below.'),implode(', ',$modified_attrs)));
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
<?php if ($modified_attrs) { ?>
|
||||
<tr>
|
||||
<td class="icon"><img src="images/light.png" /></td>
|
||||
echo '</table>';
|
||||
|
||||
<?php if (count($modified_attrs) > 1) { ?>
|
||||
<td colspan="3"><?php echo sprintf($lang['attrs_modified'],implode(', ',$modified_attrs)); ?></td>
|
||||
flush();
|
||||
|
||||
<?php } else { ?>
|
||||
<td colspan="3"><?php echo sprintf($lang['attr_modified'],implode('',$modified_attrs)); ?></td>
|
||||
<?php } ?>
|
||||
if (! $ldapserver->isReadOnly()) {
|
||||
echo '<form action="update_confirm.php" method="post" name="edit_form">';
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
|
||||
printf('<input type="hidden" name="dn" value="%s" />',$dn);
|
||||
}
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
echo '<br />'."\n\n";
|
||||
echo '<table class="edit_dn">';
|
||||
|
||||
</table>
|
||||
|
||||
<?php flush(); ?>
|
||||
|
||||
<br />
|
||||
<table class="edit_dn">
|
||||
|
||||
<?php if ($show_internal_attrs) {
|
||||
if ($show_internal_attrs) {
|
||||
$counter = 0;
|
||||
|
||||
foreach (get_entry_system_attrs($ldapserver,$dn) as $attr => $vals) {
|
||||
foreach ($ldapserver->getDNSysAttrs($dn) as $attr => $vals) {
|
||||
$counter++;
|
||||
$schema_href = sprintf('schema.php?server_id=%s&view=attributes&viewvalue=%s',
|
||||
$ldapserver->server_id,real_attr_name($attr));
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="attr"><b><a title="<?php echo sprintf( $lang['attr_name_tooltip'], $attr ); ?>" href="<?php echo $schema_href; ?>"><?php echo htmlspecialchars( $attr ); ?></b></td>
|
||||
</tr>
|
||||
printf('<tr><td colspan="2" class="attr"><b><a title="'._('Click to view the schema defintion for attribute type \'%s\'').'" href="%s" />%s</b></td></tr>',
|
||||
$attr,$schema_href,htmlspecialchars($attr));
|
||||
|
||||
<tr>
|
||||
<td class="val">
|
||||
echo '<tr><td class="val"><small>';
|
||||
|
||||
<?php if (is_attr_binary($ldapserver,$attr)) {
|
||||
$href = "download_binary_attr.php?server_id=$server_id&dn=$encoded_dn&attr=$attr";
|
||||
?>
|
||||
if ($ldapserver->isAttrBinary($attr)) {
|
||||
$href = sprintf('download_binary_attr.php?server_id=%s&dn=%s&attr=%s',$server_id,$encoded_dn,$attr);
|
||||
|
||||
<small>
|
||||
<?php echo $lang['binary_value']; ?><br />
|
||||
<?php if (count($vals) > 1) {
|
||||
for ($i = 1; $i <= count($vals); $i++) { ?>
|
||||
echo _('Binary value');
|
||||
echo '<br />';
|
||||
|
||||
<a href="<?php sprintf('%s&value_num=%s',$href,$i); ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?>(<?php echo $i; ?>)</a>
|
||||
<br />
|
||||
if (count($vals) > 1) {
|
||||
for ($i=1;$i<=count($vals);$i++)
|
||||
printf('<a href="%s&value_num=%s"><img src="images/save.png" /> %s(%s)</a><br />',
|
||||
$href,$i,_('download value'),$i);
|
||||
|
||||
<?php
|
||||
}
|
||||
} else { ?>
|
||||
<a href="<?php echo $href; ?>"><img src="images/save.png" /> <?php echo $lang['download_value']; ?></a><br />
|
||||
<?php }
|
||||
} else {
|
||||
printf('<a href="%s"><img src="images/save.png" /> %s</a><br />',
|
||||
$href,_('download value'));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
foreach ($vals as $v) {
|
||||
echo htmlspecialchars($v);
|
||||
echo "<br />\n";
|
||||
}
|
||||
foreach ($vals as $v)
|
||||
printf('%s<br />',htmlspecialchars($v));
|
||||
}
|
||||
?>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
echo '</small></td></tr>';
|
||||
}
|
||||
|
||||
if ($counter == 0)
|
||||
echo "<tr><td colspan=\"2\">(" . $lang['no_internal_attributes'] . ")</td></tr>\n";
|
||||
printf('<tr><td colspan="2">(%s)</td></tr>',_('No internal attributes'));
|
||||
|
||||
echo "\n\n";
|
||||
}
|
||||
|
||||
flush(); ?>
|
||||
|
||||
<!-- Table of attributes/values to edit -->
|
||||
|
||||
<?php if (! $ldapserver->isReadOnly()) { ?>
|
||||
<form action="update_confirm.php" method="post" name="edit_form">
|
||||
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
|
||||
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
|
||||
<?php }
|
||||
flush();
|
||||
|
||||
} else {
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="title"><?php echo $lang['createf_create_object']; ?></h3>
|
||||
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> <?php echo $lang['using_template'];?>: <b><?php echo htmlspecialchars($_REQUEST['template']); ?></b></h3>
|
||||
|
||||
<?php
|
||||
printf('<h3 class="title">%s</h3>',_('Create Object'));
|
||||
printf('<h3 class="subtitle">%s: <b>%s</b> %s: <b>%s</b></h3>',
|
||||
_('Server'),$ldapserver->name,_('using template'),htmlspecialchars($_REQUEST['template']));
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user