summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/class/externuser.class.php26
-rw-r--r--app/class/framework.class.php2
-rw-r--r--app/class/group.class.php20
-rw-r--r--app/class/issue.class.php28
-rw-r--r--app/class/message.class.php26
-rw-r--r--app/class/pad.class.php26
-rw-r--r--app/class/setting.class.php28
-rw-r--r--app/class/stage.class.php25
-rw-r--r--app/class/user.class.php30
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);
+ }
+}
+
+?>