Jump to content

Joaogl

Members
  • Posts

    19
  • Joined

  • Last visited

Joaogl's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Can you please confirm if this is the right place? https://github.com/nshahzad/codon/issues/2 Since its taking quite a while to get an answer I'm not sure if its the right place... Thanks, Joao Lourenco.
  2. Ok thank you very much I will contact him about the codon on github. Thanks, Joao Lourenco.
  3. Hello, I'd like to know if I can sell a CMS which is based on the codon and ezdb module that I built. This CMS has two versions: one only uses ezdb, the other uses both ezdb and codon module's. I saw the License but since the modules where not changed, I didn't remove the credits and there is a huge structure arround it I'm not sure... Also I don't think the code will be given to the clients.. it will run in our servers. This is a project for schools to manage some data and create statistical data for the Ministries of Education in Portugal. I got the ezdb from here: https://github.com/nshahzad/ezdb and codon from here: https://github.com/nshahzad/codon Thank you, Joao Lourenco.
  4. Hello, I'm making an ACARS and I've came up with a question... I know that phpvms accepts coordinates and altitudes for the PIREP and that they show up on the Map but I'm not sure where I need to send those and in what format... I think its on the route_details field of the DB but not sure... Thank you, Joao Lourenco.
  5. that easy... thank you so much man!
  6. Hello, I'm trying to solve a problem on my module, its a sql injection problem but I don't know to solve it since its a text field... Here its code: protected function add_request_post() { /* id pilotid schedule type */ if($this->post->id == '') { $this->set('message', 'Invalid Certificate specified'); $this->render('core_error.tpl'); return; } if($this->post->pilotid == '' || $this->post->schedule == '' || $this->post->type == '') { $this->set('message', 'You must write your schedules'); $this->render('core_error.tpl'); return; } $data = array( 'id'=>$this->post->id, 'pilotid'=>$this->post->pilotid, 'type'=>$this->post->type, 'schedule'=>$this->post->schedule ); AcademyData::addRequest($data); if(DB::errno() != 0) { if(DB::$errno == 1062) // Duplicate entry $this->set('message', 'You have already submited a request.'); else $this->set('message', 'There was an error sending your request. Try again later.'); $this->render('core_error.tpl'); return false; } $this->set('message', 'Request submited with success.'); $this->render('core_success.tpl'); } public static function addRequest($data) { /* $data = array('id'=>$this->post->id, 'pilotid'=>$this->post->pilotid, 'type'=>$this->post->type, 'schedule'=>$this->post->schedule);*/ $sql = "INSERT INTO ".TABLE_PREFIX."requests ( `pilotid`, `schedule`, `type`, `cid`, `status`, `score`) VALUES ( '{$data['pilotid']}', '{$data['schedule']}', '{$data['type']}', '{$data['id']}', '0', '3')"; echo $sql; $res = DB::query($sql); if(DB::errno() != 0) return false; return true; } How could I fix it? Thanks, Joao Lourenco.
  7. I did managed to fix all of that know I just got a question... How can I make the logins and log out's if both phpvms and phpbb have similar classes? (Auth, Templates, Session) how can I get arround with that?
  8. Did it, now it gives me this error: Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Fatal error: require(): Failed opening required 'includes/startup.' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/forum/common.php on line 19 so I tried this: include('/home/tigersor/public_html/forum/include/startup.php'); include('/home/tigersor/public_html/forum/common.php'); and then this happed: Warning: include(/home/tigersor/public_html/forum/include/startup.php): failed to open stream: No such file or directory in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: include(): Failed opening '/home/tigersor/public_html/forum/include/startup.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Fatal error: require(): Failed opening required 'includes/startup.' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/forum/common.php on line 19
  9. Don't know how I missed that but it doesn't work anyway... Warning: include(/public_html/forum/common.php): failed to open stream: No such file or directory in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: include(): Failed opening '/public_html/forum/common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Fatal error: Call to a member function session_begin() on a non-object in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 39 Thank you for the awnser, Joao Lourenco
  10. Hello guys, I know there was once a topic about automatic register on the phpbb forum from the phpvms register but that's the small part of my problem and I'm here trying to find the awnser for rest of it. I don't consider myself a very good php programmer so please don't expect too much... So what I'm trying to do is to get a few things done like, registration, login, logout, account activation and finally but not least, a last posts page. Registration is done and working. Login is giving me an error that I will post in a few. Logout, don't know yet how to do it. Account activation, I thought I only had to remove the users actkey from the database but it didn't work... Last posts page... well... no Idea... haven't started yet. My code: <?php class ForumManager extends CodonModule { public function __construct() { CodonEvent::addListener('ForumManager'); } public function EventListener($eventinfo) { if($eventinfo[0] == 'registration_complete') self::RegisterAccount($eventinfo[2]); else if($eventinfo[0] == 'login_success') self::LoginAccount($eventinfo[2]); else if($eventinfo[0] == 'logout_success') self::LogoutAccount(); else if($eventinfo[0] == 'account_activated') self::ActivateAccount($eventinfo[2]); } public function RegisterAccount($userinfo) { $fname = $userinfo['firstname']; $lname = $userinfo['lastname']; $pass = $userinfo['password1']; $email = $userinfo['email']; $code = $userinfo['code']; $uinfo = PilotData::GetPilotByEmail($userinfo['email']); $code = PilotData::GetPilotCode($uinfo->code, $uinfo->pilotid); $pilot_id = $fname.' '.$lname; $pilot_id_klein = strtolower($pilot_id); $passMD5 = md5($pass); $tm = time(); DB::query("INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_actkey, user_dateformat, user_style, user_regdate) VALUES ('".$pilot_id."', '".$pilot_id_klein."', '".$passMD5."', '".$email."', '9','0.0', '0', '2','en','0099FF','1','5BN4938HB2','D M d, Y g:i a', '2', '".$tm."')"); } public function LoginAccount($userinfo) { define('IN_PHPBB', true); include('/public_html/forum/commons.php'); $user->session_begin(); $auth->acl($user->data); $user->setup(); if($user->data['is_registered']) { //User is already logged in } else { $username = $userinfo['pilotid']; $password = $userinfo['password']; echo "usuario: " . $username . " ; password: " . $password; $result = $auth->login($username, $password); if ($result['status'] == LOGIN_SUCCESS) { //User was successfully logged into phpBB echo "Login correcto"; if ($ref !=""){ header("location:$ref"); }else{ header("location:index.php"); } } else { //User's login failed echo "Login incorrecto: " . $result['status']; } } } public function LogoutAccount() { define('IN_PHPBB', true); include('/public_html/forum/common.php'); } public function ActivateAccount($userinfo) { } } ?> The login error: Warning: include(/public_html/forum/commons.php): failed to open stream: No such file or directory in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: include(): Failed opening '/public_html/forum/commons.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Fatal error: Call to a member function session_begin() on a non-object in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 39 I've checked and the commons file is indeed there... Maybe to keep the topic organized we should start with the login and then move to the next topic? What am I doing wrong to get this error? Thanks for your time, hope I help someone else with this topic, Joao Lourenco.
  11. Hello, I have two questions, Is it possible to print the error message and then kill the module if and error ocurres on a Module? Right now what is happening is that if something goes wrong on a Module it only shows the error and I'd like to have something that prints the error stops that module and continue with the rest of the website. Is it possible? Second question: if ((isset($_POST['Del'])) && (PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))) VirtualThaw2014Data::delete_mission(explode("Delete ", $_POST['Del'])[1]); this works just fine on my local server but when I move it to the host it gives me an error: Parse error: syntax error, unexpected '[' in /home/public_html/core/modules/VirtualThaw2014/VirtualThaw2014.php on line 23 The error is on the $_POST['Del'] any Idea why? Thank you, Joao Lourenco.
  12. I know the code to do that is in RealScheduleLite but i cant put it in the Schedules Default....... Please Help.....
  13. Hi guy's, I have one problem. I want to create a code to my schedules system, the code is: If the plane (ex. A330) is in (ex. LPPT) he will show's only the routes wiht the departure LPPT for that airplane. So in the schedule_results i have that code: <?php if(!$allroutes) { echo '<p align="center">No routes have been found!</p>'; return; } ?> <table width="666" class="tablesorter" id="tabledlist"> <thead> <tr> <th width="389">Flight Info</th> <th width="54"> </th> <th width="207">Options</th> </tr> </thead> <tbody> <?php foreach($allroutes as $route) { /* Uncomment this code if you want only schedules which are from the last PIREP that pilot filed */ if(Auth::LoggedIn()) { $search = array( 'p.pilotid' => Auth::$userinfo->pilotid, 'p.accepted' => PIREP_ACCEPTED ); $reports = RealScheduleLiteData::get_pilot_location($userinfo->pilotid); if(is_object($reports)) { # IF the arrival airport doesn't match the departure airport if($reports->arricao != $route->depicao) { continue; } } } /* Skip over a route if it's not for this day of week Left this here, so it can be omitted if your VA doesn't use this. Comment out these two lines if you don't want to. */ /* Check if a 7 is being used for Sunday, since PHP thinks 0 is Sunday */ $route->daysofweek = str_replace('7', '0', $route->daysofweek); if(strpos($route->daysofweek, date('w')) === false) continue; /* END DAY OF WEEK CHECK */ /* This will skip over a schedule if it's been bid on This only runs if the below setting is enabled If you don't want it to skip, then comment out this code below by adding // in front of each line until the END DISABLE SCHEDULE comment below If you do that, and want to show some text when it's been bid on, see the comment below */ if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0) { continue; } /* END DISABLE SCHEDULE ON BID */ /* Skip any schedules which have aircraft that the pilot is not rated to fly (according to RANK), only skip them if they are logged in. */ if(Config::Get('RESTRICT_AIRCRAFT_RANKS') === true && Auth::LoggedIn()) { /* This means the aircraft rank level is higher than what the pilot's ranklevel, so just do "continue" and move onto the next route in the list */ if($route->aircraftlevel > Auth::$userinfo->ranklevel) { continue; } } /* THIS BEGINS ONE TABLE ROW */ ?> <tr> <td> <a href="<?php echo url('/schedules/details/'.$route->id);?>"><?php echo $route->code . $route->flightnum?> <?php echo '('.$route->depicao.' - '.$route->arricao.')'?> </a> <br /> <strong>Departure: </strong><?php echo $route->deptime;?> <strong>Arrival: </strong><?php echo $route->arrtime;?><br /> <strong>Equipment: </strong><?php echo $route->aircraft; ?> (<?php echo $route->registration;?>) <strong>Distance: </strong><?php echo $route->distance . Config::Get('UNITS');?> <br /> <strong>Days Flown: </strong><?php echo Util::GetDaysCompact($route->daysofweek); ?><br /> <?php echo ($route->route=='') ? '' : '<strong>Route: </strong>'.$route->route.'<br />' ?> <?php echo ($route->notes=='') ? '' : '<strong>Notes: </strong>'.html_entity_decode($route->notes).'<br />' ?> <?php # Note: this will only show if the above code to # skip the schedule is commented out if($route->bidid != 0) { echo 'This route has been bid on'; } ?> </td> <td> </td> <td nowrap> <a href="<?php echo url('/schedules/details/'.$route->id);?>">View Details</a><br /> <a href="<?php echo url('/schedules/brief/'.$route->id);?>">Pilot Brief</a><br /> <?php # Don't allow overlapping bids and a bid exists if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0) { ?> <a id="<?php echo $route->id; ?>" class="addbid" href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a> <?php } else { if(Auth::LoggedIn()) { ?> <a id="<?php echo $route->id; ?>" class="addbid" href="<?php echo url('/schedules/addbid');?>">Add to Bid</a> <?php } } ?> </td> </tr> <?php /* END OF ONE TABLE ROW */ } ?> </tbody> </table> <hr> Please Help-me .....
  14. Joaogl

    Modules

    thank you really thank you now its working. hehehhe
  15. Joaogl

    Modules

    Hello guy's, <?php class adicionar extends CodonModule { public function index() { $this->show('adicionar.tpl'); $this->set('userinfo', Auth::$userinfo); } } ?> and on template <style type="text/css"> #tabledlistcolor { color: #069; } .style1 {color: #669900} </style> <?php Auth::$userinfo ?> <h3>*Reservar um Oasis/Aldeia <?php echo $userinfo->firstname; ?>*</h3> <p> </p> and still doesn't work i and i m logged in
×
×
  • Create New...