php8
[web.mtrack] / MTrackWeb / Projects.php
index e69de29..744b274 100644 (file)
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ *
+ * public facing.. listing projects..
+ * and selecting active project..
+ *
+ * GET -> list of projects
+ * POST -> set active project..
+ * 
+ * 
+ */
+
+require_once 'MTrackWeb.php';
+
+class MTrackWeb_Projects extends MTrackWeb
+{
+    
+    //function getAuth-- inherit
+    var $authUserArray;
+    
+    function get($pi='') {
+        
+        
+        $kv = $this->userProjects();
+        $ret = array();
+        foreach($kv as $k=>$v) {
+            $ret[] = array('id'=>$k, 'name' => $v);
+        }
+        $this->jdata($ret); 
+        
+    }
+     
+    /**
+     *
+     * Things that can change...
+     * - permission updates 
+     *
+     */
+    function post($id)
+    {
+          if (isset($id)) {
+            $this->currentProject($id);
+            return $this->jok($this->currentProject());
+        }
+        
+        
+        
+    }
+     
+    
+    
+    
+}
\ No newline at end of file