// Process logout if the user is logging out if ($_REQUEST['action'] == 'logout') { session_destroy(); mystery_setup_default_session(); mystery_header(); mystery_display_user_feedback('You have successfully logged out.'); } // Process the authentication for the user. If not logged in, it will display the login box mystery_process_authentication(); // Load the configuration for this table, if applicable if ($_REQUEST['table'] != 'none') { mystery_get_table_configuration($_REQUEST['table']); } // FIX if (isset($_REQUEST['ss'])) { mystery_print_r($_SESSION); } // Determine which action the user is looking for switch ($_REQUEST['action']) { case 'redirect': mystery_redirect($_REQUEST['location']); break; case 'help': mystery_header(); mystery_display_help(); mystery_footer(); break; case 'documentation': mystery_header(); mystery_display_documentation(); mystery_footer();
<?php /* /portal/view/:id POST or GET: ?login=userlogin&password=userpassword Response: HTTP 302 moved response forwarding the user to the JNLP for the activity in VIEW mode */ $diy_id = $_PORTAL['action']; $path = '/portal/view/:' . $diy_id . '?login='******'user_username'] . '&password='******'portal']['member_pw']; echo $path; $host = $portal_config['diy_server']; $fp = fsockopen($host, 80); fputs($fp, "GET " . $path . " HTTP/1.0\r\n"); fputs($fp, "Host: " . $host . "\r\n"); fputs($fp, "Connection: close\r\n"); echo $fp; $response = ''; while (!feof($fp)) { $response .= fgets($fp, 128); } fclose($fp); list($http_headers, $http_content) = explode("\r\n\r\n", $response); // rather than properly parse the xml, we'll just do a quick regular expression // in the future, we could probably use MiniXML - http://minixml.psychogenic.com/overview.html mystery_print_r($response); /*preg_match('~>([0-9]+)</id>~', $http_content, $matches); $diy_member_id = $matches[1]; return $diy_member_id; */
function portal_get_diy_activities() { // This function get's all of the DIY activities in XML format then converts to a PHP array $activity_xml = portal_get_from_diy('/users/9/activities.xml'); mystery_print_r($activity_xml); }
<?php echo 'testing'; /*$file = portal_generate_resized_image('/tmp/castle.jpg', 150,150); rename($file, '/tmp/castle-thumb.jpg'); echo $file; $file = portal_generate_resized_image('/tmp/school_image_file_1.jpg', 150,150); rename($file, '/tmp/school_image_file_1-thumb.jpg'); echo $file; echo '<hr>'; */ $diy_id = portal_get_diy_member_id('Paul W', 'Burney', '*****@*****.**', '*****@*****.**', 'test'); mystery_print_r($diy_id); /* echo portal_get_unique_username('Paul', 'Burney'); portal_debug_query(); */
function mystery_debug_query($connection = 'dbh') { // this function displays the last paramaterized query that was processed global $_MYSTERY; mystery_print_r('#009900', $_MYSTERY[$connection]->last_query); }