0d72c06e by Kevin Burton

updates

1 parent 17a91d41
......@@ -88,6 +88,34 @@ function validateDate( $date, $format='YYYY-MM-DD')
}
function validate_creditcard($cc_num, $type) {
if($type == "amex") {
$pattern = "/^([34|37]{2})([0-9]{13})$/"; //American Express
if (preg_match($pattern,$cc_num)) {
$verified = true;
} else {
$verified = false;
}
} elseif ($type == "mc") {
$pattern = "/^([51|52|53|54|55]{2})([0-9]{14})$/"; //Mastercard
if (preg_match($pattern,$cc_num)) {
$verified = true;
} else {
$verified = false;
}
} elseif ( $type == "visa" ) {
$pattern = "/^([4]{1})([0-9]{12,15})$/"; //Visa
if (preg_match($pattern,$cc_num)) {
$verified = true;
} else {
$verified = false;
}
}
return $verified;
}
class Vars {
public static $prefixes = Array(
......@@ -102,9 +130,9 @@ class Vars {
);
public static $countries = Array(
'CAN' => 'Canada'
, 'USA' => 'United States'
, 'MEX' => 'Mexico'
'CA' => 'Canada'
, 'US' => 'United States'
, 'MX' => 'Mexico'
, 'Other' => 'Other'
);
......
......@@ -109,7 +109,7 @@ unset($rc, $roles['administrator']);
<td>
<select name="user_role" id="create_user_role">
<?php foreach($roles as $roled=>$name):?>
<option value="<?php echo $roled;?>"><?php echo $name;?></option>
<option value="<?php echo $roled;?>" <?php echo ($roled=="guest") ? "selected" : "";?>><?php echo $name;?></option>
<?php endforeach;?>
</select>
</td>
......
......@@ -195,7 +195,7 @@ use WP_User, WP_Roles;
<div style="clear:both;"></div>
<div id="show_special_status" style="display:<?php echo ($role=="member") ? "block" : "none";?>">
<div id="show_special_status" style="display:block;">
<h3 style="margin-bottom:5px; padding-bottom:0px;">Special Status:</h3>
<input type="hidden" name="special_status_active" value="true" />
<table cellpadding="0" cellspacing="0" border="0">
......@@ -261,6 +261,7 @@ use WP_User, WP_Roles;
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function() {
/* Dan asked me to keep special status open for all in the backend.
jQuery('#user_role').change(function() {
if (jQuery(this).val() == "member") {
jQuery('#show_special_status').show();
......@@ -268,6 +269,7 @@ jQuery(function() {
jQuery('#show_special_status').hide();
}
});
*/
});
</script>
......