catalog admin
parent
7661679e98
commit
bbfbbe78b7
|
@ -1,76 +0,0 @@
|
|||
<?php
|
||||
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/public/vhost/g/gutenberg/dev/private/lib/php");
|
||||
include_once ("pgcat.phh");
|
||||
|
||||
authenticate ("createuser");
|
||||
|
||||
getstr ("mode");
|
||||
$caption = ucfirst ($mode) . " User";
|
||||
|
||||
pageheader ($caption);
|
||||
|
||||
include_once ("sqlform.phh");
|
||||
|
||||
$db = $config->db ();
|
||||
$db->logger = new logger ();
|
||||
$f = new SQLForm ();
|
||||
getint ("fk_users");
|
||||
getstr ("filter");
|
||||
|
||||
if (ismode ("delete")) {
|
||||
$f->SubCaption ("You are about to delete this user.");
|
||||
$f->SubCaption ("Press the '$caption' button to continue or " .
|
||||
"hit the back button on your browser to dismiss.");
|
||||
} else {
|
||||
$f->Text ("user", "user", "User", SQLCHAR, 80, 240, true);
|
||||
$f->Text ("login", "login", "Login", SQLCHAR, 80, 240, true);
|
||||
$f->TextArea ("note", "note", "Note", SQLCHAR, 4, 80, false);
|
||||
|
||||
$f->LoadData ("select * from users where pk = $fk_users");
|
||||
}
|
||||
$f->Hidden ("fk_users");
|
||||
$f->Hidden ("filter");
|
||||
|
||||
if (isupdatemode ("add")) {
|
||||
if ($f->Check ()) {
|
||||
$sql = $f->mkInsert ($db->GetFormatter ());
|
||||
if ($db->Exec ("insert into users " . $sql)) {
|
||||
msg ("User added !");
|
||||
} else {
|
||||
error_msg ("Could not add user!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isupdatemode ("edit")) {
|
||||
if ($f->Check ()) {
|
||||
$sql = $f->mkUpdate ($db->GetFormatter ());
|
||||
if ($db->Exec ("update users set " . $sql . "where pk = $fk_users")) {
|
||||
msg ("User modified !");
|
||||
} else {
|
||||
error_msg ("Could not modify user !");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isupdatemode ("delete")) {
|
||||
$db->Exec ("delete from mn_users_permissions where fk_users = $fk_users");
|
||||
if ($db->Exec ("delete from users where pk = $fk_users")) {
|
||||
msg ("User deleted !");
|
||||
} else {
|
||||
error_msg ("Could not delete user !");
|
||||
}
|
||||
}
|
||||
|
||||
if (isupdate ()) {
|
||||
if (!isupdatemode ("delete")) {
|
||||
p ("<a href=\"user?mode=edit&filter=$filter&fk_users=$fk_users\">Back to User</a>");
|
||||
}
|
||||
} else {
|
||||
$f->Output ($caption, $caption);
|
||||
}
|
||||
|
||||
p ("<a href=\"users_list?filter=$filter\">Back to User List</a>");
|
||||
|
||||
pagefooter ();
|
||||
|
||||
?>
|
|
@ -1 +0,0 @@
|
|||
gutenbackend@login2.ibiblio.org.27895:1596734584
|
|
@ -58,12 +58,14 @@ if (isupdatemode ("add")) {
|
|||
$retcode = $db->Exec ("insert into attributes " . $sql);
|
||||
}
|
||||
}
|
||||
|
||||
if (isupdatemode ("edit")) {
|
||||
if ($f->Check ()) {
|
||||
$sql = $f->mkUpdate ($db->GetFormatter ());
|
||||
$retcode = $db->Exec ("update attributes set " . $sql . "where pk = $pk");
|
||||
}
|
||||
}
|
||||
|
||||
if (isupdatemode ("delete")) {
|
||||
$retcode = $db->Exec ("delete from attributes where pk = $pk");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue