authorisationdb : remove all the sub-objects when removing one object
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1475 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -188,7 +188,7 @@ class authorizationdb extends authorization
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Remove the informations about an object
|
||||
/** Remove the informations about an object and all its sub-objects
|
||||
@param string $object Object path to drop
|
||||
@return TRUE or an exception with the error message */
|
||||
public function drop ($object)
|
||||
@@ -229,6 +229,7 @@ class authorizationdb extends authorization
|
||||
throw new Exception (_("Removing more than one object"), 412);
|
||||
if ($rc == 0)
|
||||
throw new Exception (_("No object removed"), 412);
|
||||
$rc = $this->db->delete ("$object$this->separator%");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -246,6 +247,7 @@ class authorizationdb extends authorization
|
||||
throw new Exception (_("Removing more than one object"), 412);
|
||||
if ($rc == 0)
|
||||
throw new Exception (_("No object removed"), 412);
|
||||
$rc = $this->db->delete ("$object$this->separator%");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -361,6 +363,7 @@ class authorizationdb extends authorization
|
||||
throw new Exception (sprintf (_("Object %s doesn't exists"), $object),
|
||||
400);
|
||||
$search = reset ($search);
|
||||
// TODO : Don't update if the user is not the owner of the file
|
||||
$this->db->update ($object, array ("modbits"=>$modbits));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user