Changeset 700

Show
Ignore:
Timestamp:
08/22/05 16:18:43 (8 years ago)
Author:
plec_
Message:

Add automatic redirect to install.php if Smarty not installed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/SmartyWifidog.php

    r566 r700  
    2929define('COMMON_CONTENT_SMARTY_PATH', LOCAL_CONTENT_REL_PATH.'common/'); 
    3030 
    31 // load Smarty library 
    32 require_once(BASEPATH.'lib/smarty/Smarty.class.php'); 
     31# Check if Smarty installed, if not redirect user to web-base installation 
     32if (file_exists(BASEPATH.'lib/smarty/Smarty.class.php')) { 
     33  require_once(BASEPATH.'lib/smarty/Smarty.class.php');       # load Smarty library 
     34} else { 
     35  $exploded_path = explode("/", $_SERVER['SCRIPT_NAME']);     # Split directories in token 
     36  array_pop($exploded_path);                                  # Remove install.php from the list 
     37  $system_path = implode("/", $exploded_path);                # Build the system_path for the auth-server 
     38  print "Redirection to Wifidog web-base install <META HTTP-EQUIV=Refresh CONTENT=\"1; URL=$system_path/install.php\">"; 
     39  exit(); 
     40} 
    3341 
    3442// The setup.php file is a good place to load