0
我試圖設置使用PHP LDAP用戶logonhours。我已經開始創建一個GUI,它看起來像活動目錄,其中藍色和灰色單元表示允許和拒絕的登錄時間。我的問題是間歇,我收到「服務器不願意執行」,我認爲這是與我的包(「C」,bindec(strrev($塊)))嵌套在foreach循環是不隨地吐痰正確的格式。有什麼我應該釘到包(「C」,bindec(strrev($塊)))聲明,以確保它總是在正確的格式爲我的DC接受呢?PHP Logonhours格式
if (isset($_POST['logonhours'])){
$set_logonhours = $_POST['logonhours'];
$set_logonhours_end = mb_substr($set_logonhours, -5); // EST TIMEZONE
$set_logonhours_begin = mb_substr($set_logonhours, 0, -5); // EST TIMEZONE
$set_logonhours_tz = $set_logonhours_end . $set_logonhours_begin;
$set_eighthourchunks = str_split($set_logonhours_tz, 8);
foreach ($set_eighthourchunks as $chunk){
$logondec = pack("C", bindec(strrev($chunk))); //inconsistently works sometimes
}
echo $logondec;
$adldap->user()->modify($_POST['username'], array("logonhours"=>$logondec));
echo '<br>';
echo ldap_error($adldap->getLdapConnection()) . '<br>';
}
有人嗎?........ – Noob01