diff options
| author | Malf Furious <m@lfurio.us> | 2016-01-01 16:58:34 -0500 | 
|---|---|---|
| committer | Malf Furious <m@lfurio.us> | 2016-01-01 16:58:34 -0500 | 
| commit | 03dd6556041ec11efe86f36d53db38c02d4362a7 (patch) | |
| tree | e2565c1e1dc7ba5de7342b7b6199d970c60dae94 /app | |
| parent | c36269f976cb8287f1b6e17d4b0a958e4e9741da (diff) | |
| parent | 0a92a484554f214d0e499c872807e6b0a3e865ad (diff) | |
| download | scrott-03dd6556041ec11efe86f36d53db38c02d4362a7.tar.gz scrott-03dd6556041ec11efe86f36d53db38c02d4362a7.zip | |
Merge branch 'datastructures' into dev
Diffstat (limited to '')
| -rw-r--r-- | app/class/externuser.class.php | 26 | ||||
| -rw-r--r-- | app/class/framework.class.php | 2 | ||||
| -rw-r--r-- | app/class/group.class.php | 20 | ||||
| -rw-r--r-- | app/class/issue.class.php | 28 | ||||
| -rw-r--r-- | app/class/message.class.php | 26 | ||||
| -rw-r--r-- | app/class/pad.class.php | 26 | ||||
| -rw-r--r-- | app/class/setting.class.php | 28 | ||||
| -rw-r--r-- | app/class/stage.class.php | 25 | ||||
| -rw-r--r-- | app/class/user.class.php | 30 | 
9 files changed, 210 insertions, 1 deletions
| diff --git a/app/class/externuser.class.php b/app/class/externuser.class.php new file mode 100644 index 0000000..8f5c9d0 --- /dev/null +++ b/app/class/externuser.class.php @@ -0,0 +1,26 @@ +<?php + +require_once "class/object.class.php"; + +/* + * Non-application users + */ +class ExternUser extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        $cols = array( +            "guid", +            "email", +            "emailConfKey" +        ); + +        parent::__construct("extern-user", $cols); +        $this->loadObj($guid); +    } +} + +?> diff --git a/app/class/framework.class.php b/app/class/framework.class.php index eea6c25..d1293de 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -50,7 +50,7 @@ abstract class Framework      /*       * Get or create the app's database connection object (this is a singleton object and dependent on system-level config)       */ -    function getDbConnection() +    static function getDbConnection()      {          global $_SCROTT; diff --git a/app/class/group.class.php b/app/class/group.class.php new file mode 100644 index 0000000..2f3af40 --- /dev/null +++ b/app/class/group.class.php @@ -0,0 +1,20 @@ +<?php + +require_once "class/object.class.php"; + +/* + * User groups + */ +class Group extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        parent::__construct(); +        $this->loadObj($guid); +    } +} + +?> diff --git a/app/class/issue.class.php b/app/class/issue.class.php new file mode 100644 index 0000000..90a095c --- /dev/null +++ b/app/class/issue.class.php @@ -0,0 +1,28 @@ +<?php + +require_once "class/object.class.php"; + +/* + * Pad issues + */ +class Issue extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        $cols = array( +            "guid", +            "number", +            "assignee", +            "unread", +            "desc" +        ); + +        parent::__construct("issue", $cols); +        $this->loadObj($guid); +    } +} + +?> diff --git a/app/class/message.class.php b/app/class/message.class.php new file mode 100644 index 0000000..d39bea8 --- /dev/null +++ b/app/class/message.class.php @@ -0,0 +1,26 @@ +<?php + +require_once "class/object.class.php"; + +/* + * User messages and log messages + */ +class Message extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        $cols = array( +            "guid", +            "author", +            "message" +        ); + +        parent::__construct("message", $cols); +        $this->loadObj($guid); +    } +} + +?> diff --git a/app/class/pad.class.php b/app/class/pad.class.php new file mode 100644 index 0000000..335ef63 --- /dev/null +++ b/app/class/pad.class.php @@ -0,0 +1,26 @@ +<?php + +require_once "class/object.class.php"; + +/* + * Scrott pads + */ +class Pad extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        $cols = array( +            "guid", +            "stage", +            "nextIssueNumber" +        ); + +        parent::__construct("pad", $cols); +        $this->loadObj($guid); +    } +} + +?> diff --git a/app/class/setting.class.php b/app/class/setting.class.php new file mode 100644 index 0000000..ea5fac3 --- /dev/null +++ b/app/class/setting.class.php @@ -0,0 +1,28 @@ +<?php + +require_once "class/framework.class.php"; + +/* + * Scrott administrative settings + */ +class Setting extends Framework +{ +    /* +     * Helper function for getting setting values from the database +     */ +    static function getValue($key) +    { +        $db = parent::getDbConnection(); +        $escdKey = $db->esc($key); + +        $query = "SELECT `value` FROM `setting` WHERE `key` = '" . $escdKey . "'"; +        $res = $db->query($query); + +        if (count($res) == 0) +            return false; + +        return $res[0]['value']; +    } +} + +?> diff --git a/app/class/stage.class.php b/app/class/stage.class.php new file mode 100644 index 0000000..a2dfba5 --- /dev/null +++ b/app/class/stage.class.php @@ -0,0 +1,25 @@ +<?php + +require_once "class/object.class.php"; + +/* + * Pad stages + */ +class Stage extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        $cols = array( +            "guid", +            "stage" +        ); + +        parent::__construct("stage", $cols); +        $this->loadObj($guid); +    } +} + +?> diff --git a/app/class/user.class.php b/app/class/user.class.php new file mode 100644 index 0000000..8ef91ae --- /dev/null +++ b/app/class/user.class.php @@ -0,0 +1,30 @@ +<?php + +require_once "class/object.class.php"; + +/* + * Application users + */ +class User extends Object +{ +    /* +     * Constructor +     */ +    function __construct($guid = null) +    { +        $cols = array( +            "guid", +            "key", +            "salt", +            "alias", +            "email", +            "emailConf", +            "emailConfKey" +        ); + +        parent::__construct("user", $cols); +        $this->loadObj($guid); +    } +} + +?> | 
