Jump to content

RedKingOne

Members
  • Posts

    52
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by RedKingOne

  1. On 7/8/2023 at 7:17 AM, swaluver480 said:

    after some research through multiple forms and talking to some other VA owners on discord (since im interested in this too) looks like youll have to do some extensive work. 

    first youll need to navigate to app/Http/Controllers/Auth/LoginController.php
     

    and make the necessary changes
     

    use VATSIMSSO\VATSIMSSO;
    use VATSIMSSO\Auth\Token;
    use VATSIMSSO\Auth\User;



    then it looks like youll have to navigate (i belive in that same file) and find handleProviderCallback() code

    this is where i got told youll have to make a php code below it that verifies the incoming request, gets the Users access token, and details, and logins the user. 

    (have no idea without recreating  it what that code will be)

    then navigate to routes/web.php

     there add in the vatsim sso callback
     

    Route::get('/auth/vatsim/callback', 'App\Http\Controllers\Auth\LoginController@handleProviderCallback');

     

    youll also probably will need to modify the config file and a few more but he told me thats a start as he didnt go all the way through becuase he gained the info needed for what his needs were. 

     

    i hope this helps you out

     

     

     

    It certainly gives me something to think about. Appreciate the pointer.

  2. The following is a section of the code used on a custom WordPress plugin to create a user account.

    Although I can read the file and make slight modifications to it; I have no clue how to apply the principles used here to phpVMS.

     

    Quote

    <?php

     

    //=========================================//

        // VATSIM CONNECT FUNCTIONS

        //=========================================//

     

        function vatsimConnect(){

     

            //require_once("vatsim_connect_functions.php");

            require_once("vendor/autoload.php");

     

            // Required for VATSIM Connect

            $clientID                   = get_option('vatsim_connect_client_id');           // VATSIM Connect Client ID

            $clientSecret               = get_option('vatsim_connect_client_secret');       // VATSIM Connect Client Secret

            $scopes                     = get_option('vatsim_connect_scopes');              // VATSIM Connect Scopes

            $redirectURL                = get_option('vatsim_connect_redirect_url');        // VATSIM Connect Redirect URL

     

            // Required for Plugin

            $loginDeniedURL             = get_option('vatsim_connect_login_denied_url');    // LOCAL Redirect URL Login Denied

            $logoutURL                  = get_option('vatsim_connect_logout_url');          // LOCAL Redirect URL Logout Message

     

            $urlAuthorize               = 'https://auth.vatsim.net/oauth/authorize';        // VATSIM Authorize URL

            $urlAccessToken             = 'https://auth.vatsim.net/oauth/token';            // VATSIM Token URL

            $urlResourceOwnerDetails    = 'https://auth.vatsim.net/api/user';               // VATSIM User Details URL

     

            // Create Provider with VATSIM Connect Details

            $provider = new \League\OAuth2\Client\Provider\GenericProvider([

                'clientId'                => $clientID,

                'clientSecret'            => $clientSecret,

                'redirectUri'             => $redirectURL,

                'urlAuthorize'            => $urlAuthorize,

                'urlAccessToken'          => $urlAccessToken,

                'urlResourceOwnerDetails' => $urlResourceOwnerDetails,

                'scopes'                  => $scopes

            ]);

     

            // Check if login / logout request is found in URI

            if(isset($_GET['vatsim_connect'])){

     

                $code = $_GET['vatsim_connect'];

     

                if($code == 'logout'){

                   

                    wp_logout();

     

                    header('Location: ' . $logoutURL);

     

                    exit();

     

                }elseif($code == 'login'){

     

                    $authorizationURL = $provider->getAuthorizationUrl();

     

                    $_SESSION['oauth2state'] = $provider->getState();

     

                    header('Location: ' . $authorizationURL);

                   

                    exit();

     

                }    

            }

     

            // Check if VATSIM Connect code is found in URI & user is not logged in yet

            if(isset($_GET['code']) && (!is_user_logged_in())){

     

                // Check if session state against previously stored one to mitigate CSRF attack

                if(empty($_GET['state']) || (isset($_SESSION['oauth2state']) && $_GET['state'] !== $_SESSION['oauth2state'])){

     

                    if (isset($_SESSION['oauth2state'])){

     

                        unset($_SESSION['oauth2state']);

     

                    }

     

                    exit('Invalid state');

     

                } else {

     

                    try{

     

                        // Try to get an access token using the authorization code grant.

                        $accessToken = $provider->getAccessToken('authorization_code', [

                            'code' => $_GET['code']

                        ]);

     

                        // Fetch Token Data

                        $vatsimAccessToken      = $accessToken->getToken();

                        $vatsimRefreshToken     = $accessToken->getRefreshToken();

                        $vatsimTokenExpireDate  = $accessToken->getExpires();

                        $vatsimIsTokenExpired   = $accessToken->hasExpired();

     

                        // Using the access token, we may look up details about the resource owner.

                        $resourceOwner = $provider->getResourceOwner($accessToken);

     

                        // Fetch VATSIM data from resource owner

                        $userData               = $resourceOwner->toArray();

                        $vatsimEmail            = $userData['data']['personal']['email'];               // VATSIM Registered Email

                        $vatsimCID              = $userData['data']['cid'];                             // VATSIM CID

                        $vatsimNameFirst        = $userData['data']['personal']['name_first'];          // VATSIM Registered First Name

                        $vatsimNameLast         = $userData['data']['personal']['name_last'];           // VATSIM Registered Last Name

                        $vatsimCountryCode      = $userData['data']['personal']['country']['id'];       // VATSIM Registered Country Code

                        $vatsimCountryName      = $userData['data']['personal']['country']['name'];     // VATSIM Registered Country Name

                        $vatsimRatingID         = $userData['data']['vatsim']['rating']['id'];          // VATSIM ATC Rating ID

                        $vatsimRatingShort      = $userData['data']['vatsim']['rating']['short'];       // VATSIM ATC Rating Short

                        $vatsimRatingLong       = $userData['data']['vatsim']['rating']['long'];        // VATSIM ATC Rating Long

                        $vatsimRegionName       = $userData['data']['vatsim']['region']['name'];        // VATSIM Region Name

                        $vatsimRegionID         = $userData['data']['vatsim']['region']['id'];          // VATSIM Region ID

                        $vatsimDivisionName     = $userData['data']['vatsim']['division']['name'];      // VATSIM Division Name

                        $vatsimDivisionID       = $userData['data']['vatsim']['division']['id'];        // VATSIM Division ID

                        $vatsimSubDivisionName  = $userData['data']['vatsim']['subdivision']['name'];   // VATSIM SubDivision Name

                        $vatsimSubDivisionID    = $userData['data']['vatsim']['subdivision']['id'];     // VATSIM SubDivision ID

                        $vatsimToken            = $userData['data']['oauth']['token_valid'];            // VATSIM Oauth Token Valid Boolean

     

                        // Check if correct scopes have been approved for login / registration

                        if(!$vatsimToken && !$vatsimNameFirst && !$vatsimNameLast && !$vatsimEmail){

     

                            wp_redirect($loginDeniedURL);

     

                            exit();

     

                        }

     

                        // Check if user with VATSIM CID already in WP User database

                        $isUser = get_user_by('login',$vatsimCID);

     

                        // Update WP User

                        if($isUser){

     

                            $userData = array(

                                'ID'                    => $isUser->ID,            

                                'user_login'            => $vatsimCID,          

                                'user_email'            => $vatsimEmail,        

                                'display_name'          => $vatsimNameFirst . ' ' . $vatsimNameLast,                

                                'nickname'              => $vatsimNameFirst . ' ' . $vatsimNameLast,

                                'first_name'            => $vatsimNameFirst,

                                'last_name'             => $vatsimNameLast,

                                'show_admin_bar_front'  => 'false'

                            );

     

                            $userID = wp_insert_user($userData) ;

     

                            if (!is_wp_error($userID)){

         

                                // Create array of VATSIM Data

                                $vatsimData = array(

                                    'vatsim_country_code'       => $vatsimCountryCode,

                                    'vatsim_country_name'       => $vatsimCountryName,

                                    'vatsim_atc_rating_id'      => $vatsimRatingID,

                                    'vatsim_atc_rating_short'   => $vatsimRatingShort,

                                    'vatsim_atc_rating_long'    => $vatsimRatingLong,

                                    'vatsim_region_name'        => $vatsimRegionName,

                                    'vatsim_region_id'          => $vatsimRegionID,

                                    'vatsim_division_name'      => $vatsimDivisionName,

                                    'vatsim_division_id'        => $vatsimDivisionID,

                                    'vatsim_sub_division_name'  => $vatsimSubDivisionName,

                                    'vatsim_sub_division_id'    => $vatsimSubDivisionID

                                );

     

                                // Loop through VATSIM Data and update WP User Meta database

                                foreach($vatsimData as $k => $v){

                                    update_user_meta($userID, $k, $v );

                                }

     

                                //Login User

                                vatsimConnectLogin($vatsimCID);

     

                            }else{

     

                                $errorString = $userID->get_error_message();

                                //echo $errorString;

     

                            }

     

                        // Create New WP User

                        }else{

     

                            $userData = array(

                                'user_pass'             => NULL,                

                                'user_login'            => $vatsimCID,          

                                'user_email'            => $vatsimEmail,        

                                'display_name'          => $vatsimNameFirst . ' ' . $vatsimNameLast,                

                                'nickname'              => $vatsimNameFirst . ' ' . $vatsimNameLast,

                                'first_name'            => $vatsimNameFirst,

                                'last_name'             => $vatsimNameLast,

                                'show_admin_bar_front'  => 'false'

                            );

     

                            $userID = wp_insert_user($userData) ;

     

                            if (!is_wp_error($userID)){

         

                                // Create array of VATSIM Data

                                $vatsimData = array(

                                    'vatsim_country_code'       => $vatsimCountryCode,

                                    'vatsim_country_name'       => $vatsimCountryName,

                                    'vatsim_atc_rating_id'      => $vatsimRatingID,

                                    'vatsim_atc_rating_short'   => $vatsimRatingShort,

                                    'vatsim_atc_rating_long'    => $vatsimRatingLong,

                                    'vatsim_region_name'        => $vatsimRegionName,

                                    'vatsim_region_id'          => $vatsimRegionID,

                                    'vatsim_division_name'      => $vatsimDivisionName,

                                    'vatsim_division_id'        => $vatsimDivisionID,

                                    'vatsim_sub_division_name'  => $vatsimSubDivisionName,

                                    'vatsim_sub_division_id'    => $vatsimSubDivisionID

                                );

     

                                // Loop through VATSIM Data and insert into WP User Meta database

                                foreach($vatsimData as $k => $v){

                                    update_user_meta($userID, $k, $v );

                                }

     

                                //Login User

                                vatsimConnectLogin($vatsimCID);

                                 

                            }else{

     

                                $errorString = $userID->get_error_message();

                                //echo $errorString;

     

                            }

     

                        }

     

                    } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {

     

                        // Failed to get the access token or user details.

                        //echo "Error: ";

     

                        //exit($e->getMessage());

     

                    }

                }

            }

        }

        add_action('init','vatsimConnect');

     

        //User Login with VATSIM CID

        function vatsimConnectLogin($vatsimCID){

           

            $user = get_user_by('login',$vatsimCID);

     

            if(!is_wp_error($user))

            {

     

                // Set Cookies for Login

                wp_clear_auth_cookie();

                wp_set_current_user($user->ID);

                wp_set_auth_cookie($user->ID);

     

                // Redirect back to selected URL

                $redirect = get_option('vatsim_connect_redirect_url');

                wp_safe_redirect($redirect);

     

                exit();

     

            }

        }

     

        //=========================================//

        // UPDATE USER DATA EVERY 24H BASED ON VATSIM API

        //=========================================//

     

        function vatsimUpdateUserData(){

     

            //Get list of all Ratings

            $dataFeed = json_decode(file_get_contents("https://data.vatsim.net/v3/vatsim-data.json"));

     

            //Get list of all Regions

            $regionsData = json_decode(file_get_contents("https://api.vatsim.net/api/regions/"));

     

            //Get list of all Divisions

            $divisionsData = json_decode(file_get_contents("https://api.vatsim.net/api/divisions/"));

     

            //Get list of all SubDivisions

            $SubDivisionsData = json_decode(file_get_contents("https://api.vatsim.net/api/subdivisions/"));

     

            //Get all Users

            $users = get_users();

     

            foreach($users as $user){

               

                $userID = $user->ID;

                $vatsimCID = $user->user_login;

               

                if(is_numeric($vatsimCID)){

                   

                    //Fetch Latest Data from Public API

                    $updatedData = json_decode(file_get_contents("https://api.vatsim.net/api/ratings/$vatsimCID/"));

     

                    if($updatedData){

     

                        $vatsimRatingID         = $updatedData->rating;         // VATSIM ATC Rating ID

                        $vatsimRatingShort      = "Not Found";

                        $vatsimRatingLong       = "Not Found";

     

                        foreach($dataFeed->ratings as $rating){

                            if($vatsimRatingID == $rating->id){

                                $vatsimRatingShort = $rating->short;

                                $vatsimRatingLong = $rating->long;

                            }

                        }

                       

                        $vatsimRegionID         = $updatedData->region;     // VATSIM Region ID

                        $vatsimRegionName       = "-";

     

                        foreach($regionsData as $region){

                            if($vatsimRegionID == $region->id){

                                $vatsimRegionName = $region->name;

                            }

                        }

                       

                        $vatsimDivisionID       = $updatedData->division;   // VATSIM Division ID

                        $vatsimDivisionName     = "-";

     

                        foreach($divisionsData as $division){

                            if($vatsimDivisionID == $division->id){

                                $vatsimDivisionName = $division->name;

                            }

                        }

     

                        $vatsimSubDivisionID       = $updatedData->subdivision;   // VATSIM SubDivision ID

                        $vatsimSubDivisionName     = "-";

     

                        foreach($SubDivisionsData as $subDivision){

                            if($vatsimSubDivisionID == $subDivision->code){

                                $vatsimSubDivisionName = $subDivision->fullname;

                            }

                        }

     

                        // Create array of VATSIM Data

                        $vatsimData = array(

                            'vatsim_atc_rating_id'      => $vatsimRatingID,

                            'vatsim_atc_rating_short'   => $vatsimRatingShort,

                            'vatsim_atc_rating_long'    => $vatsimRatingLong,

                            'vatsim_region_name'        => $vatsimRegionName,

                            'vatsim_region_id'          => $vatsimRegionID,

                            'vatsim_division_name'      => $vatsimDivisionName,

                            'vatsim_division_id'        => $vatsimDivisionID,

                            'vatsim_sub_division_name'   => $vatsimSubDivisionName,

                            'vatsim_sub_division_id'     => $vatsimSubDivisionID

                        );

     

                        // Loop through VATSIM Data and update WP User Meta database

                        foreach($vatsimData as $k => $v){

                            update_user_meta($userID, $k, $v );

                        }

                    }

                }  

            }

        }

        add_action('vatsim_update_users_data_cron','vatsimUpdateUserData');


     

        //=========================================//

        // RESTRICT NON-ADMIN PROFILE EDITING  

        //=========================================//

     

        function vatsimStopProfileAccess() {

     

            if(get_option('vatsim_connect_disable_profile_access') == 1){

     

                if(!current_user_can('manage_options')){

               

                    remove_menu_page( 'profile.php' );

                    remove_submenu_page( 'users.php', 'profile.php' );

     

                    if(defined('IS_PROFILE_PAGE')){

     

                        if(IS_PROFILE_PAGE === true) {

     

                            wp_die( 'To change your VATSIM profile information visit https://www.vatsim.net.' );

     

                        }

                    }

                }  

            }          

        }

        add_action( 'admin_menu', 'vatsimStopProfileAccess' );

     

        //=========================================//

        // FORCE VATSIM Connect OAuth

        //=========================================//

     

        function vatsimConnectForceLogin(){

           

            if(get_option('vatsim_connect_force_login') == 1){

     

                global $pagenow;

     

                // Login and Logout Redirect URL

                $loginURL = get_site_url() . '/?vatsim_connect=login';

                $logoutURL = get_option('vatsim_connect_logout_url');

     

                // Create Backdoor for Admin Access without VATSIM Connect

                if('wp-login.php' == $pagenow || 'wp-admin' == $pagenow){

     

                    $status = 0;    //Default Status

     

                    if(!empty($_GET['adminbackdoor']) && $_GET['adminbackdoor'] == true){

                        $status = 1;

                    }

     

                    if(!empty($_GET['loggedout']) && $_GET['loggedout'] == true){

                        $status = 2;

                    }

     

                    if(!empty($_GET['action']) && $_GET['action'] == "logout"){

                        $status = 3;

                    }

     

                    switch($status){

                        case 0:

                            wp_redirect($loginURL);

                            break;

                        case 1:

                            if($_SERVER['REQUEST_METHOD'] === 'POST'){

                                // Continue regular login without using VATSIM Connect

                            }

                            break;

                        case 2:

                            wp_redirect($logoutURL);

                            break;

                        case 3:

                            wp_redirect($logoutURL);

                            break;

                        default:

                            wp_redirect($loginURL);

                            break;

                    }

                }

            }

        }

        add_action('init','vatsimConnectForceLogin');

     

    ?>

     

     

  3. 6 hours ago, DisposableHero said:

    @RedKingOne this can happen only if "vatsim sso" provides you all relevant data needed for user creation, at minimum you will need full name, email and a password for the person. You can auto assign some values to other required fields, also you will need to somehow bypass (disable) or find a way to be sure captcha checks during registration. Still will be tricky and if "vatsim sso" returns minimal data then it will be impossible to create a user directly.

     

    In this case, what you can do is a vatsim membership check before reaching your registration form, at least you will be sure that person has an active account on the network during that exact moment.

     

    To be honest, I think only benefit of this implementation will be the network status check (banned/suspended/inactive etc.) for administrative purposes.

     

    Good luck

     

    If I want to know anything about anyone on VATSIM I can look up the CID in the stats page or I can look up the CID via the direct feed.

    For example, if I look myself up I would go to https://api.vatsim.net/api/ratings/1289149/ and I would get back

    id: "1289149"

    rating: 10

    pilotrating: 0

    militaryrating: 0

    susp_date: null

    reg_date: "2014-04-22T20:09:18"

    region: "AMAS"

    division: "CAR"

    subdivision: "SDO"

    lastratingchange: "2021-04-06T23:12:47"

     

    In reality, VATSIM also stores more data that can be pulled and validated via the API. It also includes:

    VATSIM Registered Email
    VATSIM Registered First Name
    VATSIM Registered Last Name
    VATSIM Registered Country Code
    VATSIM Registered Country Name

     

    With the exception of Hub selection, The pilot would not need to add anything. All the relevant data would be pulled through the API.
     

     

  4. 6 hours ago, DisposableHero said:

    What will be the benefit of this effort ?

     

    Are you willing to automatically create the v7 user with data provided by VATSIM (like name, mail, VATSIM CID etc.) or just willing to use it for login/authentication ?

     

    If this will be used for authentication only, what is the difference between using your username and password compared to VATSIM CID and password ?

     

    If you are wishing to create the user record, is VATSIM returning all necessary data for you to create a user record when someone signs in within their system ?

     

    There can be more questions regarding this, but the main one is at the top :) 

     

    Good luck and God speed

     

    Correct. I want users to be able to register via the vatsim sso with all of their relevant data pulled from vatsim and used to create the user account. This will validate the user is in good standing with the network and provide us with accurate info while allowing the user to use one account for all of it. In turn, if a user gets banned or suspended on the network, that status will reflect with us since they won't be able to use the sso to access their account. A great way to provide automatic checks and balances between our pilot roster and the vatsim network.

  5. Would it be possible to integrate the VATSIM single sign-on (vatsim connect) with phpVMS?

     

    I am building my VA to operate solely on the VATSIM network, and since we already have the capability to store the VATSIM CID and use it to direct members to the stats area. I think it would be great if we can also use it for the actual member account.

  6. 3 hours ago, DisposableHero said:

    I do not think that you are experiencing the same issue @RedKingOne

     

    What you are experiencing is the different and related to your theme settings, check your theme.json file and adjust it according to your "name" definition.

    (or vice versa, keep the theme.json intact but change the name definition at custom profile field according to theme.json)

     

    Good luck ;)

     

    That did the trick. Changed VATSIM to VATSIM ID as the name in the settings in order to match the theme.json file. If I had half your brain, I could rule the world LOL. Thanks for the help.

    • Haha 1
  7. 11 hours ago, ProAvia said:

    There are several areas that TFDI need to work on to get smartCARS 3 to be fully compatible with phpVMS v7.

    Until TFDI fully utilizes the phpVMS API and other items, there is nothing that can be done from the phpVMS side.

    Maybe post on the TFDI smartCARS 3 forum on their website.

     

    Their statement that smartCARS 3 now natively supports phpVMS 7 is not entirely true.

     

    Good to know. Thanks, ProAvia.

  8. Currently using Disposable Basic Pack v3.4.x on phpVMS v7 dev (latest as of 2 July 2023).

     

    After installing smartCARS3 I began testing all the connections. I can currently connect to our databases and make use of our databases with no problems. I can equally bit on flights and file PIREPS. That said, the only area I am detecting a fault is on the website's live flight map. It does not show the active flight. I can see it on VATSIM, and on the smartCARS map, but not on the website. I checked the settings page to see if I was missing a setting with no joy. I checked the TFDi forums and noted that smartCARS3 now natively supports phpVMS7. I would appreciate any guidance the community can provide. Thanks in advance everyone. 

  9. I am also experiencing this issue. I followed the steps on this forum and the ones listed at 

     

    I can see the field in the registration area and the admin panel. Unfortunately, the data is not translating to the user profile or the pilot roster. I would appreciate any further guidance the can community can provide. Thanks all.

    Screenshot_1.jpg

    Screenshot_2.jpg

    Screenshot_3.jpg

  10. 5 minutes ago, DisposableHero said:

     

    Just change your APP_URL in your env.php , then clear application cache from admin > maintenance, that's all.

     

    APP_URL='http://crew.mygreatva.com' // without SSL
    APP_URL='https://crew.mygreatva.com' // with SSL

     

    If your site is live and pilots have configured their vmsAcars clients (according to old non-secure url), advise them to re-download the config file (from their profile) or just add the missing "s" to the url in vmsAcars settings (needs to be done by each pilot, as this is a client/local matter).

     

    Additionally you may consider defining a permanent redirection from http to https via your hosting control panel or server settings (not related to phpVMS)

     

    Good luck

     

    Magic!! LoL

    Thanks for the assistance, I had not cleared the cache.

    • Haha 1
  11. I am in need of some guidance when it comes to enabling the SSL certs on the site. I feel like I am missing a step. Currently using Disposable Basic Pack v3.4.x on phpVMS v7 dev (latest as of 2 July 2023).

     

    In phpVMS v5.x it was just a matter of changing two lines of code in the local and global config.php files from HTTP to HTTPS. Based on the instructions during the setup of v7 it stated that the env.php file has the same capabilities as the config files from v5. I don't see a related option in the file and after looking around the documentation, I could not find any relevant materials. Any guidance would be appreciated.

     

    Thanks in advance! 

  12. @ProAviaI thought I should share the full error log when the .../SimBrief page is loaded.

     

    Quote

     

    [03-Oct-2021 01:52:12 UTC] PHP Warning: simplexml_load_file(https://www.simbrief.com/ofp/flightplans/xml/.xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /public_html/crew.airboundvirtual.net/core/modules/SimBrief/SimBrief.php on line 12

     

    [03-Oct-2021 01:52:12 UTC] PHP Warning: simplexml_load_file(): I/O warning : failed to load external entity &quot;https://www.simbrief.com/ofp/flightplans/xml/.xml&quot; in /public_html/crew.airboundvirtual.net/core/modules/SimBrief/SimBrief.php on line 12

     

    [03-Oct-2021 01:52:12 UTC] PHP Warning: Invalid argument supplied for foreach() in /public_html/crew.airboundvirtual.net/core/templates/SimBrief/SimBrief.php on line 27

     

    [03-Oct-2021 01:52:12 UTC] PHP Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character' in /public_html/crew.airboundvirtual.net/core/templates/SimBrief/SimBrief.php:64 Stack trace: #0

     

    /public_html/crew.airboundvirtual.net/core/templates/SimBrief/SimBrief.php(64): DateTime->__construct('@') #1

     

    /public_html/crew.airboundvirtual.net/core/classes/TemplateSet.class.php(238): include('/home/hhn5rom3k...') #2

     

    /public_html/crew.airboundvirtual.net/core/classes/TemplateSet.class.php(181): TemplateSet->getTemplate('SimBrief/SimBri...', false, true, false) #3

     

    /public_html/crew.airboundvirtual.net/core/classes/Template.class.php(82): TemplateSet->showTemplate('SimBrief/SimBri...') #4

     

    /public_html/crew.airboundvirtual.net/core/classes/CodonModule.class.php(92): Template::show('SimBrief/SimBri...') #5

     

    /public_html/crew.airboundvirtual.net/core/ in /home/hhn5rom3k2gz/public_html/crew.airboundvirtual.net/core/templates/SimBrief/SimBrief.php on line 64

     

     

    I am guessing the template errors are a result of the XLM files not loading. On a side note, all other modules load up just fine. SimBrief is the only troublesome one at the moment.

  13. On 9/28/2021 at 8:21 PM, ProAvia said:

    Be sure url_fopen is set to ON in php.

     

    Seems the XML file is unable to load/import.

     

    Did you customize any portion of the simBrief addon? If so, revert to default. Or maybe try when using the default "crystal" skin.

     

    One other thing it may be.... check your Windows regional settings are set to "en-US" and that your decimal separator is set to a period and not a comma. simBrief uses a period and will error if a comma is used - even if region is en-US.

     

     

     

    @ProAviasorry on the delay, and thanks for the continued support. I can confirm that url_fopen is on. I am also using the all default files for the SimBrief module pulled directly from GitHub. Added by credentials and website as directed of course. I also attempted your suggestion and changed to crystal theme. Same result.

  14. Quote

    @ProAvia

    What are the contents of line 12 in the .../modules/SimBrief/SimBrief.php file?

     

    What do you mean by a "modified version of phpvms 5.5.x"? What exact version? Look in the lower right corner of the admin panel.

     

    What version of MySQL or MariaDB?

     

    This is the complete code for the SimBrief.php

    Quote

    <?php

        class SimBrief extends CodonModule
        {


            public function index()
            {


                $url = 'https://www.simbrief.com/ofp/flightplans/xml/'.$this->get->ofp_id.'.xml';
                $xml = simplexml_load_file($url);
                $this->set('info', $xml);
                $this->render('SimBrief/SimBrief.php'); 
                //print_r($xml);
            }
    }

     

    Line 12 is 

    Quote

    $xml = simplexml_load_file($url);

     

    I am running simpilot phpvms 5.5.2 and a MySQL Server version: 5.7.33-cll-lve - MySQL Community Server - (GPL). When I say modified version I am referring to skins and modules, not the platforms themselves.

  15. Greetings everyone, I have taken all the steps in the read me file and even attempted some of the modifications suggested in the forums. I still continue to get the following errors. Any help would be appreciated. I am running PHP Version 5.6 on a modified version of phpvms 5.5.X. Skin is a modified combination of the Mark Sawn and Stisla Crew Centers.
     

    Quote

     

    Warning: simplexml_load_file(https://www.simbrief.com/ofp/flightplans/xml/.xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /public_html/crew.airboundvirtual.net/core/modules/SimBrief/SimBrief.php on line 12

    Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.simbrief.com/ofp/flightplans/xml/.xml" in /public_html/crew.airboundvirtual.net/core/modules/SimBrief/SimBrief.php on line 12

     

     

     

  16. On 1/10/2017 at 10:31 AM, Karamellwuerfel said:

    Hey guys! I've made a Weather module that shows you real time and

    instant weather informations of the current airport where the logged in pilot is.

    ZVFcPtc.png

    DEMO VIDEO: www.youtube.com/watch?v=Cx0HCaW-a5I

     

    
    #########INSTALLATION#########
    
    1. Copy the "core/modules/InstantWeather"-folder into your "core/modules"-folder of your va
    2. Copy the "core/templates/instantweather"-folder into your "core/templates"-folder of your va
    
    3. To show the module in the navigation: <li><a href="<?php echo url('/instantweather'); ?>">InstantWeather</a></li>

    USE INFORMATION ON OTHER PAGES (v 1.9) --> More on github project README.md

    Use MainController::Run to display all different information of the table on other pages. Available functions:

    
    <?php MainController::Run('InstantWeather', 'metar'); ?>        // example: EDDS 070920Z 26004KT 230V300 9999 FEW012 SCT025 BKN068 18/16 Q1015 NOSIG
    <?php MainController::Run('InstantWeather', 'pressure'); ?>     // example: 982 mbar
    <?php MainController::Run('InstantWeather', 'wind_speed'); ?>   // example: 4 kts
    <?php MainController::Run('InstantWeather', 'wind_degrees'); ?> // example: 260°
    <?php MainController::Run('InstantWeather', 'temperature'); ?>  // example: 18.0 °C
    <?php MainController::Run('InstantWeather', 'dewpoint'); ?>     // example: 16.0 °C
    <?php MainController::Run('InstantWeather', 'visibility'); ?>   // example: 6.21 mile
    
    <?php MainController::Run('InstantWeather', 'skycondition'); ?> 
    /* example: Sky condition level 1 FEW 1200 ft 
                Sky condition level 2 SCT 2500 ft (Scattered)
                Sky condition level 3 BKN 6800 ft (Broken)
    */

    DOWNLOAD 

    (Tested on PHPVMS Version 2.1.936)

    Would this be adaptable to a WP site. I would like to be able to weather on my front end.

  17. Greetings all. Im wondering if anyone can help me integrate a decoded metars table to run on a WP front page. I know about CheckWX and although I can get it working on php I cant seem to sort it on WP. Any help would be great.

  18. So I've managed to get the iframes working. On last bit, hoping you all can help me with. If I am signed in to the crewcenter, I the iframe shows me the skin plus the map. When im logout, it will only show me the map. Any thoughts on how I can get the iframe to show me only the map regardless of status.

  19. 8 minutes ago, ProAvia said:

    Mine doesn't redirect until you click a link on the index.php page.

     

    How about if you edit frontpage_main in the skins folder?
     

    
    <?php if(Auth::LoggedIn()) {
    	header('Location:'.SITE_URL.'/index.php/profile');
    } else {
    	header('Location:'.SITE_URL.'/index.php/login');
    } ?>

    In the 'else' section, have /index.php - without the /login. Of course, you would need to provide a login section on the index.php page. Or have a totally different page to go to if not logged in - but it would still need a login section or link to the login page.

     

    Like I said, I don't have a crew center skin and don't really know if the above would work with it or not.

    Hey no worries, I appreciate you even taking the time. That still didn't work. Either full blank page or fatal errors out.

     

    If I can try a different a different approach to this. Do you know how to create a module for use inside of phpvms. Im figuring if I can add a blank module to only show text, than I can use the normal code spinets to pull all the stats into that one module. After that I can just iframe the module to the static page.

  20. 2 minutes ago, ProAvia said:

    If you go to your domain... http://urlhere.org/welcome - it should load the index page. clicking any link there will load to the /portal directory

    If you go to your domain/portal... http://urlhere.org/welcome/portal - it should load the same index page

     

    I don't use a crew center type skin. My log in box is in the upper right corner of the page. I just wanted to main domain and the phpvms directory to show the same page. 

    https://mysite.com - domain

    https://mysite.com/phpvms - where my phpvms files/folders are

     

     

    What I mean is that if I type http://urlhere.org/welcome/index.php it will auto redirect to http://urlhere.org/welcome/portal/index.php. Trouble remains, If I dont have a user name and password it still wont show me anything.in a worst case scenario I know I can just iframe the map. Im just trying to scripted so that I can pull the rest of the VA stats as well.

×
×
  • Create New...