CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 User Password Management

Print topic Send  topic

Author Message
Henryk

Posts: 63
Posted: 02/27/2008, 6:57 AM

I feel kind of silly, and I have searched these forums a bazillion times without finding anything that works, but here is my problem. I have a member information page. I want to be able to make it so that an admin (group 3) or the member whose record it is, can change the password, but no one else.

I have tried panels and show-hide on before show events (show hide on the submit button and show hide on the form), both of which I managed to do wrong since it did not work. If someone wouldn't mind giving me a stupid friendly description of how to fix that, I would be immensely grateful.

My apologies in advance because from reading the forums and my familiarity with ccs, it would seem to me like it is a straightforward task, yet I just can't seem to grasp it.
View profile  Send private message
DonB
Posted: 02/27/2008, 7:46 AM

Before Show event of the submit button:

show/hide the button on the condition:

$Component->Visible = ((CCGroupID() == <your admin group>) || (CCGetUserID()
== <fieldname>)) ? true : false;

the fieldname is from your record, something like
$Container->DataSource->UserID->GetValue(). That's got to be worked out
based on your specific form, I'm not able to give the correct reference.
Just put an 'echo' statement in the button BeforeShow and display the value
to be sure you have it correctly specified.

--
DonB



"Henryk" <Henryk@forum.codecharge> wrote in message
news:547c57a42d461a@news.codecharge.com...
>I feel kind of silly, and I have searched these forums a bazillion times
>without
> finding anything that works, but here is my problem. I have a member
> information
> page. I want to be able to make it so that an admin (group 3) or the
> member
> whose record it is, can change the password, but no one else.
>
> I have tried panels and show-hide on before show events (show hide on the
> submit button and show hide on the form), both of which I managed to do
> wrong
> since it did not work. If someone wouldn't mind giving me a stupid
> friendly
> description of how to fix that, I would be immensely grateful.
>
> My apologies in advance because from reading the forums and my familiarity
> with
> ccs, it would seem to me like it is a straightforward task, yet I just
> can't
> seem to grasp it.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

Henryk

Posts: 63
Posted: 02/27/2008, 8:15 AM

So I would create a before show event on the button, and use custom code (pasting the text you posted)? Or is that a value inserted under a parameter using the show-hide?
View profile  Send private message
DonB
Posted: 02/27/2008, 9:02 AM

The event. Not just pasting the code, substituting your correct data values
after you do.

--
DonB



"Henryk" <Henryk@forum.codecharge> wrote in message
news:547c58c9fc0d9a@news.codecharge.com...
> So I would create a before show event on the button, and use custom code
> (pasting the text you posted)? Or is that a value inserted under a
> parameter
> using the show-hide?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Henryk

Posts: 63
Posted: 02/27/2008, 9:09 AM

Thank you Don. I will give it a shot later on today and hopefully return with a boisterous show of gratitude :)
View profile  Send private message
Henryk

Posts: 63
Posted: 03/03/2008, 7:44 AM

I feel really dumb, but I can't seem to get the userid side of it to work. For some reason it does not seem to pass the userid from the form into the events. The ccgetuserid is pulling fine, and the the groupid works like a champ, but I just can not seem to figure out what I am doing wrong with simply pulling the userid which is a hidden field in the form.

The field is userid (all lowercase) and I am adding custom code on before show event. The code is in a page called maint_events.php I am so sorry to bother folks with what to me seems like a dumb error I am making or some simple option I am overlooking.

Do I need to declare userid somewhere as a global?
View profile  Send private message
Henryk

Posts: 63
Posted: 03/06/2008, 8:03 AM

Would it help if I posted the events.php code?
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/06/2008, 8:41 AM

Yes please do, so we can count the number of equal signs used in the condition. Kidding always good to post code here


_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.