Ejemplo n.º 1
0
 public static function verifyBlacklist($data)
 {
     $settings = IniHandle::readini();
     if ($data['custom'] == 'blacklist_skype') {
         $price = $settings['skypebl'];
     } elseif ($data['custom'] == 'blacklist_ip') {
         $price = $settings['ipbl'];
     } else {
         Log::write('PayPal', 'No custom parameter, could not get product(Blacklist:skype/IP)');
         return;
     }
     Log::write('PayPal', 'Verifying Blacklist');
     $user = User::find($data['option_selection1']);
     if (empty($user)) {
         Log::write('PayPal', 'Blacklist verify: User does not exist');
         return View::make('msg.error')->with('error', 'User does not exist.');
     }
     if ($data['mc_gross'] != $price) {
         Log::write('PayPal', 'Blacklist verify: prices do not match');
         return View::make('msg.error')->with('error', 'Prices do not match');
     }
     if (Custblacklist::where('blacklist', '=', $data['option_selection2'])->count() != 0) {
         Log::write('PayPal', 'Blacklist verify: Blacklist variable already exists: ' . $data['option_selection2']) . ' -> continue process though';
         return true;
     }
     Custblacklist::create(array('user_id' => $data['option_selection1'], 'blacklist' => strtolower($data['option_selection2']), 'type' => $data['custom'] == 'blacklist_skype' ? 'skype' : 'ip', 'transaction_id' => $data['txn_id']));
     Log::write('PayPal', 'Blacklist verify: succeeded added blacklist: ' . $data['option_selection2']);
     return true;
 }
Ejemplo n.º 2
0
 public function get_info($id)
 {
     $trans = Payment::where('transaction_id', '=', $id)->first();
     if (empty($trans)) {
         return View::make('msg.error')->with('error', 'This transaction does not exist');
     }
     $settings = IniHandle::readini();
     return View::make('page.admin.transaction.info')->with('trans', $trans)->with('currency', $settings['ppcurrency'])->with('transactions', Payment::where('user_id', '=', $trans->user_id)->order_by('date', 'DESC')->take(15)->get());
 }
Ejemplo n.º 3
0
 public function post_skype()
 {
     $skype = Input::get('api');
     $skype = trim($skype);
     $settings = IniHandle::readini();
     $settings['skypeapi'] = $skype;
     IniHandle::write_ini_file($settings);
     return \Laravel\Redirect::to('/admin/booter/skype');
 }
Ejemplo n.º 4
0
 public function post_process()
 {
     Log::write('PayPal', 'Trying to process IPN');
     Bundle::start('paypal-ipn');
     $listener = new IpnListener();
     //        $listener->use_sandbox = true;
     try {
         $listener->requirePostMethod();
         $verified = $listener->processIpn();
     } catch (Exception $e) {
         Log::info($e->getMessage());
     }
     if ($verified) {
         Log::write('PayPal', 'IPN payment looks verified');
         $data = Input::get();
         $settings = IniHandle::readini();
         if (!in_array($data['payment_status'], array('Completed', 'COMPLETED', 'completed'))) {
             Log::write('PayPal', 'payment not completed');
             return View::make('msg.error')->with('error', 'PayPal: payment not completed');
         }
         if (strtolower($data['receiver_email']) != strtolower($settings['ppemail'])) {
             Log::write('PayPal', 'receive email not same as set in settings. Settings: ' . $settings['ppemail'] . ' ||| PayPal email: ' . $data['receiver_email']);
             return View::make('msg.error')->with('error', 'PayPal: receive email not same as set in settings');
         }
         if (Payment::where('transaction_id', '=', $data['txn_id'])->count() != 0) {
             Log::write('PayPal', 'transaction ID already exists');
             return View::make('msg.error')->with('error', 'PayPal: transaction ID already exists');
         }
         if (strtolower($data['mc_currency']) != strtolower($settings['ppcurrency'])) {
             Log::write('PayPal', 'Currencies do not match');
             return View::make('msg.error')->with('error', 'PayPal: currencies do not match');
         }
         Log::write('PayPal', 'Got past all PLAN controller checks now going into CUSTOM');
         if (strtolower($data['custom']) == 'plan') {
             $result = Payment::verifyPlan($data);
             if (!$result) {
                 return $result;
             }
         } elseif (strtolower($data['custom']) == 'blacklist_skype' || strtolower($data['custom']) == 'blacklist_ip') {
             $result = Payment::verifyBlacklist($data);
             if (!$result) {
                 return $result;
             }
         } else {
             Log::write('PayPal', 'Custom not found, can\'t verify anything');
             return View::make('msg.error')->with('error', 'Fraudulent payment?');
         }
         Log::write('PayPal', 'Now trying to add Payment info to DB');
         $payment = Payment::create(array('user_id' => $data['option_selection1'], 'token' => $data['ipn_track_id'], 'date' => date('Y-m-d H:i:s', time()), 'ack' => $data['payment_status'], 'transaction_id' => $data['txn_id'], 'amount' => $data['mc_gross'], 'paypal_fee' => $data['mc_fee'], 'status' => $data['payment_status'], 'description' => $data['custom']));
         Log::write('PayPal', 'Successful payment, DB id: ' . $payment->id);
     } else {
         Log::write('PayPal', 'IPN listener returns false on check');
     }
     return 'handled';
 }
Ejemplo n.º 5
0
 public function post_ipbl()
 {
     $price = Input::Get('price');
     if (empty($price) || !is_numeric($price)) {
         return View::make('msg.error')->with('error', 'Invalid price set');
     }
     $settings = IniHandle::readini();
     $settings['ipbl'] = $price;
     IniHandle::write_ini_file($settings);
     return Redirect::to('/admin/plan/blacklist');
 }
Ejemplo n.º 6
0
 public static function skypeResolve($username)
 {
     if (empty($username)) {
         return View::make('msg.errormn')->with('error', '<br />Invalid username.');
     }
     if (Custblacklist::where('type', '=', 'skype')->where('blacklist', '=', $username)->count() > 0) {
         return View::make('msg.errormn')->with('error', '<br />This Skype name is blocked from being resolved');
     }
     $settings = IniHandle::readini();
     if (empty($settings['skypeapi']) || $settings['skypeapi'] == '') {
         $url = base64_decode('aHR0cDovL2luZmVybm9hcGkuY29tL3NreXBlLnBocD9hcGlrZXk9Y2M4NGNiOTQ3MmFkZmNhZWM2MTVmMjI4ZTgwMmY2ZWVjNWJiZDlkMSZ1c2VyPQ==') . $username;
     } else {
         $url = $settings['skypeapi'] . $username;
     }
     $c = curl_init();
     curl_setopt($c, CURLOPT_URL, $url);
     curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
     $result = curl_exec($c);
     return '<br /><table style="margin-left:30px;"><tbody><tr><td>Username:</td><td>' . $username . '</td></tr><tr><td>IP:</td><td>' . $result . '</td></tr></tbody></table>';
 }
Ejemplo n.º 7
0
 public function get_dump()
 {
     $settings = IniHandle::readini();
     $methods = $settings['methods'];
     $api = $settings['skypeapi'];
     $skypebl = $settings['skypebl'];
     $ipbl = $settings['ipbl'];
     $result = array();
     foreach ($settings as $key => $value) {
         $result[$key] = '';
     }
     $result['pagetitle'] = 'PrettyBoot';
     $result['name_part1'] = 'Pretty';
     $result['name_part2'] = 'Boot';
     $result['booterstatus'] = 1;
     $result['methods'] = $methods;
     $result['skypeapi'] = $api;
     $result['skypebl'] = $skypebl;
     $result['ipbl'] = $ipbl;
     $result['ppcurrency'] = 'USD';
     IniHandle::write_ini_file($result);
     return Redirect::to('/admin/settings');
 }
Ejemplo n.º 8
0
 public static function getSetting()
 {
     $data = IniHandle::readini();
     return $data;
 }
Ejemplo n.º 9
0
 public function resetPassword()
 {
     $password = substr(md5(time()), 0, 10);
     $this->password = Hash::make($password);
     $this->save();
     $settings = IniHandle::readini();
     $name = $settings['name_part1'] . $settings['name_part2'];
     $adminmail = $settings['admin_mail'];
     $message = "Hey there {$this->email}, \n\n                    You requested a password reset.\n\n                    Your new password is: {$password} \n\n                    Greetings the staff at {$name}";
     mail($this->emailaddress, 'Password reset', $message, "From: {$adminmail}");
     return View::make('msg.success')->with('msg', 'We\'ve sent an email to you with your username and new password!');
 }
Ejemplo n.º 10
0
 public function get_index()
 {
     $settings = IniHandle::readini();
     return View::make('page.buy.blacklist')->with('settings', $settings);
 }
Ejemplo n.º 11
0
 public static function status()
 {
     $s = IniHandle::readini();
     if ($s['booterstatus'] == true) {
         return true;
     }
     return false;
 }