fixed warnings about mktime()

This commit is contained in:
Roland Gruber 2006-02-23 08:22:22 +00:00
parent 79775ef04d
commit f9a7b34d6d
4 changed files with 28 additions and 21 deletions

View File

@ -8,6 +8,7 @@
-> fixed login problems for AD servers
-> improved sorting of account lists
-> fixed language setting in default configuration profile
-> fixed PHP5 warnings (getdate() and mktime())
08.02.2006 1.0.rc2
- new translation: Dutch

View File

@ -549,10 +549,12 @@ class sambaAccount extends baseModule {
}
// check values for user account
if ($this->scope == 'user') {
$this->attributes['pwdCanChange'][0] = mktime($post['pwdCanChange_h'], $post['pwdCanChange_m'], $post['pwdCanChange_s'],
$post['pwdCanChange_mon'], $post['pwdCanChange_day'], $post['pwdCanChange_yea']);
$this->attributes['pwdMustChange'][0] = mktime($post['pwdMustChange_h'], $post['pwdMustChange_m'], $post['pwdMustChange_s'],
$post['pwdMustChange_mon'], $post['pwdMustChange_day'], $post['pwdMustChange_yea']);
$this->attributes['pwdCanChange'][0] = mktime(intval($post['pwdCanChange_h']), intval($post['pwdCanChange_m']),
intval($post['pwdCanChange_s']), intval($post['pwdCanChange_mon']), intval($post['pwdCanChange_day']),
intval($post['pwdCanChange_yea']));
$this->attributes['pwdMustChange'][0] = mktime(intval($post['pwdMustChange_h']), intval($post['pwdMustChange_m']),
intval($post['pwdMustChange_s']), intval($post['pwdMustChange_mon']), intval($post['pwdMustChange_day']),
intval($post['pwdMustChange_yea']));
$this->attributes['smbHome'][0] = $post['smbHome'];
$this->attributes['homeDrive'][0] = $post['homeDrive'];
$this->attributes['scriptPath'][0] = $post['scriptPath'];
@ -963,7 +965,7 @@ class sambaAccount extends baseModule {
if ($rawAccounts[$i][$ids['sambaAccount_pwdCanChange']] != "") {
if (get_preg($rawAccounts[$i][$ids['sambaAccount_pwdCanChange']], 'date')) {
$parts = explode("-", $rawAccounts[$i][$ids['sambaAccount_pwdCanChange']]);
$time = mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]);
$time = mktime(0, 0, 0, intval($parts[1]), intval($parts[0]), intval($parts[2]));
$partialAccounts[$i]['pwdCanChange'] = $time;
}
else {
@ -976,7 +978,7 @@ class sambaAccount extends baseModule {
if ($rawAccounts[$i][$ids['sambaAccount_pwdMustChange']] != "") {
if (get_preg($rawAccounts[$i][$ids['sambaAccount_pwdMustChange']], 'date')) {
$parts = explode("-", $rawAccounts[$i][$ids['sambaAccount_pwdMustChange']]);
$time = mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]);
$time = mktime(0, 0, 0, intval($parts[1]), intval($parts[0]), intval($parts[2]));
$partialAccounts[$i]['pwdMustChange'] = $time;
}
else {

View File

@ -564,12 +564,15 @@ class sambaSamAccount extends baseModule {
}
// user attributes
if ($_SESSION[$this->base]->type=='user') {
$this->attributes['sambaPwdCanChange'][0] = mktime($post['sambaPwdCanChange_h'], $post['sambaPwdCanChange_m'], $post['sambaPwdCanChange_s'],
$post['sambaPwdCanChange_mon'], $post['sambaPwdCanChange_day'], $post['sambaPwdCanChange_yea']);
$this->attributes['sambaPwdMustChange'][0] = mktime($post['sambaPwdMustChange_h'], $post['sambaPwdMustChange_m'], $post['sambaPwdMustChange_s'],
$post['sambaPwdMustChange_mon'], $post['sambaPwdMustChange_day'], $post['sambaPwdMustChange_yea']);
$this->attributes['sambaKickoffTime'][0] = mktime($post['sambaExpire_h'], $post['sambaExpire_m'], $post['sambaExpire_s'],
$post['sambaExpire_mon'], $post['sambaExpire_day'], $post['sambaExpire_yea']);
$this->attributes['sambaPwdCanChange'][0] = mktime(intval($post['sambaPwdCanChange_h']), intval($post['sambaPwdCanChange_m']),
intval($post['sambaPwdCanChange_s']), intval($post['sambaPwdCanChange_mon']), intval($post['sambaPwdCanChange_day']),
intval($post['sambaPwdCanChange_yea']));
$this->attributes['sambaPwdMustChange'][0] = mktime(intval($post['sambaPwdMustChange_h']), intval($post['sambaPwdMustChange_m']),
intval($post['sambaPwdMustChange_s']), intval($post['sambaPwdMustChange_mon']), intval($post['sambaPwdMustChange_day']),
intval($post['sambaPwdMustChange_yea']));
$this->attributes['sambaKickoffTime'][0] = mktime(intval($post['sambaExpire_h']), intval($post['sambaExpire_m']),
intval($post['sambaExpire_s']), intval($post['sambaExpire_mon']), intval($post['sambaExpire_day']),
intval($post['sambaExpire_yea']));
$this->attributes['sambaHomePath'][0] = $post['sambaHomePath'];
if ($post['sambaHomeDrive'] == "-")
$this->attributes['sambaHomeDrive'][0] = '';
@ -1163,8 +1166,8 @@ class sambaSamAccount extends baseModule {
}
// expiration date
if (isset($profile['sambaSamAccount_expire_day'][0]) && ($profile['sambaSamAccount_expire_day'][0] != "")) {
$date = mktime(10, 0, 0, $profile['sambaSamAccount_expire_mon'][0],
$profile['sambaSamAccount_expire_day'][0], $profile['sambaSamAccount_expire_yea'][0]);
$date = mktime(10, 0, 0, intval($profile['sambaSamAccount_expire_mon'][0]),
intval($profile['sambaSamAccount_expire_day'][0]), intval($profile['sambaSamAccount_expire_yea'][0]));
$this->attributes['sambaKickoffTime'][0] = $date;
}
// domain -> change SID
@ -1329,7 +1332,7 @@ class sambaSamAccount extends baseModule {
if ($rawAccounts[$i][$ids['sambaSamAccount_pwdCanChange']] != "") {
if (get_preg($rawAccounts[$i][$ids['sambaSamAccount_pwdCanChange']], 'date')) {
$parts = explode("-", $rawAccounts[$i][$ids['sambaSamAccount_pwdCanChange']]);
$time = mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]);
$time = mktime(0, 0, 0, intval($parts[1]), intval($parts[0]), intval($parts[2]));
$partialAccounts[$i]['sambaPwdCanChange'] = $time;
}
else {
@ -1342,7 +1345,7 @@ class sambaSamAccount extends baseModule {
if ($rawAccounts[$i][$ids['sambaSamAccount_pwdMustChange']] != "") {
if (get_preg($rawAccounts[$i][$ids['sambaSamAccount_pwdMustChange']], 'date')) {
$parts = explode("-", $rawAccounts[$i][$ids['sambaSamAccount_pwdMustChange']]);
$time = mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]);
$time = mktime(0, 0, 0, intval($parts[1]), intval($parts[0]), intval($parts[2]));
$partialAccounts[$i]['sambaPwdMustChange'] = $time;
}
else {
@ -1355,7 +1358,7 @@ class sambaSamAccount extends baseModule {
if ($rawAccounts[$i][$ids['sambaSamAccount_expireDate']] != "") {
if (get_preg($rawAccounts[$i][$ids['sambaSamAccount_expireDate']], 'date')) {
$parts = explode("-", $rawAccounts[$i][$ids['sambaSamAccount_expireDate']]);
$time = mktime(0, 0, 0, $parts[1], $parts[0], $parts[2]);
$time = mktime(0, 0, 0, intval($parts[1]), intval($parts[0]), intval($parts[2]));
$partialAccounts[$i]['sambaKickoffTime'] = $time;
}
else {

View File

@ -247,7 +247,8 @@ class shadowAccount extends baseModule {
$this->attributes['shadowMax'][0] = $post['shadowMax'];
$this->attributes['shadowWarning'][0] = $post['shadowWarning'];
$this->attributes['shadowInactive'][0] = $post['shadowInactive'];
$this->attributes['shadowExpire'][0] = intval(mktime(10, 0, 0, $post['shadowExpire_mon'],$post['shadowExpire_day'], $post['shadowExpire_yea'])/3600/24);
$this->attributes['shadowExpire'][0] = intval(mktime(10, 0, 0, intval($post['shadowExpire_mon']), intval($post['shadowExpire_day']),
intval($post['shadowExpire_yea']))/3600/24);
if ( !get_preg($this->attributes['shadowMin'][0], 'digit')) $triggered_messages['shadowMin'][] = $this->messages['shadowMin'][0];
if ( !get_preg($this->attributes['shadowMax'][0], 'digit')) $triggered_messages['shadowMax'][] = $this->messages['shadowMax'][0];
if ( $this->attributes['shadowMin'][0] > $this->attributes['shadowMax'][0]) $triggered_messages['shadowMin'][] = $this->messages['shadow_cmp'][0];
@ -380,7 +381,7 @@ class shadowAccount extends baseModule {
if ($rawAccounts[$i][$ids['shadowAccount_expireDay']] != '') {
if (get_preg($rawAccounts[$i][$ids['shadowAccount_expireDay']], 'date')) {
$parts = explode('-', $rawAccounts[$i][$ids['shadowAccount_expireDay']]);
$partialAccounts[$i]['shadowExpire'][] = intval(mktime(10, 0, 0, $parts[1], $parts[0], $parts[2])/3600/24);
$partialAccounts[$i]['shadowExpire'][] = intval(mktime(10, 0, 0, intval($parts[1]), intval($parts[0]), intval($parts[2]))/3600/24);
}
else {
$errMsg = $this->messages['shadow_expireDate'][0];
@ -403,8 +404,8 @@ class shadowAccount extends baseModule {
// special profile options
// expiration date
if (isset($profile['shadowAccount_shadowExpire_day'][0]) && ($profile['shadowAccount_shadowExpire_day'][0] != "")) {
$date = intval(mktime(10, 0, 0, $profile['shadowAccount_shadowExpire_mon'][0],
$profile['shadowAccount_shadowExpire_day'][0], $profile['shadowAccount_shadowExpire_yea'][0])/3600/24);
$date = intval(mktime(10, 0, 0, intval($profile['shadowAccount_shadowExpire_mon'][0]),
intval($profile['shadowAccount_shadowExpire_day'][0]), intval($profile['shadowAccount_shadowExpire_yea'][0]))/3600/24);
$this->attributes['shadowExpire'][0] = $date;
}
}