本文整理汇总了PHP中AuthLDAP::Dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthLDAP::Dropdown方法的具体用法?PHP AuthLDAP::Dropdown怎么用?PHP AuthLDAP::Dropdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthLDAP
的用法示例。
在下文中一共展示了AuthLDAP::Dropdown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ldapChooseDirectory
/** Form to choose a ldap server
*
* @param $target target page for the form
*
* @return nothing
**/
static function ldapChooseDirectory($target)
{
global $DB;
$query = "SELECT *\n FROM `glpi_authldaps`\n WHERE `is_active` = '1'\n ORDER BY `name` ASC";
$result = $DB->query($query);
if ($DB->numrows($result) == 1) {
//If only one server, do not show the choose ldap server window
$ldap = $DB->fetch_assoc($result);
$_SESSION["ldap_server"] = $ldap["id"];
Html::redirect($_SERVER['PHP_SELF']);
}
echo "<div class='center'>";
echo "<form action='{$target}' method=\"post\">";
echo "<p>" . __('Please choose LDAP directory to import users from') . "</p>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'><th colspan='2'>" . __('LDAP directory choice') . "</th></tr>";
//If more than one ldap server
if ($DB->numrows($result) > 1) {
echo "<tr class='tab_bg_2'><td class='center'>" . __('Name') . "</td>";
echo "<td class='center'>";
AuthLDAP::Dropdown(array('name' => 'ldap_server', 'display_emptychoice' => false, 'comment' => true, 'condition' => "`is_active`='1'"));
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td class='center' colspan='2'>";
echo "<input class='submit' type='submit' name='ldap_showusers' value=\"" . _sx('button', 'Post') . "\"></td></tr>";
} else {
//No ldap server
echo "<tr class='tab_bg_2'>" . "<td class='center' colspan='2'>" . __('No LDAP directory defined in GLPI') . "</td></tr>";
}
echo "</table>";
Html::closeForm();
echo "</div>";
}