I want to have an external script (totaly external from postnuke) which still requires users to be logged in and uses the pnAPI.
What do I need to include into this external script so that the following code will work? pnUserLoggedIn() function in particular.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mazdev responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 05:25 PM
- nestormateo responded to »Fillters in Clip« 06:33 AM
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 03:19 AM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Using external scripts with pn data
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
SO it's not going to be in the pnFrame at all? You need to include the pnapi.php for sure.
--
Home Page | Find on Facebook | Follow on Twitter
-
**unknown user**
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 1097
At root (but not very secure)
Code
<?php
include 'includes/pnAPI.php";
pnInit();
if (pnUserLoggedIn()) {
$username = pnUserGetVar('uname');
echo "Hi ".pnVarPrepForDisplay($username)." dude... And Welcome!!";
} else {
echo "Booou... !";
}
?>
;) -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 63
Thanks Chestnut...
I did have this script in a seperate folder including the pnAPI.php, I moved it to the PN-root folder (/html), however, I still get the following error
-------
Warning: Division by zero in /home/avalonse/public_html/html/test.php on line 3
Warning: main(PHP): failed to open stream: No such file or directory in /home/avalonse/public_html/html/test.php on line 3
Warning: main(): Failed opening 'PHP' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/avalonse/public_html/html/test.php on line 3
Fatal error: Call to undefined function: pninit() in /home/avalonse/public_html/html/test.php on line 4
-------
Line 3 is > include 'includes/pnAPI.php";
Line 4 is > pnInit();
obviously pnAPI.php doesn't like being included here for some reason beyond my comprehension. -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 63
is there another option of reading the user's cookie to find their user ID and then trace it back to their details in the DB?
I notice the session ID is encrypted however, probably to prevent doing things like this.
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
