smaller design fixes
This commit is contained in:
parent
833f30a4da
commit
f5c8c62355
|
@ -84,71 +84,8 @@ class account { // This class keeps all needed values for any account
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function initvars($type=false,$DN=false) { // This function registers all needes session-varibales needed by account.php
|
|
||||||
// if session was started previos, the existing session will be continued
|
|
||||||
session_save_path('../sess');
|
|
||||||
@session_start();
|
|
||||||
setlanguage();
|
|
||||||
if ($type) {
|
|
||||||
if (isset($_SESSION['shelllist'])) unset($_SESSION['shelllist']);
|
|
||||||
$_SESSION['shelllist'] = getshells(); // Write List of all valid shells in variable
|
|
||||||
if (isset($_SESSION['account'])) unset($_SESSION['account']);
|
|
||||||
if (isset($_SESSION['errors'])) unset($_SESSION['errors']);
|
|
||||||
if ($DN) {
|
|
||||||
if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']);
|
|
||||||
$DN = str_replace("\'", '',$DN);
|
|
||||||
switch ($type) {
|
|
||||||
case 'user':
|
|
||||||
$_SESSION['account'] = loaduser($DN);
|
|
||||||
$_SESSION['account_old'] = $_SESSION['account'];
|
|
||||||
$_SESSION['account']->unix_password='';
|
|
||||||
$_SESSION['account']->smb_password='';
|
|
||||||
$_SESSION['account']->general_dn = substr($_SESSION['account']->general_dn, strpos($_SESSION['account']->general_dn, ',')+1);
|
|
||||||
break;
|
|
||||||
case 'group':
|
|
||||||
$_SESSION['account'] = loadgroup($DN);
|
|
||||||
$_SESSION['account_old'] = $_SESSION['account'];
|
|
||||||
$_SESSION['account']->general_dn = substr($_SESSION['account']->general_dn, strpos($_SESSION['account']->general_dn, ',')+1);
|
|
||||||
$_SESSION['final_changegids'] = '';
|
|
||||||
break;
|
|
||||||
case 'host':
|
|
||||||
$_SESSION['account'] = loadhost($DN);
|
|
||||||
$_SESSION['account_old'] = $_SESSION['account'];
|
|
||||||
$_SESSION['account']->unix_password='';
|
|
||||||
$_SESSION['account']->smb_password='';
|
|
||||||
$_SESSION['account']->general_dn = substr($_SESSION['account']->general_dn, strpos($_SESSION['account']->general_dn, ',')+1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']);
|
|
||||||
switch ($type) {
|
|
||||||
case 'user':
|
|
||||||
$_SESSION['account'] = loadUserProfile('default');
|
|
||||||
$_SESSION['account']->type = 'user';
|
|
||||||
break;
|
|
||||||
case 'group':
|
|
||||||
$_SESSION['account'] = loadGroupProfile('default');
|
|
||||||
$_SESSION['account']->type = 'group';
|
|
||||||
break;
|
|
||||||
case 'host':
|
|
||||||
$_SESSION['account'] = loadHostProfile('default');
|
|
||||||
$_SESSION['account']->type = 'host';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if ( (($type=='user')||($type=='group')) && ($_SESSION['config']->scriptServer)) {
|
|
||||||
$values = getquotas($type);
|
|
||||||
if (is_object($values)) {
|
|
||||||
while (list($key, $val) = each($values)) // Set only defined values
|
|
||||||
if ($val) $_SESSION['account']->$key = $val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getshells() { // Return a list of all shells listed in ../config/shells
|
function getshells() { // Return a list of all shells listed in ../config/shells
|
||||||
$shells = file('../config/shells');
|
$shells = file('../../config/shells');
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($shells[$i]) {
|
while ($shells[$i]) {
|
||||||
chop($shells[$i]);
|
chop($shells[$i]);
|
||||||
|
@ -1006,7 +943,7 @@ function loadgroup($dn) { // Will load all needed values from an existing group
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if (isset($attr['gidNumber'][0])) $return->general_uidNumber = $attr['gidNumber'][0];
|
if (isset($attr['gidNumber'][0])) $return->general_uidNumber = $attr['gidNumber'][0];
|
||||||
if (isset($attr['description'][0])) $return->general_gecos = $attr['description'][0];
|
if (isset($attr['gecos'][0])) $return->general_gecos = utf8_decode($attr['gecos'][0]);
|
||||||
if (isset($attr['cn'][0])) {
|
if (isset($attr['cn'][0])) {
|
||||||
$return->general_username = $attr['cn'][0];
|
$return->general_username = $attr['cn'][0];
|
||||||
if ($_SESSION['config']->scriptServer) getquotas('group',$attr['cn'][0]);
|
if ($_SESSION['config']->scriptServer) getquotas('group',$attr['cn'][0]);
|
||||||
|
@ -1059,8 +996,8 @@ function createuser($values) { // Will create the LDAP-Account
|
||||||
$attr['objectClass'][1] = 'shadowAccount';
|
$attr['objectClass'][1] = 'shadowAccount';
|
||||||
if ($_SESSION['config']->samba3 == 'yes') {
|
if ($_SESSION['config']->samba3 == 'yes') {
|
||||||
$attr['objectClass'][2] = 'sambaSamAccount';
|
$attr['objectClass'][2] = 'sambaSamAccount';
|
||||||
$attr['sambaNTPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password);
|
$attr['sambaNTPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password);
|
||||||
$attr['sambaLMPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password);
|
$attr['sambaLMPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password);
|
||||||
$attr['sambaPwdLastSet'] = time(); // sambaAccount_may
|
$attr['sambaPwdLastSet'] = time(); // sambaAccount_may
|
||||||
if ($values->smb_password_no) {
|
if ($values->smb_password_no) {
|
||||||
$attr['sambaNTPassword'] = 'NO PASSWORD*****';
|
$attr['sambaNTPassword'] = 'NO PASSWORD*****';
|
||||||
|
@ -1086,8 +1023,8 @@ function createuser($values) { // Will create the LDAP-Account
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$attr['objectClass'][2] = 'sambaAccount';
|
$attr['objectClass'][2] = 'sambaAccount';
|
||||||
$attr['ntPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password);
|
$attr['ntPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password);
|
||||||
$attr['lmPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password);
|
$attr['lmPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password);
|
||||||
$attr['pwdLastSet'] = time(); // sambaAccount_may
|
$attr['pwdLastSet'] = time(); // sambaAccount_may
|
||||||
if ($values->smb_password_no) {
|
if ($values->smb_password_no) {
|
||||||
$attr['ntPassword'] = 'NO PASSWORD*****';
|
$attr['ntPassword'] = 'NO PASSWORD*****';
|
||||||
|
@ -1245,8 +1182,8 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ($values->smb_password!='') {
|
if ($values->smb_password!='') {
|
||||||
$attr['sambaNTPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password);
|
$attr['sambaNTPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password);
|
||||||
$attr['sambaLMPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password);
|
$attr['sambaLMPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password);
|
||||||
$attr['sambaPwdLastSet'] = time(); // sambaAccount_may
|
$attr['sambaPwdLastSet'] = time(); // sambaAccount_may
|
||||||
}
|
}
|
||||||
if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['sambaPwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may
|
if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['sambaPwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may
|
||||||
|
@ -1276,8 +1213,8 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ($values->smb_password!='') {
|
if ($values->smb_password!='') {
|
||||||
$attr['ntPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password);
|
$attr['ntPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password);
|
||||||
$attr['lmPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password);
|
$attr['lmPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password);
|
||||||
$attr['pwdLastSet'] = time(); // sambaAccount_may
|
$attr['pwdLastSet'] = time(); // sambaAccount_may
|
||||||
}
|
}
|
||||||
if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['pwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may
|
if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['pwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may
|
||||||
|
|
|
@ -92,7 +92,6 @@ tr.userlist-head {
|
||||||
|
|
||||||
/* color of rows on mouseOver */
|
/* color of rows on mouseOver */
|
||||||
tr.userlist-over {
|
tr.userlist-over {
|
||||||
background-color:#CCCCFF;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* color of checked rows */
|
/* color of checked rows */
|
||||||
|
@ -463,3 +462,28 @@ select.hostedit-bright {
|
||||||
background-color:#ffc4ba;
|
background-color:#ffc4ba;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* table style for useredit.php
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset.useredit-bright {
|
||||||
|
background-color:#fff2a3;
|
||||||
|
}
|
||||||
|
|
||||||
|
legend.useredit-bright {
|
||||||
|
color:blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.useredit-dark {
|
||||||
|
background-color:#CCCCFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
legend.useredit-dark {
|
||||||
|
color:blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
select.useredit-bright {
|
||||||
|
background-color:#CCCCFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ if (isset($_GET['DN'])) {
|
||||||
if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']);
|
if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']);
|
||||||
$DN = str_replace("\'", '',$_GET['DN']);
|
$DN = str_replace("\'", '',$_GET['DN']);
|
||||||
$_SESSION['account'] = loadgroup($DN);
|
$_SESSION['account'] = loadgroup($DN);
|
||||||
$_SESSION['account'] ->type = 'group';
|
|
||||||
$_SESSION['account_old'] = $_SESSION['account'];
|
$_SESSION['account_old'] = $_SESSION['account'];
|
||||||
$_SESSION['account']->general_dn = substr($_SESSION['account']->general_dn, strpos($_SESSION['account']->general_dn, ',')+1);
|
$_SESSION['account']->general_dn = substr($_SESSION['account']->general_dn, strpos($_SESSION['account']->general_dn, ',')+1);
|
||||||
$_SESSION['final_changegids'] = '';
|
$_SESSION['final_changegids'] = '';
|
||||||
|
|
|
@ -33,6 +33,7 @@ include_once('../../lib/ldap.inc'); // LDAP-functions
|
||||||
session_save_path('../../sess');
|
session_save_path('../../sess');
|
||||||
@session_start();
|
@session_start();
|
||||||
setlanguage();
|
setlanguage();
|
||||||
|
$_SESSION['shelllist'] = getshells(); // Write List of all valid shells in variable
|
||||||
if (isset($_GET['DN'])) {
|
if (isset($_GET['DN'])) {
|
||||||
if (isset($_GET['DN']) && $_GET['DN']!='') {
|
if (isset($_GET['DN']) && $_GET['DN']!='') {
|
||||||
if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']);
|
if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']);
|
||||||
|
@ -415,7 +416,7 @@ switch ($select_local) { // Select which part of page will be loaded
|
||||||
'<a href="help.php?HelpNumber=406" target="lamhelp">'._('Help').'</a>'.
|
'<a href="help.php?HelpNumber=406" target="lamhelp">'._('Help').'</a>'.
|
||||||
'</td></tr>'."\n".'<tr><td>';
|
'</td></tr>'."\n".'<tr><td>';
|
||||||
echo _('Additional groups');
|
echo _('Additional groups');
|
||||||
echo '</td>'."\n".'<td><select name="f_general_groupadd[]" size="4" multiple>';
|
echo '</td>'."\n".'<td><select name="f_general_groupadd[]" size="3" multiple>';
|
||||||
// loop though existing groups for additional groups
|
// loop though existing groups for additional groups
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
if ($_SESSION['account']->general_groupadd) {
|
if ($_SESSION['account']->general_groupadd) {
|
||||||
|
@ -460,7 +461,7 @@ switch ($select_local) { // Select which part of page will be loaded
|
||||||
echo _('Values with * are required');
|
echo _('Values with * are required');
|
||||||
echo "</fieldset>\n</td></tr><tr><td>";
|
echo "</fieldset>\n</td></tr><tr><td>";
|
||||||
if (count($profilelist)!=0) {
|
if (count($profilelist)!=0) {
|
||||||
echo "<fieldset class=\"useredit-middle\"><legend class=\"useredit-bright\"><b>";
|
echo "<fieldset class=\"useredit-dark\"><legend class=\"useredit-bright\"><b>";
|
||||||
echo _("Load profile");
|
echo _("Load profile");
|
||||||
echo "</b></legend>\n<table border=0>\n<tr>\n<td>";
|
echo "</b></legend>\n<table border=0>\n<tr>\n<td>";
|
||||||
echo "<select name=\"f_general_selectprofile\" >";
|
echo "<select name=\"f_general_selectprofile\" >";
|
||||||
|
@ -485,7 +486,7 @@ switch ($select_local) { // Select which part of page will be loaded
|
||||||
$date = getdate ($_SESSION['account']->unix_pwdexpire);
|
$date = getdate ($_SESSION['account']->unix_pwdexpire);
|
||||||
echo "<input name=\"select\" type=\"hidden\" value=\"unix\">\n";
|
echo "<input name=\"select\" type=\"hidden\" value=\"unix\">\n";
|
||||||
echo "<table border=0 width=\"100%\">\n<tr><td valign=\"top\" width=\"15%\" >";
|
echo "<table border=0 width=\"100%\">\n<tr><td valign=\"top\" width=\"15%\" >";
|
||||||
echo "<table border=0><tr><td><fieldset class=\"useredit-middle\"><legend class=\"useredit-bright\"><b>";
|
echo "<table border=0><tr><td><fieldset class=\"useredit-dark\"><legend class=\"useredit-bright\"><b>";
|
||||||
echo _('Please select page:');
|
echo _('Please select page:');
|
||||||
echo "</b></legend>\n";
|
echo "</b></legend>\n";
|
||||||
echo "<input name=\"next_general\" type=\"submit\" value=\""; echo _('General'); echo "\">\n<br>";
|
echo "<input name=\"next_general\" type=\"submit\" value=\""; echo _('General'); echo "\">\n<br>";
|
||||||
|
@ -772,7 +773,7 @@ switch ($select_local) { // Select which part of page will be loaded
|
||||||
// Quota Settings
|
// Quota Settings
|
||||||
echo "<input name=\"select\" type=\"hidden\" value=\"quota\">\n";
|
echo "<input name=\"select\" type=\"hidden\" value=\"quota\">\n";
|
||||||
echo "<table border=0 width=\"100%\">\n<tr><td valign=\"top\" width=\"15%\" >";
|
echo "<table border=0 width=\"100%\">\n<tr><td valign=\"top\" width=\"15%\" >";
|
||||||
echo "<table border=0><tr><td><fieldset class=\"useredit-middle\"><legend class=\"useredit-bright\"><b>";
|
echo "<table border=0><tr><td><fieldset class=\"useredit-dark\"><legend class=\"useredit-bright\"><b>";
|
||||||
echo _('Please select page:');
|
echo _('Please select page:');
|
||||||
echo "</b></legend>\n";
|
echo "</b></legend>\n";
|
||||||
echo "<input name=\"next_general\" type=\"submit\" value=\""; echo _('General'); echo "\">\n<br>";
|
echo "<input name=\"next_general\" type=\"submit\" value=\""; echo _('General'); echo "\">\n<br>";
|
||||||
|
@ -812,7 +813,7 @@ switch ($select_local) { // Select which part of page will be loaded
|
||||||
// Personal Settings
|
// Personal Settings
|
||||||
echo "<input name=\"select\" type=\"hidden\" value=\"personal\">\n";
|
echo "<input name=\"select\" type=\"hidden\" value=\"personal\">\n";
|
||||||
echo "<table border=0 width=\"100%\">\n<tr><td valign=\"top\" width=\"15%\" >";
|
echo "<table border=0 width=\"100%\">\n<tr><td valign=\"top\" width=\"15%\" >";
|
||||||
echo "<table border=0><tr><td><fieldset class=\"useredit-middle\"><legend class=\"useredit-bright\"><b>";
|
echo "<table border=0><tr><td><fieldset class=\"useredit-dark\"><legend class=\"useredit-bright\"><b>";
|
||||||
echo _('Please select page:');
|
echo _('Please select page:');
|
||||||
echo "</b></legend>\n";
|
echo "</b></legend>\n";
|
||||||
echo "<input name=\"next_general\" type=\"submit\" value=\""; echo _('General'); echo "\">\n<br>";
|
echo "<input name=\"next_general\" type=\"submit\" value=\""; echo _('General'); echo "\">\n<br>";
|
||||||
|
|
Loading…
Reference in New Issue