Skip to content

Commit

Permalink
update v 1.0.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sujit223 committed Jun 13, 2016
1 parent aa9786d commit 283d97e
Show file tree
Hide file tree
Showing 5,078 changed files with 343,708 additions and 179,852 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/node_modules
Homestead.yaml
Homestead.json
/nbproject/private/
/nbproject/private/
.env
/app/Plugins/ServiceDesk/
/app/config/
1,867 changes: 1,867 additions & 0 deletions DB/dummy-data.sql

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3>About Faveo</h3>
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master">&nbsp;<img src="https://img.shields.io/badge/License-OSL-blue.svg">&nbsp;<a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a>&nbsp;<a href="https://styleci.io/repos/34716238"><img src="https://styleci.io/repos/34716238/shield" alt="StyleCI" height="19px"></a>&nbsp;<a href="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/index.html" target="_blank"><img src="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/grade.svg" height="20px"></a>&nbsp;<a href="https://scrutinizer-ci.com/g/ladybirdweb/faveo-helpdesk/?branch=master" target="_blank"><img src="https://scrutinizer-ci.com/g/ladybirdweb/faveo-helpdesk/badges/quality-score.png?b=master" height="20px"></a></br>
<h3>About Faveo</h3>
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master">&nbsp;<img src="https://img.shields.io/badge/License-OSL-blue.svg">&nbsp;<a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a>&nbsp;<a href="https://styleci.io/repos/34716238"><img src="https://styleci.io/repos/34716238/shield" alt="StyleCI" height="19px"></a>&nbsp;<a href="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/index.html" target="_blank"><img src="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/grade.svg" height="20px"></a>&nbsp;<a href="https://scrutinizer-ci.com/g/ladybirdweb/faveo-helpdesk/?branch=master" target="_blank"><img src="https://scrutinizer-ci.com/g/mverma16/faveo-helpdesk/badges/quality-score.png?b=master" height="20px"></a></br>
<p>Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
<br/><br/>
The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions.
Expand Down Expand Up @@ -28,8 +28,6 @@ Faveo is designed & developed by <a href="http://www.ladybirdweb.com/" target="_
<li> Database: MySQL(5.0+) or Postgres or SQLite or SQL Server</li>
<li> Web Server Extension: Pretty URLs or Search Engine Friendly URL's have to be enabled in your web server configuration</li>
</ul>
<p><small><b>Note:</b> php5 dependencies for <em>nginx/php-fpm</em> setup are as follow</small></p>
```php5-curl php5-mysql php5-mcrypt php5-cli php5-gd php5-imap```

<h3>Faveo Web Hosting</h3>
<p><a href="http://www.store.ladybirdwebhost.com/" target="_blank">Ladybird Web Host</a> Offers hosting with minimum requirement to host Faveo web application. Faveo has been tested on Ladybird Web Host servers &amp; works very well in their server environment. All web hosting packages offered by Ladybird Web Host come with 30 day money back gurantee.</p>
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions app/BaseModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App;

use File;
use Illuminate\Database\Eloquent\Model;

/**
* ======================================
* Attchment Model
* ======================================
* This is a model representing the attachment table.
*
* @author Ladybird <info@ladybirdweb.com>
*/
class BaseModel extends Model
{
public function setAttribute($property, $value)
{
require_once base_path('vendor'.DIRECTORY_SEPARATOR.'htmlpurifier'.DIRECTORY_SEPARATOR.'library'.DIRECTORY_SEPARATOR.'HTMLPurifier.auto.php');
$path = base_path('vendor'.DIRECTORY_SEPARATOR.'htmlpurifier'.DIRECTORY_SEPARATOR.'library'.DIRECTORY_SEPARATOR.'HTMLPurifier'.DIRECTORY_SEPARATOR.'DefinitionCache'.DIRECTORY_SEPARATOR.'Serializer');
if (!File::exists($path)) {
File::makeDirectory($path, $mode = 0777, true, true);
}
$config = \HTMLPurifier_Config::createDefault();
//dd($config);
$purifier = new \HTMLPurifier($config);
if ($value != strip_tags($value)) {
$value = $purifier->purify($value);
}
parent::setAttribute($property, $value);
}
}
8 changes: 0 additions & 8 deletions app/Commands/Command.php

This file was deleted.

4 changes: 1 addition & 3 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ protected function schedule(Schedule $schedule)
->hourly();

$schedule->call(function () {

$user = new User();
$user->save();

})->everyFiveMinutes();
})->everyFiveMinutes();
}
}
207 changes: 146 additions & 61 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,47 @@
namespace App\Exceptions;

// controller
use App\Http\Controllers\Common\PhpMailController;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
//use Illuminate\Validation\ValidationException;
use Illuminate\Foundation\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
// use Symfony\Component\HttpKernel\Exception\HttpException;
// use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
use Bugsnag;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class Handler extends ExceptionHandler
{
public $phpmailer;
class Handler extends ExceptionHandler {

/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException',
// 'Symfony\Component\HttpKernel\Exception\HttpException',
// 'Illuminate\Http\Exception\HttpResponseException',
ValidationException::class,
AuthorizationException::class,
HttpResponseException ::class,
ModelNotFoundException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
];

/**
* Create a new controller instance.
* constructor to check
* 1. php mailer.
*
* @return void
*/
// public function __construct(PhpMailController $PhpMailController)
// {
// $this->PhpMailController = $PhpMailController;
// }

/**
* Report or log an exception.
*
Expand All @@ -29,8 +53,14 @@ class Handler extends ExceptionHandler
*
* @return void
*/
public function report(Exception $e)
{
public function report(Exception $e) {
$debug = \Config::get('app.bugsnag_reporting');
$debug = ($debug) ? 'true' : 'false';
if ($debug == 'false') {
Bugsnag::setBeforeNotifyFunction(function ($error) {
return false;
});
}
return parent::report($e);
}

Expand All @@ -42,51 +72,42 @@ public function report(Exception $e)
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
//dd($e);
$phpmail = new PhpMailController();
$this->PhpMailController = $phpmail;
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
} elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
}
// This is to check if the debug is true or false
if (config('app.debug') == false) {
// checking if the error is actually an error page or if its an system error page
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
return response()->view('errors.404', []);
} else {
// checking if the application is installed
if (\Config::get('database.install') == 1) {
// checking if the error log send to Ladybirdweb is enabled or not
if (\Config::get('app.ErrorLog') == '1') {
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['system_error' => "<pre style='background-color: #FFC7C7;/* border-color: red; */border: 1px solid red;border-radius: 3px;'> <b>Message:</b>".$e->getMessage().'<br/> <b>Code:</b>'.$e->getCode().'<br/> <b>File:</b>'.$e->getFile().'<br/> <b>Line:</b>'.$e->getLine().'</pre>']);
} catch (Exception $exx) {
}
}
}

return response()->view('errors.500', []);
}
}
// returns non oops error message
return parent::render($request, $e);
// checking if the error is related to http error i.e. page not found
if ($this->isHttpException($e)) {
// returns error for page not found
return $this->renderHttpException($e);
}
// checking if the config app sebug is enabled or not
if (config('app.debug')) {
// returns oops error page i.e. colour full error page
return $this->renderExceptionWithWhoops($e);
}

return parent::render($request, $e);
}
// public function render($request, Exception $e) {
// if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
// return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
// } elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
// return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
// }
// This is to check if the debug is true or false
// if (config('app.debug') == false) {
// // checking if the error is actually an error page or if its an system error page
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
// return response()->view('errors.404', []);
// } else {
// // checking if the application is installed
// if (\Config::get('database.install') == 1) {
// // checking if the error log send to Ladybirdweb is enabled or not
// if (\Config::get('app.ErrorLog') == '1') {
//
// }
// }
// return response()->view('errors.500', []);
// }
// }
// returns non oops error message
// return parent::render($request, $e);
// checking if the error is related to http error i.e. page not found
// if ($this->isHttpException($e)) {
// // returns error for page not found
// return $this->renderHttpException($e);
// }
// // checking if the config app sebug is enabled or not
// if (config('app.debug')) {
// // returns oops error page i.e. colour full error page
// return $this->renderExceptionWithWhoops($e);
// }
//return parent::render($request, $e);
// }

/**
* function to generate oops error page.
Expand All @@ -95,14 +116,78 @@ public function render($request, Exception $e)
*
* @return \Illuminate\Http\Response
*/
protected function renderExceptionWithWhoops(Exception $e)
{
// new instance of whoops class to display customized error page
$whoops = new \Whoops\Run();
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
// protected function renderExceptionWithWhoops(Exception $e) {
// // new instance of whoops class to display customized error page
// $whoops = new \Whoops\Run();
// $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
//
// return new \Illuminate\Http\Response(
// $whoops->handleException($e), $e->getStatusCode(), $e->getHeaders()
// );
// }

/**
* Render an exception into an HTTP response.
* @param type $request
* @param Exception $e
* @return type mixed
*/
public function render($request, Exception $e) {

return new \Illuminate\Http\Response(
$whoops->handleException($e), $e->getStatusCode(), $e->getHeaders()
);
switch ($e) {
case $e instanceof \Illuminate\Http\Exception\HttpResponseException :
return parent::render($request, $e);
case $e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException :
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
case $e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException :
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
default :
return $this->common($request, $e);
}
}

/**
* Function to render 500 error page
* @param type $request
* @param type $e
* @return type mixed
*/
public function render500($request, $e) {
if (config('app.debug') == true) {
return parent::render($request, $e);
}
return redirect()->route('error500', []);
}

/**
* Function to render 404 error page
* @param type $request
* @param type $e
* @return type mixed
*/
public function render404($request, $e) {
if (config('app.debug') == true) {
return parent::render($request, $e);
}
return redirect()->route('error404', []);
}

/**
* Common finction to render both types of codes
* @param type $request
* @param type $e
* @return type mixed
*/
public function common($request, $e) {
switch ($e) {
case $e instanceof HttpException :
return $this->render404($request, $e);
case $e instanceof NotFoundHttpException :
return $this->render404($request, $e);
default :
return $this->render500($request, $e);
}
return parent::render($request, $e);
}

}
Loading

0 comments on commit 283d97e

Please sign in to comment.