Restrict Access to Page Using a password.php Instead of Server Behavior

I previously used "log in" and "restrict access to page" server behaviors for my client portal when I only had one client. I had my username and password stored in mySQL database. I recently have gained more clients that all needed to be redirected to their own customized landing page when logged in. Because of this, I used a password.php to store the usernames and passwords and to redirect to different pages. Now, I am wondering how I can restrict access to these pages (i.e. someone won't be able to access the pages by typing the url) since I will not be connecting to a database anymore.

I'm also confused by your statements.
>Now, I am wondering how I can restrict access to these pages
>(i.e.  someone won't be able to access the pages by typing the url)
>since I  will not be connecting to a database anymore.
It doesn't matter where you store the credentials - database or php file - the techniques for restricting access will be similar. I really don't understand why you moved away from the database when you got more clients. The more data you need to manage, the more reason to store it in a database.
After logging in, most sites direct users to the same page, yet pull user specific data from the database. If for some reason you can't do this and need to built individual pages for each client, then store the 'landing' page for the client in the php file or database. Restrict access to each page by comparing the logged in name with an allowed login name. Or a more dynamic approach would be to dynamically pass the page name to a database query that validates that it's ok for the logged in user to access.
Also, these questions are more appropriate for the app dev forum.

Similar Messages

  • Help! php Restrict Access to Page() in dw cs5 problem

    I have an admin.php page which takes me to other pages where i can update my info displayed on the website. All was working well until I added the restrict access to page behaviour. When i log in successfully, I am supposed to be taken to those update pages. If the log in is not successful, I am led back to the login page (the "restricted" page). However, even if I log in successfully, I am being taken to the "restricted" page when I try to access the update pages! I do not understand what is going wrong. Any help?

    anb_newbie wrote:
    I have a login page which either takes me to the update info page or will take me to the "restricted" page. The problem is even with a successful login, I am taken to the 'restricted' page.
    How do you know the login is successful? If you're taken to the restricted page, it means that the login failed.
    There doesn't appear to be anything wrong with the code you posted here. Possible reasons for the failure include getting the username or password wrong (they're usually case-sensitive). It's also possible that sessions haven't been enabled on your server, or that PHP can't write to the directory where sessions are stored.

  • Problem with Restrict Access to Page with access level using ASP

    I'm using Dreamweaver CS3 with ASP-VBScript and an Access
    database. The pages were created from scratch for this project,
    using those tools all the way through.
    I've created a login page, an admin homepage, and add, edit,
    and list records pages for three tables. The login page uses the
    Server Behavior "Log in User", all other pages use the Server
    Behavior "Restrict Access to Page". All of these are based on an
    Access Level.
    Login seems to work correctly, and redirects to the admin
    homepage. From the admin homepage, I can open any other page as
    expected, and they initially display correctly. On the add and edit
    pages, however,
    submitting the form often results in getting logged out, but
    not always.
    Once this happens, I can log back in, but other problems will
    sometimes occur during that second login session. Sometimes,
    logouts will occur on pages that worked fine during the first login
    session. Sometimes, another session variable that I've setup
    manually will change when it shouldn't...as if there were two
    values stored for my session variable, and reloading the page
    changes to the other value.
    This
    post seems closest to my experience, but it doesn't look like
    there was really an answer beyond "I had to fight with it for a bit
    to get it to work":
    I suspected that there is some problem with session settings
    on the server. We have an almost identical tool on the same server
    that was developed with an older version of DW that works more
    reliably; it sometimes has problems with the initial login, but
    never has a problem after that.
    Has anyone experienced problems like this? Any suggestions
    for what to check? I'm really pulling my hair out since it's so
    unreliable...the kind of problem that goes away when you try to
    show someone and comes back when they leave.

    Hello,
    I was thinking that all I would need would be the username, although username and paswsword would be more secure.  There are about 50 users and no groups or levels.  They are all equal ... same level.
    The website is private and there is a general content area for all users and then there will be private areas for each user where proprietary documents will be held.  I need to be able to ensure that user 'A' can only see the user 'A' pages, user 'B' can only see user 'B', etc.
    I don't really understand what the Dreamweaver script is doing, but the overview sounded like it was the right tool to accomplish what I'm trying to do.
    Any assistance greatly appreciated.
    thanks.

  • Restrict Access To Page Not Working with Different Auth Levels

    I have just started playing with the idea of using different auth levels to allow different users access to certain pages on my site.
    Within my SQL database I have a authlevel table consisting of 3 possible levels (guest, user, admin)
    I am using the Dreamweaver "Log in user" to log in users based on username, pass, and auth level and "Restrict access to page" set to allow user levels 'user' and 'admin'.
    The problem, however, occurs when trying to log in.  No matter what auth level I try I am redirected to my page where users should be redirected if they are not allowed to enter that page.
    I have included below my code from my login page and the page where all authorized users (user and admin) should be directed upon entering the restricted area.
    Login Page:
    <?php require_once('../Connections/hondovfd.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "authlevel";
      $MM_redirectLoginSuccess = "/membersonly/membersonly.php";
      $MM_redirectLoginFailed = "/membersonly/loginfailed.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_hondovfd, $hondovfd);
      $LoginRS__query=sprintf("SELECT username, password, authlevel FROM login WHERE username=%s AND password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $hondovfd) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        $loginStrGroup  = mysql_result($LoginRS,0,'authlevel');
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;          
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];    
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/phptemplate.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="Title" -->
    <title>Log In</title>
    <!-- InstanceEndEditable -->
    <meta name="description" content="Hondo Fire and Rescue serves the Arroyo Hondo and Canada Village areas of Santa Fe County, NM." />
    <meta name="keywords" content="hondo, hondo fire, hondo vfd, hondo fire department, santa fe county fire department, santa fe county, volunteer fire department, hondo volunteer fire department" />
    <link href="../stylesheet.css" type="text/css" rel="stylesheet" />
    <!--[if IE]>
    <style type="text/css">
    #mainContent, #sidebar1 { zoom: 1;}
    </style>
    <![endif]-->
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="thrColLiqHdr">
    <div id="container">
    <div id="header"></div>
      <div id="sidebar1">
      <h3>Navigation : </h3>
      <ul id="MenuBar1" class="MenuBarVertical">
      <li><a href="/index.php">Home</a></li>
    <li><a href="/support.php">Support Hondo</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Information Menu</a>
        <ul>
          <li><a href="/people.php">Our People</a></li>
          <li><a href="http://www.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=101620713606637979698.00045b6ead4ab4ea70b78&z=11" target="_blank">Response Area</a></li>
          <li><a href="/medical.php">Medical</a></li>
          <li><a href="/apparatus.php">Apparatus</a></li>
          <li><a href="/training.php">Training</a></li>
          <li><a href="/volunteer.php">Volunteer</a></li>
          <li><a href="/statistics.php">Statistics</a></li>
          <li><a href="/patchtrading.php">Patch Trading</a></li>
        </ul>
      </li>
      <li><a href="/album.php">Photo Gallery</a></li>
      <li><a href="/calendar.php">Calendar</a></li>
      <li><a href="/news.php">Blog/News</a></li>
      <li><a href="/links.php">Links</a></li>
      <li><a href="/contact.php">Contact Us</a></li>
    </ul>
    <br />
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <span class="lefttext">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="8567201">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </img></input></input>
      </span>
    </form>
    <span class="lefttext"><br />
    </span>
    <center>
      <span class="lefttext"><a href="http://www.facebook.com/pages/Santa-Fe-NM/Hondo-Volunteer-Fire-Department/74284233488" target="_blank" class="lefttext">Hondo VFD on Facebook</a></span>
    </center>
      <!-- end #sidebar1 --></div>
      <div id="sidebar2"> 
        <p><a href="/membersonly/login.php">Log In</a> | <a href="/membersonly/logout.php">Log Out</a></p>
        <p>Call Statistics for <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/month.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?> as of <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/date.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></p>
      <table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="60%">EMS Calls</td>
        <td width="40%"><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/emscalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
      <tr>
        <td>Fire Calls</td>
        <td><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/firecalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
    </table>
      <hr />
        <div id="cse" style="width:100%;">Loading</div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
      google.load('search', '1');
      google.setOnLoadCallback(function(){
        new google.search.CustomSearchControl().draw('cse');
      }, true);
    </script>
         <!-- End Google Search Element -->
      </div>
      <!-- end #sidebar2 -->
      <div id="mainContent">
      <div class="top"></div><div class="wrap"><!-- InstanceBeginEditable name="Main Content" -->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="47" class="h2">Members Only Login</td>
      </tr>
      <tr>
        <td><form ACTION="<?php echo $loginFormAction; ?>" id="login" name="login" method="POST">
        <table width="40%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="31%">Username:</td>
        <td width="69%"><input name="username" type="text" /></td>
      </tr>
      <tr>
        <td>Password</td>
        <td><input name="password" type="password" /></td>
      </tr>
    </table>
    <input name="Submit" type="submit" />
        </form></td>
      </tr>
    </table>
      <!-- InstanceEndEditable -->
    </div>
    <div class="bottom"></div>
    </div>
         <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <br class="clearfloat" />
      <div id="footer">
        <p align="center">&copy; Copyright 2009 Hondo Volunteer Fire Department | <a href="mailto:[email protected]">Contact Us</a><a href="http://www.legalhelpers.com/chapter-13-bankruptcy/chapter13.html"></a><br />Hosting provided by <a href="http://studiox.com/" target="_blank">Studio X</a></p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    <?php include_once("/var/home/hondovfd/hondovfd.org/www/analyticstracking.php"); ?>
    </body>
    <!-- InstanceEnd --></html>
    Other Page:
    <?php
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "user,admin";
    $MM_donotCheckaccess = "false";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && false) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "/membersonly/loginfailed.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
      $MM_referrer .= "?" . $QUERY_STRING;
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/phptemplate.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="Title" -->
    <title>Members Only Area</title>
    <!-- InstanceEndEditable -->
    <meta name="description" content="Hondo Fire and Rescue serves the Arroyo Hondo and Canada Village areas of Santa Fe County, NM." />
    <meta name="keywords" content="hondo, hondo fire, hondo vfd, hondo fire department, santa fe county fire department, santa fe county, volunteer fire department, hondo volunteer fire department" />
    <link href="../stylesheet.css" type="text/css" rel="stylesheet" />
    <!--[if IE]>
    <style type="text/css">
    #mainContent, #sidebar1 { zoom: 1;}
    </style>
    <![endif]-->
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="thrColLiqHdr">
    <div id="container">
    <div id="header"></div>
      <div id="sidebar1">
      <h3>Navigation : </h3>
      <ul id="MenuBar1" class="MenuBarVertical">
      <li><a href="/index.php">Home</a></li>
    <li><a href="/support.php">Support Hondo</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Information Menu</a>
        <ul>
          <li><a href="/people.php">Our People</a></li>
          <li><a href="http://www.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=101620713606637979698.00045b6ead4ab4ea70b78&z=11" target="_blank">Response Area</a></li>
          <li><a href="/medical.php">Medical</a></li>
          <li><a href="/apparatus.php">Apparatus</a></li>
          <li><a href="/training.php">Training</a></li>
          <li><a href="/volunteer.php">Volunteer</a></li>
          <li><a href="/statistics.php">Statistics</a></li>
          <li><a href="/patchtrading.php">Patch Trading</a></li>
        </ul>
      </li>
      <li><a href="/album.php">Photo Gallery</a></li>
      <li><a href="/calendar.php">Calendar</a></li>
      <li><a href="/news.php">Blog/News</a></li>
      <li><a href="/links.php">Links</a></li>
      <li><a href="/contact.php">Contact Us</a></li>
    </ul>
    <br />
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <span class="lefttext">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="8567201">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </img></input></input>
      </span>
    </form>
    <span class="lefttext"><br />
    </span>
    <center>
      <span class="lefttext"><a href="http://www.facebook.com/pages/Santa-Fe-NM/Hondo-Volunteer-Fire-Department/74284233488" target="_blank" class="lefttext">Hondo VFD on Facebook</a></span>
    </center>
      <!-- end #sidebar1 --></div>
      <div id="sidebar2"> 
        <p><a href="/membersonly/login.php">Log In</a> | <a href="/membersonly/logout.php">Log Out</a></p>
        <p>Call Statistics for <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/month.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?> as of <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/date.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></p>
      <table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="60%">EMS Calls</td>
        <td width="40%"><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/emscalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
      <tr>
        <td>Fire Calls</td>
        <td><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/firecalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
    </table>
      <hr />
        <div id="cse" style="width:100%;">Loading</div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
      google.load('search', '1');
      google.setOnLoadCallback(function(){
        new google.search.CustomSearchControl().draw('cse');
      }, true);
    </script>
         <!-- End Google Search Element -->
      </div>
      <!-- end #sidebar2 -->
      <div id="mainContent">
      <div class="top"></div><div class="wrap"><!-- InstanceBeginEditable name="Main Content" -->
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="47" class="h2">Members Only Area</td>
      </tr>
      <tr>
        <td><p><a href="/membersonly/documents.php">Useful Documents</a></p>
          <p><a href="/membersonly/IncidentCount01_08.pdf">Current Call Statistics</a> as of 9/3/09</p>
          </td>
      </tr>
    </table>
      <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script><!-- InstanceEndEditable -->
    </div>
    <div class="bottom"></div>
    </div>
         <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <br class="clearfloat" />
      <div id="footer">
        <p align="center">&copy; Copyright 2009 Hondo Volunteer Fire Department | <a href="mailto:[email protected]">Contact Us</a><a href="http://www.legalhelpers.com/chapter-13-bankruptcy/chapter13.html"></a><br />Hosting provided by <a href="http://studiox.com/" target="_blank">Studio X</a></p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    <?php include_once("/var/home/hondovfd/hondovfd.org/www/analyticstracking.php"); ?>
    </body>
    <!-- InstanceEnd --></html>

    you don't need all that bloat.  set a session during login of some kind of uniquely identifying id.  i.e.
    $_SESSION['id'] = $row_rs['id'];
    then on the pages you need to protect, check it like this....
    <?php
    session_start();
    if (!(isset($_SESSION['id']) && $_SESSION['id'] != '')) {
    die(header("Location: http://www.notinprotectedareas.com")); }
    ?>
    you can use an include file i.e.
    <?php require_once('login_check.php'); ?>
    where file is name login_check.php to make your auth controls clean on your protected pages.

  • Restrict Access to Page Issue...

    Hi this is my first time on Adobe forums, im regard myself as
    new to web design, im making my first proper website, for portfolio
    purposes. www.imaginationwebdesign.co.uk/port2 is the website..
    I am using Dreamweaver CS3 coding with HTML / PHP / MySQL
    My Issue:
    I have implemented Restrict Access to Page dependant upon
    User / Pass / Access Level.
    Access Levels are 1 and 3 and are stored on my MySQL
    Database.
    3 = Full Admin Rights
    1 = Minimal Admin Rights.
    Now, Whilst the Restrict access works, when Access Level 1
    attempts to display page only for Access Level 3, It's not
    redirecting to the "AccessDenied.php" page... instead a blank white
    page is being displayed and unless i press Back, it just stays
    blank and doesnt redirect.
    I have used the Server Behaviour Panel so the code is
    automatically generated but the source is:
    <?php
    if (!isset($_SESSION)) {
    session_start();
    $MM_authorizedUsers = "3";
    $MM_donotCheckaccess = "false";
    // *** Restrict Access To Page: Grant or deny access to this
    page
    function isAuthorized($strUsers, $strGroups, $UserName,
    $UserGroup) {
    // For security, start by assuming the visitor is NOT
    authorized.
    $isValid = False;
    // When a visitor has logged into this site, the Session
    variable MM_Username set equal to their username.
    // Therefore, we know that a user is NOT logged in if that
    Session variable is blank.
    if (!empty($UserName)) {
    // Besides being logged in, you may restrict access to only
    certain users based on an ID established when they login.
    // Parse the strings into arrays.
    $arrUsers = Explode(",", $strUsers);
    $arrGroups = Explode(",", $strGroups);
    if (in_array($UserName, $arrUsers)) {
    $isValid = true;
    // Or, you may restrict access to only certain users based
    on their username.
    if (in_array($UserGroup, $arrGroups)) {
    $isValid = true;
    if (($strUsers == "") && false) {
    $isValid = true;
    return $isValid;
    $MM_restrictGoTo = "AccessDeniedAdmin.php";
    if (!((isset($_SESSION['MM_Username'])) &&
    (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'],
    $_SESSION['MM_UserGroup'])))) {
    $MM_qsChar = "?";
    $MM_referrer = $_SERVER['PHP_SELF'];
    if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
    if (isset($QUERY_STRING) && strlen($QUERY_STRING)
    > 0)
    $MM_referrer .= "?" . $QUERY_STRING;
    $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar .
    "accesscheck=" . urlencode($MM_referrer);
    header("Location: ". $MM_restrictGoTo);
    exit;
    ?>
    any help would be great to get the redirection working...
    I've tried this on several pages and it still doesnt work.
    Thank you and sorry if this is posted in the wrong area.
    David.

    Davidbirkin wrote:
    > I finally managed to solve the issue.. although, to me
    it was a rather strange
    > issue..
    Strange to you, perhaps, but it's a very common issue.
    > Before the Validation to check for Access level i had
    this line of code...
    >
    > <?php require_once('Connections/con1.php'); ?>
    >
    > No, i have moved that line of code to appear AFTER the
    access level validation
    > check, and it's all working fine... maybe it's the order
    i added the dynamic
    > functions to the Page, but now it is working...
    As I said in my original reply, the problem was almost
    certainly caused
    by an error that you couldn't see because the display of
    errors is
    turned off for security reasons. The Restrict Access to Page
    server
    behavior uses session_start(), which must come before there
    is any
    output to the browser. "Output" includes new lines or
    whitespace outside
    PHP tags. There is almost certainly an extra line at the end
    of
    con1.php, which would prevent the session from starting. In
    turn, that
    would generate an error, resulting in your blank page.
    The problem is closely related to the "headers already sent"
    error
    message that confuses most PHP beginners. Read about it here:
    http://docs.php.net/manual/en/function.header.php
    By the way, it sounds as though you are testing everything on
    a remote
    server, rather than testing locally before deploying to a
    remote server.
    That's a very bad idea, particularly if the display of errors
    is turned
    off. You should test files in a safe, local environment with
    error
    reporting turned to the highest level, and eliminate all
    errors before
    deploying to a live server. If you're testing locally, make
    sure that
    error_reporting in php.ini is set to E_ALL, and that
    display_errors is on.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • ToJSONString Showing Up in Restrict Access to Page List

    Working in DW CS3 with ADDT using PHP and MySQL. I'm having a issue which I don't think I had before when I use the Restrict Access to Page server behavior. I'm working with user access levels pulled from the 'levels' field in my database and everything appears to be working as expected. I can select any number of available integers to restrict access to those pages. However, I've noticed that if I go back to edit that list of access levels, a new entry appears below the last integer in the list called "toJSONString". (toJSONString does not show up when I initially add the server behavior, only if I go back in to change it).
    I did a quick search and turned up this info:"The JSONString interface allows a toJSONString() method so that a class can change the behavior of JSONObject.toString(), JSONArray.toString(), and JSONWriter.value(Object). The toJSONString method will be used instead of the default behavior of using the Object's toString() method and quoting the result." Unfortunately, I don't understand any of that.
    I don't know why toJSONString is showing up in the list and if I should be concerned. (Mac OS 10.5.5; DW CS3 (v( Build 3481] and ADDT 1.0.0)

    tyler4iq wrote:
    > OK. I'm trying to authenticate users through a log in
    page, but it always fail.
    It's a known bug in MX 2004:
    http://friendsofed.infopop.net/2/OpenTopic?a=tpc&s=989094322&f=8033053165&m=324102421
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Is it possible to resrict access to pages to members/password-holders?

    Is it possible to resrict access to pages to members/password-holders?  How do I set up a membership application form/password entry form to my site?

    You can browse the Firefox source code online via the MXR and DXR websites than easily allows to search for data and possibly backtrack code changes to bugs via the annotations.
    The Password Manager has this chrome URL in Firefox;
    chrome://passwordmgr/content/passwordManager.xul
    A search for this file on MXR for the release branch:
    *http://mxr.mozilla.org/mozilla-release/source/toolkit/components/passwordmgr/content/passwordManager.xul
    The latest code is on mozilla-central
    You need an archive manager that can handle tar.bz2 archive files to access the source code locally.<br />
    You can look at 7-zip if you do not have one.
    * http://www.7-zip.org/

  • How do I set the PATH to use ImageMagick under PHP on my Server?

    Hi,
    I have the ImageMagick binaries installed. They are working in the terminal.
    But when I try to use it out of a php script on the webserver, it cant find the DYLD_LIBRARY_PATH.
    The manual says:
    Set the MAGICK_HOME environment variable to the path where you extracted the ImageMagick files. For example:
    export MAGICK_HOME="$HOME/ImageMagick-6.3.7"
    If the bin subdirectory of the extracted package is not already in your executable search path, add it to your PATH environment variable. For example:
    export PATH="$MAGICK_HOME/bin:$PATH"
    Set the DYLD_LIBRARY_PATH environment variable:
    export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"
    I can do all this in the Terminal, but how and where do I set it, that it also works with the scripts on the webserver?
    Thanks and Regards,
    JO

    Joachim,
    I have not tested any of this but...
    If you are just using the default Mac OS X Server install of Apache and the PHP module, then Apache's path is /usr/bin:/bin:/usr/sbin:/sbin (when running under the user:group=www:www). Basically, if the server is running under that user and PHP inherits the basic PATH of that user's shell, then anything linked into those directories should be available to the scripts, i.e. link your ImagMagick bin and lib paths into /usr 's directories. See 'man ln' in Terminal. User www doesn't have a defined shell, though, so I don't know where the PATH comes from.
    Alternatively, you might be able to use Apache's env_module (on by default) to manipulate the PATH environment variable in a config file. See Apache's manual on environment variables.
    Another means is to utilize 'suexec' in Apache and switch the user:group of CGI execution, etc. to a actual user with a definable .bash_profile (or whatever shell you are using). There are security concerns with this. See Apache's manual on suexec. You may want to also consider compiling PHP as CGI.
    BTW: the new version of PHP has some new experimental native ImageMagick libraries built in. I assume it looks for the binaries in the usual places and/or may need to be compiled with their paths during ./configure.
    Larry

  • Problems with PHP and MySQLi server behaviors

    Hi,
    I'm a graphic and Web-designer with some knowledge of PHP and MySQL and I've been using Dreaweaver since very early ages in creating dynamic web projects and use the Bindings and Server behaviors quite a lot. But recently PHP has deprecated MySQL_connect since 2012 and it seems Dreamweaver isnt suporting the alternative MYSQLi server behaviors which will be the future of accessing Databases in MySQL along side with other options. Without this feature Dreamweaver is not of any use to us web-designers, since there are many Free great Editing software out there... Is the Dreamweaver team solving this problem? Or are you really planning on dropping this software? I've been using CS5.5 for a while and was planning on updating but this is a key feature and without it its not worth the investment.
    Kind regards.
    Eddy

    heduino wrote:
    Hi,
    I'm a graphic and Web-designer with some knowledge of PHP and MySQL and I've been using Dreaweaver since very early ages in creating dynamic web projects and use the Bindings and Server behaviors quite a lot. But recently PHP has deprecated MySQL_connect since 2012 and it seems Dreamweaver isnt suporting the alternative MYSQLi server behaviors which will be the future of accessing Databases in MySQL along side with other options. Without this feature Dreamweaver is not of any use to us web-designers, since there are many Free great Editing software out there... Is the Dreamweaver team solving this problem? Or are you really planning on dropping this software? I've been using CS5.5 for a while and was planning on updating but this is a key feature and without it its not worth the investment.
    Kind regards.
    Eddy
    There are no plans that I know of to introduce a new set of mysqli server behaviours into DW from Adobe. They have left that to  thrid party developers to bring out extensions which replace them.
    What the server behaviours could do was very limiting anyway so I suspect any replacement mysqli behaviours would also be very limiting. I personally jumped into thre code and started to write my own mysqli connection files and query strings by watching a few simple tutorials on youtube - it isnt that difficult.
    Look for 'php academy' on youtube - they have about 9 simple to follow tutorials on getting started with mysqli.

  • PHP, ASP, CFM Server Behavior Code Output in DW 8- CS3- CS4

    Is there any major differences in the SB code output in CS4 vs CS3 or 8?  I am debating buying CS4, but have heard code is essentially the same output when using the PHP, CFM and ASP server behaviors.  I essentially only use DW for the pre-built SB dynamic functions as I write my own HTML and CSS. I can hand code if needed in DW8, but wanted to check with the experts on the code output of both versions.  Is there any major difference?

    Thanks David.  I may wait for CS5 then to see if any new features in Server Behaviors set of actions.  I should hand code more, but the DW server behaviors are great for a quick basic website.  I just worry they wont work completely with new versions of CFM and PHP to come.

  • Restrict access to page in Dreamweaver MX 2004 PHP

    OK. I'm trying to authenticate users through a log in page,
    but it always fail.
    I have a index.php, which ask for username and password. It
    checks for username password in a MySQL table.
    Then I have update.php, once authenticated users can update
    some data on a form, and submit changes.
    When I enter wrong username/pass, it goes straight to
    error.php, which is good.
    When I enter correct username/pass, it goes to
    ....error.php?accesscheck=%2.....
    Thanks so much.

    tyler4iq wrote:
    > OK. I'm trying to authenticate users through a log in
    page, but it always fail.
    It's a known bug in MX 2004:
    http://friendsofed.infopop.net/2/OpenTopic?a=tpc&s=989094322&f=8033053165&m=324102421
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Block/Restrict access request page on CUP

    Hi All,
    I've an interesting requirement.
    We use a CUP 5.3 SP7. We would be using the IDM webservices to create access requests to CUP and we want all our requests to be initiated ONLY through our IDM solution. Is there a way we can restrict the /AE/index.jsp  page access to only the users with a AEAdmin role? (Assuming the Admins follow the rules !!!)
    I've succeeded in taking out the Create Request and Copy Request from the AEApprover role mby adjusting the UME actions, but the same user can still access the  /AE/index.jsp  page to create a request.
    Any insight/work around is greatly appreciated.
    Thanks & Regards,
    Anil

    Anil,
    You can edit the index_left_nav.jsp page on the GRC server to disable the request access link on the Index page. To achieve this open the index_left_nav.jsp page and comment the whole tr and th lines containing the following words.
    LocaleUtil.getLabel(AELabels.LBL_IDX_NAV_REQUESTACCESS
    Commenting is done by the following characters <!--- and --->.
    - Naveen

  • Restrict access to pages

    Hi all.
    My adf application web consists on three pages, one of them has a region with a bounded task flow.
    There are to points to enter in the page, one for the admin, another for the users. This boths pages must be visible from the outside.
    http://localhost:7101/MyApp/faces/login.jspx.
    http://localhost:7101/MyApp/faces/admin.jspx.
    If somebody writes this url`s, the pages will be loaded.
    When a user is logged in, the other page is loaded with his info in Session.
    http://localhost:7101/MyApp/faces/main.jspx.
    The problem is that if I write the url:
    http://localhost:7101/MyApp/faces/main.jspx.
    it is also loaded, and it cannot be loaded because the user must be logged in.
    The ideal feature is if some user writes this url in the navigator and the user is not logged in, the application loads by default
    http://localhost:7101/MyApp/faces/login.jspx.
    Any help please?
    Thanks a lot
    Edited by: user13038749 on 07-oct-2011 0:59

    ifyou are trying to access a pagefragment from a bounded taskflow then you dont have to worry about the user login... if in the bounded taskflow the user will be asked to login when he is not safe to use the page.
    if you are not havign a bounded taskflow and you want to restrict the access to the page then you have to give the security for that particular page in the jazn-data.xml to authenticated-role to view the page..

  • Creating restricted access to webpages using dreamweaver

    Im using dreamweaver and i want to make some of my pages restricted, ive gone through the adobe walkthroughs but there isn't an option to create server behaviours. Is there a way around this?

    Hello Ben,
    in addition to Mark's hint: If you do it of yourself you have to deal with these ".htaccess" and ".htpasswd" files. I didn't struggle to write them of myself, I used the provider's (ISP) service. The advantage is, that the two files (.htaccess and .htpasswd) are created simultaneously and systemconform.
    You too will find this offer, I am sure, at your provider's website. See screenshot of mine ("Passwortschutz" is something like "password protection).
    Hans-G.

  • Problem accessing HTML pages using Tomcat 4

    I am very new to programming. I have created an html file (ThreeParamsForm.html) and placed it in development directoy. I am unsure of how to access that file. When i am typing http://localhost/ThreeParamsForm.html it is giving me HTTP Status 404 error. I have tried using servlets in similar way it is working fine. Please help.....

    did you include the port number if other than 80 ?
    i.e. http:\\localhost:8080\whatever

Maybe you are looking for

  • Pening GR List.....Any report Available

    Dear Gurus, Client is asking as of date, how many GR are pending for Invoice Verification...Can we get the list in SAP. PLease guide. Regards, Venkat

  • Just updated adobe pro 9.5.1

    I did the update to pro 9.5.1.  Now I can not print, or resave files on my external hard drive... i get this error mess: The file may be read only, or another user may have it open.  Please save the file with a different name or in a different folder

  • Can't configure servers in cf Builder using coldfusion as MultiServer

    I have coldfusion 9 installed as MultiServer in mac OS 10.6. I'm usisng Apache 2.2 I access each instances using apache virtual host. No matter witch WebServer port I configured when adding a new server in CF Builder it always start the cfusion insta

  • Firefox 3.66 and Flash 10.1.53.64 Crash Constantly

    Ever since the install it crashes constantly.. sometimes it could go for awhile with no problems, other times like tonight it'll crash like 6 times in 2 minutes. Doesn't seem to be a certain website either. Could be YouTube, could be MySpace, could b

  • Printing sales order details using adobe forms

    hi all, i need to print the sales order header and the respective item details using the adobe form.my requirement is to print the header on each and every page. for suppose my header is say '1' it contains 20 item details,and the page can hold 15 it