* @copyright 2016 by Ralf Becker * @version $Id$ */ if (php_sapi_name() !== 'cli' && !empty($_GET['app']) && preg_match('/^[a-z0-9_-]+$/i', $_GET['app'])) { $app = $_GET['app']; } elseif ($_SERVER['argc'] > 1) { $app = $_SERVER['argv'][1]; } else { $app = 'admin'; } include __DIR__.'/../phpgwapi/inc/common_functions.inc.php'; $path = EGW_SERVER_ROOT.'/'.$app.'/templates/default/config.tpl'; if (!file_exists($path) || !($content = file_get_contents($path))) { die("File not found: $path"); } if (!preg_match('|(.*)|sui', $content, $table) && !preg_match('|\]*\>(.*)|sui', $content, $table)) { die('No BEGIN/END body or table tag found!'); } $table[1] = preg_replace('/^/U', '', $table[1]); if (!preg_match_all('|( ';