本文整理汇总了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']);
}
}
}
}
}