add: User profile data table is now a flat table.
This commit is contained in:
parent
8590ef89d5
commit
07a40788bb
41 changed files with 493 additions and 164 deletions
|
|
@ -84,10 +84,14 @@ email address to check for duplication
|
|||
=cut
|
||||
|
||||
sub isDuplicateEmail {
|
||||
my $session = shift;
|
||||
my $email = shift;
|
||||
my ($otherEmail) = $session->db->quickArray("select count(*) from userProfileData where fieldName='email' and fieldData = ".$session->db->quote($email)." and userId <> ".$session->db->quote($session->user->userId));
|
||||
return ($otherEmail > 0);
|
||||
my $session = shift;
|
||||
my $email = shift;
|
||||
my ($otherEmail)
|
||||
= $session->db->quickArray(
|
||||
'select count(*) from userProfileData where email = ? and userId <> ?',
|
||||
[$email, $session->user->userId]
|
||||
);
|
||||
return ($otherEmail > 0);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -138,10 +138,9 @@ sub doUserSearch {
|
|||
}
|
||||
$keyword = $session->db->quote($keyword);
|
||||
my $sql = "select users.userId, users.username, users.status, users.dateCreated, users.lastUpdated,
|
||||
email.fieldData as email from users
|
||||
left join userProfileData email on users.userId=email.userId and email.fieldName='email'
|
||||
left join userProfileData useralias on users.userId=useralias.userId and useralias.fieldName='alias'
|
||||
where $selectedStatus and (users.username like ".$keyword." or useralias.fieldData like ".$keyword." or email.fieldData like ".$keyword.")
|
||||
userProfileData.email from users
|
||||
left join userProfileData on users.userId=userProfileData.userId
|
||||
where $selectedStatus and (users.username like ".$keyword." or alias like ".$keyword." or email like ".$keyword.")
|
||||
and users.userId not in (".$session->db->quoteAndJoin($userFilter).") order by users.username";
|
||||
if ($returnPaginator) {
|
||||
my $p = WebGUI::Paginator->new($session,$session->url->page("op=".$op));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue