*** empty log message ***

This commit is contained in:
katagia 2003-06-08 19:08:29 +00:00
parent ad520a8995
commit b584c21620
3 changed files with 44 additions and 29 deletions

View File

@ -769,7 +769,7 @@ function createuser($values) { // Will create the LDAP-Account
addhomedir($values->general_username); addhomedir($values->general_username);
} }
// Add User to Additional Groups // Add User to Additional Groups
if ($values->general_groupadd) if ($values->general_groupadd[0])
foreach ($values->general_groupadd as $group2) { foreach ($values->general_groupadd as $group2) {
$result = ldap_search($_SESSION['ldap']->server(), 'cn='.$group2.','.$_SESSION['config']->get_GroupSuffix(), "objectclass=posixGroup"); $result = ldap_search($_SESSION['ldap']->server(), 'cn='.$group2.','.$_SESSION['config']->get_GroupSuffix(), "objectclass=posixGroup");
$entry = ldap_first_entry($_SESSION['ldap']->server(), $result); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result);
@ -1013,7 +1013,7 @@ function createhost($values) { // Will create the LDAP-Account
$success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr);
if (!$success) return 4; if (!$success) return 4;
// Add Host to Additional Groups // Add Host to Additional Groups
if ($values->general_groupadd) if ($values->general_groupadd[0])
foreach ($values->general_groupadd as $group2) { foreach ($values->general_groupadd as $group2) {
$result = ldap_search($_SESSION['ldap']->server(), 'cn='.$group2.','.$_SESSION['config']->get_GroupSuffix(), "objectclass=posixGroup"); $result = ldap_search($_SESSION['ldap']->server(), 'cn='.$group2.','.$_SESSION['config']->get_GroupSuffix(), "objectclass=posixGroup");
$entry = ldap_first_entry($_SESSION['ldap']->server(), $result); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result);

View File

@ -239,7 +239,10 @@ switch ($_POST['select']) { // Select which part of page should be loaded and ch
break; break;
case 'finish': case 'finish':
// Check if pdf-file should be created // Check if pdf-file should be created
if ($_POST['outputpdf']) createpdf($_SESSION['account']); if ($_POST['outputpdf']) {
createpdf($_SESSION['account']);
$select_local = 'pdf';
}
break; break;
} }
@ -284,6 +287,7 @@ if ($_POST['load']) $select_local='load';
if ($_POST['save']) $select_local='save'; if ($_POST['save']) $select_local='save';
if ($select_local != 'pdf') {
// Write HTML-Header and part of Table // Write HTML-Header and part of Table
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
\"http://www.w3.org/TR/html4/loose.dtd\">\n"; \"http://www.w3.org/TR/html4/loose.dtd\">\n";
@ -294,6 +298,7 @@ echo "</title>\n
<meta http-equiv=\"pragma\" content=\"no-cache\">\n <meta http-equiv=\"pragma\" content=\"no-cache\">\n
<meta http-equiv=\"cache-control\" content=\"no-cache\">\n <meta http-equiv=\"cache-control\" content=\"no-cache\">\n
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">"; <meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">";
}
switch ($select_local) { switch ($select_local) {
// backmain = back to lists // backmain = back to lists
@ -353,10 +358,13 @@ switch ($select_local) {
break; break;
} }
if ($select_local != 'pdf') {
echo "</head><body>\n"; echo "</head><body>\n";
echo "<form action=\"account.php\" method=\"post\">\n"; echo "<form action=\"account.php\" method=\"post\">\n";
if ($error != "0") StatusMessage("ERROR", _("Invalid Value!"), $error); if ($error != "0") StatusMessage("ERROR", _("Invalid Value!"), $error);
echo "<table rules=\"all\" class=\"account\" width=\"100%\">\n"; echo "<table rules=\"all\" class=\"account\" width=\"100%\">\n";
}
switch ($select_local) { // Select which part of page will be loaded switch ($select_local) { // Select which part of page will be loaded
@ -1009,5 +1017,5 @@ switch ($select_local) { // Select which part of page will be loaded
} }
// Print end of HTML-Page // Print end of HTML-Page
echo '</table></form></body></html>'; if ($select_local != 'pdf') echo '</table></form></body></html>';
?> ?>

View File

@ -38,11 +38,15 @@ if ($_POST['tolist'] && ($_FILES['userfile']['size']>0)) $select = 'list';
if ($_POST['back']) $select = 'main'; if ($_POST['back']) $select = 'main';
if ($_POST['cancel']) $select = 'cancel'; if ($_POST['cancel']) $select = 'cancel';
if ($_POST['create']) $select = 'create'; if ($_POST['create']) $select = 'create';
if ($_POST['pdf']) createpdf($_SESSION['accounts']); if ($_POST['pdf']) {
createpdf($_SESSION['accounts']);
$select='pdf';
}
if (!$select && !$_SESSION['pointer']) $select='main'; if (!$select && !$_SESSION['pointer']) $select='main';
if (!$select && $_SESSION['pointer']) $select='create'; if (!$select && $_SESSION['pointer']) $select='create';
if ($select!='pdf') {
// Write HTML-Header and part of Table // Write HTML-Header and part of Table
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">'; "http://www.w3.org/TR/html4/loose.dtd">';
@ -53,6 +57,7 @@ echo '</title>
<meta http-equiv="pragma" content="no-cache"> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">'; <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">';
}
switch ($select) { switch ($select) {
case 'cancel': case 'cancel':
@ -68,10 +73,12 @@ switch ($select) {
break; break;
} }
if ($select!='pdf') {
echo '</head><body> echo '</head><body>
<form enctype="multipart/form-data" action="masscreate.php" method="post">'; <form enctype="multipart/form-data" action="masscreate.php" method="post">';
echo '<table rules="all" class="masscreate" width="100%"> echo '<table rules="all" class="masscreate" width="100%">
<tr><td></td></tr>'; <tr><td></td></tr>';
}
switch ($select) { switch ($select) {
case 'main': case 'main':
@ -228,5 +235,5 @@ switch ($select) {
} }
echo '</table></form></body></html>'; if ($select!='pdf') echo '</table></form></body></html>';
?> ?>