X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=inc%2Fdb%2Fanydb.php;h=1094365eb42a6201d99bdd0e851427d096e60977;hp=bb80032a274eb3e4b898728f24f80c2e3c29b394;hb=939514b912738c5784b04a0d207db1afd918eb69;hpb=e4a4e5149d55cf01a86f26392c52fdca803654ce diff --git a/inc/db/anydb.php b/inc/db/anydb.php index bb80032..1094365 100644 --- a/inc/db/anydb.php +++ b/inc/db/anydb.php @@ -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)) { @@ -89,9 +93,14 @@ interface anydbConnection { */ public function create_items_table(); + /* + * returns true if $usrname is name of an existing user, false otherwise. + */ + public function user_exists ($usrname); + /* * set password $pwd for user $usrname. If $usrname does not exist, create - * it. + * it */ public function setpwd($usrname, $pwd); @@ -118,9 +127,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 +143,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 */