mirror of https://github.com/tLDP/LDP
kill some dead files
This commit is contained in:
parent
e47934ac13
commit
8361ca0ce4
|
@ -1,47 +0,0 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$query = new CGI;
|
||||
$dbmain = "ldp";
|
||||
@row;
|
||||
|
||||
# Read parameters
|
||||
$caller = param('caller');
|
||||
$doc_id = param('doc_id');
|
||||
$editor_id = param('editor_id');
|
||||
$active = param('active');
|
||||
$editor_role = param('editor_role');
|
||||
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
|
||||
$username = $query->remote_user();
|
||||
$result=$conn->exec("SELECT username, admin, maintainer_id FROM username WHERE username='$username'");
|
||||
@row = $result->fetchrow;
|
||||
$founduser = $row[0];
|
||||
$founduser =~ s/\s+$//;
|
||||
if ($username ne $founduser) {
|
||||
print $query->redirect("../newaccount.html");
|
||||
exit;
|
||||
} else {
|
||||
if ($row[1] ne 't') {
|
||||
print $query->redirect("../wrongpermission.html");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
#print header;
|
||||
#print start_html;
|
||||
$sql = "INSERT INTO document_editor(doc_id, editor_id, active, editor_role) VALUES ($doc_id, $editor_id, '$active', '$editor_role')";
|
||||
$result=$conn->exec($sql);
|
||||
|
||||
|
||||
#print header;
|
||||
#print start_html;
|
||||
#print $sql;
|
||||
#print end_html;
|
||||
#exit;
|
||||
|
||||
print $query->redirect($caller)
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$query = new CGI;
|
||||
|
||||
$dbmain = "ldp";
|
||||
@row;
|
||||
|
||||
# Read parameters
|
||||
$caller = param('caller');
|
||||
$doc_id = param('doc_id');
|
||||
$editor_id = param('editor_id');
|
||||
$active = param('active');
|
||||
$editor_role = param('editor_role');
|
||||
$chkDel = param('chkDel');
|
||||
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
|
||||
$username = $query->remote_user();
|
||||
$result=$conn->exec("SELECT username, admin, maintainer_id FROM username WHERE username='$username'");
|
||||
@row = $result->fetchrow;
|
||||
$founduser = $row[0];
|
||||
$founduser =~ s/\s+$//;
|
||||
if ($username ne $founduser) {
|
||||
print $query->redirect("../newaccount.html");
|
||||
exit;
|
||||
} else {
|
||||
if (($row[1] ne 't') and ($row[2] != $doc_id)) {
|
||||
print $query->redirect("../wrongpermission.html");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $chkDel eq 'on' ) {
|
||||
$sql = "DELETE FROM document_editor WHERE doc_id = $doc_id and editor_id = $editor_id";
|
||||
$result=$conn->exec($sql);
|
||||
}
|
||||
else {
|
||||
$sql = "UPDATE document_editor SET active = '$active' WHERE doc_id = $doc_id and editor_id = $editor_id";
|
||||
$result=$conn->exec($sql);
|
||||
$sql = "UPDATE document_editor SET editor_role = '$editor_role' WHERE doc_id = $doc_id and editor_id = $editor_id";
|
||||
$result=$conn->exec($sql);
|
||||
}
|
||||
print $query->redirect($caller)
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$query = new CGI;
|
||||
$dbmain = "ldp";
|
||||
@row;
|
||||
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
|
||||
$username = $query->remote_user();
|
||||
$result=$conn->exec("SELECT username, admin, maintainer_id FROM username WHERE username='$username'");
|
||||
@row = $result->fetchrow;
|
||||
$founduser = $row[0];
|
||||
$founduser =~ s/\s+$//;
|
||||
if ($username ne $founduser) {
|
||||
print $query->redirect("../newaccount.html");
|
||||
exit;
|
||||
} else {
|
||||
if (($row[1] ne 't') and ($row[2] != $doc_id)) {
|
||||
print $query->redirect("../wrongpermission.html");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
# Read parameters
|
||||
$caller = param('caller');
|
||||
$editor_name = param('editor_name');
|
||||
$editor_name =~ s/\'/\'\'/;
|
||||
$email = param('email');
|
||||
|
||||
$sql = "SELECT max(editor_id) from editor";
|
||||
$result=$conn->exec($sql);
|
||||
@row = $result->fetchrow;
|
||||
$editor_id = $row[0] + 1;
|
||||
|
||||
$sql = "INSERT INTO editor(editor_id, editor_name, email) VALUES ($editor_id, '$editor_name', '$email')";
|
||||
|
||||
#print header;
|
||||
#print start_html;
|
||||
#print "<p>$editor_name";
|
||||
#print "<p>$email";
|
||||
#print "<p>$editor_id";
|
||||
#print "<p>$sql";
|
||||
#print end_html;
|
||||
#exit;
|
||||
|
||||
$conn->exec($sql);
|
||||
|
||||
print $query->redirect($caller)
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$query = new CGI;
|
||||
$dbmain = "ldp";
|
||||
@row;
|
||||
|
||||
# Read parameters
|
||||
$editor_id = param('editor_id');
|
||||
|
||||
# Load data from db and call edit form
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
|
||||
$result = $conn->exec("SELECT editor_id, editor_name, email, notes from editor where editor_id = $editor_id");
|
||||
die $conn->errorMessage unless PGRES_TUPLES_OK eq $result->resultStatus;
|
||||
|
||||
@row = $result->fetchrow;
|
||||
|
||||
# Load from db
|
||||
$editor_id = $row[0];
|
||||
$editor_name = $row[1];
|
||||
$editor_name =~ s/\s*$//;
|
||||
$email = $row[2];
|
||||
$email =~ s/\s*$//;
|
||||
$notes = $row[3];
|
||||
$notes =~ s/\s*$//;
|
||||
|
||||
|
||||
print header(-expires=>'now');
|
||||
|
||||
print "<html><head><title>$editor_name</title>";
|
||||
print "<link rel=stylesheet href='../ldp.css' type='text/css'></head>";
|
||||
print "<body>";
|
||||
|
||||
print "<h1>$editor_name</h1>\n";
|
||||
|
||||
system("./navbar.pl");
|
||||
|
||||
print "<p>ID: $editor_id";
|
||||
print "<form name=edit method=POST action='editor_save.pl'>";
|
||||
print "<input type=hidden name=editor_id value=$editor_id></input>";
|
||||
printf "<p><table>\n";
|
||||
print '<tr><th>Name:</th><td><input type=text name="editor_name" size=30 value="' . $editor_name . '"></input></td></tr>';
|
||||
print '<tr><th>Email:</th><td><input type=text name="email" size=30 value="' . $email . '"></input></td></tr>';
|
||||
print "<tr><th valign=top>Notes:</th><td><textarea name=notes rows=10 cols=40>$notes</textarea></td></tr>\n";
|
||||
print "<tr><td></td><td><input type=submit value=Save></td></tr>";
|
||||
print "</table>";
|
||||
print "</form>";
|
||||
|
||||
$docs_result = $conn->exec("SELECT document.doc_id, document.title, class, pub_status.pub_status_name, document_editor.editor_role, document_editor.active FROM document_editor, document, pub_status WHERE document_editor.editor_id = $editor_id AND document.pub_status = pub_status.pub_status AND document_editor.doc_id = document.doc_id ORDER BY document.title");
|
||||
die $conn->errorMessage unless PGRES_TUPLES_OK eq $docs_result->resultStatus;
|
||||
|
||||
print "\n<h2>Documents</h2>\n";
|
||||
printf "<p><table border=1 cellspacing=2\n";
|
||||
print "<tr><th>Title</th><th>Class</th><th>Doc Status</th><th>Role</th><th>Active</th></tr>";
|
||||
while (@row = $docs_result->fetchrow) {
|
||||
$doc_id = $row[0];
|
||||
$title = $row[1];
|
||||
$class = $row[2];
|
||||
$pub_status_name = $row[3];
|
||||
$editor_role = $row[4];
|
||||
$active = $row[5];
|
||||
if ( $active eq 't' ) { $active = "Active" } else { $active = "Inactive" }
|
||||
print "<tr>";
|
||||
print "<form method=POST action='document_editor_save.pl'>\n";
|
||||
print "<td valign=top><a href='document_edit.pl?doc_id=$doc_id'>$title</a></td>\n";
|
||||
print "<td valign=top>$class</td>\n";
|
||||
print "<td valign=top>$pub_status_name</td>\n";
|
||||
print "<td valign=top>$editor_role</td>\n";
|
||||
print "<td valign=top>$active</td>\n";
|
||||
print "</form>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
printf "</table>\n";
|
||||
|
||||
print end_html;
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$dbmain='ldp';
|
||||
@row;
|
||||
$count = 0;
|
||||
|
||||
$query = new CGI;
|
||||
|
||||
# Connect to database
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
|
||||
$username = $query->remote_user();
|
||||
$result=$conn->exec("SELECT username, admin, maintainer_id FROM username WHERE username='$username'");
|
||||
@row = $result->fetchrow;
|
||||
$admin = $row[1];
|
||||
|
||||
$result=$conn->exec("SELECT editor_id, editor_name, email FROM editor ORDER BY editor_name");
|
||||
die $conn->errorMessage unless PGRES_TUPLES_OK eq $result->resultStatus;
|
||||
|
||||
# print the page
|
||||
print header(-expires=>'now');
|
||||
print "<html><head><title>LDP Editors</title>";
|
||||
print "<link rel=stylesheet href='../ldp.css' type='text/css'>";
|
||||
print "</head>";
|
||||
print "<body>";
|
||||
|
||||
print "<h1>LDP Editors</h1>\n";
|
||||
|
||||
system("./navbar.pl");
|
||||
|
||||
print "<p><table border=0>\n";
|
||||
print "<tr><th>Name</th><th>Email</th></tr>\n";
|
||||
while (@row = $result->fetchrow) {
|
||||
$editor_id = $row[0];
|
||||
$editor_name = $row[1];
|
||||
$editor_email = $row[2];
|
||||
if ( $editor_name eq "" ) { $editor_name = 'J. Doe' }
|
||||
print "<tr><td>\n";
|
||||
print a({href=>"editor_edit.pl?editor_id=$editor_id"},"$editor_name");
|
||||
print "</td>\n";
|
||||
print "<td>\n";
|
||||
print a({href=>"mailto\:$editor_email"},"$editor_email");
|
||||
print "</td>\n";
|
||||
print "</tr>";
|
||||
$count++;
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print "<p>Count: $count";
|
||||
|
||||
if ($admin eq 't') {
|
||||
print "<p><hr>\n";
|
||||
|
||||
print "<h1>New Editor</h1>\n";
|
||||
|
||||
print "<p><form method=POST action='editor_add.pl'>\n";
|
||||
print "<input type=hidden name=caller value='editor_list.pl'>\n";
|
||||
print "<table>\n";
|
||||
print "<tr><td align=right>Name:</td><td><input type=text name=editor_name width=20 size=20></td></tr>\n";
|
||||
print "<tr><td align=right>Email:</td><td><input type=text name=email width=20 size=20></td></tr>\n";
|
||||
print "<tr><td></td><td><input type=submit value=Save></td></tr>\n";
|
||||
print "</table></form>\n";
|
||||
}
|
||||
|
||||
print end_html;
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use CGI qw(:standard);
|
||||
use Pg;
|
||||
|
||||
$query = new CGI;
|
||||
$dbmain = "ldp";
|
||||
@row;
|
||||
|
||||
# Read parameters
|
||||
$caller = param('caller');
|
||||
$maintainer_name = param('maintainer_name');
|
||||
$maintainer_name =~ s/\'/\'\'/;
|
||||
$email = param('email');
|
||||
|
||||
$conn=Pg::connectdb("dbname=$dbmain");
|
||||
|
||||
$username = $query->remote_user();
|
||||
$result=$conn->exec("SELECT username, admin, maintainer_id FROM username WHERE username='$username'");
|
||||
@row = $result->fetchrow;
|
||||
$founduser = $row[0];
|
||||
$founduser =~ s/\s+$//;
|
||||
if ($username ne $founduser) {
|
||||
print $query->redirect("../newaccount.html");
|
||||
exit;
|
||||
} else {
|
||||
if ($row[1] ne 't') {
|
||||
print $query->redirect("../wrongpermission.html");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT max(maintainer_id) from maintainer";
|
||||
$result=$conn->exec($sql);
|
||||
@row = $result->fetchrow;
|
||||
$maintainer_id = $row[0] + 1;
|
||||
|
||||
$sql = "INSERT INTO maintainer(maintainer_id, maintainer_name, email) VALUES ($maintainer_id, '$maintainer_name', '$email')";
|
||||
$conn->exec($sql);
|
||||
|
||||
#print header;
|
||||
#print start_html;
|
||||
#print "<p>$maintainer_name";
|
||||
#print "<p>$email";
|
||||
#print "<p>$maintainer_id";
|
||||
#print "<p>$sql";
|
||||
#print end_html;
|
||||
#exit;
|
||||
|
||||
|
||||
print $query->redirect($caller)
|
||||
|
Loading…
Reference in New Issue