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
6d926b3a
authored
2011-03-04 18:41:46 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated notifications and user manager
1 parent
4a6e546c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
com/Notifications/Notifications.php
com/UserManager/UserManager.php
com/UserManager/views/edit_user_profile.php
com/Notifications/Notifications.php
View file @
6d926b3
...
...
@@ -368,8 +368,8 @@ class Vars {
public
static
$notices
;
public
static
$options
;
public
static
$field_lookup
=
array
(
'
current_user'
=>
"Current Logged-in User
"
,
'
allusers'
=>
"All Users
"
'
allusers'
=>
"All Users
"
,
'
report'
=>
"Report
"
);
}
?>
\ No newline at end of file
...
...
com/UserManager/UserManager.php
View file @
6d926b3
...
...
@@ -228,8 +228,10 @@ class ProfileValidation extends Common\Validation {
}
public
function
home_province
(
$val
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Province field can not be empty'
);
if
(
$_POST
[
'profile_preference'
]
==
"Home"
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Home Province field can not be empty'
);
}
}
update_user_meta
(
$_POST
[
'uid'
],
__FUNCTION__
,
$val
);
}
...
...
@@ -239,8 +241,10 @@ class ProfileValidation extends Common\Validation {
}
public
function
home_country
(
$val
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Country field can not be empty'
);
if
(
$_POST
[
'profile_preference'
]
==
"Home"
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Home Country field can not be empty'
);
}
}
update_user_meta
(
$_POST
[
'uid'
],
__FUNCTION__
,
$val
);
}
...
...
@@ -262,7 +266,7 @@ class ProfileValidation extends Common\Validation {
}
if
(
$_POST
[
'profile_preference'
]
==
"Home"
)
{
wp
_update_user
(
Array
(
'ID'
=>
$_POST
[
'uid'
]
,
'user_email'
=>
$val
)
);
_update_user
(
Array
(
'ID'
=>
$_POST
[
'uid'
]
,
'user_email'
=>
$val
)
);
}
update_user_meta
(
$_POST
[
'uid'
],
'home_email'
,
$val
);
...
...
@@ -281,8 +285,10 @@ class ProfileValidation extends Common\Validation {
}
public
function
work_province
(
$val
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Province field can not be empty'
);
if
(
$_POST
[
'profile_preference'
]
==
"Work"
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Work Province field can not be empty'
);
}
}
update_user_meta
(
$_POST
[
'uid'
],
__FUNCTION__
,
$val
);
}
...
...
@@ -292,8 +298,10 @@ class ProfileValidation extends Common\Validation {
}
public
function
work_country
(
$val
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Country field can not be empty'
);
if
(
$_POST
[
'profile_preference'
]
==
"Work"
)
{
if
(
empty
(
$val
))
{
throw
new
Exception
(
'Work Country field can not be empty'
);
}
}
update_user_meta
(
$_POST
[
'uid'
],
__FUNCTION__
,
$val
);
}
...
...
@@ -315,7 +323,7 @@ class ProfileValidation extends Common\Validation {
}
if
(
$_POST
[
'profile_preference'
]
==
"Work"
)
{
wp
_update_user
(
Array
(
'ID'
=>
$_POST
[
'uid'
]
,
'user_email'
=>
$val
)
);
_update_user
(
Array
(
'ID'
=>
$_POST
[
'uid'
]
,
'user_email'
=>
$val
)
);
}
update_user_meta
(
$_POST
[
'uid'
],
'work_email'
,
$val
);
...
...
com/UserManager/views/edit_user_profile.php
View file @
6d926b3
...
...
@@ -162,7 +162,7 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
<table
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
class=
"my-profile-table"
>
<tbody>
<tr>
<td
colspan=
"2"
><input
type=
"radio"
name=
"profile_preference"
value=
"
Home
"
<?php
echo
(
get_user_meta
(
$_GET
[
'uid'
],
'profile_preference'
,
true
)
==
"Work"
)
?
"checked='checked'"
:
""
;
?>
/>
<em>
Preferred
</em>
contact method.
</td>
<td
colspan=
"2"
><input
type=
"radio"
name=
"profile_preference"
value=
"
Work
"
<?php
echo
(
get_user_meta
(
$_GET
[
'uid'
],
'profile_preference'
,
true
)
==
"Work"
)
?
"checked='checked'"
:
""
;
?>
/>
<em>
Preferred
</em>
contact method.
</td>
</tr>
<tr><td
colspan=
"2"
>
</td></tr>
<tr
class=
"work-only"
>
...
...
Please
register
or
sign in
to post a comment