include '_lib.php'; // sanitize token or alias $token = isset($_REQUEST['token']) && sanitize('token', $_REQUEST['token']) ? $_REQUEST['token'] : FALSE; $alias = isset($_REQUEST['alias']) && sanitize('alias', $_REQUEST['alias']) ? $_REQUEST['alias'] : FALSE; // pull token if alias was supplied if ($alias) { $aliasSQL = sprintf("SELECT token FROM aliases WHERE alias = '%s';", $alias); $aliasResult = mysql_query($aliasSQL); if ($a = mysql_fetch_assoc($aliasResult)) { $token = $a['token']; } } // pull makefile from DB $opts['raw'] = isset($_GET['raw']) ? TRUE : FALSE; $opts['alias'] = $alias ? $alias : FALSE; $makefile = generateMakefile($token, $opts); if (!$makefile) { $fail = 'fail'; $error = "Something broke :(\r\n\nCheck your URL...\r\n\r\n\r\n\n...or if there's an error onscreen and you feel generous,\nyou could post it at https://github.com/rupl/drush_make_generator/issues - thanks!"; } // output mode? if (isset($opts['raw']) && $opts['raw'] == 'raw') { // raw/permalink header("Content-type: text/plain\r\n"); print $makefile; exit; } else { // bookmarking/sharing ?> <!doctype html>
<?php include('_lib.php'); // sanitize token and pull makefile from db $token = (isset($_REQUEST['token']) && sanitize('token',$_REQUEST['token'])) ? $_REQUEST['token'] : ''; $mode = (isset($_GET['raw'])) ? 'raw' : FALSE; $makefile = generateMakefile($token,$mode); if (!$makefile){ $fail = 'fail'; $error = "Something broke :(\r\n Check your URL...\r\n\r\n\r\n ...or if there's an error onscreen post it at https://github.com/rupl/drush_make_generator/issues - thanks!"; } // output mode? if ($mode == 'raw') { // raw/permalink header("Content-type: text/plain\r\n"); print $makefile; exit; } else {