]> dev.renevier.net Git - syp.git/blobdiff - inc/db/anydb.php
web interface to add co-administrators
[syp.git] / inc / db / anydb.php
index bb80032a274eb3e4b898728f24f80c2e3c29b394..596561cbc9027c15f89cbaf51aae9b1b000046b6 100644 (file)
@@ -10,10 +10,11 @@ class feature {
     private $title = null;
     private $description = null;
     private $date = 0;
+    private $user = null;
 
     const err_lonlat_invalid = 1;
 
-    function __construct ($id, $lon, $lat, $imgpath, $title, $description, $date) {
+    function __construct ($id, $lon, $lat, $imgpath, $title, $description, $date, $user) {
         $this->imgpath = $imgpath;
 
         // id
@@ -30,6 +31,9 @@ class feature {
         // date
         $this->date = $date;
 
+        // user
+        $this->user = $user;
+
         // longitude
         if (!isset ($lon) || !is_numeric ($lon) ||
              ($lon < -180) || ($lon > 180)) {
@@ -90,10 +94,12 @@ interface anydbConnection {
     public function create_items_table();
 
     /*
-     * set password $pwd for user $usrname. If $usrname does not exist, create
-     * it.
+     * set password $pwd for user $usrname. 
+     * If $usrname does not exist:
+     *    - if $create_if_not_exists is true: create user.
+     *    - if $create_if_not_exists is false: throws an err_query error.
      */
-    public function setpwd($usrname, $pwd);
+    public function setpwd($usrname, $pwd, $create_if_not_exists);
 
     /*
      * check that $pwd_md5 is md5 for $username password.
@@ -118,9 +124,10 @@ interface anydbConnection {
     public function getfeature($id);
 
     /*
-     * returns an array of available features
+     * returns an array of features managed by $user. If $user is undefined or
+     * if user is "admin", return all available features.
      */
-    public function listfeatures();
+    public function listfeatures($user);
 
     /*
      * returns the most recent features sorted by date. If $num_features is not
@@ -133,14 +140,6 @@ interface anydbConnection {
      */
     public function imgpath_exists($imgpath);
 
-    /*
-     * returns Minimum Bounding Rectangle containing all feature locations.
-     * That function must return a result even if database is not functional.
-     * Minimum Bounding Rectangle is presented as an Array:
-     *      [bottom, left, top, right]
-     */
-    public function mbr();
-
     /*
      * get name of database backend
      */