本文整理汇总了PHP中CMbDT::dateTimeFromAD方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::dateTimeFromAD方法的具体用法?PHP CMbDT::dateTimeFromAD怎么用?PHP CMbDT::dateTimeFromAD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::dateTimeFromAD方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mapTo
/**
* @param CUser $user
* @param array $values
*
* @return CUser
*/
static function mapTo(CUser $user, $values)
{
$user->user_username = self::getValue($values, "samaccountname");
$user->user_first_name = self::getValue($values, "givenname");
$user->user_last_name = self::getValue($values, "sn") ? self::getValue($values, "sn") : self::getValue($values, "samaccountname");
$user->user_phone = self::getValue($values, "telephonenumber");
$user->user_email = self::getValue($values, "mail");
$whencreated = null;
if ($when_created = self::getValue($values, "whencreated")) {
$whencreated = CMbDT::date(CMbDT::dateTimeFromAD($when_created));
}
$accountexpires = null;
if ($account_expires = self::getValue($values, "accountexpires")) {
// 1000000000000000000 = 16-11-4769 01:56:35
if ($account_expires < 1000000000000000000) {
$accountexpires = CMbDT::date(CMbDT::dateTimeFromLDAP($account_expires));
}
}
// 66048,Account: Enabled - DONT_EXPIRE_PASSWORD
// 66080,Account: Enabled - DONT_EXPIRE_PASSWORD - PASSWD_NOTREQD
// 66050 = Disabled
$actif = self::getValue($values, "useraccountcontrol") == 66050 ? 0 : 1;
$user->loadRefMediuser();
if ($user->_id) {
$mediuser = $user->_ref_mediuser;
$mediuser->actif = $actif;
$mediuser->deb_activite = $whencreated;
$mediuser->fin_activite = $accountexpires;
$mediuser->_ldap_store = true;
$mediuser->store();
}
$user->_user_actif = $actif;
$user->_user_deb_activite = $whencreated;
$user->_user_fin_activite = $accountexpires;
return $user;
}