summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-07-21 00:25:49 -0400
committerMalf Furious <m@lfurio.us>2018-07-21 00:25:49 -0400
commit8924aabba1c3427250a07910c05028c53db07871 (patch)
tree1f0fe4b32a31272ba07446353c9c8f1d89b0bed1 /examples
parent7349f221c65b4f52c58efff444399b7d0cf368f6 (diff)
downloadscrott-8924aabba1c3427250a07910c05028c53db07871.tar.gz
scrott-8924aabba1c3427250a07910c05028c53db07871.zip
Remove old content
Diffstat (limited to 'examples')
-rw-r--r--examples/model/auth.mod.php115
-rw-r--r--examples/model/dashboard.mod.php29
-rw-r--r--examples/model/deauth.mod.php31
-rw-r--r--examples/model/except.mod.php30
-rw-r--r--examples/model/master.mod.php56
-rw-r--r--examples/model/obj.mod.php30
-rw-r--r--examples/view/dashboard/default.view.php27
-rw-r--r--examples/view/except/default.view.php47
-rw-r--r--examples/view/master/foot.view.php29
-rw-r--r--examples/view/master/topp.view.php62
10 files changed, 0 insertions, 456 deletions
diff --git a/examples/model/auth.mod.php b/examples/model/auth.mod.php
deleted file mode 100644
index 000db95..0000000
--- a/examples/model/auth.mod.php
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-require_once "model/common.mod.php";
-require_once "class/user.class.php";
-require_once "class/form.class.php";
-require_once "class/setting.class.php";
-
-class AuthModel extends CommonModel
-{
- /*
- * Default action
- */
- function deflt()
- {
- $userTbl = new User();
-
- if (count($userTbl->getAllUsers_orderByName()) == 0)
- {
- $this->noaccounts = true;
- $this->activeTab['signup'] = "in active";
- $this->tabSwap = false;
- }
-
- else
- {
- $this->activeTab['login'] = "in active";
- $this->tabSwap = Setting::allowPublicSignup();
- }
- }
-
- /*
- * Attempt to register a new account
- */
- function signup($input)
- {
- $userTbl = new User();
-
- if (!Setting::allowPublicSignup() && count($userTbl->getAllUsers_orderByName()) > 0)
- {
- $this->logError("You may not signup at this time");
- return;
- }
-
- $form = new Form();
- $form->field_text("username");
- $form->field_text("password", null, false);
- $form->field_text("cPassword", null, false);
-
- if (!$form->populate($input))
- {
- $this->logFormErrors($form);
- return;
- }
-
- if ($form->password != $form->cPassword)
- {
- $this->logError("Passwords do not match");
- return;
- }
-
- $user = new User();
-
- if (!$user->createNewUser($form->username, $form->password))
- {
- $this->logError("Your requested username is already in use");
- return;
- }
-
- $this->setCurrentUser($user);
- $this->redirectTo($this->ap() . "/");
- }
-
- /*
- * Attempt to login
- */
- function login($input)
- {
- $form = new Form();
- $form->field_text("username");
- $form->field_text("password", null, false);
-
- if (!$form->populate($input))
- {
- $this->logFormErrors($form);
- return;
- }
-
- $user = new User();
-
- if (!($user->initByUsername($form->username) && $user->validatePassword($form->password)))
- {
- $this->logError("Username or password is incorrect");
- return;
- }
-
- $this->setCurrentUser($user);
- $this->redirectTo($this->ap() . "/");
- }
-}
-
-?>
diff --git a/examples/model/dashboard.mod.php b/examples/model/dashboard.mod.php
deleted file mode 100644
index 00fb759..0000000
--- a/examples/model/dashboard.mod.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-require_once "model/common.mod.php";
-
-class DashboardModel extends CommonModel
-{
- /*
- * Default action
- */
- function deflt()
- {
- }
-}
-
-?>
diff --git a/examples/model/deauth.mod.php b/examples/model/deauth.mod.php
deleted file mode 100644
index 8991606..0000000
--- a/examples/model/deauth.mod.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-require_once "class/model.class.php";
-
-class DeauthModel extends Model
-{
- /*
- * Default action
- */
- function deflt()
- {
- $this->setCurrentUser();
- $this->redirectTo($this->ar() . "/");
- }
-}
-
-?>
diff --git a/examples/model/except.mod.php b/examples/model/except.mod.php
deleted file mode 100644
index fb81315..0000000
--- a/examples/model/except.mod.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-require_once "model/master.mod.php";
-
-class ExceptModel extends MasterModel
-{
- /*
- * Default action
- */
- function deflt($message)
- {
- $this->message = $message;
- }
-}
-
-?>
diff --git a/examples/model/master.mod.php b/examples/model/master.mod.php
deleted file mode 100644
index 5aaafa8..0000000
--- a/examples/model/master.mod.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-require_once "class/model.class.php";
-
-class MasterModel extends Model
-{
- /*
- * Get the appropriate alert class to use when showing the notice modal
- */
- function getNoticeModalAlertClass()
- {
- if ($this->isError())
- return "alert-danger";
-
- if ($this->isWarning())
- return "alert-warning";
-
- if ($this->isNotice())
- return "alert-info";
-
- return "";
- }
-
- /*
- * Get the appropriate glyphicon to use when showing the notice modal
- */
- function getNoticeModalGlyphicon()
- {
- if ($this->isError())
- return "glyphicon glyphicon-remove-sign";
-
- if ($this->isWarning())
- return "glyphicon glyphicon-exclamation-sign";
-
- if ($this->isNotice())
- return "glyphicon glyphicon-info-sign";
-
- return "";
- }
-}
-
-?>
diff --git a/examples/model/obj.mod.php b/examples/model/obj.mod.php
deleted file mode 100644
index 159c962..0000000
--- a/examples/model/obj.mod.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-require_once "model/common.mod.php";
-
-class ObjModel extends CommonModel
-{
- /*
- * Constructor
- */
- function __construct($guid)
- {
- parent::__construct($guid);
- }
-}
-
-?>
diff --git a/examples/view/dashboard/default.view.php b/examples/view/dashboard/default.view.php
deleted file mode 100644
index caf78da..0000000
--- a/examples/view/dashboard/default.view.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
--->
-
-<!DOCTYPE html>
-
-<html lang="en">
- <head>
- <?php include "view/common/head.view.php"; ?>
- <title>Scrott - Dashboard</title>
- </head>
-
- <body>
- <?php include "view/common/topp.view.php"; ?>
- <?php include "view/common/foot.view.php"; ?>
- </body>
-</html>
diff --git a/examples/view/except/default.view.php b/examples/view/except/default.view.php
deleted file mode 100644
index 01cf123..0000000
--- a/examples/view/except/default.view.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
--->
-
-<!DOCTYPE html>
-
-<html lang="en">
- <head>
- <?php include "view/master/head.view.php"; ?>
- <title>Scrott - Application Exception</title>
-
- <style type="text/css">
- body { padding-top: 50px; }
- </style>
- </head>
-
- <body>
- <?php include "view/master/topp.view.php"; ?>
-
- <div class="container">
- <div class="jumbotron text-center">
- <h1>Scrott derped</h1>
- <h5>System internals reported this:</h5>
-
- <div class="well well-sm text-danger">
- <h3><?=$mod->message?></h3>
- </div>
-
- <a href="<?=$mod->ar()?>/" class="btn btn-primary btn-lg">
- <span class="glyphicon glyphicon-pencil"></span> Go to Scrott Dashboard
- </a>
- </div>
- </div>
-
- <?php include "view/master/foot.view.php"; ?>
- </body>
-</html>
diff --git a/examples/view/master/foot.view.php b/examples/view/master/foot.view.php
deleted file mode 100644
index 6279b05..0000000
--- a/examples/view/master/foot.view.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-?>
-
-<script type="text/javascript" src="<?=$mod->ar()?>/assets/js/jquery.min.js"></script>
-<script type="text/javascript" src="<?=$mod->ar()?>/assets/js/bootstrap.min.js"></script>
-<script type="text/javascript" src="<?=$mod->ar()?>/assets/js/scrott.js"></script>
-
-<?php if ($mod->isError() || $mod->isWarning() || $mod->isNotice()) { ?>
- <script type="text/javascript">
- $(window).load(function() {
- $("#noticeModal").modal("show");
- });
- </script>
-<?php } ?>
diff --git a/examples/view/master/topp.view.php b/examples/view/master/topp.view.php
deleted file mode 100644
index 9a0b0fe..0000000
--- a/examples/view/master/topp.view.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-
-/*
- * SCROTT Copyright (C) 2016 Malf Furious
- *
- * Scrott is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation, either version 3 of the License,
- * or (at your option) any later version.
- *
- * Scrott is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- */
-
-?>
-
-<?php if ($mod->isError() || $mod->isWarning() || $mod->isNotice()) { ?>
- <div id="noticeModal" class="modal fade" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
-
- <div class="modal-body alert <?=$mod->getNoticeModalAlertClass()?>" style="margin: 0;">
- <h1 class="text-center"><span class="<?=$mod->getNoticeModalGlyphicon()?>"></span></h1>
- <h5 class="text-center">Something Happened</h5>
-
- <?php if ($mod->isError()) { ?>
- <p>
- <?php foreach ($mod->errorlist as $err) { ?>
- <span class="label label-danger">Error</span> <?=$err?><br />
- <?php } ?>
- </p>
- <?php } ?>
-
- <?php if ($mod->isWarning()) { ?>
- <p>
- <?php foreach ($mod->warninglist as $warn) { ?>
- <span class="label label-warning">Warning</span> <?=$warn?><br />
- <?php } ?>
- </p>
- <?php } ?>
-
- <?php if ($mod->isNotice()) { ?>
- <p>
- <?php foreach ($mod->noticelist as $note) { ?>
- <span class="label label-info">Notice</span> <?=$note?><br />
- <?php } ?>
- </p>
- <?php } ?>
-
- <div class="text-center">
- <button type="button" class="btn btn-default" data-dismiss="modal">
- <span class="glyphicon glyphicon-ok"></span> Got it
- </button>
- </div>
- </div>
-
- </div>
- </div>
- </div>
-<?php } ?>