Jump to content

Oxymoron290

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Oxymoron290

  1. Hey guys! Remember SimPilotGroup's Airmail Module available at https://github.com/D.../phpVMS-AirMail ? I've been doing a few additions to the module lately, specifically those we have set up as our milestones. (Viewable at https://github.com/D...sues/milestones ) With the most recent one being a contacts addition (Pull Request #6 https://github.com/D...-AirMail/pull/6 ) Here is a video demonstrating the new additions: This is already in production over at Wings on Air http://wingsonair.net ! Stay tuned for more updates to this module soon! A ton of thanks to SimPilotGroup for creating the original airmail module and making this neat little addition possible. Enjoy, Oxymoron290 Temprary Content: While we are waiting for SimPilot to evaluate and accept the pull request the download will not be available at his github, to get it while it's hot, download the source at https://github.com/O...l/tree/contacts (Because we all have a little hipster in us saying "I had an address book before it was even in the airmail module")
  2. https://github.com/D...-AirMail/pull/4 pull request submitted.
  3. a better solution coming up in the next release: http://forum.phpvms.net/topic/8375-installation-errors/
  4. Hey Vansers! I know we already discussed this issue on github, So I'm posting a link to the issue submitted to keep any researchers informed! https://github.com/n...pVMS/issues/102 For this one, refer to https://github.com/n...hpVMS/issues/77 This one I neglected to commit. after line 60, add the following: self::$request = new stdClass(); Edit: Sorry, I didn't forget to commit this, It's available at https://github.com/nshahzad/phpVMS/commit/96bee1315c14d1a576e80090ef66909fde3fa34f Good luck!
  5. I have a fix for the issues you guys are reporting, I also have some new features. Just waiting on david to create a development branch before submitting the pull request.
  6. I shall require 78 Smirnoffs, 12 rubber bands, 117 pop-sickle sticks, a bottle of pepto bismol and a bottle of elmers glue. I will PM you with the address where you can ship the supplies. Haha, just kidding. here is how I decided to implement that function: I placed the above function in ./core/common/MaintenanceData.class.php ​Now for the following bit you will have to forgive me as I have modded our installation of phpVMS tremendously and can't remember exactally what is in the default package. In ./core/common/PilotData.class.php around line 291 I put the following code (Keep in mind I have edited this file alot in my installation and might be on a different line for you. The function is changePilotID($old_pilotid, $new_pilotid) and it should go 3 lines after the $pilot_exists line) [/size] [size=4] $avatarFix = MaintenanceData::fixAvatar($old_pilotid, $new_pilotid); if($avatarFix !== true){ return $avatarFix; } Now for your convenience I will provide you with the full function that we are currently using on WOAVA, however, I would recommend AGAINST copying and using the code as I have made some security patches to the phpVMS Pilot Groups and this exact code wont work with the current release. (However, it might with the dev release! =] available here: https://github.com/n...archive/dev.zip ) [/size] [size=4]/** * PilotData::changePilotID() * * @param mixed $old_pilotid * @param mixed $new_pilotid * @return */ public static function changePilotID($old_pilotid, $new_pilotid) { if(!PilotGroups::group_has_perm(Auth::$usergroups, EDIT_PILOTS)) { Debug::showCritical('Unauthorized access - You do not have permissions to edit pilots'); die(); } $pilot_exists = self::getPilotData($new_pilotid); if (is_object($pilot_exists)) { return false; }[/size] [size=4] $avatarFix = MaintenanceData::fixAvatar($old_pilotid, $new_pilotid); if($avatarFix !== true){ return $avatarFix; } DB::query('SET foreign_key_checks = 0;'); // List of all the tables which need to update $table_list = array( 'groupmembers', 'pilots', 'adminlog', 'awardsgranted', 'acarsdata', 'sessions', 'pireps', 'pirepcomments', 'fieldvalues', 'bids');[/size] [size=4] foreach ($table_list as $table) { $sql = 'UPDATE `' . TABLE_PREFIX . $table . '` SET `pilotid`=' . $new_pilotid . ' WHERE `pilotid`=' . $old_pilotid; DB::query($sql); } return true; }[/size] [size=4]
  7. poor guy are you still wanting this buddy? What version of phpVMS do you want it on?
  8. This depends on several things and mainly by your network layout. For example, Lets say your Internet service provider has supplied you with a router or modem, this is their demarcation point. And let's say this modem only has one ethernet port, so in order for you to have multiple computers connected to the internet you install your own router, as most people do. You now have 3 firewalls in your network. The one on your modem, the one on your router, and the one built into your windows system. Here is what I would recommend you do. Identify your ISP's demarcation point and find out if it has a firewall, if it does, forward port 80 to the next "node", or next device, in your network. (moving towards your XAMPP web server) If you have a secondary router or device which is equipped with a firewall forward port 80 on it aswell to the next node on your network which by now should be your PC if it hasn't been hit yet. Once you have port 80 forwarded to your PC, verify the windows firewall isn't blocking it. The best way to know if your computer is configured properly as a web server is to try and access the webserver on that PC from an alternate PC on your network, such as your "work pc" as you discribed it above. You can also use http://www.yougetsignal.com/tools/open-ports/ as a tool to check if your successful. As a last resort, feel free to message me personally and I will be more than happy to assist you with this. Keep in mind however that worst case scenario your ISP may block you from hosting a web server, as any residential ISP would recommend you against doing. They also will provide absolutely no help in this situation. Good Luck! And happy hosting =)
  9. Give a man a fish, he eats for a day...
  10. Oxymoron290

    error

    That's a bit harsh and against the values of the open source community Although the license allows for such bigotry development, One shouldn't hinder the ability for another to approve and contribute upon the project. Especially when just asking for help.
  11. you alternatively want to do this: if($oldFile['filename'] != $pilotcode){ LogData::addLog(Auth::$userinfo->pilotid, "[Avatar HotFix]The file ".$newAvatar." was renamed to ".$pilotcode.'.'.$oldFile['extension']); $reply = @rename($directory.DS.$newAvatar, $directory.DS.$pilotcode.'.'.$oldFile['extension']); if (Config::Get('SIGNATURE_SHOW_AVATAR_IMAGE') == true) { LogData::addLog(Auth::$userinfo->pilotid, "[Avatar HotFix]Regernated signature for ".$pilotcode); PilotData::GenerateSignature($pilot->pilotid); } return $reply; }else{ return true; }
  12. I havn't used FSPAX, however it determines the users online status by the ACARS module, which i would assume, fspax ties into, as would any acars system.
  13. and a bottle of Elmer's glue. forgot to add that in there...
  14. Below is a function which will take any givin pilot and find the appropriate avatar for him and re-associate the avatar with the pilot after said pilot has been moved to another airline, or had their ID changed. ​it also deletes any unnecessary avatars. public static function fixAvatar($pilotid){ // Get the pilots Information. $pilotid = (int)$pilotid; $sql = "SELECT * FROM `".TABLE_PREFIX."pilots` WHERE `pilotid`=$pilotid"; $pilot = DB::get_row($sql); unset($pilotid); $err = DB::errno(); if($err != 0){ return false; } // Setting up the check (with regex) for an avatar with the pilots current ID. $pilotcode = PilotData::getPilotCode($pilot->code, $pilot->pilotid); $pilotid = preg_replace("/[^0-9]/", "", $pilotcode ); if(substr(SITE_ROOT, -1) == DS){ $rootDir = substr_replace(SITE_ROOT, "", -1); }else{ $rootDir = SITE_ROOT; } $directory = $rootDir.AVATAR_PATH; if (!is_dir($directory)) { return false; } $files = array(); if($handel = opendir($directory)){ // Go through each avatar and find any that match the pilots. while (false !== ($file = readdir($handel))){ if ('.' === $file) continue; if ('..' === $file) continue; if(preg_replace("/[^0-9]/", "", $file ) == $pilotid){ $files[] = $file; } } closedir($handel); if(count($files) == 0){ return true; // No files to update, exit successful. }else{ // if there is more than one avatars for the pilot find the newest one. if(count($files) > 1){ $newer = 0; foreach($files as $file){ $tmp = @filemtime($directory.DS.$file); if($tmp == NULL) $tmp = @filemtime(utf8_decode($directory.DS.$file)); if($tmp == null) // if your function is exiting here, try CHMODing your avatars directory. return false; if($tmp > $newer){ $newer = $tmp; $newAvatar = $file; } } // we will need to loop through these again and delete all matching $files that don't match $newAvatar. foreach($files as $file){ if($file != $newAvatar){ @unlink($directory.DS.$file); // delete the file. if(file_exists($directory.DS.$file)){ LogData::addLog(Auth::$userinfo->pilotid, "There was an error while deleting ".SITE_URL.AVATAR_PATH.$file.". Please delete it manually."); return false; }else{ LogData::addLog(Auth::$userinfo->pilotid, "The file ".SITE_URL.AVATAR_PATH.$file." was deleted successfully."); } } } }else{ $newAvatar = $files[0]; } $oldFile = pathinfo($directory.DS.$newAvatar); if($oldFile['filename'] != $pilotcode){ LogData::addLog(Auth::$userinfo->pilotid, "The file ".$newAvatar." was renamed to ".$pilotcode.'.'.$oldFile['extension']); return @rename($directory.DS.$newAvatar, $directory.DS.$pilotcode.'.'.$oldFile['extension']); }else{ return true; } } } return false; } This is the bare function and depending on where you put it, will be called different from implementation to implementation. For more information, or a pre-build implementation, I shall require 78 Smirnoffs, 12 rubber bands, 117 pop-sickle sticks, and a bottle of pepto bismol. ~wings on air~
  15. i sense many security risks in your future =(
  16. Hey Guys! So we were doing some development at woava.net tonight and came up with this little puppy. Thought you guys would like it. It checks weather the selected user is in a flight or not, if the user is in a flight it displays the current status of a flight, (parked, pushing back, taking off, etc...), Their departure to arrival in the format of DEPICAO -> ARRICO, (ex, kdfw -> klax), and the precentage currently based on distance from the flight. You can also base it on time using the variables <?php $acars->deptime; $acars->timeremaining; //and $acars->arrtime; ?> Anyways, enjoy! <?php /** ==================VVVV Checking Current logged in user VVVV================== **/ $acarsdata = ACARSData::GetACARSData(); if($acarsdata != null || !empty($acarsdata)){ foreach($acarsdata as $acars){ if($acars->pilotid == Auth::$userinfo->pilotid){ echo '<br />You are currently in a flight!'; echo '<br />Status: '.$acars->phasedetail; //echo '<br />Departure: '.$acars->depicao.' ';//.$acars->depname; //echo '<br />Arrival: '.$acars->arricao.' ';//.$acars->arrname; echo '<br />'.$acars->depicao .' -> '. $acars->arricao; $totalDistance = OperationsData::getAirportDistance($acars->depicao, $acars->arricao); $remainingDistance = $acars->distremain; $precent = ($remainingDistance/$totalDistance)*100; // Counts down precentage. 100%, 99%, 98%, etc... $precent = abs($precent-100); // Counts up precentage. 0%, 1%, 2%, etc... echo '<br />Precentage: ' . round($precent) . '%'; }else{ echo '<br />You are NOT currently in a flight!'; } } }else{ echo '<br />You are NOT currently in a flight!'; } /** ==================^^^^ Checking Current logged in user ^^^^================== **/ /** ===================================VVVV Pilot Public Profile dot tee pee elle VVVV============================= **/ $acarsdata = ACARSData::GetACARSData(); if($acarsdata != null || !empty($acarsdata)){ foreach($acarsdata as $acars){ if($acars->pilotid == $pilot->pilotid){ echo '<br />Pilot is currently in a flight!'; echo '<br />Status: '.$acars->phasedetail; //echo '<br />Departure: '.$acars->depicao.' ';//.$acars->depname; //echo '<br />Arrival: '.$acars->arricao.' ';//.$acars->arrname; echo '<br />'.$acars->depicao .' -> '. $acars->arricao; $totalDistance = OperationsData::getAirportDistance($acars->depicao, $acars->arricao); $remainingDistance = $acars->distremain; $precent = ($remainingDistance/$totalDistance)*100; // Counts down precentage. 100%, 99%, 98%, etc... $precent = abs($precent-100); // Counts up precentage. 0%, 1%, 2%, etc... echo '<br />Precentage: ' . round($precent) . '%'; }else{ echo '<br />Pilot is NOT currently in a flight!'; } }else{ echo '<br />Pilot is NOT currently in a flight!'; } /** ===================================^^^^ Pilot Public Profile dot tee pee elle ^^^^============================= **/ ?> Any improvements? comments? questions? feel free to ask! P.S. This goes on the pilot_public_profile.tpl <?php $usersOnline = StatsData::UsersOnline(); $check = false; if($usersOnline != null || !empty($usersOnline)){ foreach($usersOnline as $user){ if($user->pilotid == $pilot->pilotid){ $check = true; }else{ $check = false; } if($check){ break; } } if($check){ echo 'Pilot is currently Online'; }else{ echo 'Pilot is currently Offline'; } }else{ echo 'Pilot is currently Offline'; } ?> Edit: Had to add in the if($acarsdata != null || !empty($acarsdata)) to prevent errors when there are no flights in progress.
  17. Got it all figured out: https://github.com/nshahzad/phpVMS/issues/80
  18. Okay so I've been playing around with the group permissions and trying to add in a few custom permissions of my own, And then I stumbled across something in the logic that had me stumped. So in a few moments I will ask the question but before I would like to explain how I'm understanding this to make sure I have it down right. If the following paragraph sounds too confusing just ignore it, It's still kinda hard for me to explain. Basically what I can get from this is that each permission is represented in binary format and it starts at 1 then 10, then 100, then 1000. and you just check to see if that bit is on when checking for a permission. for example if I'm wanting to check if a user has permission 1 (By defualt this is EDIT_NEWS) and permission 4 (By default this is EMAIL_PILOTS) I would check to see if they have their permission value evaluates to 1001 Now I know this is all done for me in PilotGroups so there isn't much that I need to do in evaluating, just call the functions in that class. However this is the problem I'm having, I've noticed that between permissions 6 (EDIT_FLEET) and 7(EDIT_SCHEDUALS) there is a bit missing, it skips stright from 0x20 to 0x80, completely skipping 0x40? Is there a reason for this? I mean I'm sure if I were to add in a permission with the value of 0x40 and edit the FULL_ADMIN variable to have 35651583 instead of 35651519 then it should work just fine right? Or was there a reason for leaving out that bit?
  19. There is a readme that explains how to use it, and test.PHP is an examlple. I'm currently writing upload scripts for different forms. I will be posting those within the next week.
  20. Hey guys, I'm kinda new here, but I just made my first add-on for phpVMS, Developed on phpVMS Version v2.1.934-171-gbc02380 It's an addon that allows you to upload files such as images and junk. I've found it handy when creating Awards, Ranks, Adding aircraft and things like that in the admin panel. I plan to distribute that when I finish aswell. The github repository is at: https://github.com/Oxymoron290/Uploader-phpVMS
×
×
  • Create New...