14 Replies Latest reply on Sep 10, 2007 12:28 PM by Günter Schenk

    Unique User Login Areas

      Is it possible to create a user login and password, but when each user logs in, they only see content specifically for them? I know how to create user logins using ADDT but I'm not sure how to go about specific user login content. Any help would be great.
        • 1. Re: Unique User Login Areas
          Günter Schenk Level 4
          Hi,

          yes that´s possible, done that many times. Basically it would work this way:

          1. make sure the respective records contain an extra field (numeric) that´s storing the respective "kt_login_id" session variable -- when it comes to namimg this field, I prefer something like "record_owner". However, this approach will make sure that a certain record is getting allocated to a certain user.

          2. once all the table´s records do have a value set in the "record_owner" field, you should be able to use a query on the respective page that´s comparing the to-be-displayed records against the current session variable "kt_login_id" -- example:

          "SELECT * FROM your_table WHERE record_owner" equals the "kt_login_id" session variable

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Unique User Login Areas
            Hi. Forgive me for butting in. This is exactly what i am looking for.

            Can you clarify with more detail;

            1. make sure the respective records contain an extra field (numeric) that´s storing the respective "kt_login_id" session variable...

            Please explain in more detail. If you can walk me through this i think i will have no problem with point 2.

            Thankyou
            Gary
            • 3. Re: Unique User Login Areas
              Günter Schenk Level 4
              Hi Gary,

              you could simply do that by e.g. adding a hidden field (obviously named after the field´s name) to the "insert record" page which stores & inserts the session variable "kt_login_id" to make this record is getting assigned to a certain user ID -- means the hidden field´s "value" needs to be predefined by clicking on DW´s "bind to dynamic source" button and then "bind" it to the session variable "kt_login_id"

              Does this help ?

              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Unique User Login Areas
                Where do you place the "SELECT * FROM your_table WHERE record_owner" equals the "kt_login_id" session variable " code? I am lost on that one....
                • 5. Re: Unique User Login Areas
                  Günter Schenk Level 4
                  >>
                  Where do you place the "SELECT * FROM your_table WHERE record_owner" equals the "kt_login_id" session variable " code?
                  >>

                  I´d suggest adding this particular condition to your ADDT list -- here´s where the records need to be pre-filtered to just show stuff the current users actually "owns".

                  one example which would require you to load the ADDT list document and switch to Code view :: a typical list will (somewhere at the page´s top) contain a query like:

                  SELECT whatever FROM your_table WHERE {$NXTFilter_rsnews_content1} ORDER BY {$NXTSort_rsnews_content1}

                  within this query you should be able to add the above mentioned condition like this:

                  SELECT whatever FROM your_table WHERE {$NXTFilter_rsnews_content1} AND record_owner = '".$_SESSION['kt_login_id']."' ORDER BY {$NXTSort_rsnews_content1}

                  That´s how it always works for me

                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Unique User Login Areas
                    Level 1
                    Not exactly sure what you mean by the "ADDT list"... Sorry I am VERY new to ADDT.

                    Thank you
                    • 7. Re: Unique User Login Areas
                      Günter Schenk Level 4
                      Hi Scott,

                      >>
                      Not exactly sure what you mean by the "ADDT list"... Sorry I am VERY new to ADDT
                      >>

                      alright, then I´d better ask back -- what did you create with ADDT so far, and where respectively in what context do *you* need to...

                      >>
                      place the "SELECT * FROM your_table WHERE record_owner" equals the "kt_login_id" session variable " code
                      >>

                      ?

                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Unique User Login Areas
                        Level 1
                        I am too far ahead of myself I think. I am going to start from scratch and see where I end up. I am trying to make a database where the user can login and change their information only. I know how to set up an update page, but I cant figure out how a user can update their own.

                        Thanks Gunter!
                        • 9. Re: Unique User Login Areas
                          Günter Schenk Level 4
                          Hi Scott,

                          >>
                          I am too far ahead of myself I think
                          >>

                          I honestly had this impression too ;-)

                          >>
                          I know how to set up an update page, but I cant figure out how a user can update their own
                          >>

                          ah well, think I now understand the desired scenario -- in this case you won´t need to create any "records list" page anyway, but would just have to create a, say, "edit_mysettings.php" update page that´s containing the following query:

                          "SELECT * FROM user_table WHERE user_id" equals the Session Variable "kt_login_id"

                          Such an update page incl. the desired form elements can be easily built by applying ADDT´s "Update Record Form Wizard" to an empty PHP document

                          Günter Schenk
                          Adobe Community Expert, Dreamweaver
                          • 10. Re: Unique User Login Areas
                            (PaulCoates)
                            Scott,

                            Make a recordset

                            SELECT *
                            FROM Users
                            WHERE UserID = ParamUserID

                            In the Advanced section add a variable called ParamUserID

                            Variables

                            Name ParamUserID
                            Type Numeric
                            Default value -1
                            Runtime value $_SESSION['UserID']

                            You will then filter the data to the userID of the user who is logged in.

                            Paul
                            • 11. Re: Unique User Login Areas
                              HOW TO DO THAT????
                              How to let the user see some stuff what is specially crated for him, - I mean when user logon to his page he is seeing an information created specially for him.
                              I just cant get it, I've tried every thing even broke an notebook because of my nerves, but i cant create it, can any one please help. thank you very much.

                              im was created a database with table and columns with usre name , passwords, etc, i can make user logon but cant make them see a special text taken out from database wich is specialy created from them.
                              • 12. Re: Unique User Login Areas
                                Günter Schenk Level 4
                                Hi Gatis, <br /> <br />please don´t despair, we´re all here for you :-) <br /> <br />1. <br />&gt;&gt; <br />see a special text taken out from database wich is specialy created from them <br />&gt;&gt; <br /> <br />first of all :: make sure that the database table that´s containing the "created for them" column, also provides a secondary *numeric* column <i>(let´s call this one "user_id" for further reference)</i> which you´ll need for storing the respective user_id <i>(the one from your ADDT login table)</i> it should exclusively belong to -- I´m quite sure you did that already, but: better is better ;-) <br /> <br />2. as you probably already know, ADDT´s session variable "kt_login_id" will always be there for you to clearly identify the currently logged in user -- that said... <br /> <br />3. on the page that´s supposed to display the current user´s "created for them" text, you´ll first need to add a query which will grab the correct column for the currently logged in "user_id" -- means, a query like this one: <br /> <br />"SELECT special_text FROM your_table WHERE user_id" equals the session variable "kt_login_id" <br /> <br />4. Now that this is done, insert the "dynamic text" that´s related to this query <i>(from DW´s bindings panel)</i> at the desired position in your document, and... <br /> <br />5. highlight this "dynamic text" instance, and add Dreamweaver´s "Show If Recordset Is Not Empty" server behaviour to it -- because you´ll need to make sure that this content <i>(or the page section it´s been embedded in)</i> is only shown *if* the respective table column actually has some content. <br /> <br />6. please note: if the above mentioned session variable "kt_login_id" should not be detected on that page for whatever reason, you´ll need to manually add... <br /> <br /><?php<br />session_start();<br />?> <br /> <br />...at the very beginning of this page. <br /> <br />Cheers, <br />Günter Schenk <br />Adobe Community Expert, Dreamweaver <br /> <br />P.S. 1: <br /> <br />as you´re obviously a new ADDT user, I´d like to ask you to -- depending on your issue of course -- rather open a new thread than "hijacking" an existing one. After all your current issue is not really related to what´s been posted before, and a clear separation of threads will help everyone to spot your stuff later on <br /> <br />P.S. 2: <br /> <br />&gt;&gt; <br />even broke an notebook because of my nerves <br />&gt;&gt; <br /> <br />well, in case it will work the way I suggested -- would that mean you might be willing to send me a new notebook ? Just an idea :-)
                                • 13. Re: Unique User Login Areas
                                  Level 1
                                  As I understand ADDT means adobe dreamweaver developer toolbox, em I right? but there's a problem with that I have an dreamveawer version no 8 and I cant install that package on my computer, ADDT is created only for Dreamweaver CS3. is there any other posibilities to work with registered users?

                                  great thanks.
                                  • 14. Re: Unique User Login Areas
                                    Günter Schenk Level 4
                                    Hi Gatis,

                                    >>
                                    but there's a problem with that I have an dreamveawer version no 8 and I cant install that package on my computer, ADDT is created only for Dreamweaver CS3
                                    >>

                                    yeah, you´re in a somewhat "wrong" forum, and because of this I assumingly won´t be receiving a notebook from you - what a shame, lol :-)

                                    >>
                                    is there any other posibilities to work with registered users?
                                    >>

                                    Sure, you don´t need ADDT to create simple user logins -- that´s something you can also do with DW 8 and its native server behaviours such as "Log In User" (see "server behaviours" tab :: User Authentication).

                                    After applying DW´s "Log In User" - behaviour, DW will also be using several "side wide" session variables to help you identifying the user. These session variables *names* are different from what ADDT is using, but the general *procedure* I mentioned above (querying the database, checking against the login_id etc) will be pretty much the same for DW8.

                                    Cheers,
                                    Günter Schenk
                                    Adobe Community Expert, Dreamweaver