ASNMTAP
view release on metacpan or search on metacpan
applications/htmlroot/cgi-bin/moderator/comments.pl view on Meta::CPAN
# User Session and Access Control
my ($sessionID, undef, undef, undef, undef, undef, undef, $errorUserAccessControl, $remoteUserLoggedOn, undef, undef, $givenNameLoggedOn, $familyNameLoggedOn, undef, undef, $userType, undef, undef, undef, $subTitle) = user_session_and_access_control ...
# Serialize the URL Access Parameters into a string
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&environment=$Cenvironment&environIDreload=$Cen...
# Debug information
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>action : $action<br>catalog ID : $CcatalogID<br>cat.ID rel...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
unless ( defined $userType ) {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print "<br>\n<table WIDTH=\"100%\" border=0><tr><td class=\"HelpPluginFilename\">\n<font size=\"+1\">$errorUserAccessControl</font>\n</td></tr></table>\n<br>\n";
} else {
$action = 'insertView' if ( $CcatalogIDreload or $CenvironIDreload );
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} ."?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID";
my $localYear = sprintf ("%04d", (localtime)[5] );
my $localMonth = sprintf ("%02d", (localtime)[4] );
my $currentYear = sprintf ("%04d", (localtime)[5] + 1900 );
my $currentMonth = sprintf ("%02d", (localtime)[4] + 1 );
my $currentDay = sprintf ("%02d", (localtime)[3] );
my $currentHour = sprintf ("%02d", (localtime)[2] );
my $currentMin = sprintf ("%02d", (localtime)[1] );
my $currentSec = sprintf ("%02d", (localtime)[0] );
my ($CactivationTimeslot, $CsuspentionTimeslot, $tsec, $tmin, $thour, $tday, $tmonth, $tyear);
if ($CactivationDate ne '' and $CactivationTime ne '') {
($tyear, $tmonth, $tday) = split(/\-/, $CactivationDate);
$tyear -= 1900; $tmonth--;
($thour, $tmin, $tsec) = split(/:/, $CactivationTime);
$CactivationTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
} else {
$CactivationTimeslot = '';
}
if ($CsuspentionDate ne '' and $CsuspentionTime ne '') {
($tyear, $tmonth, $tday) = split(/\-/, $CsuspentionDate);
$tyear -= 1900; $tmonth--;
($thour, $tmin, $tsec) = split(/:/, $CsuspentionTime);
$CsuspentionTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
} else {
$CsuspentionTimeslot = '';
}
$nextAction = ($action eq 'insertView' ? 'insert' : 'insertView');
# open connection to database and query data
$rv = 1;
$dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subT...
if ($dbh) {
if ( $action eq 'insertView' ) {
$sql = "select catalogID, catalogName from $SERVERTABLCATALOG where not catalogID = '$CATALOGID' and activated = '1' order by catalogName asc";
($rv, $catalogIDSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CcatalogID, 'catalogID', $CATALOGID, '-Parent-', '', 'onChange="javascript:catalogIDsubmitForm();"', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $d...
$environmentSelect = '<select name="environment" size="1" onChange="javascript:environIDsubmitForm();"><option value="P"'. ($Cenvironment eq 'P' ? ' selected' : '') .'>Production</option><option value="A"'. ($Cenvironment eq 'A' ? ' selected'...
$sql = "select uKey, concat( LTRIM(SUBSTRING_INDEX(title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as optionValueTitle from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where catalogID = '$CcatalogID' and $SERVERTABLPLUGINS.environm...
($rv, $unselected_id) = create_combobox_multiple_from_DBI ($rv, $dbh, $sql, $action, $CuKey, 'unselected', 'uKey', 10, 64, 0, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
if ( defined $remoteUserLoggedOn ) {
$CremoteUser = $remoteUserLoggedOn;
$sql = "select remoteUser, email from $SERVERTABLUSERS where catalogID = '$CcatalogID' and remoteUser = '$CremoteUser'";
} else {
my $andActivated = ($action eq 'insertView') ? 'and activated = 1' : '';
$sql = "select remoteUser, email from $SERVERTABLUSERS where catalogID = '$CcatalogID' and pagedir REGEXP '/$pagedir/' and remoteUser <> 'admin' and remoteUser <> 'sadmin' $andActivated order by email";
}
($rv, $remoteUsersSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 0, '', $CremoteUser, 'remoteUser', 'none', '-Select-', '', '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
} else {
my $CentryDate = "$currentYear-$currentMonth-$currentDay";
my $CentryTime = "$currentHour:$currentMin:$currentSec";
my $CentryTimeslot = timelocal($currentSec, $currentMin, $currentHour, $currentDay, $localMonth, $localYear);
if ($CactivationDate eq '' or $CactivationTime eq '') {
$CactivationDate = $CentryDate;
$CactivationTime = $CentryTime;
$CactivationTimeslot = $CentryTimeslot;
}
if ($CsuspentionDate eq '' or $CsuspentionTime eq '') {
$CsuspentionDate = "0000-00-00";
$CsuspentionTime = "00:00:00";
$CsuspentionTimeslot = "9999999999";
}
my $dummyInstability = ($Cinstability eq 'on') ? 1 : 0;
my $dummyPersistent = ($Cpersistent eq 'on') ? 1 : 0;
my $dummyDowntime = ($Cdowntime eq 'on') ? 1 : 0;
foreach $catalogID_uKey (@CatalogIDuKeyList) {
my ($catalogID, $uKey) = split(/_/, $catalogID_uKey);
unless ( defined $uKey ) {
$uKey = $catalogID;
$catalogID = $CcatalogID;
}
($rv, $Ctitle) = get_title( $dbh, $rv, $catalogID, $uKey, $debug, -1, $sessionID );
$CatalogIDuKeyListStatus .= "<tr><td>$uKey from $catalogID</td>";
if ($rv and defined $Ctitle) {
$sql = 'INSERT INTO ' .$SERVERTABLCOMMENTS. ' SET catalogID="' .$catalogID. '", uKey="' .$uKey. '", replicationStatus="I", title="' .$Ctitle. '", entryDate="' .$CentryDate. '", entryTime="' .$CentryTime.'", entryTimeslot="' .$CentryTimesl...
$CatalogIDuKeyListStatus .= "<td>$Ctitle</td></tr>";
if ( $debug eq 'F' ) {
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
} else {
$CatalogIDuKeyListStatus .= "<tr><td> </td><td>$sql</td></tr>";
}
} else {
$CatalogIDuKeyListStatus .= "<td>NOT found</td></tr>";
}
}
}
( run in 0.637 second using v1.01-cache-2.11-cpan-39bf76dae61 )