Updated notification system to allow for much more functionality.
This commit is contained in:
parent
2bb835a445
commit
6d574cd0b9
5 changed files with 133 additions and 73 deletions
|
|
@ -30,7 +30,7 @@ use WebGUI::User;
|
|||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_viewMessageLog &www_viewProfile &www_editProfile &www_editProfileSave &www_createAccount &www_deactivateAccount &www_deactivateAccountConfirm &www_displayAccount &www_displayLogin &www_login &www_logout &www_recoverPassword &www_recoverPasswordFinish &www_createAccountSave &www_updateAccount);
|
||||
our @EXPORT = qw(&www_viewMessageLogMessage &www_viewMessageLog &www_viewProfile &www_editProfile &www_editProfileSave &www_createAccount &www_deactivateAccount &www_deactivateAccountConfirm &www_displayAccount &www_displayLogin &www_login &www_logout &www_recoverPassword &www_recoverPasswordFinish &www_createAccountSave &www_updateAccount);
|
||||
our %ldapStatusCode = ( 0=>'success (0)', 1=>'Operations Error (1)', 2=>'Protocol Error (2)',
|
||||
3=>'Time Limit Exceeded (3)', 4=>'Size Limit Exceeded (4)', 5=>'Compare False (5)',
|
||||
6=>'Compare True (6)', 7=>'Auth Method Not Supported (7)', 8=>'Strong Auth Required (8)',
|
||||
|
|
@ -253,7 +253,7 @@ sub www_createAccountSave {
|
|||
}
|
||||
WebGUI::Session::start($u->userId);
|
||||
_logLogin($u->userId,"success");
|
||||
WebGUI::MessageLog::addEntry('',$session{setting}{onNewUserAlertGroup},'',536) if ($session{setting}{alertOnNewUser});
|
||||
WebGUI::MessageLog::addInternationalizedEntry('',$session{setting}{onNewUserAlertGroup},'',536) if ($session{setting}{alertOnNewUser});
|
||||
} else {
|
||||
$output = "<h1>".WebGUI::International::get(70)."</h1>".$error.www_createAccount();
|
||||
}
|
||||
|
|
@ -563,27 +563,32 @@ sub www_updateAccount {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewMessageLog {
|
||||
my (@data, $output, $sth, @row, $i, $p);
|
||||
my (%status, @data, $output, $sth, @row, $i, $p);
|
||||
if (WebGUI::Privilege::isInGroup(2,$session{user}{userId})) {
|
||||
%status = (notice=>WebGUI::International::get(551),pending=>WebGUI::International::get(552),completed=>WebGUI::International::get(350));
|
||||
$output = '<h1>'.WebGUI::International::get(159).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select messageLogId,message,url,dateOfEntry from messageLog where userId=$session{user}{userId} order by dateOfEntry desc");
|
||||
$sth = WebGUI::SQL->read("select messageLogId,subject,url,dateOfEntry,status from messageLog where userId=$session{user}{userId} order by dateOfEntry desc");
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr><td class="tableData">';
|
||||
$row[$i] .= '<a href="'.WebGUI::URL::page('op=viewMessageLogMessage&mlog='.$data[0]).'">'.$data[1].'</a>';
|
||||
$row[$i] .= '</td><td class="tableData">';
|
||||
if ($data[2] ne "") {
|
||||
$data[2] = WebGUI::URL::append($data[2],'mlog='.$data[0]);
|
||||
$row[$i] .= '<a href="'.$data[2].'">';
|
||||
}
|
||||
$row[$i] .= $data[1];
|
||||
$row[$i] .= $status{$data[4]};
|
||||
if ($data[2] ne "") {
|
||||
$row[$i] .= '</a>';
|
||||
}
|
||||
$row[$i] .= '</td><td class="tableData">'.epochToHuman($data[3],"%m/%d/%Y @ %H:%n%p").'</td></tr>';
|
||||
$row[$i] .= '</td><td class="tableData">'.epochToHuman($data[3]).'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=viewMessageLog'),\@row);
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(351).'</td><td class="tableHeader">'.WebGUI::International::get(352).'</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(351).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(553).'</td>
|
||||
<td class="tableHeader">'.WebGUI::International::get(352).'</td></tr>';
|
||||
if ($p->getPage($session{form}{pn}) eq "") {
|
||||
$output .= '<tr><td rowspan=2 class="tableData">'.WebGUI::International::get(353).'</td></tr>';
|
||||
} else {
|
||||
|
|
@ -598,6 +603,33 @@ sub www_viewMessageLog {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewMessageLogMessage {
|
||||
my (%status, %data, $output, $sth, @row, $i, $p);
|
||||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::isInGroup(2,$session{user}{userId})) {
|
||||
%status = (notice=>WebGUI::International::get(551),pending=>WebGUI::International::get(552),completed=>WebGUI::International::get(350));
|
||||
$output = '<h1>'.WebGUI::International::get(159).'</h1>';
|
||||
%data = WebGUI::SQL->quickHash("select * from messageLog where messageLogId=$session{form}{mlog} and userId=$session{user}{userId}");
|
||||
$output .= '<b>'.$data{subject}.'</b><br>';
|
||||
$output .= epochToHuman($data{dateOfEntry}).'<br>';
|
||||
if ($data{url} ne "" && $data{status} eq 'pending') {
|
||||
$data{url} = WebGUI::URL::append($data{url},'mlog='.$data{messageLogId});
|
||||
$output .= '<a href="'.$data{url}.'">';
|
||||
}
|
||||
$output .= $status{$data{status}}.'<br>';
|
||||
if ($data{url} ne "") {
|
||||
$output .= '</a>';
|
||||
}
|
||||
$output .= '<br>'.$data{message}.'<p>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('op=viewMessageLog').'">'.WebGUI::International::get(354).'</a><p>';
|
||||
$output .= _accountOptions();
|
||||
} else {
|
||||
$output = WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewProfile {
|
||||
my ($a, %data, $category, $label, $value, $previousCategory, $output, $u, %gender);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue