Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0d72c06e
authored
2011-01-28 20:33:55 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updates
1 parent
17a91d41
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
com/HTML/HTML.php
com/UserManager/views/create_user.php
com/UserManager/views/edit_user_overview.php
com/HTML/HTML.php
View file @
0d72c06
...
...
@@ -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
(
'CA
N
'
=>
'Canada'
,
'US
A
'
=>
'United States'
,
'M
E
X'
=>
'Mexico'
'CA'
=>
'Canada'
,
'US'
=>
'United States'
,
'MX'
=>
'Mexico'
,
'Other'
=>
'Other'
);
...
...
com/UserManager/views/create_user.php
View file @
0d72c06
...
...
@@ -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>
...
...
com/UserManager/views/edit_user_overview.php
View file @
0d72c06
...
...
@@ -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>
...
...
Please
register
or
sign in
to post a comment