From f5c8c623551565c17889b6426575cf8e0deed2a2 Mon Sep 17 00:00:00 2001 From: katagia Date: Mon, 15 Sep 2003 16:54:44 +0000 Subject: [PATCH] smaller design fixes --- lam/lib/account.inc | 83 ++++------------------------- lam/style/500_layout.css | 26 ++++++++- lam/templates/account/groupedit.php | 1 - lam/templates/account/useredit.php | 11 ++-- 4 files changed, 41 insertions(+), 80 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 849e491a..b8755df1 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -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 - $shells = file('../config/shells'); + $shells = file('../../config/shells'); $i=0; while ($shells[$i]) { chop($shells[$i]); @@ -1006,7 +943,7 @@ function loadgroup($dn) { // Will load all needed values from an existing group $i++; } 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])) { $return->general_username = $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'; if ($_SESSION['config']->samba3 == 'yes') { $attr['objectClass'][2] = 'sambaSamAccount'; - $attr['sambaNTPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password); - $attr['sambaLMPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password); + $attr['sambaNTPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password); + $attr['sambaLMPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password); $attr['sambaPwdLastSet'] = time(); // sambaAccount_may if ($values->smb_password_no) { $attr['sambaNTPassword'] = 'NO PASSWORD*****'; @@ -1086,8 +1023,8 @@ function createuser($values) { // Will create the LDAP-Account } else { $attr['objectClass'][2] = 'sambaAccount'; - $attr['ntPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password); - $attr['lmPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password); + $attr['ntPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password); + $attr['lmPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password); $attr['pwdLastSet'] = time(); // sambaAccount_may if ($values->smb_password_no) { $attr['ntPassword'] = 'NO PASSWORD*****'; @@ -1245,8 +1182,8 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account } else if ($values->smb_password!='') { - $attr['sambaNTPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password); - $attr['sambaLMPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password); + $attr['sambaNTPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password); + $attr['sambaLMPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password); $attr['sambaPwdLastSet'] = time(); // 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 if ($values->smb_password!='') { - $attr['ntPassword'] = exec('../lib/createntlm.pl nt ' . $values->smb_password); - $attr['lmPassword'] = exec('../lib/createntlm.pl lm ' . $values->smb_password); + $attr['ntPassword'] = exec('../../lib/createntlm.pl nt ' . $values->smb_password); + $attr['lmPassword'] = exec('../../lib/createntlm.pl lm ' . $values->smb_password); $attr['pwdLastSet'] = time(); // sambaAccount_may } if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['pwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index 75d869bf..3134461c 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -92,7 +92,6 @@ tr.userlist-head { /* color of rows on mouseOver */ tr.userlist-over { - background-color:#CCCCFF; } /* color of checked rows */ @@ -463,3 +462,28 @@ select.hostedit-bright { 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; +} + diff --git a/lam/templates/account/groupedit.php b/lam/templates/account/groupedit.php index 0a97a293..6279c7db 100644 --- a/lam/templates/account/groupedit.php +++ b/lam/templates/account/groupedit.php @@ -38,7 +38,6 @@ if (isset($_GET['DN'])) { if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']); $DN = str_replace("\'", '',$_GET['DN']); $_SESSION['account'] = loadgroup($DN); - $_SESSION['account'] ->type = 'group'; $_SESSION['account_old'] = $_SESSION['account']; $_SESSION['account']->general_dn = substr($_SESSION['account']->general_dn, strpos($_SESSION['account']->general_dn, ',')+1); $_SESSION['final_changegids'] = ''; diff --git a/lam/templates/account/useredit.php b/lam/templates/account/useredit.php index eb85c448..a3147477 100644 --- a/lam/templates/account/useredit.php +++ b/lam/templates/account/useredit.php @@ -33,6 +33,7 @@ include_once('../../lib/ldap.inc'); // LDAP-functions session_save_path('../../sess'); @session_start(); setlanguage(); +$_SESSION['shelllist'] = getshells(); // Write List of all valid shells in variable if (isset($_GET['DN'])) { if (isset($_GET['DN']) && $_GET['DN']!='') { if (isset($_SESSION['account_old'])) unset($_SESSION['account_old']); @@ -415,7 +416,7 @@ switch ($select_local) { // Select which part of page will be loaded ''._('Help').''. ''."\n".''; echo _('Additional groups'); - echo ''."\n".''; // loop though existing groups for additional groups foreach ($groups as $group) { 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 "\n"; if (count($profilelist)!=0) { - echo "
"; + echo "
"; echo _("Load profile"); echo "\n\n\n
"; echo "\n"; echo "\n
"; - echo "
"; + echo "
"; echo _('Please select page:'); echo "\n"; echo "\n
"; @@ -772,7 +773,7 @@ switch ($select_local) { // Select which part of page will be loaded // Quota Settings echo "\n"; echo "\n
"; - echo "
"; + echo "
"; echo _('Please select page:'); echo "\n"; echo "\n
"; @@ -812,7 +813,7 @@ switch ($select_local) { // Select which part of page will be loaded // Personal Settings echo "\n"; echo "\n
"; - echo "
"; + echo "
"; echo _('Please select page:'); echo "\n"; echo "\n
";