close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

limiting access

Thread began 12/19/2016 11:36 am by Jamie | Last modified 12/26/2016 7:59 pm by Ray Borduin | 137 views | 12 replies |

Jamie

limiting access

Hey Ray

On the attached page, just wondering how I do the following:

1. limit access based on $_SESSION['UserGroupID'] = $row_WADAlogins['UserID']
2. If the Password field is changed and updated, how would I show a message like 'password changed successfully'?

Thanks

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

1) You can hand code it:

php:
<?php

if ($_SESSION['UserGroupID'] != $row_WADAlogins['UserID']) {
  
header("location: accessDenied.php");
  die();
}
?>



2) You should be able to pass a url parameter or set a session variable when the password is changed and check for it in an IF statement to show a message.

Sign in to reply to this post

Jamie

thanks Ray

1) how would I modify it to include Admin or would it be better to do an if else to show depending on the UserGroupID session?

2) do you mean add a session? If so, do I set the trigger to the password column? What would the value be to only trigger if the password has been changed? have attached image for reference

Sign in to reply to this post

Ray BorduinWebAssist

To include or exclude admin you can add an additional check for the admin group session variable to the IF statement.

You might have to do it manually. The trigger would probably be a comparison between the posted password vs the one saved in the database to see if they have changed.

Sign in to reply to this post

Jamie

Thanks Ray. what behaviour do I need to be using to set this up in the first instance?

Sign in to reply to this post

Ray BorduinWebAssist

I'm afraid I don't exactly know what you are referring to. What first instance? Please be a little more specific and I can try to provide direction.

Sign in to reply to this post

Jamie

sorry, what I meant was which server behaviour should I be using to get a message to show on password change as I am unsure how to make the comparison between the posted password vs the one saved in the database

Sign in to reply to this post

Ray BorduinWebAssist

I think you would do it manually with an IF statement.

php:
if ($Recordset->getColumnVal("UserPassword") != $_POST['PasswordField']) {

  $_SESSION['PasswordChanged'] = true;
}
Sign in to reply to this post

Jamie

OK, so have got

<?php if ($row_WADAlogins['UserPassword'] != $_POST['Confirm']) {
$_SESSION['PasswordChanged'] = true;
} ?>


and

<?php if($_SESSION["PasswordChanged"] = true ){ ?>
<span class="text-element requiredLabel" style="background: green; text-align:center;">Password successfully changed</span>
<?php } ?>



But the message is showing all the time....

Sign in to reply to this post

Jamie

still no joy. message is constantly showing regardless of password change or not

Sign in to reply to this post
loading

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...