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(); } }
/** * 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); }
/** * 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; }
/** * @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); }
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>"; }
/** * 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); }