From 479aca0db88f0b1af52f399f19a0a8267bd10744 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 27 Jun 2017 01:49:35 -0400 Subject: Add dbconfig model code --- app/model/dbconfig.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/model/dbconfig.php (limited to 'app/model') diff --git a/app/model/dbconfig.php b/app/model/dbconfig.php new file mode 100644 index 0000000..822fd88 --- /dev/null +++ b/app/model/dbconfig.php @@ -0,0 +1,44 @@ +text("dbHost"); + $form->text("dbUname"); + $form->text("dbPasswd", false); + $form->text("dbName"); + + if (!$form->populate(input())) + return; + + $stat = database::setConfig("mysql", $form->dbHost, $form->dbUname, + $form->dbPasswd, $form->dbName); + + if (!$stat) + return; + + location("/"); +} + +?> -- cgit v1.2.3 From 75dd0e67ca684f779b712b313f188d23f903609f Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 6 Jul 2017 23:45:09 -0400 Subject: Remove unused global declaration --- app/model/dbconfig.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/model') diff --git a/app/model/dbconfig.php b/app/model/dbconfig.php index 822fd88..c66b052 100644 --- a/app/model/dbconfig.php +++ b/app/model/dbconfig.php @@ -21,8 +21,6 @@ require_once "class/form.class.php"; */ if (isAction("save")) { - global $_SCROTT; - $form = new form(); $form->text("dbHost"); $form->text("dbUname"); -- cgit v1.2.3