Users questions

Author Message

Carlos Revillo

Thursday 29 September 2005 4:41:07 am

Hi. I'm working with ez User Module. I want guest accounts can edit their profile. i gave read and edit access to a 'secret' section to guest accounts. Now i have to questions.
1.- Why users cannot change their passwords?. I think it's a problem with permissions, but i don't wich function i need.
2.- I want users can cancel their accounts by themselves. I don't know if there is a function for that or if i have to develope another one...
thanks a lot

Ɓukasz Serwatka

Thursday 29 September 2005 5:43:52 am

Hi Carlos,

Ad.1

Give your user access to /user/password/ view. Go to User accounts->Roles and policies edit you role and add new police:
Module: user
Function: password
Limitations: No limitations

Ad.2

You can make simple form, pass data to your module and disable user account or delete it.

This code example will disable user.

include_once( 'kernel/classes/datatypes/ezuser/ezuser.php' );

$user =& eZUser::currentuser();
$contentObjectID = $user->attribute('contentobject_id');
$isEnabled = 0;
$userSetting =& eZUserSetting::create( $contentObjectID, $isEnabled );
$userSetting->store();

I hope this will help you.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Carlos Revillo

Thursday 29 September 2005 10:23:07 am

thanks a lot. your first answer works perfect for me. but i have problems with second one. let's see. what i'm doing is exactly the same proccess as ez.no site.
you click 'my profile', then 'edit profile' and you get the update form. but what i'm trying to do is add a 'cancel account' button to this last form. Now the question is which action i have to assing to that button, or maybe, how do i redirect the form to that script you tell me before. thanks again. sorry for my english.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.