I'm trying to implement my own password dialog according to the
instructions from chapter 61 of the language reference.
Unfortunately CHANGE CURRENT USER(3;"") doesn't change the user.
Though Validate password(3;"") says OK. CHANGE CURRENT USER doesn't
raise an error dialog, it just sets OK to 0. And that is all.
What could be wrong?
MacOSX, 4D 2004.3. I have set Designer as default user. Password is
blanc, user 3 is created by the Designer.
Koen
--------------------
Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Knesselare
Belgium
bvbaC...@telenet.be
I believe you have to have a valid password for the user, "blank" won't
do. Don't know if 4D, Inc considers this a security issue, or if its an
oversight.
Regards,
Scott Wirth
When I wrote my own password system I found that CHANGE CURRENT USER
changed the current user but only for the current process. I discovered
that one could actually have different current users for different
processes! I found that I had to store the current user in an
interprocess variable in order to achieve the functionality that made
sense to me.
David Baer
Oakland, CA
So in order to use any 4D password related commands (like User in
Group or Current User), you have to call CHANGE CURRENT USER for
every process you start?
Is this true in both 4D 2003.7 and 4D 2004?
----------------------------------------
Randy Jaynes
Management Software
On 24/03/06, Randy Jaynes <randy_...@joborder.com> wrote:
>
> So in order to use any 4D password related commands (like User in
> Group or Current User), you have to call CHANGE CURRENT USER for
> every process you start?
>
> Is this true in both 4D 2003.7 and 4D 2004?
--
Martin Miller - <http://www.AnotherSphere.net>
___________________________________________________________________
communications - infrastructure - database - 4D - MacOS
Thus CHANGE CURRENT USER should only be used during startup, or if
you close all active processes. Otherwise you'll end up with a mix of
"current users" in different processes.
If you're going to rollout your own password system you have 2 options:
- do it out of 4D's password system, and loose plugin access control
- do it within 4D's password system and then you have to do the
Change Current User trick during Startup
hth
julio
>
> afaik CHANGE CURRENT USER will set the new user for the current
> process and any new processes.
> Any existing active process will stay attached to whatever user was
> current when they started, which makes sense.
>
> Thus CHANGE CURRENT USER should only be used during startup, or if
> you close all active processes. Otherwise you'll end up with a mix of
> "current users" in different processes.
Ahh...I think I remember a discussion about this in the last few
months. This seems to be what I remember came out of that thread.
> If you're going to rollout your own password system you have 2
> options:
> - do it out of 4D's password system, and loose plugin access control
Actually, you lose a little more than this. Like in LOCKED
ATTRIBUTES, the user parameter is the user name from the 4D password
system. If there is no password system (ie roll your own), then
"Manager" is always returned.
HTH,
Randy
On 24/03/06, Randy Jaynes <randy_...@joborder.com> wrote:
> Actually, you lose a little more than this. Like in LOCKED
> ATTRIBUTES, the user parameter is the user name from the 4D password
> system. If there is no password system (ie roll your own), then
> "Manager" is always returned.
--
>
> In which case you could shadow your own rolled users with actual 4D
> users.
I got that impression out of the thread, too. I just haven't had the
time to test it to be sure.
That issue with LOCKED ATTRIBUTES has been a burr in my butt for a
while, but this issue with CHANGE CURRENT USER needing to be called
at startup or when starting every process means I have to think
through how to get this accomplished in our shell without causing
problems when distributing our OEM database.
I have a method that _is_ called at the start of every process, so I
think I could do it there, but not positive until I test.
It's on the list of things to do at some point...
Thanks for all your thoughts. I got it working now.
It looks as if to get the 4D password system working, at least the
Designer must have a password. I left the Administrator password
blank and set Administrator to be the default user. So no questions
asked (by 4D) when launching the application.
I was (and am) calling CHANGE CURRENT USER from the Startup method,
so this must be OK for the new processes which will be launched later
on.
Now I can show my own user/password dialog and change the 4D user
accordingly. This is how I can get control on the 4D Plugin usage etc.
Thanks.
Koen
Op 23-mrt-06, om 18:14 heeft Koen Van Hooreweghe het volgende
geschreven:
> I'm trying to implement my own password dialog according to the
> instructions from chapter 61 of the language reference.
> Unfortunately CHANGE CURRENT USER(3;"") doesn't change the user.
--------------------
>
> OK Guys,
>
> Thanks for all your thoughts. I got it working now.
>
> It looks as if to get the 4D password system working, at least the
> Designer must have a password. I left the Administrator password
> blank and set Administrator to be the default user. So no questions
> asked (by 4D) when launching the application.
>
> I was (and am) calling CHANGE CURRENT USER from the Startup method,
> so this must be OK for the new processes which will be launched later
> on.
>
> Now I can show my own user/password dialog and change the 4D user
> accordingly. This is how I can get control on the 4D Plugin usage etc.
Actually, based on the comments I remember, you don't have to assign
the designer a password.
If I understand this correctly, the 4D user access system is still
active, it just doesn't give you the built-in 4D password dialog.
So you can still add/remove/change users with the 4D commands (this
is what Martin Miller meant by 'shadow your own rolled users with
actual 4D Users), and you get to give ONLY your user/password dialog.
After you exit YOUR user/password dialog, you call CHANGE CURRENT
USER, and you're at the same point you are if you had used a designer
password.
Of course, if I'm wrong about needing a designer password, you could
probably bypass 4D's built-in dialog by assigning a default user.
Then you get right up to YOUR login dialog and call CHANGE CURRENT
USER afterward.
Either way I think you're okay. But no designer password probably
makes things easier.
HTH,
Randy
I just tried that. Cleared the Designer password. CHANGE CURRENT USER
stops working. No error is returned, OK is set to 0 and the user is
not changed.
So, my conclusion is you really need to set a Designer password.
Koen
Op 24-mrt-06, om 15:32 heeft Randy Jaynes het volgende geschreven:
> Actually, based on the comments I remember, you don't have to assign
> the designer a password.
--------------------