showGMT() static public method

Dropdown for GMT selection
static public showGMT ( $name, $value = '' )
$name select name
$value default value (default '')
Esempio n. 1
0
 function showFormAdvancedConfig()
 {
     $ID = $this->getField('id');
     $hidden = '';
     echo "<div class='center'>";
     echo "<form method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_2'><th colspan='4'>";
     echo "<input type='hidden' name='id' value='{$ID}'>" . __('Advanced information') . "</th></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Use TLS') . "</td><td>";
     if (function_exists("ldap_start_tls")) {
         Dropdown::showYesNo('use_tls', $this->fields["use_tls"]);
     } else {
         echo "<input type='hidden' name='use_tls' value='0'>" . __('ldap_start_tls does not exist');
     }
     echo "</td>";
     echo "<td>" . __('LDAP directory time zone') . "</td><td>";
     Dropdown::showGMT("time_offset", $this->fields["time_offset"]);
     echo "</td></tr>";
     if (self::isLdapPageSizeAvailable(false, false)) {
         echo "<tr class='tab_bg_1'>";
         echo "<td>" . __('Use paged results') . "</td><td>";
         Dropdown::showYesNo('can_support_pagesize', $this->fields["can_support_pagesize"]);
         echo "</td>";
         echo "<td>" . __('Page size') . "</td><td>";
         Dropdown::showNumber("pagesize", array('value' => $this->fields['pagesize'], 'min' => 100, 'max' => 100000, 'step' => 100));
         echo "</td></tr>";
         echo "<tr class='tab_bg_1'>";
         echo "<td>" . __('Maximum number of results') . "</td><td>";
         Dropdown::showNumber('ldap_maxlimit', array('value' => $this->fields['ldap_maxlimit'], 'min' => 100, 'max' => 999999, 'step' => 100, 'toadd' => array(0 => __('Unlimited'))));
         echo "</td><td colspan='2'></td></tr>";
     } else {
         $hidden .= "<input type='hidden' name='can_support_pagesize' value='0'>";
         $hidden .= "<input type='hidden' name='pagesize' value='0'>";
         $hidden .= "<input type='hidden' name='ldap_maxlimit' value='0'>";
     }
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('How LDAP aliases should be handled') . "</td><td colspan='4'>";
     $alias_options[LDAP_DEREF_NEVER] = __('Never dereferenced (default)');
     $alias_options[LDAP_DEREF_ALWAYS] = __('Always dereferenced');
     $alias_options[LDAP_DEREF_SEARCHING] = __('Dereferenced during the search (but not when locating)');
     $alias_options[LDAP_DEREF_FINDING] = __('Dereferenced when locating (not during the search)');
     Dropdown::showFromArray("deref_option", $alias_options, array('value' => $this->fields["deref_option"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'><td class='center' colspan='4'>";
     echo "<input type='submit' name='update' class='submit' value=\"" . __s('Save') . "\">";
     echo $hidden;
     echo "</td></tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
Esempio n. 2
0
 function showFormAdvancedConfig($ID, $target)
 {
     global $LANG;
     echo "<form method='post' action='{$target}'>";
     echo "<div class='center'><table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_2'><th colspan='4'>";
     echo "<input type='hidden' name='id' value='{$ID}'>" . $LANG['entity'][14] . "</th></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['setup'][180] . "&nbsp;:</td><td>";
     if (function_exists("ldap_start_tls")) {
         $use_tls = $this->fields["use_tls"];
         echo "<select name='use_tls'>";
         echo "<option value='0' " . (!$use_tls ? " selected " : "") . ">" . $LANG['choice'][0] . "</option>";
         echo "<option value='1' " . ($use_tls ? " selected " : "") . ">" . $LANG['choice'][1] . "</option>";
         echo "</select>";
     } else {
         echo "<input type='hidden' name='use_tls' value='0'>" . $LANG['setup'][181];
     }
     echo "</td>";
     echo "<td>" . $LANG['setup'][186] . "&nbsp;:</td><td>";
     Dropdown::showGMT("time_offset", $this->fields["time_offset"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['ldap'][30] . "&nbsp;:&nbsp;</td><td colspan='4'>";
     $alias_options[LDAP_DEREF_NEVER] = $LANG['ldap'][31];
     $alias_options[LDAP_DEREF_ALWAYS] = $LANG['ldap'][32];
     $alias_options[LDAP_DEREF_SEARCHING] = $LANG['ldap'][33];
     $alias_options[LDAP_DEREF_FINDING] = $LANG['ldap'][34];
     Dropdown::showFromArray("deref_option", $alias_options, array('value' => $this->fields["deref_option"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'><td class='center' colspan=4>";
     echo "<input type='submit' name='update' class='submit' value=\"" . $LANG['buttons'][2] . "\">";
     echo "</td></tr>";
     echo "</table></form></div>";
 }
 /**
  * Print the config form for restrictions
  *
  * @return Nothing (display)
  **/
 function showFormAuthentication()
 {
     global $DB, $CFG_GLPI;
     if (!Config::canUpdate()) {
         return false;
     }
     echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>";
     echo "<div class='center' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='4'>" . __('Authentication') . "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td width='30%'>" . __('Automatically add users from an external authentication source') . "</td><td width='20%'>";
     Dropdown::showYesNo("is_users_auto_add", $CFG_GLPI["is_users_auto_add"]);
     echo "</td><td width='30%'>" . __('Add a user without accreditation from a LDAP directory') . "</td><td width='20%'>";
     Dropdown::showYesNo("use_noright_users_add", $CFG_GLPI["use_noright_users_add"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td> " . __('Action when a user is deleted from the LDAP directory') . "</td><td>";
     AuthLDap::dropdownUserDeletedActions($CFG_GLPI["user_deleted_ldap"]);
     echo "</td><td> " . __('GLPI server time zone') . "</td><td>";
     Dropdown::showGMT("time_offset", $CFG_GLPI["time_offset"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td colspan='4' class='center'>";
     echo "<input type='submit' name='update_auth' class='submit' value=\"" . _sx('button', 'Save') . "\">";
     echo "</td></tr>";
     echo "</table></div>";
     Html::closeForm();
 }
Esempio n. 4
0
 /**
  * Print the config form for restrictions
  *
  * @return Nothing (display)
  **/
 function showFormAuthentication()
 {
     global $DB, $LANG, $CFG_GLPI;
     if (!haveRight("config", "w")) {
         return false;
     }
     echo "<form name='form' action=\"" . getItemTypeFormURL(__CLASS__) . "\" method='post'>";
     echo "<div class='center' id='tabsbody'>";
     echo "<input type='hidden' name='id' value='" . $CFG_GLPI["id"] . "'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='4'>" . $LANG['login'][10] . "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td> " . $LANG['setup'][124] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("is_users_auto_add", $CFG_GLPI["is_users_auto_add"]);
     echo "</td><td> " . $LANG['setup'][613] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("use_noright_users_add", $CFG_GLPI["use_noright_users_add"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td> " . $LANG['ldap'][45] . "&nbsp;:</td><td>";
     AuthLDap::dropdownUserDeletedActions($CFG_GLPI["user_deleted_ldap"]);
     echo "</td><td> " . $LANG['setup'][186] . "&nbsp;:</td><td>";
     Dropdown::showGMT("time_offset", $CFG_GLPI["time_offset"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td colspan='4' class='center'>";
     echo "<input type='submit' name='update_auth' class='submit' value=\"" . $LANG['buttons'][2] . "\">";
     echo "</td></tr>";
     echo "</table></div>";
     echo "</form>";
 }