RELEASE 0.9.8
This commit is contained in:
@@ -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 } ?>
|
Reference in New Issue
Block a user