<?PHP
    // Initialize vars
    optional_variable($config->ldap_host_url,             "");
    optional_variable($config->ldap_contexts,             "");
    optional_variable($config->ldap_user_type,    "");
    optional_variable($config->ldap_user_attribute,    "");
    optional_variable($config->ldap_search_sub,         "");
    optional_variable($config->ldap_opt_deref,         "");
    optional_variable($config->ldap_bind_dn,             "");
    optional_variable($config->ldap_bind_pw,             "");
    optional_variable($config->ldap_version,             "2");
    optional_variable($config->ldap_objectclass,         "");
    optional_variable($config->ldap_memberattribute,    "");
    optional_variable($config->ldap_creators,             "");
    optional_variable($config->ldap_create_context,     "");
    optional_variable($config->ldap_expiration,         "");
    optional_variable($config->ldap_expiration_warning,         "10");
    optional_variable($config->ldap_expireattr,         "");
    optional_variable($config->ldap_gracelogins,         "");
    optional_variable($config->ldap_graceattr,         "");
    optional_variable($config->auth_user_create,         "");
    optional_variable($config->auth_user_create,         "");
    optional_variable($config->auth_ldap_forcepasswordchange,         "");
    
    optional_variable($config->auth_user_firstname_updatelocal,     "1");
    optional_variable($config->auth_user_firstname_editlock,        "1");  
    optional_variable($config->auth_user_firstname_updateremote,    "");                    
    optional_variable($config->auth_user_lastname_updatelocal,         "1");
    optional_variable($config->auth_user_lastname_editlock,         "1");  
    optional_variable($config->auth_user_lastname_updateremote,     "");  
    optional_variable($config->auth_user_email_updatelocal,         "1");
    optional_variable($config->auth_user_email_editlock,             "1");  
    optional_variable($config->auth_user_email_updateremote,         ""); 
    optional_variable($config->auth_user_phone1_updatelocal,         "");
    optional_variable($config->auth_user_phone1_editlock,             "");  
    optional_variable($config->auth_user_phone1_updateremote,         ""); 
    optional_variable($config->auth_user_phone2_updatelocal,         "");
    optional_variable($config->auth_user_phone2_editlock,             "");  
    optional_variable($config->auth_user_phone2_updateremote,         ""); 
    optional_variable($config->auth_user_department_updatelocal,     "");
    optional_variable($config->auth_user_department_editlock,         "");  
    optional_variable($config->auth_user_department_updateremote,  ""); 
    optional_variable($config->auth_user_address_updatelocal,         "");
    optional_variable($config->auth_user_address_editlock,             "");  
    optional_variable($config->auth_user_address_updateremote,         ""); 
    optional_variable($config->auth_user_city_updatelocal,             "");
    optional_variable($config->auth_user_city_editlock,             "");  
    optional_variable($config->auth_user_city_updateremote,         ""); 
    optional_variable($config->auth_user_country_updatelocal,         "");
    optional_variable($config->auth_user_country_editlock,             "");  
    optional_variable($config->auth_user_country_updateremote,         ""); 
    optional_variable($config->auth_user_description_updatelocal,     "");
    optional_variable($config->auth_user_description_editlock,         "");  
    optional_variable($config->auth_user_description_updateremote, ""); 
    optional_variable($config->auth_user_lang_updatelocal,             "");
    optional_variable($config->auth_user_lang_editlock,             "");  
    optional_variable($config->auth_user_lang_updateremote,         ""); 
    optional_variable($config->auth_user_idnumber_updatelocal,         "");
    optional_variable($config->auth_user_idnumber_editlock,         "");  
    optional_variable($config->auth_user_idnumber_updateremote,     ""); 

    optional_variable($config->auth_ldap_stdchangepassword,        false); 
    
if (!function_exists('ldap_connect')){ // Is php4-ldap really there?
    print '<p align="center"><font color="red"><strong>Warning:
           The PHP LDAP module does not seem to be present. 
           Please ensure it is installed and enabled.</strong></font></p>';
}
    
?>
<tr>
   <td colspan="2">
        <h4><?php print_string("auth_ldap_server_settings", "auth") ?> </h4>
   </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_host_url:</td>
    <td>
        <input name="ldap_host_url" type="text" size="30" value="<?php echo $config->ldap_host_url?>">
    <?php  if (isset($err["ldap_host_url"])) formerr($err["ldap_host_url"]); ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_host_url","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_version:</td>
    <td>
    <?php
       $versions[2] = "2";
       $versions[3] = "3";
       choose_from_menu($versions, "ldap_version", $config->ldap_version, "");
       if (isset($err["ldap_version"])) formerr($err["ldap_version"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_version","auth") ?>
    </td>
</tr>

<tr>
   <td colspan="2">
        <h4><?php print_string("auth_ldap_bind_settings", "auth") ?> </h4>
   </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_bind_dn:</td>
    <td>
    <input name="ldap_bind_dn" type="text" size="30" value="<?php echo $config->ldap_bind_dn?>">
    <?php  if (isset($err["ldap_bind_dn"])) formerr($err["ldap_bind_dn"]); ?>
    </td><td>
    <?php  print_string("auth_ldap_bind_dn","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_bind_pw:</td>
    <td>
    <input name="ldap_bind_pw" type="password" size="30" value="<?php echo $config->ldap_bind_pw?>">
    <?php  if (isset($err["ldap_bind_pw"])) formerr($err["ldap_bind_pw"]); ?>
    </td><td>
    <?php  print_string("auth_ldap_bind_pw","auth") ?>
    </td>
</tr>

<tr>
   <td colspan="2">
        <h4><?php print_string("auth_ldap_user_settings", "auth") ?> </h4>
   </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_user_type:</td>
    <td>
    <?php choose_from_menu(auth_ldap_suppported_usertypes(), "ldap_user_type", $config->ldap_user_type, ""); ?>
    <?php  if (isset($err["ldap_user_type"])) formerr($err["ldap_user_type"]); ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_user_type","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_contexts:</td>
    <td>
    <input name="ldap_contexts" type="text" size="30" value="<?php echo $config->ldap_contexts?>">
    <?php  if (isset($err["ldap_contexts"])) formerr($err["ldap_contexts"]); ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_contexts","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_search_sub:</td>
    <td>
    <input name="ldap_search_sub" type="text" size="1" value="<?php echo $config->ldap_search_sub?>">
    <?php  if (isset($err["ldap_search_sub"])) formerr($err["ldap_search_sub"]); ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_search_sub","auth") ?>
    </td>
</tr>
<tr valign="top" class="required">
    <td align="right">ldap_opt_deref:</td>
    <td>
    <?php
       $opt_deref[LDAP_DEREF_NEVER] = get_string("no");
       $opt_deref[LDAP_DEREF_ALWAYS] = get_string("yes");
       choose_from_menu($opt_deref, "ldap_opt_deref", $config->ldap_opt_deref, LDAP_DEREF_NEVER);
       if (isset($err["ldap_opt_deref"])) formerr($err["ldap_opt_deref"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_opt_deref","auth") ?>
    </td>
</tr>



<tr valign="top" class="required">
    <td align="right">ldap_user_attribute:</td>
    <td>
    <input name="ldap_user_attribute" type="text" size="30" value="<?php echo $config->ldap_user_attribute?>">
    <?php  if (isset($err["ldap_user_attribute"])) formerr($err["ldap_user_attribute"]); ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_user_attribute","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
        <td align="right">ldap_memberattribute:</td>
        <td>
    <input name="ldap_memberattribute" type="text" size="30" value="<?php echo $config->ldap_memberattribute?>">
    <?php  if (isset($err["ldap_memberattribute"])) formerr($err["ldap_memberattribute"]); ?>
    </td><td>
    <?php  print_string("auth_ldap_memberattribute","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_objectclass:</td>
    <td>
    <input name="ldap_objectclass" type="text" size="30" value="<?php echo $config->ldap_objectclass?>">
    <?php  if (isset($err["ldap_objectclass"])) formerr($err["ldap_objectclass"]); ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_objectclass","auth") ?>
    </td>
</tr>

<tr>
   <td colspan="2">
        <h4><?php print_string("forcechangepassword", "auth") ?> </h4>
   </td>
</tr>

<tr valign="top" class="required">
    <td align="right" valign="top"><?php  print_string('forcechangepassword', 'auth') ?>:</td>
    <td>
 
    <select name="auth_ldap_forcechangepassword">
        <option value="0" <?php echo ($config->auth_ldap_forcechangepassword ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_ldap_forcechangepassword ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
 
    </td>
    <td align="left" valign="top">
        <p><?php  print_string('forcechangepasswordfirst_help', 'auth') ?></p>
    </td>
</tr>

<tr valign="top"  class="required">
    <td align="right" valign="top"><?php  print_string('stdchangepassword', 'auth') ?>:</td>
    <td>
 
    <select name="auth_ldap_stdchangepassword">
        <option value="0" <?php echo ($config->auth_ldap_stdchangepassword ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_ldap_stdchangepassword ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>

    </td>
    <td align="left" valign="top">
        <p><?php  print_string('stdchangepassword_expl', 'auth') ?></p>
        <p><?php  print_string('stdchangepassword_explldap', 'auth') ?></p>
    </td>
</tr>

<tr>
   <td colspan="2">
        <h4><?php print_string("auth_ldap_passwdexpire_settings", "auth") ?> </h4>
   </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_expiration:</td>
    <td>
    <?php
       $expiration['0'] = "No";
       $expiration['1'] = "LDAP";
       choose_from_menu($expiration, "ldap_expiration", $config->ldap_expiration, "");
       if (isset($err["ldap_expiration"])) formerr($err["ldap_expiration"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_expiration_desc","auth") ?>
    </td>
</tr>


<tr valign="top" class="required">
    <td align="right">ldap_expiration_warning:</td>
    <td>
    <input name="ldap_expiration_warning" type="text" size="2" value="<?php echo $config->ldap_expiration_warning?>">
    <?php   if (isset($err["ldap_expiration_warning"])) formerr($err["ldap_expiration_warning"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_expiration_warning_desc","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_exprireattr:</td>
    <td>
    <input name="ldap_expireattr" type="text" size="30" value="<?php echo $config->ldap_expireattr?>">
    <?php  if (isset($err["ldap_expireattr"])) formerr($err["ldap_expireattr"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_expireattr_desc","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_gracelogins:</td>
    <td>
    <?php
       $grace['0'] = get_string("no");
       $grace['1'] = get_string("yes");
       choose_from_menu($grace, "ldap_gracelogins", $config->ldap_gracelogins, "");
       if (isset($err["ldap_expiration"])) formerr($err["ldap_expiration"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_gracelogins_desc","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right">ldap_graceattr:</td>
    <td>
    <input name="ldap_graceattr" type="text" size="30" value="<?php echo $config->ldap_graceattr?>">
    <?php   if (isset($err["ldap_graceattr"])) formerr($err["ldap_graceattr"]); 
    ?>
    </td>
    <td>
    <?php  print_string("auth_ldap_graceattr_desc","auth") ?>
    </td>
</tr>



<tr>
   <td colspan="2">
        <h4><?php print_string("auth_user_create", "auth") ?> </h4>
   </td>
</tr>

</tr>
<tr valign="top" class="required">
    <td align="right">ldap_create_context:</td>
    <td>
    <input name="ldap_create_context" type="text" size="30" value="<?php echo $config->ldap_create_context?>">
    <?php  if (isset($err["ldap_create_context"])) formerr($err["ldap_create_context"]); ?>
    </td><td>
    <?php  print_string("auth_ldap_create_context","auth") ?>
    </td>
</tr>


<tr>
   <td colspan="2">
        <h4><?php print_string("coursecreators") ?> </h4>
   </td>
</tr>

<tr valign="top" class="required">
        <td align="right">ldap_creators:</td>
        <td>
    <input name="ldap_creators" type="text" size="30" value="<?php echo $config->ldap_creators?>">
    <?php  if (isset($err["ldap_creators"])) formerr($err["ldap_creators"]); ?>
    </td><td>
    <?php  print_string("auth_ldap_creators","auth") ?>
    </td>
</tr>


<tr>
   <td colspan="2">
        <h4><?php print_string("auth_data_mapping", "auth") ?> </h4>
   </td>
</tr>


<tr valign="top" class="required">
    <td align="right"><?php  print_string("firstname") ?>:</td>
    <td>
    <input name="auth_user_firstname" type="text" size="30" value="<?php echo $config->auth_user_firstname?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_firstname_updatelocal">
        <option value="0" <?php echo ($config->auth_user_firstname_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_firstname_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_firstname_editlock">
        <option value="0" <?php echo ($config->auth_user_firstname_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_firstname_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_firstname_updateremote">
        <option value="0" <?php echo ($config->auth_user_firstname_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_firstname_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
    <td rowspan=12 valign="top">
    <?php  print_string("auth_ldapextrafields","auth") ?>
    <?php  print_string("auth_updatelocal_expl","auth") ?>
    <?php  print_string("auth_editlock_expl","auth") ?>
    <?php  print_string("auth_updateremote_expl","auth") ?>
    <hr>
    <?php  print_string("auth_updateremote_ldap","auth") ?>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("lastname") ?>:</td>
    <td>
    <input name="auth_user_lastname" type="text" size="30" value="<?php echo $config->auth_user_lastname?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_lastname_updatelocal">
        <option value="0" <?php echo ($config->auth_user_lastname_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_lastname_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock","auth") ?>
    <select name="auth_user_lastname_editlock">
        <option value="0" <?php echo ($config->auth_user_lastname_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_lastname_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_lastname_updateremote">
        <option value="0" <?php echo ($config->auth_user_lastname_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_lastname_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("email") ?>:</td>
    <td>
    <input name="auth_user_email" type="text" size="30" value="<?php echo $config->auth_user_email?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_email_updatelocal">
        <option value="0" <?php echo ($config->auth_user_email_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_email_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_email_editlock">
        <option value="0" <?php echo ($config->auth_user_email_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_email_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_email_updateremote">
        <option value="0" <?php echo ($config->auth_user_email_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_email_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("phone") ?> 1:</td>
    <td>
    <input name="auth_user_phone1" type="text" size="30" value="<?php echo $config->auth_user_phone1?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_phone1_updatelocal">
        <option value="0" <?php echo ($config->auth_user_phone1_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_phone1_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_phone1_editlock">
        <option value="0" <?php echo ($config->auth_user_phone1_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_phone1_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_phone1_updateremote">
        <option value="0" <?php echo ($config->auth_user_phone1_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_phone1_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("phone") ?> 2:</td>
    <td>
    <input name="auth_user_phone2" type="text" size="30" value="<?php echo $config->auth_user_phone2?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_phone2_updatelocal">
        <option value="0" <?php echo ($config->auth_user_phone2_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_phone2_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_phone2_editlock">
        <option value="0" <?php echo ($config->auth_user_phone2_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_phone2_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_phone2_updateremote">
        <option value="0" <?php echo ($config->auth_user_phone2_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_phone2_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("department") ?>:</td>
    <td>
    <input name="auth_user_department" type="text" size="30" value="<?php echo $config->auth_user_department?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_department_updatelocal">
        <option value="0" <?php echo ($config->auth_user_department_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_department_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_department_editlock">
        <option value="0" <?php echo ($config->auth_user_department_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_department_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_department_updateremote">
        <option value="0" <?php echo ($config->auth_user_department_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_department_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("address") ?>:</td>
    <td>
    <input name="auth_user_address" type="text" size="30" value="<?php echo $config->auth_user_address?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_address_updatelocal">
        <option value="0" <?php echo ($config->auth_user_address_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_address_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_address_editlock">
        <option value="0" <?php echo ($config->auth_user_address_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_address_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_address_updateremote">
        <option value="0" <?php echo ($config->auth_user_address_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_address_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("city") ?>:</td>
    <td>
    <input name="auth_user_city" type="text" size="30" value="<?php echo $config->auth_user_city?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_city_updatelocal">
        <option value="0" <?php echo ($config->auth_user_city_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_city_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_city_editlock">
        <option value="0" <?php echo ($config->auth_user_city_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_city_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_city_updateremote">
        <option value="0" <?php echo ($config->auth_user_city_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_city_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("country") ?>:</td>
    <td>
    <input name="auth_user_country" type="text" size="30" value="<?php echo $config->auth_user_country?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_country_updatelocal">
        <option value="0" <?php echo ($config->auth_user_country_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_country_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_country_editlock">
        <option value="0" <?php echo ($config->auth_user_country_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_country_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_country_updateremote">
        <option value="0" <?php echo ($config->auth_user_country_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_country_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("description") ?>:</td>
    <td>
    <input name="auth_user_description" type="text" size="30" value="<?php echo $config->auth_user_description?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_description_updatelocal">
        <option value="0" <?php echo ($config->auth_user_description_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_description_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_description_editlock">
        <option value="0" <?php echo ($config->auth_user_description_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_description_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_description_updateremote">
        <option value="0" <?php echo ($config->auth_user_description_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_description_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("idnumber") ?>:</td>
    <td>
    <input name="auth_user_idnumber" type="text" size="30" value="<?php echo $config->auth_user_idnumber?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_idnumber_updatelocal">
        <option value="0" <?php echo ($config->auth_user_idnumber_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_idnumber_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_idnumber_editlock">
        <option value="0" <?php echo ($config->auth_user_idnumber_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_idnumber_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_idnumber_updateremote">
        <option value="0" <?php echo ($config->auth_user_idnumber_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_idnumber_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>

<tr valign="top" class="required">
    <td align="right"><?php  print_string("language") ?>:</td>
    <td>
    <input name="auth_user_lang" type="text" size="30" value="<?php echo $config->auth_user_lang?>">
    <div align="right">
    <?php  print_string("auth_updatelocal", "auth") ?>
    <select name="auth_user_lang_updatelocal">
        <option value="0" <?php echo ($config->auth_user_lang_updatelocal ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_lang_updatelocal ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>
    <?php  print_string("auth_editlock", "auth") ?>
    <select name="auth_user_lang_editlock">
        <option value="0" <?php echo ($config->auth_user_lang_editlock ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_lang_editlock ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    <?php  print_string("auth_updateremote", "auth") ?>
    <select name="auth_user_lang_updateremote">
        <option value="0" <?php echo ($config->auth_user_lang_updateremote ? '' : 'selected="yes"') ?> >
            <?php  print_string("no")  ?></option>
        <option value="1" <?php echo ($config->auth_user_lang_updateremote ? 'selected="yes"' : '') ?> >
            <?php  print_string("yes") ?></option>
    </select><br>    
    </div>
    </td>
</tr>


<tr valign="top" class="required">
    <td align="right"><?php  print_string("instructions", "auth") ?>:</td>
    <td>
    <textarea name="auth_instructions" cols="30" rows="10" wrap="virtual"><?php  p($config->auth_instructions) ?></textarea> 
    </td>
    <td>
    <?php  print_string("authinstructions","auth") ?>
    <?php  helpbutton("text", get_string("helptext")) ?>
    </td>
</tr>


