本文整理汇总了PHP中AuthLdap::useAuthLdap方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthLdap::useAuthLdap方法的具体用法?PHP AuthLdap::useAuthLdap怎么用?PHP AuthLdap::useAuthLdap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthLdap
的用法示例。
在下文中一共展示了AuthLdap::useAuthLdap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdfLdapForm
static function pdfLdapForm(PluginPdfSimplePDF $pdf, Group $item)
{
if (Session::haveRight("config", "r") && AuthLdap::useAuthLdap()) {
$pdf->setColumnsSize(100);
$pdf->displayTitle(__('LDAP directory link'));
$pdf->displayText('<b>' . sprintf(__('%1$s: %2$s'), __('User attribute containing its groups') . '</b>', $item->getField('ldap_field')));
$pdf->displayText('<b>' . sprintf(__('%1$s: %2$s'), __('Attribute value') . '</b>', $item->getField('ldap_value')));
$pdf->displayText('<b>' . sprintf(__('%1$s: %2$s'), __('Group DN') . '</b>', $item->getField('ldap_group_dn')));
$pdf->displaySpace();
}
}
示例2: title
/**
* Print a good title for user pages
*
* @return nothing (display)
**/
function title()
{
global $CFG_GLPI;
$buttons = array();
$title = self::getTypeName(2);
if (static::canCreate()) {
$buttons["user.form.php"] = __('Add user...');
$title = "";
if (Auth::useAuthExt()) {
// This requires write access because don't use entity config.
$buttons["user.form.php?new=1&ext_auth=1"] = __('... From an external source');
}
}
if (Session::haveRight("import_externalauth_users", "w")) {
if (AuthLdap::useAuthLdap()) {
$buttons["ldap.php"] = __('LDAP directory link');
}
}
Html::displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", self::getTypeName(2), $title, $buttons);
}
示例3: useAuthExt
/**
* Is an external authentication used ?
*
* @return boolean
**/
static function useAuthExt()
{
//Get all the ldap directories
if (AuthLdap::useAuthLdap()) {
return true;
}
if (AuthMail::useAuthMail()) {
return true;
}
if (!empty($CFG_GLPI["x509_email_field"])) {
return true;
}
// Existing auth method
if (!empty($CFG_GLPI["ssovariables_id"])) {
return true;
}
// Using CAS server
if (!empty($CFG_GLPI["cas_host"])) {
return true;
}
return false;
}
示例4: showLDAPForm
/**
* @param $ID
**/
function showLDAPForm($ID)
{
$options = array();
$this->initForm($ID, $options);
echo "<form name='groupldap_form' id='groupldap_form' method='post' action='" . $this->getFormURL() . "'>";
echo "<div class='spaced'><table class='tab_cadre_fixe'>";
if (Group::canUpdate() && Session::haveRight("user", User::UPDATEAUTHENT) && AuthLdap::useAuthLdap()) {
echo "<tr class='tab_bg_1'>";
echo "<th colspan='2' class='center'>" . __('In users') . "</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Attribute of the user containing its groups') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "ldap_field");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Attribute value') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "ldap_value");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<th colspan='2' class='center'>" . __('In groups') . "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group DN') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "ldap_group_dn");
echo "</td></tr>";
}
$options = array('colspan' => 1, 'candel' => false);
$this->showFormButtons($options);
}
示例5: showLDAPForm
function showLDAPForm($target, $ID)
{
global $LANG;
if (!haveRight("group", "r")) {
return false;
}
if ($ID > 0) {
$this->check($ID, 'r');
} else {
// Create item
$this->check(-1, 'w');
}
echo "<form name='groupldap_form' id='groupldap_form' method='post' action='{$target}'>";
echo "<div class='spaced'><table class='tab_cadre_fixe'>";
if (haveRight("config", "r") && AuthLdap::useAuthLdap()) {
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2' class='center'>" . $LANG['setup'][256] . " : </td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['setup'][260] . " : </td>";
echo "<td>";
autocompletionTextField($this, "ldap_field");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['setup'][601] . " : </td>";
echo "<td>";
autocompletionTextField($this, "ldap_value");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2' class='center'>" . $LANG['setup'][257] . " : </td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['setup'][261] . " : </td>";
echo "<td>";
autocompletionTextField($this, "ldap_group_dn");
echo "</td></tr>";
}
$options = array('colspan' => 1, 'candel' => false);
$this->showFormButtons($options);
echo "</table></div></form>";
}
示例6: title
/**
* Print a good title for user pages
*
* @return nothing (display)
**/
function title()
{
global $LANG, $CFG_GLPI;
$buttons = array();
$title = $LANG['Menu'][14];
if ($this->canCreate()) {
$buttons["user.form.php?new=1"] = $LANG['setup'][2];
$title = "";
if (Auth::useAuthExt()) {
// This requires write access because don't use entity config.
$buttons["user.form.php?new=1&ext_auth=1"] = $LANG['setup'][125];
}
}
if (haveRight("import_externalauth_users", "w")) {
if (AuthLdap::useAuthLdap()) {
$buttons["ldap.php"] = $LANG['setup'][3];
}
}
displayTitle($CFG_GLPI["root_doc"] . "/pics/users.png", $LANG['Menu'][14], $title, $buttons);
}