set pswmustchange to correct value (same as unix-expire-date)

Allowed % in Samba-Paths
This commit is contained in:
katagia 2003-07-10 12:25:29 +00:00
parent 6b7f28b4c6
commit 2e4baad5c7
3 changed files with 43 additions and 39 deletions

View File

@ -345,10 +345,10 @@ function checksamba($values, $type) { // This function checks all samba account
if ($values->smb_smbHome != $return->smb_smbHome) $errors[] = array('INFO', _('smbHome'), _('Inserted groupname in smbhome.')); if ($values->smb_smbHome != $return->smb_smbHome) $errors[] = array('INFO', _('smbHome'), _('Inserted groupname in smbhome.'));
if ( !ereg('^([a-z]|[A-Z]|[0-9]|[\|]|[\#]|[\*]|[\,]|[\.]|[\;]|[\:]|[\_]|[\-]|[\+]|[\!]|[\%]|[\&]|[\/]|[\?]|[\{]|[\[]|[\(]|[\)]|[\]]|[\}])*$', if ( !ereg('^([a-z]|[A-Z]|[0-9]|[\|]|[\#]|[\*]|[\,]|[\.]|[\;]|[\:]|[\_]|[\-]|[\+]|[\!]|[\%]|[\&]|[\/]|[\?]|[\{]|[\[]|[\(]|[\)]|[\]]|[\}])*$',
$values->smb_password)) $errors[] = array('ERROR', _('Password'), _('Password contents invalid characters. Valid characters are: a-z, A-Z, 0-9 and #*,.;:_-+!$%&/|?{[()]}= !')); $values->smb_password)) $errors[] = array('ERROR', _('Password'), _('Password contents invalid characters. Valid characters are: a-z, A-Z, 0-9 and #*,.;:_-+!$%&/|?{[()]}= !'));
if ( (!$return->smb_scriptPath=='') && (!ereg('^([/])*[a-z]([a-z]|[0-9]|[.]|[-]|[_])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_])*)*$', $return->smb_scriptPath))) if ( (!$return->smb_scriptPath=='') && (!ereg('^([/])*[a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*)*$', $return->smb_scriptPath)))
$errors[] = array('ERROR', _('Scriptpath'), _('Scriptpath is invalid')); $errors[] = array('ERROR', _('Scriptpath'), _('Scriptpath is invalid'));
if ( (!$return->smb_profilePath=='') && (!ereg('^[/][a-z]([a-z]|[0-9]|[.]|[-]|[_])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_])*)*$', $return->smb_profilePath)) if ( (!$return->smb_profilePath=='') && (!ereg('^[/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*)*$', $return->smb_profilePath))
&& (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-])+)+$', $return->smb_profilePath))) && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+)+$', $return->smb_profilePath)))
$errors[] = array('ERROR', _('Profilepath'), _('ProfilePath is invalid.')); $errors[] = array('ERROR', _('Profilepath'), _('ProfilePath is invalid.'));
if ( (!$return->smb_smbHome=='') && !ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-])+)+$', $return->smb_smbhome)) if ( (!$return->smb_smbHome=='') && !ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-])+)+$', $return->smb_smbhome))
$errors[] = array('ERROR', _('smbHome'), _('smbHome is invalid.')); $errors[] = array('ERROR', _('smbHome'), _('smbHome is invalid.'));
@ -566,13 +566,14 @@ function findgroups() { // Will return an array with all Groupnames found in LDA
function getgid($groupname) { // Will return the the gid to an existing Groupname function getgid($groupname) { // Will return the the gid to an existing Groupname
// Check if group already exists // Check if group already exists
$result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), 'cn=' . $groupname, array('gidNumber'), 0); $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), 'ObjectClass=PosixGroup', array('gidNumber', 'cn'), 0);
$entry = ldap_first_entry($_SESSION['ldap']->server(), $result); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result);
if ($entry) { while ($entry) {
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
if ($attr['gidNumber'][0]) return $attr['gidNumber'][0]; if (($attr['gidNumber'][0]) && ($attr['cn'][0]==$groupname)) return $attr['gidNumber'][0];
$entry = ldap_next_entry($_SESSION['ldap']->server(), $entry);
} }
else return -1; return -1;
} }
@ -695,13 +696,14 @@ function loaduser($dn) { // Will load all needed values from an existing account
$return->unix_pwdexpire_mon = $date['mon']; $return->unix_pwdexpire_mon = $date['mon'];
$return->unix_pwdexpire_yea = $date['year']; $return->unix_pwdexpire_yea = $date['year'];
} }
if ($attr['pwdCanChange'][0]) $return->smb_pwdcanchange = $attr['pwdCanChange'][0];
if ($_SESSION['config']->samba3 == 'yes') { if ($_SESSION['config']->samba3 == 'yes') {
if ($attr['sambaAcctFlags'][0]) { if ($attr['sambaAcctFlags'][0]) {
if (strrpos($attr['sambaAcctFlags'][0], 'W')) $return->smb_flagsW=true; if (strrpos($attr['sambaAcctFlags'][0], 'W')) $return->smb_flagsW=true;
if (strrpos($attr['sambaAcctFlags'][0], 'D')) $return->smb_flagsD=true; if (strrpos($attr['sambaAcctFlags'][0], 'D')) $return->smb_flagsD=true;
if (strrpos($attr['sambaAcctFlags'][0], 'X')) $return->smb_flagsX=true; if (strrpos($attr['sambaAcctFlags'][0], 'X')) $return->smb_flagsX=true;
} }
if ($attr['sambaPwdCanChange'][0]) $return->smb_pwdcanchange = $attr['sambaPwdCanChange'][0];
if ($attr['sambaPwdCanChange'][0]<time()) $return->smb_pwdmustchange = 1;
if ($attr['sambaHomePath'][0]) $return->smb_smbhome = $attr['sambaHomePath'][0]; if ($attr['sambaHomePath'][0]) $return->smb_smbhome = $attr['sambaHomePath'][0];
if ($attr['sambaHomeDrive'][0]) $return->smb_homedrive = $attr['sambaHomeDrive'][0]; if ($attr['sambaHomeDrive'][0]) $return->smb_homedrive = $attr['sambaHomeDrive'][0];
if ($attr['sambaLogonScript'][0]) $return->smb_scriptPath = $attr['sambaLogonScript'][0]; if ($attr['sambaLogonScript'][0]) $return->smb_scriptPath = $attr['sambaLogonScript'][0];
@ -716,6 +718,8 @@ function loaduser($dn) { // Will load all needed values from an existing account
if (strrpos($attr['acctFlags'][0], 'X')) $return->smb_flagsX=true; if (strrpos($attr['acctFlags'][0], 'X')) $return->smb_flagsX=true;
} }
if ($attr['smbHome'][0]) $return->smb_smbhome = $attr['smbHome'][0]; if ($attr['smbHome'][0]) $return->smb_smbhome = $attr['smbHome'][0];
if ($attr['pwdCanChange'][0]) $return->smb_pwdcanchange = $attr['pwdCanChange'][0];
if ($attr['pwdCanChange'][0]<time()) $return->smb_pwdmustchange = 1;
if ($attr['homeDrive'][0]) $return->smb_homedrive = $attr['homeDrive'][0]; if ($attr['homeDrive'][0]) $return->smb_homedrive = $attr['homeDrive'][0];
if ($attr['scriptPath'][0]) $return->smb_scriptPath = $attr['scriptPath'][0]; if ($attr['scriptPath'][0]) $return->smb_scriptPath = $attr['scriptPath'][0];
if ($attr['profilePath'][0]) $return->smb_profilePath = $attr['profilePath'][0]; if ($attr['profilePath'][0]) $return->smb_profilePath = $attr['profilePath'][0];
@ -785,13 +789,14 @@ function loadhost($dn) { // Will load all needed values from an existing account
$return->unix_pwdexpire_mon = $date['mon']; $return->unix_pwdexpire_mon = $date['mon'];
$return->unix_pwdexpire_yea = $date['year']; $return->unix_pwdexpire_yea = $date['year'];
} }
if ($attr['pwdCanChange'][0]) $return->smb_pwdcanchange = $attr['pwdCanChange'][0];
if ($_SESSION['config']->samba3 == 'yes') { if ($_SESSION['config']->samba3 == 'yes') {
if ($attr['sambaAcctFlags'][0]) { if ($attr['sambaAcctFlags'][0]) {
if (strrpos($attr['sambaAcctFlags'][0], 'W')) $return->smb_flagsW=true; if (strrpos($attr['sambaAcctFlags'][0], 'W')) $return->smb_flagsW=true;
if (strrpos($attr['sambaAcctFlags'][0], 'D')) $return->smb_flagsD=true; if (strrpos($attr['sambaAcctFlags'][0], 'D')) $return->smb_flagsD=true;
if (strrpos($attr['sambaAcctFlags'][0], 'X')) $return->smb_flagsX=true; if (strrpos($attr['sambaAcctFlags'][0], 'X')) $return->smb_flagsX=true;
} }
if ($attr['sambaPwdCanChange'][0]) $return->smb_pwdcanchange = $attr['sambaPwdCanChange'][0];
if ($attr['sambaPwdCanChange'][0]<time()) $return->smb_pwdmustchange = 1;
if ($attr['sambaDomainName'][0]) $return->smb_domain = $attr['sambaDomainName'][0]; if ($attr['sambaDomainName'][0]) $return->smb_domain = $attr['sambaDomainName'][0];
} }
else { else {
@ -801,6 +806,8 @@ function loadhost($dn) { // Will load all needed values from an existing account
if (strrpos($attr['acctFlags'][0], 'X')) $return->smb_flagsX=true; if (strrpos($attr['acctFlags'][0], 'X')) $return->smb_flagsX=true;
} }
if ($attr['domain'][0]) $return->smb_domain = $attr['domain'][0]; if ($attr['domain'][0]) $return->smb_domain = $attr['domain'][0];
if ($attr['pwdCanChange'][0]) $return->smb_pwdcanchange = $attr['pwdCanChange'][0];
if ($attr['pwdCanChange'][0]<time()) $return->smb_pwdmustchange = 1;
} }
if ($attr['givenName'][0]) $return->general_givenname = $attr['givenName'][0]; if ($attr['givenName'][0]) $return->general_givenname = $attr['givenName'][0];
if ($attr['sn'][0]) $return->general_surname = $attr['sn'][0]; if ($attr['sn'][0]) $return->general_surname = $attr['sn'][0];
@ -875,7 +882,7 @@ function createuser($values) { // Will create the LDAP-Account
$attr['sambaSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * $values->general_uidNumber + 1000); // sambaAccount_may $attr['sambaSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * $values->general_uidNumber + 1000); // sambaAccount_may
$attr['sambaPrimaryGroupSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * getgid($values->general_group) + 1001); // sambaAccount_req $attr['sambaPrimaryGroupSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * getgid($values->general_group) + 1001); // sambaAccount_req
if ($values->smb_pwdcanchange) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdmustchange) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
$attr['sambaAcctFlags'] = smbflag(values); // sambaAccount_may $attr['sambaAcctFlags'] = smbflag(values); // sambaAccount_may
$attr['displayName'] = $values->general_gecos; // sambaAccount_may $attr['displayName'] = $values->general_gecos; // sambaAccount_may
if ($values->smb_smbhome!='') $attr['sambaHomePath'] = $values->smb_smbhome; // sambaAccount_may if ($values->smb_smbhome!='') $attr['sambaHomePath'] = $values->smb_smbhome; // sambaAccount_may
@ -898,7 +905,7 @@ function createuser($values) { // Will create the LDAP-Account
$attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may $attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may
$attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); // sambaAccount_req $attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); // sambaAccount_req
if ($values->smb_pwdcanchange) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdmustchange) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
$attr['acctFlags'] = smbflag(values); // sambaAccount_may $attr['acctFlags'] = smbflag(values); // sambaAccount_may
$attr['displayName'] = $values->general_gecos; // sambaAccount_may $attr['displayName'] = $values->general_gecos; // sambaAccount_may
if ($values->smb_smbhome!='') $attr['smbHome'] = $values->smb_smbhome; // sambaAccount_may if ($values->smb_smbhome!='') $attr['smbHome'] = $values->smb_smbhome; // sambaAccount_may
@ -1036,10 +1043,9 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account
$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==0) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange && $values_old->smb_pwdcanchange!=1) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['sambaPwdCanChange'] = "1"; // sambaAccount_may
if ($values->smb_pwdmustchange && $values->smb_pwdmustchange==0) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
if ($values->smb_pwdmustchange==0 && $values->smb_pwdmustchange==1) $attr_rem['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = "0"; // sambaAccount_may
$attr['sambaAcctFlags'] = smbflag($values); // sambaAccount_may $attr['sambaAcctFlags'] = smbflag($values); // sambaAccount_may
if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['sambaHomePath'] = $values->smb_smbhome; // sambaAccount_may if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['sambaHomePath'] = $values->smb_smbhome; // sambaAccount_may
if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['sambaHomePath'] = $values_old->smb_smbhome; // sambaAccount_may if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['sambaHomePath'] = $values_old->smb_smbhome; // sambaAccount_may
@ -1067,10 +1073,9 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account
$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==0) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange && $values_old->smb_pwdcanchange!=1) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['pwdCanChange'] = "1"; // sambaAccount_may
if ($values->smb_pwdmustchange && $values->smb_pwdmustchange==0) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
if ($values->smb_pwdmustchange==0 && $values->smb_pwdmustchange==1) $attr_rem['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may
$attr['acctFlags'] = smbflag($values); // sambaAccount_may $attr['acctFlags'] = smbflag($values); // sambaAccount_may
if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['smbHome'] = $values->smb_smbhome; // sambaAccount_may if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['smbHome'] = $values->smb_smbhome; // sambaAccount_may
if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['smbHome'] = $values_old->smb_smbhome; // sambaAccount_may if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['smbHome'] = $values_old->smb_smbhome; // sambaAccount_may
@ -1253,7 +1258,7 @@ function createhost($values) { // Will create the LDAP-Account
$attr['sambaSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * $values->general_uidNumber + 1000); // sambaAccount_may $attr['sambaSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * $values->general_uidNumber + 1000); // sambaAccount_may
$attr['sambaPrimaryGroupSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * getgid($values->general_group) + 1001); // sambaAccount_req $attr['sambaPrimaryGroupSID'] = $_SESSION[config]->get_domainSID() . "-" . (2 * getgid($values->general_group) + 1001); // sambaAccount_req
if ($values->smb_pwdcanchange) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdmustchange) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
$attr['sambaAcctFlags'] = smbflag($values); // sambaAccount_may $attr['sambaAcctFlags'] = smbflag($values); // sambaAccount_may
$attr['displayName'] = $values->general_gecos; // sambaAccount_may $attr['displayName'] = $values->general_gecos; // sambaAccount_may
if ($values->smb_domain!='') $attr['sambaDomainName'] = $values->smb_domain; // sambaAccount_may if ($values->smb_domain!='') $attr['sambaDomainName'] = $values->smb_domain; // sambaAccount_may
@ -1271,7 +1276,7 @@ function createhost($values) { // Will create the LDAP-Account
$attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may $attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may
$attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); // sambaAccount_req $attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); // sambaAccount_req
if ($values->smb_pwdcanchange) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdmustchange) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
$attr['acctFlags'] = smbflag($values); // sambaAccount_may $attr['acctFlags'] = smbflag($values); // sambaAccount_may
$attr['displayName'] = $values->general_gecos; // sambaAccount_may $attr['displayName'] = $values->general_gecos; // sambaAccount_may
if ($values->smb_domain!='') $attr['domain'] = $values->smb_domain; // sambaAccount_may if ($values->smb_domain!='') $attr['domain'] = $values->smb_domain; // sambaAccount_may
@ -1385,10 +1390,9 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
$attr['sambaPwdLastSet'] = time(); // sambaAccount_may $attr['sambaPwdLastSet'] = time(); // sambaAccount_may
} }
if ($values->general_gecos != $values_old->general_gecos) $attr['displayName'] = $values->general_gecos; // sambaAccount_may if ($values->general_gecos != $values_old->general_gecos) $attr['displayName'] = $values->general_gecos; // sambaAccount_may
if ($values->smb_pwdcanchange && $values_old->smb_pwdcanchange==0) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange && $values_old->smb_pwdcanchange!=1) $attr['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['sambaPwdCanChange'] = "1"; else $attr['sambaPwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['sambaPwdCanChange'] = "1"; // sambaAccount_may
if ($values->smb_pwdmustchange && $values->smb_pwdmustchange==0) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
if ($values->smb_pwdmustchange==0 && $values->smb_pwdmustchange==1) $attr_rem['sambaPwdMustChange'] = "1"; else $attr['sambaPwdMustChange'] = "0"; // sambaAccount_may
$attr['acctFlags'] = smbflag($values); // sambaAccount_may $attr['acctFlags'] = smbflag($values); // sambaAccount_may
if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['sambaDomainName'] = $values->smb_domain; // sambaAccount_may if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['sambaDomainName'] = $values->smb_domain; // sambaAccount_may
if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['sambaDomainName'] = $values_old->smb_domain; // sambaAccount_may if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['sambaDomainName'] = $values_old->smb_domain; // sambaAccount_may
@ -1406,10 +1410,9 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
$attr['pwdLastSet'] = time(); // sambaAccount_may $attr['pwdLastSet'] = time(); // sambaAccount_may
} }
if ($values->general_gecos != $values_old->general_gecos) $attr['displayName'] = $values->general_gecos; // sambaAccount_may if ($values->general_gecos != $values_old->general_gecos) $attr['displayName'] = $values->general_gecos; // sambaAccount_may
if ($values->smb_pwdcanchange && $values_old->smb_pwdcanchange==0) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange && $values_old->smb_pwdcanchange!=1) $attr['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['pwdCanChange'] = "1"; // sambaAccount_may
if ($values->smb_pwdmustchange && $values->smb_pwdmustchange==0) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may if ($values->smb_pwdmustchange) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea); // sambaAccount_may
if ($values->smb_pwdmustchange==0 && $values->smb_pwdmustchange==1) $attr_rem['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may
$attr['acctFlags'] = smbflag($values); // sambaAccount_may $attr['acctFlags'] = smbflag($values); // sambaAccount_may
if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may
if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['domain'] = $values_old->smb_domain; // sambaAccount_may if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['domain'] = $values_old->smb_domain; // sambaAccount_may

View File

@ -388,6 +388,7 @@ if ($select_local != 'pdf') {
if (is_array($errors)) if (is_array($errors))
for ($i=0; $i<sizeof($errors); $i++) StatusMessage($errors[$i][0], $errors[$i][1], $errors[$i][2]); for ($i=0; $i<sizeof($errors); $i++) StatusMessage($errors[$i][0], $errors[$i][1], $errors[$i][2]);
} }
//print_r($_SESSION['account']);
switch ($select_local) { // Select which part of page will be loaded switch ($select_local) { // Select which part of page will be loaded
// general = startpage, general account paramters // general = startpage, general account paramters
@ -760,27 +761,27 @@ switch ($select_local) { // Select which part of page will be loaded
<a href="help.php?HelpNumber=433" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=433" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('Script Path'); echo _('Script Path');
echo '</td>'."\n".'<td><input name="f_smb_scriptpath" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_scriptPath . '"> echo '</td>'."\n".'<td><input name="f_smb_scriptpath" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_scriptPath . '">
</td>'."\n".'<td> </td>'."\n".'<td>
<a href="help.php?HelpNumber=434" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=434" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('Profile Path'); echo _('Profile Path');
echo '</td>'."\n".'<td><input name="f_smb_profilePath" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_profilePath . '"> echo '</td>'."\n".'<td><input name="f_smb_profilePath" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_profilePath . '">
</td>'."\n".'<td> </td>'."\n".'<td>
<a href="help.php?HelpNumber=435" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=435" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('User Workstations'); echo _('User Workstations');
echo '</td>'."\n".'<td><input name="f_smb_smbuserworkstations" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_smbuserworkstations . '"> echo '</td>'."\n".'<td><input name="f_smb_smbuserworkstations" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_smbuserworkstations . '">
</td>'."\n".'<td> </td>'."\n".'<td>
<a href="help.php?HelpNumber=436" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=436" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('smb Home'); echo _('smb Home');
echo '</td>'."\n".'<td><input name="f_smb_smbhome" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_smbhome . '"> echo '</td>'."\n".'<td><input name="f_smb_smbhome" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_smbhome . '">
</td>'."\n".'<td> </td>'."\n".'<td>
<a href="help.php?HelpNumber=437" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=437" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('Domain'); echo _('Domain');
echo '</td>'."\n".'<td><input name="f_smb_domain" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_domain . '"> echo '</td>'."\n".'<td><input name="f_smb_domain" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_domain . '">
</td>'."\n".'<td> </td>'."\n".'<td>
<a href="help.php?HelpNumber=438" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=438" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n"; </td></tr>'."\n";
@ -821,7 +822,7 @@ switch ($select_local) { // Select which part of page will be loaded
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('Windows Groupname'); echo _('Windows Groupname');
echo '</td><td> echo '</td><td>
<input name="f_smb_domain" type="text" size="30" maxlength="30" value="' . $_SESSION['account']->smb_displayName . '"> <input name="f_smb_domain" type="text" size="30" maxlength="80" value="' . $_SESSION['account']->smb_displayName . '">
</td><td> </td><td>
<a href="help.php?HelpNumber=465" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=465" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n"; </td></tr>'."\n";
@ -928,7 +929,7 @@ switch ($select_local) { // Select which part of page will be loaded
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('Postal address'); echo _('Postal address');
echo '</td>'."\n".'<td> echo '</td>'."\n".'<td>
<input name="f_personal_postalAddress" type="text" size="30" maxlength="30" value="' . $_SESSION['account']->personal_postalAddress . '"> <input name="f_personal_postalAddress" type="text" size="30" maxlength="80" value="' . $_SESSION['account']->personal_postalAddress . '">
</td><td> </td><td>
<a href="help.php?HelpNumber=452" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=452" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
@ -952,7 +953,7 @@ switch ($select_local) { // Select which part of page will be loaded
</td></tr>'."\n".'<tr><td>'; </td></tr>'."\n".'<tr><td>';
echo _('eMail Address'); echo _('eMail Address');
echo '</td>'."\n".'<td> echo '</td>'."\n".'<td>
<input name="f_personal_mail" type="text" size="30" maxlength="30" value="' . $_SESSION['account']->personal_mail . '"> <input name="f_personal_mail" type="text" size="30" maxlength="80" value="' . $_SESSION['account']->personal_mail . '">
</td><td> </td><td>
<a href="help.php?HelpNumber=456" target="lamhelp">'._('Help').'</a> <a href="help.php?HelpNumber=456" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td> </td></tr>'."\n".'<tr><td>
@ -1008,7 +1009,7 @@ switch ($select_local) { // Select which part of page will be loaded
echo '<tr><td> echo '<tr><td>
<input name="back" type="submit" value="'; echo _('back'); echo '"> <input name="back" type="submit" value="'; echo _('back'); echo '">
</td>'."\n".'<td> </td>'."\n".'<td>
</td>'."\n".'<td><input name="f_finish_safeProfile" type="text" size="30" maxlength="30"> </td>'."\n".'<td><input name="f_finish_safeProfile" type="text" size="30" maxlength="50">
<input name="save" type="submit" value="'; <input name="save" type="submit" value="';
echo _('Save Profile'); echo _('Save Profile');
echo '"><a href="help.php?HelpNumber=457" target="lamhelp">'._('Help').'</a> echo '"><a href="help.php?HelpNumber=457" target="lamhelp">'._('Help').'</a>

View File

@ -291,7 +291,7 @@ switch ($select) {
$_SESSION['accounts'][$_SESSION['pointer']]->unix_password = base64_encode(mcrypt_encrypt( $_SESSION['accounts'][$_SESSION['pointer']]->unix_password = base64_encode(mcrypt_encrypt(
MCRYPT_RIJNDAEL_256, $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); MCRYPT_RIJNDAEL_256, $key, genpasswd(), MCRYPT_MODE_ECB, $iv));
$_SESSION['accounts'][$_SESSION['pointer']]->smb_password = $_SESSION['accounts'][$_SESSION['pointer']]->unix_password; $_SESSION['accounts'][$_SESSION['pointer']]->smb_password = $_SESSION['accounts'][$_SESSION['pointer']]->unix_password;
if ( time()-$time<(get_cfg_var('max_execution_time')-10)) { if ( (time()-$time)<(get_cfg_var('max_execution_time')-10)) {
$error = createuser($_SESSION['accounts'][$_SESSION['pointer']]); $error = createuser($_SESSION['accounts'][$_SESSION['pointer']]);
if ($error==1) $_SESSION['pointer']++; if ($error==1) $_SESSION['pointer']++;
else { else {