From 9830d73b6819c4930bd96cc657b42aa3a10d8d66 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 16 Sep 2018 22:25:22 -0400 Subject: Remove old content --- examples/common.mod.php | 113 ---------------------------------- examples/root.control.php | 131 ---------------------------------------- examples/setting.modal.view.php | 130 +-------------------------------------- 3 files changed, 1 insertion(+), 373 deletions(-) diff --git a/examples/common.mod.php b/examples/common.mod.php index 6cba871..0d740ef 100644 --- a/examples/common.mod.php +++ b/examples/common.mod.php @@ -1,54 +1,5 @@ first_setting_tab_active = 0; - $this->first_setting_tab_disp = 0; - $this->common_handleFormSubmissions($_REQUEST['input'], $_FILES['attachment']); - - if (!is_null($guid)) - { - $this->obj = new DBObject($guid); - $this->owner = $this->obj->getOwner(); - $this->members = $this->obj->getMembers(); - } - - $this->common_deflt(); - } - /* * Default action */ @@ -83,41 +34,6 @@ class CommonModel extends MasterModel } } - /* - * Handle form submissions from common views - */ - function common_handleFormSubmissions($input, $attachment) - { - switch ($input['action']) - { - case "common-group-add": $this->addNewGroup($input); break; - case "common-setting-group": $this->saveSettingGroup($input, $attachment); break; - case "common-setting-user": $this->saveSettingUser($input, $attachment); break; - case "common-setting-admin": $this->saveSettingAdmin($input); break; - case "common-setting-allusers-adduser": $this->saveSettingAllusersAdduser($input); break; - case "common-setting-allusers-edituser": $this->saveSettingAllusersEdituser($input, $attachment); break; - case "common-setting-allusers-deluser": $this->saveSettingAllusersDeluser($input); break; - } - } - - /* - * Create a new user group - */ - function addNewGroup($input) - { - $form = new Form(); - $form->field_text("name"); - - if (!$form->populate($input)) - { - $this->logFormErrors($form); - return; - } - - $group = new Group(); - $group->createNewGroup($form->name, $this->getCurrentUser()); - } - /* * Save changes to user group settings */ @@ -465,33 +381,4 @@ class CommonModel extends MasterModel } } - /* - * Set CSS class for the first tab title in the setting modal only - */ - function getSettingModalTabActiveClass() - { - if (!$this->first_setting_tab_active) - { - $this->first_setting_tab_active = 1; - return "active"; - } - - return ""; - } - - /* - * Set CSS classes for the first tab in the setting modal only - */ - function getSettingModalTabDispClasses() - { - if (!$this->first_setting_tab_disp) - { - $this->first_setting_tab_disp = 1; - return "in active"; - } - - return ""; - } -} - ?> diff --git a/examples/root.control.php b/examples/root.control.php index 7e4d1ab..614ab33 100644 --- a/examples/root.control.php +++ b/examples/root.control.php @@ -1,87 +1,3 @@ -normalizeArgv($argv); - - try - { - /* Assert that the system config file exists and has been included */ - if (!$this->scrottConfExists()) - { - $ctrl = new Sysconf(); - $ctrl->handle($argv); - return; - } - - /* Assert we are running over HTTP(S), whichever is desired */ - switch ($_SCROTT['settSSL']) - { - case "force": $this->sec_require_https(); break; - case "forbid": $this->sec_forbid_https(); break; - default: - switch (Setting::settSSL()) - { - case "force": $this->sec_require_https(); break; - case "forbid": $this->sec_forbid_https(); break; - } - } - - /* Assert session IP */ - $this->sec_verify_ip(); - - /* Assert that a user is logged in */ - if (!$this->getCurrentUser()) - { - $ctrl = new Auth(); - $ctrl->handle($argv); - return; - } - - /* Handle page request */ - if (count($argv) == 0) - $ctrl = new Dashboard(); - - else - { - switch ($argv[0]) - { - case "logout": $ctrl = new Deauth(); break; case "deleteaccount": $ctrl = new Deleteacct(); break; default: /* Check if arg is an object guid */ @@ -96,50 +12,3 @@ class Root extends Controller /* No page to show for requested path */ throw new Exception("The requested path is not valid."); break; - } - } - - $ctrl->handle($argv); - } - - catch (Exception $e) - { - $ctrl = new Except(); - $ctrl->handle($e->getMessage()); - } - } - - /* - * Get a useful path string by normalizeing the $argv array received from the main function. - * This will remove directory names that appear in the $this->ar() string and the initial - * and trailing (if present) empty strings - */ - function normalizeArgv($argv) - { - $argv = array_values(array_filter($argv)); - $ar = array_values(array_filter(explode("/", $this->ar()))); - $i = 0; - $trunc = true; - - if (count($ar) == 0) - return $argv; - - foreach ($ar as $elem) - { - if ($elem != $argv[$i]) - { - $trunc = false; - break; - } - - $i++; - } - - if (!$trunc) - return $argv; - - return array_values(array_slice($argv, count($ar))); - } -} - -?> diff --git a/examples/setting.modal.view.php b/examples/setting.modal.view.php index 2217805..029b58b 100644 --- a/examples/setting.modal.view.php +++ b/examples/setting.modal.view.php @@ -1,147 +1,24 @@ - - - - -- cgit v1.2.3