Change own password (with low permission)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Change own password (with low permission)

This post has NOT been accepted by the mailing list yet.
Dear Community

I'm trying to set up a script, where a user can change his own password. Im trying to solve this problem with the following code:

$user = $gdata->retrieveUser($username);
$user->login->password = $newPassword;
$user = $user->save();

When I run my script and log in as a google apps super-administrator, that code perfectly does what it's supposed to do.

But if I log in as a normal user, I get the following error:

Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 500 Internal Error' in /home/.....

So my question is, if there is any possibility to change his own password without being a super-administrator..?
If no, I would have to create a big security-hole in my script.

Thank you everybody for your help!