This topic is locked

Get user in own page

11/8/2007 10:41:35 AM
PHPRunner General questions
T
tobeseuser author

Hi

I would like to use some own created pages in the same directory where I would like to get the current user or if no user is logged in redirect to log in page and back again.
Is this possible? And how <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6760&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' /> if it's doable.
Best Regards

Tommy

Sergey Kornilov admin 11/8/2007

You can insert the following code snippet in the beginning of your own PHP page:

<?php

if(!@$_SESSION["UserID"] || !CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Edit"))

{

$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];

header("Location: login.php?message=expired");

return;

}

?>
T
tobeseuser author 11/9/2007

Thx, I'll have a llok at that. What's the best solution if you then would like to add some own menu items to the generated menu?
Best Regards

Tommy

Sergey Kornilov admin 11/9/2007

I guess you can do this in Visual Editor.