]> dev.renevier.net Git - syp.git/blobdiff - inc/db/anydb.php
err_lonlat_invalid exceptions not thrown correctly
[syp.git] / inc / db / anydb.php
index 596561cbc9027c15f89cbaf51aae9b1b000046b6..ca61b0f3135877af1c96737f6d9b2f2be8259e94 100644 (file)
@@ -37,14 +37,14 @@ class feature {
         // longitude
         if (!isset ($lon) || !is_numeric ($lon) ||
              ($lon < -180) || ($lon > 180)) {
-            throw new Exception ($this->err_lonlat_invalid);
+            throw new Exception (self::err_lonlat_invalid);
         }
         $this->lon = $lon;
 
         // latitude
         if (!isset ($lat) || !is_numeric ($lat) ||
              ($lat < -90) || ($lat > 90)) {
-            throw new Exception ($this->err_lonlat_invalid);
+            throw new Exception (self::err_lonlat_invalid);
         }
         $this->lat = $lat;
     }
@@ -94,12 +94,16 @@ interface anydbConnection {
     public function create_items_table();
 
     /*
-     * 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.
+     * returns true if $usrname is name of an existing user, false otherwise.
      */
-    public function setpwd($usrname, $pwd, $create_if_not_exists);
+    public function user_exists ($usrname);
+
+    /*
+     * set password $pwd for user $usrname. If $usrname does not exist, create
+     * it.
+     * throws an err_query error in case $pwd is null
+     */
+    public function setpwd($usrname, $pwd);
 
     /*
      * check that $pwd_md5 is md5 for $username password.