Author Topic: Move Admin link into template variable  (Read 474 times)

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Move Admin link into template variable
« on: August 19, 2009, 03:06:03 PM »
Currently, index.php contains the following lines:

Code: [Select]
<?php function authenticated() {
if ($cfg[protect]===true && !isset($_SERVER['PHP_AUTH_USER'])) return false;
if (isset($_SERVER['PHP_AUTH_USER']) &&($_SERVER['PHP_AUTH_USER'] != $cfg[user] || $_SERVER['PHP_AUTH_PW'] != $cfg[pass])) return false;
return true;
} if (
authenticated()) echo ' | <a href="./admin">Admin</a>'?>

This should be updated to:

Code: [Select]
<?php echo $ccms['adminlink'?>
That way, if you develop other templates you are not repeating the security logic.