Announcement

Collapse
No announcement yet.

Users See own school Data

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Users See own school Data

    Hello

    I have an application consisting of grids and forms for multiple schools, students, staff and infrastructure. When i a user logs in, they should only be able to see data from their own school. The school ID is a foreign key in all tables

    how do i achieve this?

  • #2
    Add the schoolid to the user table, so when a user logs in you know which school he belongs to. Apply it to a global variable, i.e. [glob_schoolid]. Then on each and every form/grid etc. where you need to apply this add the following to the sql statement:

    and where schoolID='[glob_schoolid]'

    That will filter the right data for the user.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hello Albert

      Thanks for the precise and clear guidance. However, when i implement as stated above. I log in and the user cant see any data.

      Is there something i missed? maybe in the select statement?
      Attached Files

      Comment


      • #4
        Hello Albert

        Thanks for the short and concise instructions. However when my user logs in, they see no data.

        Am i missing anything in the select statement or anywhere?
        Attached Files

        Comment


        • #5
          The login is not right since glob_school should be assigned with the school value. It has nothing now.
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment


          • #6
            Hello Albert,

            While i understand your response, The login is not right since glob_school should be assigned with the school value. It has nothing now.

            I am not sure how to implement it to get my desired results.

            Would it be possible to help me re-write my query so that it can function as required?

            Thanks a bunch for your time and assistance.


            i

            Comment


            • #7
              Originally posted by jetlii
              I have an application comprising of frameworks and structures for different schools, understudies, staff and foundation. When i a client sign in, they ought to just have the capacity to see information from their own particular school. The school ID is an outside key in all tables


              How do i implement this? Please give me the syntax

              I wrote out my code in the login app as shown in the previous posts, but i seem to miss out something. Albert gave further direction, but i still cant seem to figure it out.

              Please assist

              Comment


              • #8
                Originally posted by cmugarura View Post



                How do i implement this? Please give me the syntax

                I wrote out my code in the login app as shown in the previous posts, but i seem to miss out something. Albert gave further direction, but i still cant seem to figure it out.

                Please assist

                aducom told you. Your fault is you are not assigning to the global app to be used by the others applications.
                You miss somethins like:

                [whathevernameforyourglobalschoolvar] = {rs[0][2]};

                Remember to set [whathevernameforyourglobalschoolvar] to OUT in Global Variables
                /Giuseppe

                Professional Scriptcase Services
                Some Customers opinions

                Comment


                • #9
                  Thanks for aducom and @Gui for the very excellent instructions and assistance in fixing this. Its working perfectly fine now. If only paid support could be as helpful.

                  Comment


                  • #10
                    Originally posted by cmugarura View Post
                    Thanks for aducom and @Gui for the very excellent instructions and assistance in fixing this. Its working perfectly fine now. If only paid support could be as helpful.
                    Stay tuned to next days 8D
                    /Giuseppe

                    Professional Scriptcase Services
                    Some Customers opinions

                    Comment

                    Working...
                    X