コード例 #1
0
ファイル: compare.php プロジェクト: azeckoski/az-php-sandbox
                } else {
                    echo $vals . "<br />";
                }
            }
            echo "</td>";
            continue;
        }
        /*
         * Is this a userPassword attribute?
         */
        if (!strcasecmp($attr, 'userpassword')) {
            $user_password = $vals[0];
            $enc_type = get_enc_type($user_password);
            // Set the default hashing type if the password is blank (must be newly created)
            if ($user_password == '') {
                $enc_type = get_default_hash($server_id);
            }
            if ($side == 'dst') {
                ?>

				<input type="hidden" name="old_values[userpassword]" value="<?php 
                echo htmlspecialchars($user_password);
                ?>
" />

				<!-- Special case of enc_type to detect changes when user changes enc_type but not the password value -->
				<input size="38" type="hidden" name="old_enc_type" value="<?php 
                echo $enc_type == '' ? 'clear' : $enc_type;
                ?>
" />
コード例 #2
0
     echo '</td>';
     echo '</tr>';
     if ($is_modified_attr) {
         echo '<tr class="updated_attr"><td class="bottom" colspan="2"></td></tr>';
     }
     continue;
 }
 /*
  * Is this a userPassword attribute?
  */
 if (0 == strcasecmp($attr, 'userpassword')) {
     foreach ($vals as $user_password) {
         $enc_type = get_enc_type($user_password);
         # Set the default hashing type if the password is blank (must be newly created)
         if ($user_password == '') {
             $enc_type = get_default_hash($ldapserver->server_id);
         }
         printf('<input type="hidden" name="old_values[userpassword][]" value="%s" />', htmlspecialchars($user_password));
         echo '<!-- Special case of enc_type to detect changes when user changes enc_type but not the password value -->';
         printf('<input size="38" type="hidden" name="old_enc_type[]" value="%s" />', $enc_type == '' ? 'clear' : $enc_type);
         if (obfuscate_password_display($enc_type)) {
             echo htmlspecialchars(preg_replace('/./', '*', $user_password));
         } else {
             echo htmlspecialchars($user_password);
         }
         echo '<br />';
         printf('<input style="width: 260px" type="%s" name="new_values[userpassword][]" value="" />', obfuscate_password_display($enc_type) ? 'password' : 'text');
         echo enc_type_select_list($enc_type);
         echo '<br />';
         printf('<small><a href="javascript:passwordComparePopup(\'%s\')">%s</a></small>', base64_encode($user_password), _('Check password...'));
         echo '<br />';