You are here:  » change name of admin folder and prices visible to registered users

Active Forum Topics


change name of admin folder and prices visible to registered users

Submitted by javigdiaz on Sat, 2010-11-13 23:40 in

hi,

this is my first post and just a few simple questions

1) is it possible to change the name of the admin folder to increase security?

2) is it possible to show prices and link to merchant website only to registered users? ( We suppose we have already
done the script to register members and give them login access.)

thanks in advance

javier

Submitted by support on Mon, 2010-11-15 09:25

Hi javier,

You can change the admin folder name - there is only one direct link to it which is the "Admin Home" link in admin/admin_menu.php (line 10), so for convenience you would want to edit that file to make the link point to your new folder name, for example if you move the folder to "myadmin", change that line as follows:

  print "<a href='".$config_baseHREF."myadmin/'>Admin Home</a>&nbsp;&nbsp;";

Don't forget however that you can set a password for /admin/ at line 2 of config.advanced.php.

Hiding certain content to registered users would depend entirely on your registration / authentication mechanism, but should be straight forward. You would need to find out how you can detect a logged in user, for example by looking at a variable containing a user ID, e.g.

  $user_id

You could then add IF conditions around any of the code within the html/ files to only display the data if $user_id is set. For example, to hide the price displayed by html/searchresults.php, look for the following section of code beginning at line 23:

          <?php if ($product["numMerchants"] > 1): ?>
          ...5 lines hidden...
          <?php endif; ?>

...and REPLACE that with:

          <?php if ($user_id): ?>
          <?php if ($product["numMerchants"] > 1): ?>
          ...5 lines hidden...
          <?php endif; ?>
          <?php else: ?>
          <p>Registered Users only</p>
          <?php endif; ?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by stonecold111 on Sat, 2013-08-17 08:47

I just changed the directory, but the problem is that I can't log in with my password. I've double checked it in configadvanced.php so it shouldn't be wrong. Do I need to change any other thing like the wordpress setting?

Submitted by stonecold111 on Sat, 2013-08-17 08:52

The password should be correct. If I typed a wrong password, it showed "• authentication failed". When I typed the correct password, I was just redirected back to my homepage

Submitted by support on Sat, 2013-08-17 09:55

Hi,

You'll need to edit the name of the admin/ folder in admin/login.php at line 23:

  header("Location: ".$config_baseHREF."admin/");

...adjust as required - that should be all it is...

Cheers,
David.
--
PriceTapestry.com