CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Adding a new global variable to my Help Desk App

Print topic Send  topic

Author Message
Barry G. Sumpter
Posted: 05/10/2002, 12:37 AM

Hi all,

I'd like to give access to multiple users of my application to my Bug
Tracking.

I want to limit their access depending on their Site.

I currently have 5 sites but expect many, many more.

I need to add SiteID to Common.asp (I think).

And be able to use it like User_ID.
On any page at any time.

Any help would be appreciated.

Thanks heaps,
Barry G. Sumpter

Frank Rocco
Posted: 05/10/2002, 3:31 AM

>>"Barry G. Sumpter" <bsumpter@bigpond.net.au> wrote in message
news:abftbf$jem$1@news.codecharge.com...<<
Barry,

I would define a session variable when the user logs in.
Modify the login page for custom events, lookup their site id
and store it to a session variable like this.
Session("Site_ID") = DLookup("table","Site_ID","User_ID=" &
Session("UserID"))

HTH

Frank


Barry G. Sumpter
Posted: 05/13/2002, 12:10 AM

Hi Frank,

Its not happening.

Any thoughts on how to use Site_ID after placing this code in the custom
event?

baz

"Frank Rocco" <farocco@hotmail.com> wrote in message
news:abg7ij$6l6$1@news.codecharge.com...
> >>"Barry G. Sumpter" <bsumpter@bigpond.net.au> wrote in message
>news:abftbf$jem$1@news.codecharge.com...<<
> Barry,
>
> I would define a session variable when the user logs in.
> Modify the login page for custom events, lookup their site id
> and store it to a session variable like this.
> Session("Site_ID") = DLookup("table","Site_ID","User_ID=" &
> Session("UserID"))
>
> HTH
>
> Frank
>
>
>

Frank Rocco
Posted: 05/13/2002, 4:43 AM

Barry,

Look at the code below, let me know if this fails.

Frank

'-------------------------------
sLogin = GetParam("Login")
sPassword = GetParam("Password")
bPassed = CLng(DLookUp("", "count(*)", " =" & ToSQL(sLogin, "Text") &
" and =" & ToSQL(sPassword, "Text")))

if bPassed > 0 then
'-------------------------------
' Login and password passed
'-------------------------------
Session("UserID") = sLogin
' add begin
Session("Site_ID") = DLookup("table","Site_ID","User_ID=" &
Session("UserID"))
' add end
if not(sPage = request.serverVariables("SCRIPT_NAME")) and
not(isEmpty(sPage)) then
cn.Close
Set cn = Nothing
response.redirect(sPage & "?" & sQueryString)
end if
cn.Close
Set cn = Nothing
response.redirect(".asp")
else
sForm1Err = "Login or Password is incorrect."
end if


Barry G. Sumpter
Posted: 05/14/2002, 3:07 AM

Hi Frank,

Not sure where we're coming from here.

No hints as to what page/form/module event to put this.

Have you retrieved this from working project?
Or am I just testing some code thats been hacked out?

I'm really not interested in chasing down scripting bugs.

I'm interested in producing quality products.

I've spent enough time trying to get multiple samples
I know work as stand alone examples, to work together
in a single project.

I need proven code not trial and error script.

Thanks anyway,
Barry G. Sumpter




"Frank Rocco" <farocco@hotmail.com> wrote in message
news:abo8sp$5j8$1@news.codecharge.com...
> Barry,
>
> Look at the code below, let me know if this fails.
>
> Frank
>
> '-------------------------------
> sLogin = GetParam("Login")
> sPassword = GetParam("Password")
> bPassed = CLng(DLookUp("", "count(*)", " =" & ToSQL(sLogin, "Text")
&
> " and =" & ToSQL(sPassword, "Text")))
>
> if bPassed > 0 then
> '-------------------------------
> ' Login and password passed
> '-------------------------------
> Session("UserID") = sLogin
> ' add begin
> Session("Site_ID") = DLookup("table","Site_ID","User_ID=" &
> Session("UserID"))
> ' add end
> if not(sPage = request.serverVariables("SCRIPT_NAME")) and
> not(isEmpty(sPage)) then
> cn.Close
> Set cn = Nothing
> response.redirect(sPage & "?" & sQueryString)
> end if
> cn.Close
> Set cn = Nothing
> response.redirect(".asp")
> else
> sForm1Err = "Login or Password is incorrect."
> end if
>
>
>

Frank Rocco
Posted: 05/14/2002, 5:13 AM

Barry,

When I get to work today, I'll put a small project together and send it to
you.

Frank

Barry G. Sumpter
Posted: 05/14/2002, 5:56 AM

Thanks Frank,

What a champion!

If I can get it to work we can share it with the other CodeCharge users.

Thanks,
baz

"Frank Rocco" <farocco@hotmail.com> wrote in message
news:abqv1e$a5i$1@news.codecharge.com...
> Barry,
>
> When I get to work today, I'll put a small project together and send it to
> you.
>
> Frank
>
>


   


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

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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