Added support for custom page displayd after successfull usercreation

Enhanced LAyout to support custom page
This commit is contained in:
katagia 2003-04-24 14:27:41 +00:00
parent abc549771f
commit 12ef7a7d99
2 changed files with 95 additions and 10 deletions

27
lam/config/print.php Normal file
View File

@ -0,0 +1,27 @@
<?
echo '<tr><td>Userinformation</td></tr>';
echo '<tr><td><br></td></tr>';
echo '<tr><td>'.$_SESSION['account']->personal_title .' '. $_SESSION['account']->personal_surname .' '. $_SESSION['account']->personal_givenname . '</td></tr>';
echo '<tr><td>'.$_SESSION['account']->personal_employeeType.'</td></tr>';
echo '<tr><td>'.$_SESSION['account']->personal_street.'</td></tr>';
echo '<tr><td>'.$_SESSION['account']->personal_postalCode.$_SESSION['account']->personal_postalAddress.'</td></tr>';
echo '<tr><td><br></td></tr>';
echo '<tr><td>Telephone: '.$_SESSION['account']->personal_telephoneNumber.'</td></tr>';
echo '<tr><td>Mobile Phone: '.$_SESSION['account']->personal_mobileTelephoneNumber.'</td></tr>';
echo '<tr><td>Fax Number: '.$_SESSION['account']->personal_facsimileTelephoneNumber.'</td></tr>';
echo '<tr><td>eMail-Address: '.$_SESSION['account']->personal_mail.'</td></tr>';
echo '<tr><td><br></td></tr>';
echo '<tr><td>Username: '.$_SESSION['account']->general_username.'</td><td>UID-Number: '.$_SESSION['account']->general_uidNumber.'</td></tr>';
echo '<tr><td>Unix-Password: '.$_SESSION['account']->unix_password.'</td></tr>';
echo '<tr><td>Groupname: '.$_SESSION['account']->general_group.'</td><td>GID-Number: </td></tr>';
echo '<tr><td>User is also member of the groups: ';
foreach ($_SESSION['account']->general_groupadd[] as $group) echo $group.' ';
echo '</td></tr>';
echo '<tr><td>Homedirectory: '.$_SESSION['account']->general_homedir.'</td><td>Shell: '.$_SESSION['account']->general_shell.'</td></tr>';
echo '<tr><td><br></td></tr>';
echo '<tr><td>Windows-Password: '.$_SESSION['account']->smb_password.'</td></tr>';
echo '<tr><td>Windows-Domain: '.$_SESSION['account']->smb_domain.'</td></tr>';
echo '<tr><td>Allowed workstations: '.$_SESSION['account']->smb_smbuserworkstations.'</td></tr>';
echo '<tr><td>Windows-Homedir: '.$_SESSION['account']->smb_smbhome.'</td></tr>';
echo '</body></html>';
?>

View File

@ -200,32 +200,29 @@ if ( $create ) { // Create-Button was pressed
switch ($_SESSION['type2']) {
case 'user':
$result = createuser(); // account.inc
if (1!=1) {//if ( $result==1 || $result==3 ) {
if ( $result==1 || $result==3 ) {
$_SESSION['account'] = "";
$_SESSION['account_old'] = "";
$_SESSION['account_temp'] = "";
$select = 'general';
// Dialog anzeigen, dass Benutzer angelegt wurde und fragen, ob Daten ausgedruckt werden sollen
$select = 'finish';
}
break;
case 'group':
$result = creategroup(); // account.inc
if (1!=1) {//if ( $result==1 || $result==3 ) {
if ( $result==1 || $result==3 ) {
$_SESSION['account'] = "";
$_SESSION['account_old'] = "";
$_SESSION['account_temp'] = "";
$select = 'general';
// Dialog anzeigen, dass Gruppe angelegt wurde und fragen, ob Daten ausgedruckt werden sollen
$select = 'finish';
}
break;
case 'host':
$result = createhost(); // account.inc
if (1!=1) {//if ( $result==1 || $result==3 ) {
if ( $result==1 || $result==3 ) {
$_SESSION['account'] = "";
$_SESSION['account_old'] = "";
$_SESSION['account_temp'] = "";
$select = 'general';
// Dialog anzeigen, dass host angelegt wurde und fragen, ob Daten ausgedruckt werden sollen
$select = 'finish';
}
break;
}
@ -242,7 +239,8 @@ echo '</title>
<meta http-equiv="cache-control" content="no-cache">
<table rules="all" class="grouplist" width="100%">';
if (!$select) $select='general';
if ($createagain) $select='general';
if ($backmain) $select='backmain';
switch ($select) {
case 'general':
@ -753,6 +751,66 @@ switch ($select) {
<input name="create" type="submit" value="'; echo _('Create Account'); echo '">
</td></tr>';
break;
case 'finish':
// Final Settings
echo '<input name="select" type="hidden" value="final">
<tr><td>';
echo _('Success');
echo '</td></tr>';
switch ( $_SESSION['type2'] ) {
case 'user' :
echo '<tr><td>';
echo _('User ');
echo $_SESSION['account']->general_username;
echo _('has been created');
echo '</td></tr>';
include('../config/print.php');
echo '<tr><td>
<input name="createagain" type="submit" value="'; echo _('Create another user'); echo '">
</td><td>
<a href ="javascript:self.print();">';
echo _('Print');
echo '</a></td><td>
<input name="backmain" type="submit" value="'; echo _('Back to userlist'); echo '">
</td></tr>';
break;
case 'group' :
echo '<tr><td>';
echo _('Group ');
echo $_SESSION['account']->general_username;
echo _('has been created');
echo '</td></tr><tr><td>
<input name="createagain" type="submit" value="'; echo _('Create another group'); echo '">
</td><td></td><td>
<input name="backmain" type="submit" value="'; echo _('Back to grouplist'); echo '">
</td></tr>';
break;
case 'host' :
echo '<tr><td>';
echo _('Host ');
echo $_SESSION['account']->general_username;
echo _('has been created');
echo '</td></tr><tr><td>
<input name="createagain" type="submit" value="'; echo _('Create another host'); echo '">
</td><td></td><td>
<input name="backmain" type="submit" value="'; echo _('Back to hostlist'); echo '">
</td></tr>';
break;
}
break;
case 'backmain':
switch ( $_SESSION['type2'] ) {
case 'user' :
echo '<meta http-equiv="refresh" content="0; URL=lists/listusers.php">';
break;
case 'group' :
echo '<meta http-equiv="refresh" content="0; URL=lists/listgroups.php">';
break;
case 'host' :
echo '<meta http-equiv="refresh" content="0; URL=lists/listhosts.php">';
break;
}
break;
}
// Print end of HTML-Page