Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
This uploader supports multiple file upload.
Submit
~
var
www
podiocopy.bitkit.dk
httpdocs
app
Http
Controllers
File Content:
HomeController.php
<?php namespace App\Http\Controllers; use App\Modules\Auth\User; use App\Modules\Configurations\Config; use App\Modules\GenModels\TransferQueue; use Auth; use Input; use MongoDB\BSON\ObjectId; use MongoId; use Redirect; use Validator; use Mail; use Log; class HomeController extends Controller { /* |-------------------------------------------------------------------------- | Home Controller |-------------------------------------------------------------------------- | | This controller renders your application's "dashboard" for users that | are authenticated. Of course, you are free to change or remove the | controller as you wish. It is just here to get your app started! | */ public function __construct() { //$this->middleware('auth'); $this->transferQModel = new TransferQueue(); } /** * Show the application dashboard to the user. * * @return Response */ public function getIndex() { if (Auth::guest()) { return view('index'); } else { // return view('index'); return view('dashboard'); } } public function getFaq() { return view('faq'); } public function getContact() { return view('contact'); } public function postContact() { $input = Input::all(); $rules = array( 'name' => 'required|max:20', 'email' => 'required|email', 'support_type' => 'required|in:feature,bug,help,other', 'comments' => 'required' ); $recaptcha = $_POST['g-recaptcha-response']; $validator = Validator::make($input, $rules); if (!empty($recaptcha)) { $google_url = "https://www.google.com/recaptcha/api/siteverify"; $secret = '6Lfu3xQTAAAAAGSRzaAGhuMz_6MxV3zpDq2ABEHO'; $ip = $_SERVER['REMOTE_ADDR']; $url = $google_url . "?secret=" . $secret . "&response=" . $recaptcha . "&remoteip=" . $ip; $res = $this->curlData($url); $res = json_decode($res, true); if ($res['success']) { if ($validator->fails()) { return Redirect::to('/contact')->withErrors($validator)->withInput(); } else { Mail::send('emails.contact', $input, function ($message) use ($input) { $message->to(Config::$CONTACT_US_EMAIL, Config::$CONTACT_US_EMAIL_NAME) ->subject('Data Copy Tool Support [' . $input['email'] . ' - ' . $input['support_type'] . ']' . ' (#data-copy#)'); $message->from($input['email'], $input['name']); }); return Redirect::to('/contact')->with('success', 'Thank you for contacting us, we will get back to you shortly '); } } else { return Redirect::to('/contact')->with('captchaError', 'Wrong Selection'); } } else { if ($validator->fails()) { return Redirect::to('/contact')->with('captchaError', 'Empty captcha')->withErrors($validator)->withInput(); } else { return Redirect::to('/contact')->with('captchaError', 'Empty captcha')->withInput(); } } } public function getTermsAndConditions() { return view('terms-and-conditions'); } private function curlData($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 10); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16"); $curlData = curl_exec($curl); curl_close($curl); return $curlData; } public function getCheckUnfinished() { echo "<pre>"; $queues = $this->transferQModel->find(array('status' => array('$ne' => 'completed'))); foreach ($queues as $queue) { $date = new \DateTime(date('m/d/Y', $queue['createdTime'])); $interval = $date->diff(new \DateTime("now")); if ($interval->days >= 2) { $this->sendMail($queue); } } } private function sendMail($queue) { $userObj = new User(); $user = $userObj->findOne(array('_id' => new ObjectId($queue['user']))); $input = array(); $input['email'] = "support@phases.dk"; $input['name'] = $user['name']; try { Mail::send('emails.unfinished', $input, function ($message) use ($input) { $message->to(Config::$CONTACT_US_EMAIL, Config::$CONTACT_US_EMAIL_NAME) ->subject('Data Copy Tool Support [' . $input['email'] . ' - ]' . ' (#data-copy#)'); $message->from("nvj@phases.dk", "Nivin V Joseph"); }); } catch (Exception $e) { Log::error($e); } } }
Edit
Download
Unzip
Chmod
Delete