Pb to change "accountexpires" attribute in Active Directory
| From: | Joel d | Date: | Wed, 19 Oct 2005 12:01:13 +0000 |
| Subject: | Pb to change "accountexpires" attribute in Active Directory | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224322@lists.php.net to get a copy of this message | ||
Hi all,
I'm currently setting up a php site to control my Active Direcory, and I'm struggling with
the "Accountexpire" field.
After extending the expiration date, I can't set it back in AD, because it is in scientific
format (1.2774158851E+017). And I can't find how to transform this into an integer before
making the AD request !
I've tried inval, double, sprintf, ... without success ! I event tried to use a string: $ADtime
= ($PHPtime + 11644524000)."0000000", with no luck... I'm suspecting something inside
the ldap_mod_replace function, but can't be sure
Here's what my code looks like:
$PHPtime = time();
$newExpiration = $PHPtime + (7 * 24 * 60 * 60); //add 1 week (7 days * 24 hours * 60
minutes * 60 seconds)
$ADtime = ($PHPtime + 11644524000) * 10000000 ;
$userdata["accountexpires"] = $ADtime;
$result = ldap_mod_replace($ad, $myaccount->dn, $userdata);
Any idea how to fix this ?
thanks a lot,
---------------------------------
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !