Renamed print.php in print.html

print.html is now written in html-code

added template for delete
This commit is contained in:
katagia 2003-04-25 11:07:28 +00:00
parent c10e9e299d
commit ea9bbf788e
6 changed files with 112 additions and 55 deletions

24
lam/config/print.html Normal file
View File

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

View File

@ -1,27 +0,0 @@
<?
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

@ -570,7 +570,6 @@ function createuser() { // Will create the LDAP-Account
// 3 == Account has been modified
// 4 == Error while creating Account
// 5 == Error while modifying Account
// Value stored in shadowExpire, days since 1.1.1970
$date = mktime(0,0,0, $_SESSION['account']->unix_pwdexpire_day, $_SESSION['account']->unix_pwdexpire_mon, $_SESSION['account']->unix_pwdexpire_yea) / 86400 ;
settype($date, 'integer');
@ -612,8 +611,8 @@ function createuser() { // Will create the LDAP-Account
$attr['shadowLastChange'] = getdays(); // shadowAccunt_may
}
if ($_SESSION['account']->smb_password!='') {
$attr['ntPassword'] = exec('../lib/createntlm.pl nt' . $_SESSION['account']->smb_password);
$attr['lmPassword'] = exec('../lib/createntlm.pl lm' . $_SESSION['account']->smb_password);
$attr['ntPassword'] = exec('../lib/createntlm.pl nt ' . $_SESSION['account']->smb_password);
$attr['lmPassword'] = exec('../lib/createntlm.pl lm ' . $_SESSION['account']->smb_password);
$attr['pwdLastSet'] = time(); // sambaAccount_may
}
}
@ -622,8 +621,8 @@ function createuser() { // Will create the LDAP-Account
if ($_SESSION['account']->unix_deactivated) $attr['userPassword'] = '{CRYPT}!' . crypt($_SESSION['account']->unix_password);
else $attr['userPassword'] = '{CRYPT}' . crypt($_SESSION['account']->unix_password);
$attr['shadowLastChange'] = getdays(); // shadowAccunt_may
$attr['ntPassword'] = exec('../lib/createntlm.pl nt' . $_SESSION['account']->smb_password);
$attr['lmPassword'] = exec('../lib/createntlm.pl lm' . $_SESSION['account']->smb_password);
$attr['ntPassword'] = exec('../lib/createntlm.pl nt ' . $_SESSION['account']->smb_password);
$attr['lmPassword'] = exec('../lib/createntlm.pl lm ' . $_SESSION['account']->smb_password);
$attr['pwdLastSet'] = time(); // sambaAccount_may
}
if ($_SESSION['account']->smb_password_no) {

View File

@ -482,6 +482,6 @@ sub E_P16 {
return @p16;
}
if ($ARGV[0] eq 'nt') { print nthash($ARGV[1]); }
if ($ARGV[0] eq 'lm') { print lmhash($ARGV[1]); }
if ($ARGV[0] eq 'nt') { print nthash($ARGV[1])."\n"; }
if ($ARGV[0] eq 'lm') { print lmhash($ARGV[1])."\n"; }

View File

@ -194,30 +194,15 @@ if ( $create ) { // Create-Button was pressed
switch ($_SESSION['type2']) {
case 'user':
$result = createuser(); // account.inc
if ( $result==1 || $result==3 ) {
$_SESSION['account'] = "";
$_SESSION['account_old'] = "";
$_SESSION['account_temp'] = "";
$select = 'finish';
}
if ( $result==1 || $result==3 ) $select = 'finish';
break;
case 'group':
$result = creategroup(); // account.inc
if ( $result==1 || $result==3 ) {
$_SESSION['account'] = "";
$_SESSION['account_old'] = "";
$_SESSION['account_temp'] = "";
$select = 'finish';
}
if ( $result==1 || $result==3 ) $select = 'finish';
break;
case 'host':
$result = createhost(); // account.inc
if ( $result==1 || $result==3 ) {
$_SESSION['account'] = "";
$_SESSION['account_old'] = "";
$_SESSION['account_temp'] = "";
$select = 'finish';
}
if ( $result==1 || $result==3 ) $select = 'finish';
break;
}
}
@ -238,8 +223,22 @@ echo '</title>
if (!$select) $select='general';
if ($createagain) $select='general';
if ($backmain) $select='backmain';
if ($createagain) {
$select='general';
$_SESSION['account']="";
$_SESSION['account_temp']="";
$_SESSION['account_old']="";
}
if ($backmain) {
$select='backmain';
$_SESSION['account']="";
$_SESSION['account_temp']="";
$_SESSION['account_old']="";
}
switch ($select) {
case 'general':
@ -763,7 +762,7 @@ switch ($select) {
echo $_SESSION['account']->general_username;
echo _('has been created');
echo '</td></tr>';
include('../config/print.php');
foreach (file('../config/print.html') as $line) eval("?".">".$line."<"."?");
echo '<tr><td>
<input name="createagain" type="submit" value="'; echo _('Create another user'); echo '">
</td><td>

62
lam/templates/delete.php Normal file
View File

@ -0,0 +1,62 @@
<?
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Tilo Lutz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LDAP Account Manager Delete user, hosts or groups
*/
include_once('../lib/ldap.inc');
echo '<html><head><title>';
echo _('Delete Account');
echo '</title>
<link rel="stylesheet" type="text/css" href="../style/delete.css">
</head><body>
<form action="account.php" method="post">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<table rules="all" class="delete" width="100%">
<tr><td>';
if ($DN && $type)
foreach ($DN as $dn) {
$dn = str_replace("\'", '',$dn);
switch ($type) {
case 'user':
$success = ldap_delete($_SESSION['ldap']->server(), $dn);
if (!$success) $error = _('Could not delete user: ').$dn;
break;
case 'host':
$success = ldap_delete($_SESSION['ldap']->server(), $dn);
if (!$success) $error = _('Could not delete user: ').$dn;
break;
case 'group':
$entry = ldap_read($_SESSION['ldap']->server(), $dn, "");
if (!$entry) $error = _('Could not delete group: ').$dn;
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
if ($attr['memberUid']) $error = _('Could not delete group. Still users in group: ').$dn;
break;
}
if (!$error) echo $dn. _('deleted.');
echo '</td></tr><tr><td>';
}
echo '</form></body></html>';
?>