Change the users.php controller so its no longer restful. The problem with our approach to restfulness is that it assumes that the resource will be found in the gallery database. It may well be there, but in the case of using plugable drivers for users management, there are no guarantees that it is in our database or it could be in a ldap directory. So it was just easier to remove the restfulness and just call user::lookup instead.

(cherry picked from commit b3211cb2a8)
This commit is contained in:
Tim Almdal
2009-10-07 20:26:26 -07:00
parent 2a5a309801
commit f67bfd0992
2 changed files with 6 additions and 5 deletions

View File

@@ -17,10 +17,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Users_Controller extends REST_Controller {
protected $resource_type = "user";
class Users_Controller extends Controller {
public function update($id) {
$user = user::lookup($id);
public function _update($user) {
if ($user->guest || $user->id != user::active()->id) {
access::forbidden();
}
@@ -57,7 +57,8 @@ class Users_Controller extends REST_Controller {
}
}
public function _form_edit($user) {
public function form_edit($id) {
$user = user::lookup($id);
if ($user->guest || $user->id != user::active()->id) {
access::forbidden();
}