本文整理汇总了PHP中AuthLDAP::dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthLDAP::dropdown方法的具体用法?PHP AuthLDAP::dropdown怎么用?PHP AuthLDAP::dropdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthLDAP
的用法示例。
在下文中一共展示了AuthLDAP::dropdown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showAdvancedOptions
/**
* @since version 0.84 (before in entitydata.class)
*
* @param $entity Entity object
**/
static function showAdvancedOptions(Entity $entity)
{
global $DB;
$con_spotted = false;
$ID = $entity->getField('id');
if (!$entity->can($ID, READ)) {
return false;
}
// Entity right applied (could be User::UPDATEAUTHENT)
$canedit = $entity->can($ID, UPDATE);
if ($canedit) {
echo "<form method='post' name=form action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
}
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Values for the generic rules for assignment to entities') . "</th></tr>";
echo "<tr class='tab_bg_1'><td colspan='2' class='center'>" . __('These parameters are used as actions in generic rules for assignment to entities') . "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Information in inventory tool (TAG) representing the entity') . "</td>";
echo "<td>";
Html::autocompletionTextField($entity, "tag", array('size' => 100));
echo "</td></tr>";
if (Toolbox::canUseLdap()) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('LDAP directory information attribute representing the entity') . "</td>";
echo "<td>";
Html::autocompletionTextField($entity, "ldap_dn", array('size' => 100));
echo "</td></tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Mail domain surrogates entity') . "</td>";
echo "<td>";
Html::autocompletionTextField($entity, "mail_domain", array('size' => 100));
echo "</td></tr>";
if (Toolbox::canUseLdap()) {
echo "<tr><th colspan='2'>" . __('Values used in the interface to search users from a LDAP directory') . "</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('LDAP directory of an entity') . "</td>";
echo "<td>";
AuthLDAP::dropdown(array('value' => $entity->fields['authldaps_id'], 'emptylabel' => __('Default server'), 'condition' => "`is_active` = '1'"));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('LDAP filter associated to the entity (if necessary)') . "</td>";
echo "<td>";
Html::autocompletionTextField($entity, 'entity_ldapfilter', array('size' => 100));
echo "</td></tr>";
}
if ($canedit) {
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>";
echo "<input type='hidden' name='id' value='" . $entity->fields["id"] . "'>";
echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
} else {
echo "</table>";
}
}
示例2: header
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
$AJAX_INCLUDE = 1;
include '../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkRight('user', User::UPDATEAUTHENT);
if ($_POST["authtype"] > 0) {
$name = 'massiveaction';
if (isset($_POST['name'])) {
$name = $_POST['name'];
}
switch ($_POST["authtype"]) {
case Auth::DB_GLPI:
echo "<input type='hidden' name='auths_id' value='0'>";
break;
case Auth::LDAP:
case Auth::EXTERNAL:
AuthLDAP::dropdown(array('name' => "auths_id", 'condition' => "`is_active` = 1"));
break;
case Auth::MAIL:
AuthMail::dropdown(array('name' => "auths_id", 'condition' => "`is_active` = 1"));
break;
}
echo " <input type='submit' name='{$name}' class='submit' value=\"" . _sx('button', 'Post') . "\">";
}