From 7e136fa30f3e1f5d47acf2e825e527e7d7123238 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 8 Feb 2018 00:33:43 -0500 Subject: Remove old content --- examples/controller/auth.control.php | 67 -------- examples/controller/dashboard.control.php | 41 ----- examples/controller/deauth.control.php | 40 ----- examples/controller/deleteacct.control.php | 58 ------- examples/controller/except.control.php | 41 ----- examples/controller/sysconf.control.php | 57 ------- examples/form.class.php | 243 --------------------------- examples/index.php | 30 ---- examples/model/sysconf.mod.php | 93 ---------- examples/view/auth/default.view.php | 127 -------------- examples/view/common/foot.view.php | 19 --- examples/view/common/head.view.php | 26 --- examples/view/sysconf/default.view.php | 138 --------------- examples/view/sysconf/group.modal.view.php | 49 ------ examples/view/sysconf/issue.modal.view.php | 52 ------ examples/view/sysconf/message.modal.view.php | 55 ------ examples/view/sysconf/pad.modal.view.php | 68 -------- examples/view/sysconf/stage.modal.view.php | 52 ------ examples/view/sysconf/user.modal.view.php | 48 ------ 19 files changed, 1304 deletions(-) delete mode 100644 examples/controller/auth.control.php delete mode 100644 examples/controller/dashboard.control.php delete mode 100644 examples/controller/deauth.control.php delete mode 100644 examples/controller/deleteacct.control.php delete mode 100644 examples/controller/except.control.php delete mode 100644 examples/controller/sysconf.control.php delete mode 100644 examples/form.class.php delete mode 100644 examples/index.php delete mode 100644 examples/model/sysconf.mod.php delete mode 100644 examples/view/auth/default.view.php delete mode 100644 examples/view/common/foot.view.php delete mode 100644 examples/view/common/head.view.php delete mode 100644 examples/view/sysconf/default.view.php delete mode 100644 examples/view/sysconf/group.modal.view.php delete mode 100644 examples/view/sysconf/issue.modal.view.php delete mode 100644 examples/view/sysconf/message.modal.view.php delete mode 100644 examples/view/sysconf/pad.modal.view.php delete mode 100644 examples/view/sysconf/stage.modal.view.php delete mode 100644 examples/view/sysconf/user.modal.view.php diff --git a/examples/controller/auth.control.php b/examples/controller/auth.control.php deleted file mode 100644 index 5be1e4b..0000000 --- a/examples/controller/auth.control.php +++ /dev/null @@ -1,67 +0,0 @@ -action_signup($mod); - break; - - case "login": - $this->action_login($mod); - break; - - default: - $this->action_default($mod); - break; - } - } - - function action_default($mod) - { - $mod->deflt(); - include "view/auth/default.view.php"; - } - - function action_signup($mod) - { - $mod->signup($_REQUEST['input']); - $this->action_default($mod); - } - - function action_login($mod) - { - $mod->login($_REQUEST['input']); - $this->action_default($mod); - } -} - -?> diff --git a/examples/controller/dashboard.control.php b/examples/controller/dashboard.control.php deleted file mode 100644 index 40d3678..0000000 --- a/examples/controller/dashboard.control.php +++ /dev/null @@ -1,41 +0,0 @@ -action_default($mod); - } - - function action_default($mod) - { - $mod->deflt(); - include "view/dashboard/default.view.php"; - } -} - -?> diff --git a/examples/controller/deauth.control.php b/examples/controller/deauth.control.php deleted file mode 100644 index 5867168..0000000 --- a/examples/controller/deauth.control.php +++ /dev/null @@ -1,40 +0,0 @@ -action_default($mod); - } - - function action_default($mod) - { - $mod->deflt(); - } -} - -?> diff --git a/examples/controller/deleteacct.control.php b/examples/controller/deleteacct.control.php deleted file mode 100644 index 5dc91b5..0000000 --- a/examples/controller/deleteacct.control.php +++ /dev/null @@ -1,58 +0,0 @@ -action_delete($mod); - break; - - default: - $this->action_default($mod); - break; - } - } - - function action_default($mod) - { - $mod->deflt(); - include "view/deleteacct/default.view.php"; - } - - function action_delete($mod) - { - $mod->del($_REQUEST['input']); - $this->action_default($mod); - } -} - -?> diff --git a/examples/controller/except.control.php b/examples/controller/except.control.php deleted file mode 100644 index 8b5e1b5..0000000 --- a/examples/controller/except.control.php +++ /dev/null @@ -1,41 +0,0 @@ -action_default($mod, $message); - } - - function action_default($mod, $message) - { - $mod->deflt($message); - include "view/except/default.view.php"; - } -} - -?> diff --git a/examples/controller/sysconf.control.php b/examples/controller/sysconf.control.php deleted file mode 100644 index 6379d42..0000000 --- a/examples/controller/sysconf.control.php +++ /dev/null @@ -1,57 +0,0 @@ -action_save($mod); - break; - - default: - $this->action_default($mod); - break; - } - } - - function action_default($mod) - { - $mod->deflt(); - include "view/sysconf/default.view.php"; - } - - function action_save($mod) - { - $mod->save($_REQUEST['input']); - $this->action_default($mod); - } -} - -?> diff --git a/examples/form.class.php b/examples/form.class.php deleted file mode 100644 index 8bb6506..0000000 --- a/examples/form.class.php +++ /dev/null @@ -1,243 +0,0 @@ -textFields = array(); - $this->numbFields = array(); - $this->enumFields = array(); - - $this->errorlist = array(); - } - - /* - * Log an error - */ - function logError($str) - { - $this->errorlist[] = $str; - } - - /* - * Add new text field to the form - */ - function field_text($name, $deflt = null, $req = true) - { - if ($req !== true) - $req = false; - - $this->textFields[] = array( - 'name' => $name, - 'deflt' => $deflt, - 'req' => $req - ); - } - - /* - * Add new numeric field to the form - */ - function field_numeric($name, $min = null, $max = null, $deflt = null, $integer = true, $req = true) - { - if ($req !== true) - $req = false; - - if ($integer !== true) - $integer = false; - - $this->numbFields[] = array( - 'name' => $name, - 'min' => $min, - 'max' => $max, - 'deflt' => $deflt, - 'int' => $integer, - 'req' => $req - ); - } - - /* - * Add new enumeration field to the form - */ - function field_enum($name, $values, $deflt = null, $req = true) - { - if ($req !== true) - $req = false; - - $this->enumFields[] = array( - 'name' => $name, - 'vals' => $values, - 'deflt' => $deflt, - 'req' => $req - ); - } - - /* - * Add new boolean field to the form - */ - function field_bool($name) - { - $this->field_enum($name, array("1", "0"), "0"); - } - - /* - * Populate the form with input data from web page - */ - function populate($input) - { - /* detect duplicate names */ - $names = array(); - foreach ($this->textFields as $fld) - $names[] = $fld['name']; - foreach ($this->numbFields as $fld) - $names[] = $fld['name']; - foreach ($this->enumFields as $fld) - $names[] = $fld['name']; - - if (count(array_unique($names)) != count($names)) - { - $this->logError("Internal error: Duplicate field names defined in form"); - return false; - } - - /* init text fields */ - foreach ($this->textFields as $fld) - { - if (isset($input[$fld['name']]) && $input[$fld['name']] != "") - $this->{$fld['name']} = htmlEntities($input[$fld['name']], ENT_QUOTES); - - else if (!is_null($fld['deflt'])) - $this->{$fld['name']} = $fld['deflt']; - - else if ($fld['req']) - $this->logError($fld['name'] . " is required"); - } - - /* init numeric fields */ - foreach ($this->numbFields as $fld) - { - if (isset($input[$fld['name']]) && $input[$fld['name']] != "") - { - if (!is_numeric($input[$fld['name']])) - { - $this->logError($fld['name'] . " must be numeric"); - continue; - } - - if ($fld['int'] && (floor($input[$fld['name']]) != $input[$fld['name']])) - { - $this->logError($fld['name'] . " must be an integer"); - continue; - } - - if (!is_null($fld['min']) && ($input[$fld['name']] < $fld['min'])) - { - $this->logError($fld['name'] . " must be no less than " . $fld['min']); - continue; - } - - if (!is_null($fld['max']) && ($input[$fld['name']] > $fld['max'])) - { - $this->logError($fld['name'] . " must be no more than " . $fld['max']); - continue; - } - - $this->{$fld['name']} = $input[$fld['name']]; - } - - else if (!is_null($fld['deflt'])) - $this->{$fld['name']} = $fld['deflt']; - - else if ($fld['req']) - $this->logError($fld['name'] . " is required"); - } - - /* init enum fields */ - foreach ($this->enumFields as $fld) - { - if (isset($input[$fld['name']]) && $input[$fld['name']] != "") - { - if (array_search($input[$fld['name']], $fld['vals']) === false) - { - $this->logError($fld['name'] . " is not an appropriate value"); - continue; - } - - $this->{$fld['name']} = $input[$fld['name']]; - } - - else if (!is_null($fld['deflt'])) - $this->{$fld['name']} = $fld['deflt']; - - else if ($fld['req']) - $this->logError($fld['name'] . " is required"); - } - - /* return */ - return count($this->errorlist) == 0; - } - - /* - * Handle an uploaded file - */ - function saveFile($file, $maxsize, $allowed_mime, $path, $req = false) - { - if (isset($file) && !is_null($file)) - { - if ($file['error'] > 0) - { - if ($file['error'] != UPLOAD_ERR_NO_FILE) - $this->logError("An unknown error occurred"); - - return false; - } - - if ($file['size'] > $maxsize) - { - $this->logError("File must be no larger than " . $maxsize . " bytes"); - return false; - } - - if (is_array($allowed_mime) && array_search($file['type'], $allowed_mime) === false) - { - $this->logError("File type is not supported"); - return false; - } - - if (!move_uploaded_file($file['tmp_name'], $path)) - { - $this->logError("Error saving uploaded file"); - return false; - } - } - - else if ($req) - { - $this->logError("File upload is required"); - return false; - } - - return true; - } -} - -?> diff --git a/examples/index.php b/examples/index.php deleted file mode 100644 index 692756c..0000000 --- a/examples/index.php +++ /dev/null @@ -1,30 +0,0 @@ -handle($argv); -} - -main(explode("/", $_REQUEST['path'])); // Start rendering web page for the requested path. - -?> diff --git a/examples/model/sysconf.mod.php b/examples/model/sysconf.mod.php deleted file mode 100644 index cfbed42..0000000 --- a/examples/model/sysconf.mod.php +++ /dev/null @@ -1,93 +0,0 @@ -field_text("dbAddress"); - $form->field_text("dbName"); - $form->field_text("dbUser"); - $form->field_text("dbPass", null, false); - $form->field_enum("settSSL", array("force", "neither", "forbid")); - - if (!$form->populate($input)) - { - $this->logFormErrors($form); - return; - } - - /* test database connection (set global vars and try to get a db object) */ - $_SCROTT['conf'] = 'conf'; - $_SCROTT['dbEngine'] = 'mysql'; - $_SCROTT['dbAddress'] = $form->dbAddress; - $_SCROTT['dbName'] = $form->dbName; - $_SCROTT['dbUser'] = $form->dbUser; - $_SCROTT['dbPass'] = $form->dbPass; - - try - { - $db = $this->getDbConnection(); - } - catch (Exception $e) - { - $this->logError($e->getMessage()); - return; - } - - /* write file */ - $f = fopen($this->CONF_FILE, "w"); - - if (!$f) - { - $this->logError("Can not create configuration file"); - return; - } - - fwrite($f, "dbAddress . "';\n"); - fwrite($f, "\$_SCROTT['dbName'] = '" . $form->dbName . "';\n"); - fwrite($f, "\$_SCROTT['dbUser'] = '" . $form->dbUser . "';\n"); - fwrite($f, "\$_SCROTT['dbPass'] = '" . $form->dbPass . "';\n"); - fwrite($f, "\$_SCROTT['settSSL'] = '" . $form->settSSL . "';\n"); - fwrite($f, "?>\n"); - - fclose($f); - $this->redirectTo($this->ar() . "/"); - } -} - -?> diff --git a/examples/view/auth/default.view.php b/examples/view/auth/default.view.php deleted file mode 100644 index 9d4c9b4..0000000 --- a/examples/view/auth/default.view.php +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - Scrott - Not logged in - - - - - -
- noaccounts)) { ?> -
-

Almost there....

-

Scrott's configuration is working, but no user accounts exist.
Use the form below to signup as an admin.

-
It is presumed that you are the administrator for this Scrott install.
There is a security risk involved with exposing this page to the public!
-
- - -
-
-
-
- -
-
-
-
- -

Login

- -
- - -
- -
- - -
- -
- tabSwap) { ?> - - Signup - - - - -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
-
- -

Signup for Scrott

- -
- - -
- -
- - -
- -
- - -
- -
- tabSwap) { ?> - - Cancel - - - - -
-
-
-
-
- -
-
-
-
-
- - - - diff --git a/examples/view/common/foot.view.php b/examples/view/common/foot.view.php deleted file mode 100644 index 977ac04..0000000 --- a/examples/view/common/foot.view.php +++ /dev/null @@ -1,19 +0,0 @@ - - - diff --git a/examples/view/common/head.view.php b/examples/view/common/head.view.php deleted file mode 100644 index 76880a6..0000000 --- a/examples/view/common/head.view.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - diff --git a/examples/view/sysconf/default.view.php b/examples/view/sysconf/default.view.php deleted file mode 100644 index 90e5441..0000000 --- a/examples/view/sysconf/default.view.php +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - Scrott - System-level configuration missing - - - - - - - - - - - - - - -
-
-

-     -     -     -     -     - -

- -

Welcome to Scrott!

-
- -

You're seeing this page because the file "scrott.conf.php" is missing.
Please fill out the form below to create a config automatically!

-

Click the icons above to learn more about core Scrott features and constructs!

-
- -

This form will initialize Scrott's system-level configuration.
These are things the app needs before it can begin functioning at all!

-
It is presumed that you are the administrator for this Scrott install.
There is a security risk involved with exposing this page to the public!
- -
-
- -
-
-
-
- - Database Connection -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- - Application Installation -
- - -
Detected from location of files in web document root
-
- - Settings -
- -
- -
- -
- -
- -
- -
-
- - -
-
-
-
- -
-
-
-
- - - - diff --git a/examples/view/sysconf/group.modal.view.php b/examples/view/sysconf/group.modal.view.php deleted file mode 100644 index c0641d9..0000000 --- a/examples/view/sysconf/group.modal.view.php +++ /dev/null @@ -1,49 +0,0 @@ - - - diff --git a/examples/view/sysconf/issue.modal.view.php b/examples/view/sysconf/issue.modal.view.php deleted file mode 100644 index 694dd47..0000000 --- a/examples/view/sysconf/issue.modal.view.php +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/examples/view/sysconf/message.modal.view.php b/examples/view/sysconf/message.modal.view.php deleted file mode 100644 index 14cca2d..0000000 --- a/examples/view/sysconf/message.modal.view.php +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/examples/view/sysconf/pad.modal.view.php b/examples/view/sysconf/pad.modal.view.php deleted file mode 100644 index 2fbf26b..0000000 --- a/examples/view/sysconf/pad.modal.view.php +++ /dev/null @@ -1,68 +0,0 @@ - - - diff --git a/examples/view/sysconf/stage.modal.view.php b/examples/view/sysconf/stage.modal.view.php deleted file mode 100644 index 11e517f..0000000 --- a/examples/view/sysconf/stage.modal.view.php +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/examples/view/sysconf/user.modal.view.php b/examples/view/sysconf/user.modal.view.php deleted file mode 100644 index 034dc04..0000000 --- a/examples/view/sysconf/user.modal.view.php +++ /dev/null @@ -1,48 +0,0 @@ - - - -- cgit v1.2.3