Pb to change "accountexpires" attribute in Active Directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 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 !  

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux