| 
      1
     | 
    
      <?php
 
     | 
  
  
    | 
      2
     | 
    
      /**
 
     | 
  
  
    | 
      3
     | 
    
       *
 
     | 
  
  
    | 
      4
     | 
    
       * @category        admin
 
     | 
  
  
    | 
      5
     | 
    
       * @package         admintools
 
     | 
  
  
    | 
      6
     | 
    
       * @author          WebsiteBaker Project
 
     | 
  
  
    | 
      7
     | 
    
       * @copyright       2004-2009, Ryan Djurovich
 
     | 
  
  
    | 
      8
     | 
    
       * @copyright       2009-2011, Website Baker Org. e.V.
 
     | 
  
  
    | 
      9
     | 
    
       * @link			http://www.websitebaker2.org/
 
     | 
  
  
    | 
      10
     | 
    
       * @license         http://www.gnu.org/licenses/gpl.html
 
     | 
  
  
    | 
      11
     | 
    
       * @platform        WebsiteBaker 2.8.x
 
     | 
  
  
    | 
      12
     | 
    
       * @requirements    PHP 5.2.2 and higher
 
     | 
  
  
    | 
      13
     | 
    
       * @version         $Id: tool.php 1494 2011-08-11 14:59:01Z Luisehahne $
 
     | 
  
  
    | 
      14
     | 
    
       * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/admintools/tool.php $
 
     | 
  
  
    | 
      15
     | 
    
       * @lastmodified    $Date: 2011-08-11 16:59:01 +0200 (Thu, 11 Aug 2011) $
 
     | 
  
  
    | 
      16
     | 
    
       *
 
     | 
  
  
    | 
      17
     | 
    
       */
 
     | 
  
  
    | 
      18
     | 
    
      
 
     | 
  
  
    | 
      19
     | 
    
      require('../../config.php');
     | 
  
  
    | 
      20
     | 
    
      require_once(WB_PATH.'/framework/class.admin.php');
 
     | 
  
  
    | 
      21
     | 
    
      require_once(WB_PATH.'/framework/functions.php');
 
     | 
  
  
    | 
      22
     | 
    
      
 
     | 
  
  
    | 
      23
     | 
    
      if(!isset($_GET['tool'])) {
     | 
  
  
    | 
      24
     | 
    
      	header("Location: index.php");
     | 
  
  
    | 
      25
     | 
    
      	exit(0);
 
     | 
  
  
    | 
      26
     | 
    
      } else {
     | 
  
  
    | 
      27
     | 
    
      	$array = array();
 
     | 
  
  
    | 
      28
     | 
    
      	preg_match("/[a-z,_,a-z]+/i",$_GET['tool'],$array);
     | 
  
  
    | 
      29
     | 
    
      	$tool = $array[0];
 
     | 
  
  
    | 
      30
     | 
    
      }
 
     | 
  
  
    | 
      31
     | 
    
      
 
     | 
  
  
    | 
      32
     | 
    
      $ModulesUsingFTAN = '';
 
     | 
  
  
    | 
      33
     | 
    
      $admin_header =  true;
 
     | 
  
  
    | 
      34
     | 
    
      if(isset($_POST['save_settings'])) {
     | 
  
  
    | 
      35
     | 
    
      	$ModulesUsingFTAN = WB_PATH.'/modules/'.$tool.'/FTAN_SUPPORTED';
 
     | 
  
  
    | 
      36
     | 
    
      }
 
     | 
  
  
    | 
      37
     | 
    
      
 
     | 
  
  
    | 
      38
     | 
    
      $admin_header = (file_exists($ModulesUsingFTAN) && is_file($ModulesUsingFTAN)) == false;
 
     | 
  
  
    | 
      39
     | 
    
      $admin = new admin('admintools', 'admintools', $admin_header );
     | 
  
  
    | 
      40
     | 
    
      
 
     | 
  
  
    | 
      41
     | 
    
      // Check if tool is installed
 
     | 
  
  
    | 
      42
     | 
    
      $result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' AND directory = '".preg_replace('/[^a-z0-9_-]/i', "", $tool)."'");
     | 
  
  
    | 
      43
     | 
    
      if($result->numRows() == 0) {
     | 
  
  
    | 
      44
     | 
    
      	header("Location: index.php");
     | 
  
  
    | 
      45
     | 
    
      	exit(0);
 
     | 
  
  
    | 
      46
     | 
    
      }
 
     | 
  
  
    | 
      47
     | 
    
      $tools = $result->fetchRow();
 
     | 
  
  
    | 
      48
     | 
    
      if(!isset($_POST['save_settings'])) {
     | 
  
  
    | 
      49
     | 
    
      
 
     | 
  
  
    | 
      50
     | 
    
      ?>
 
     | 
  
  
    | 
      51
     | 
    
      <h4>
 
     | 
  
  
    | 
      52
     | 
    
      	<a href="<?php echo ADMIN_URL; ?>/admintools/index.php"><?php echo $HEADING['ADMINISTRATION_TOOLS']; ?></a>
 
     | 
  
  
    | 
      53
     | 
    
      	»
 
     | 
  
  
    | 
      54
     | 
    
      	<?php echo $tools['name']; ?>
 
     | 
  
  
    | 
      55
     | 
    
      </h4>
 
     | 
  
  
    | 
      56
     | 
    
      <?php
 
     | 
  
  
    | 
      57
     | 
    
      }
 
     | 
  
  
    | 
      58
     | 
    
      require(WB_PATH.'/modules/'.$tools['directory'].'/tool.php');
 
     | 
  
  
    | 
      59
     | 
    
      
 
     | 
  
  
    | 
      60
     | 
    
      $admin->print_footer();
 
     |