Example #1
0
function sixscan_menu_create_dashboard_frame($redirect_request = "")
{
    $user_height = '100%';
    if ($redirect_request == "") {
        /* Default redirects per different plugin types */
        if (SIXSCAN_PLATFORM_TYPE == 'wordpress') {
            $redirect_request = SIXSCAN_COMMON_DASHBOARD_URL_MAIN;
        } else {
            if (SIXSCAN_PLATFORM_TYPE == 'wordpress_backup') {
                $redirect_request = SIXSCAN_COMMON_DASHBOARD_URL_BACKUP;
            }
        }
    }
    /*	If user has already submitted a ticket, show him a "Thank you" */
    if (sixscan_menu_is_ticket_requested()) {
        sixscan_menu_submission_ok_msg();
        return;
    }
    /* Do not show dashboard iframe, if account is not active */
    if (sixscan_common_is_account_active() == FALSE) {
        return;
    }
    /*	Widget has smaller iframe size */
    if ($redirect_request == SIXSCAN_COMMON_DASHBOARD_URL_WIDGET) {
        $user_height = '550px';
    }
    print "<iframe id='sixscan_dashboard_iframe' src=\"" . sixscan_communication_oracle_auth_get_link($redirect_request) . "\" width='100%' height='{$user_height}'>\n";
    print "</iframe>\n";
    ?>
	
	<script language='javascript'>
            var frame = document.getElementById('sixscan_dashboard_iframe');
            frame.height = document.body.scrollHeight - 127;
	</script>
<?php 
}
function sixscan_installation_partner_is_to_install()
{
    /*	We arrive to this function when 6Scan is not yet installed.
    		Now we have to decide, whether to run install.
    		First case to run install is when we are at 6scan dashboard page (one of them) - that means 6Scan is not installed, but user
    		has requested to see his dashboard */
    $current_page = $_GET['page'];
    if ($current_page == SIXSCAN_COMMON_DASHBOARD_URL && sixscan_menu_is_ticket_requested() == FALSE) {
        /*	Return TRUE to install means :
        		1) We are not installed
        		2) We are not in ticket support
        		3) We have just requested 6Scan dashboard.
        		*/
        return TRUE;
    }
    /*	Second option - 6Scan is not yet installed, but we have arrived to admin panel for the first time - try registering */
    if (sixscan_installation_partner_run_first_time()) {
        return TRUE;
    }
    return FALSE;
}