From 5aafd379fad6096ac0a5facd3c37a08d117b0f95 Mon Sep 17 00:00:00 2001 From: katagia Date: Thu, 25 Sep 2003 14:14:59 +0000 Subject: [PATCH] fixed undefinded password if user was created removed stuff from default profile --- lam/config/profiles/users/default.pru | 4 +--- lam/lib/account.inc | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lam/config/profiles/users/default.pru b/lam/config/profiles/users/default.pru index 9dd4fe09..f2e73f90 100644 --- a/lam/config/profiles/users/default.pru +++ b/lam/config/profiles/users/default.pru @@ -1,5 +1,5 @@ general_group: admin -general_homedir: /home/$group/$user +general_homedir: /home/$user general_shell: /bin/bash unix_password_no: 0 unix_pwdwarn: 10 @@ -12,5 +12,3 @@ smb_password_no: 0 smb_useunixpwd: 1 smb_flagsD: 1 smb_homedrive: U: -smb_domain: sambaDomainName=test,dc=my-domain,dc=com -quota: /home,10000,10000,500,500;/,20000,20000,1000,1000 diff --git a/lam/lib/account.inc b/lam/lib/account.inc index cfaefb6f..acefbaef 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -832,10 +832,11 @@ function createuser($values) { // Will create the LDAP-Account if ($values->personal_employeeType!='') $attr['employeeType'] = utf8_encode($values->personal_employeeType); // posixAccount_may shadowAccount_may if ($values->unix_password_no) $values->unix_password = ''; - if ($values->unix_deactivated) $attr['userPassword'] = '!' . crypt($values->unix_password); + if ($values->unix_deactivated) $attr['userPassword'] = '{CRYPT}!' . crypt($values->unix_password); + else $attr['userPassword'] = '{CRYPT}'. crypt($values->unix_password); $attr['shadowLastChange'] = getdays(); // shadowAccount_may $attr['loginShell'] = $values->general_shell; // posixAccount_may - $attr['gecos'] = utf8_encode($values->general_gecos); // posixAccount_may + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); // posixAccount_may $attr['description'] = utf8_encode($values->general_gecos); // posixAccount_may sambaAccount_may $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may @@ -1052,7 +1053,7 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account if ($values->general_shell != $values_old->general_shell) $attr['loginShell'] = $values->general_shell; // posixAccount_may if ($values->general_gecos != $values_old->general_gecos) { - $attr['gecos'] = utf8_encode($values->general_gecos); // posixAccount_may + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); // posixAccount_may $attr['description'] = utf8_encode($values->general_gecos); // posixAccount_may sambaAccount_may } @@ -1365,7 +1366,7 @@ function createhost($values) { // Will create the LDAP-Account $attr['shadowLastChange'] = getdays(); // shadowAccount_may $attr['loginShell'] = $values->general_shell; // posixAccount_may - $attr['gecos'] = utf8_encode($values->general_gecos); // posixAccount_may + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); // posixAccount_may $attr['description'] = utf8_encode($values->general_gecos); // posixAccount_may sambaAccount_may if ($date!='') $attr['shadowExpire'] = $date ; // shadowAccount_may $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); @@ -1568,7 +1569,7 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account } if ($values->general_gecos != $values_old->general_gecos) { - $attr['gecos'] = utf8_encode($values->general_gecos); // posixAccount_may + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); // posixAccount_may $attr['description'] = utf8_encode($values->general_gecos); // posixAccount_may sambaAccount_may }