From bbfbbe78b760e944613bb4807220030bf9196305 Mon Sep 17 00:00:00 2001 From: Gutenberg back end service account Date: Fri, 28 Aug 2020 12:54:23 -0400 Subject: [PATCH] catalog admin --- catalog/admin/#user.php# | 76 ------------------------------------- catalog/admin/.#user.php | 1 - catalog/admin/attribute.php | 2 + 3 files changed, 2 insertions(+), 77 deletions(-) delete mode 100644 catalog/admin/#user.php# delete mode 120000 catalog/admin/.#user.php diff --git a/catalog/admin/#user.php# b/catalog/admin/#user.php# deleted file mode 100644 index 9c88027..0000000 --- a/catalog/admin/#user.php# +++ /dev/null @@ -1,76 +0,0 @@ -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 ("Back to User"); - } -} else { - $f->Output ($caption, $caption); -} - -p ("Back to User List"); - -pagefooter (); - -?> diff --git a/catalog/admin/.#user.php b/catalog/admin/.#user.php deleted file mode 120000 index 5f12a5e..0000000 --- a/catalog/admin/.#user.php +++ /dev/null @@ -1 +0,0 @@ -gutenbackend@login2.ibiblio.org.27895:1596734584 \ No newline at end of file diff --git a/catalog/admin/attribute.php b/catalog/admin/attribute.php index 2b28663..bf265a0 100644 --- a/catalog/admin/attribute.php +++ b/catalog/admin/attribute.php @@ -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"); }