summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-07 20:26:26 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-08 23:22:07 -0700
commitf67bfd099296602f60d48914ae4b09d65b0ad8d3 (patch)
treee3a42fa6ef0fbfa9b5fb7b91f1bb24eb70319239 /modules
parent2a5a3098018ca6f5a765a35c2dc9c66f277fad2e (diff)
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 b3211cb2a8282556d410c91771baeb764d47ed10)
Diffstat (limited to 'modules')
-rw-r--r--modules/user/controllers/users.php9
-rw-r--r--modules/user/helpers/user.php2
2 files changed, 6 insertions, 5 deletions
diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php
index 4ad704f0..07c5a457 100644
--- a/modules/user/controllers/users.php
+++ b/modules/user/controllers/users.php
@@ -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();
}
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index 6ae9203d..432994d6 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -25,7 +25,7 @@
*/
class user_Core {
static function get_edit_form($user) {
- $form = new Forge("users/$user->id?_method=put", "", "post", array("id" => "g-edit-user-form"));
+ $form = new Forge("users/update/$user->id", "", "post", array("id" => "g-edit-user-form"));
$form->set_attr("class", "g-narrow");
$group = $form->group("edit_user")->label(t("Edit User: %name", array("name" => $user->name)));
$group->input("full_name")->label(t("Full Name"))->id("g-fullname")->value($user->full_name);