close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Restricting Pages

Thread began 9/21/2018 3:51 pm by dhagood355349 | Last modified 9/24/2018 2:52 pm by Ray Borduin | 42 views | 4 replies |

dhagood355349

Restricting Pages

So as you can tell, I'm hammering hard on this new MySQLi. Here is another one I cant figure out... Doesn't seem to matter how I apply MySQLi Restrict Access to a Page, it has no impact and doesn't redirect.

The code that is added, what am I missing?

if ($_SERVER["REQUEST_METHOD"] == "POST") {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "user";
$RestricAccessRedirect = "NoGo.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

Change the trigger to "before page load"... this would only restrict access if they submit a form first.

Sign in to reply to this post

dhagood355349

Restricting Pages

So that shouldn't even be used then. If use the Security Assist approach which works now since you sent me the new authentication file, the logout file gives this error when ran.

Warning: Invalid argument supplied for foreach() in /home/masked/public_html/Tools/logout.php on line 17

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Logged Out</title>
</head>

<body>
<?php
@session_start();
if ("" == ""){
// WA_ClearSession
$clearAll = TRUE;
$clearThese = explode(",","");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>
<div id="LogOutContainer" class="WAATK">
<h1>Log Out</h1>
You have successfully logged out. </div>
</body>
</html>

Sign in to reply to this post

Ray BorduinWebAssist

Can I get a url to reproduce and FTP access? The error implies that sessions aren't working properly, but you say the login works, so something odd is going on. I'd like to debug it to see what I find.

Sign in to reply to this post

dhagood355349

Logout

Ended up just creating my own

<?php


session_start()
session_destroy();
header("Location: ../index.php");
?>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...