本文整理匯總了PHP中AuthLDAP::getSyncFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP AuthLDAP::getSyncFields方法的具體用法?PHP AuthLDAP::getSyncFields怎麽用?PHP AuthLDAP::getSyncFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AuthLDAP
的用法示例。
在下文中一共展示了AuthLDAP::getSyncFields方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pre_updateInDB
function pre_updateInDB()
{
global $DB;
if (($key = array_search('name', $this->updates)) !== false) {
/// Check if user does not exists
$query = "SELECT *\n FROM `" . $this->getTable() . "`\n WHERE `name` = '" . $this->input['name'] . "'\n AND `id` <> '" . $this->input['id'] . "';";
$result = $DB->query($query);
if ($DB->numrows($result) > 0) {
//To display a message
$this->fields['name'] = $this->oldvalues['name'];
unset($this->updates[$key]);
unset($this->oldvalues['name']);
Session::addMessageAfterRedirect(__('Unable to update login. A user already exists.'), false, ERROR);
}
}
/// Security system except for login update
if (Session::getLoginUserID() && !Session::haveRight("user", "w") && !strpos($_SERVER['PHP_SELF'], "login.php")) {
if (Session::getLoginUserID() === $this->input['id']) {
if (isset($this->fields["authtype"])) {
// extauth ldap case
if ($_SESSION["glpiextauth"] && ($this->fields["authtype"] == Auth::LDAP || Auth::isAlternateAuth($this->fields["authtype"]))) {
$authtype = Auth::getMethodsByID($this->fields["authtype"], $this->fields["auths_id"]);
if (count($authtype)) {
$fields = AuthLDAP::getSyncFields($authtype);
foreach ($fields as $key => $val) {
if (!empty($val) && ($key2 = array_search($key, $this->updates)) !== false) {
unset($this->updates[$key2]);
unset($this->oldvalues[$key]);
}
}
}
}
if (($key = array_search("is_active", $this->updates)) !== false) {
unset($this->updates[$key]);
unset($this->oldvalues['is_active']);
}
if (($key = array_search("comment", $this->updates)) !== false) {
unset($this->updates[$key]);
unset($this->oldvalues['comment']);
}
}
}
}
}