diff --git a/.env b/.env index f17696280..b3b316185 100644 --- a/.env +++ b/.env @@ -1,18 +1,17 @@ APP_ENV=local APP_DEBUG=true APP_KEY=SomeRandomString - DB_HOST=localhost -DB_DATABASE= -DB_USERNAME= +DB_DATABASE=fav +DB_USERNAME=root DB_PASSWORD= - CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync - MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null +DB_TYPE=mysql +DB_PORT= diff --git a/.gitignore b/.gitignore index 30bc16279..c47965c25 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/node_modules \ No newline at end of file +/vendor +/node_modules +.env diff --git a/README.md b/README.md index 0bfcdf160..f67a6cf7c 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,27 @@ -
Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
-
-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.
-
-To date, Faveo has been integrated with 6 platforms and every month there is 1 to 2 update releases with new features & platform integration.
-
-Faveo can also be customised according to requirement and we do undertake such request.
-
-Faveo is designed & developed by Ladybird Web Solution Pvt Ltd, and launched in October 2015.
Check out Faveo Knowledge Base here
-To run Faveo your host just needs a couple of things:
-Ladybird Web Host Offers hosting with minimum requirement to host Faveo web application. Faveo has been tested on Ladybird Web Host servers & works very well in their server environment. All web hosting packages offered by Ladybird Web Host come with 30 day money back gurantee.
-Faveo is very very new in the market, the product is fully working and is production worthy but it definitely will have some bugs like any software. We fully support Faveo whether free or pro edition, incase you come across any bugs, email us through the contact form. We want to make your experience of using Faveo as memorable as possible, so help us make Faveo a World, top class helpdesk application. Do check out our roadmap to stayed tuned with future releases
\ No newline at end of file +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. + +### License + +The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index dcc0edcea..deab27e51 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -51,12 +51,12 @@ class Handler extends ExceptionHandler { // return response()->view('errors.404', []); // } else { // if(\Config::get('database.install') == 1) { - // if(\Config::get('app.ErrorLog') == '%1%') { - // // \App\Http\Controllers\Common\SettingsController::smtp(); - // // \Mail::send('errors.report', array('e' => $e), function ($message) { - // // $message->to('', '')->subject(''); - // // }); - // } + // // if(\Config::get('app.ErrorLog') == '%1%') { + // // \App\Http\Controllers\Common\SettingsController::smtp(); + // // \Mail::send('errors.report', array('e' => $e), function ($message) { + // // $message->to('', '')->subject('Faveo HELPDESK Pro ERROR'); + // // }); + // // } // } // return response()->view('errors.500', []); // } diff --git a/app/Http/Controllers/API/helpdesk/InstallerApiController.php b/app/Http/Controllers/API/helpdesk/InstallerApiController.php index 77ede0943..e2b0ade17 100644 --- a/app/Http/Controllers/API/helpdesk/InstallerApiController.php +++ b/app/Http/Controllers/API/helpdesk/InstallerApiController.php @@ -18,6 +18,7 @@ use Input; use Redirect; use Session; use View; +use Exception; /** * |======================================================================= @@ -40,7 +41,7 @@ class InstallerApiController extends Controller { * @return type Json */ public function config_database(Request $request) { - error_reporting(E_ALL & ~E_NOTICE); + error_reporting(E_ALL & ~E_NOTICE); // Check for pre install if (\Config::get('database.install') == '%0%') { @@ -87,103 +88,90 @@ class InstallerApiController extends Controller { * @return type Json */ public function config_system(Request $request) { - error_reporting(E_ALL & ~E_NOTICE); + // Check for pre install + if (\Config::get('database.install') == '%0%') { + $firstname = $request->firstname; + $lastname = $request->lastname; + $email = $request->email; + $username = $request->username; + $password = $request->password; + $timezone = $request->timezone; + $datetime = $request->datetime; - try{ - \DB::connection()->getDatabaseName(); + // Migrate database + Artisan::call('migrate', array('--force' => true)); + Artisan::call('db:seed', array('--force' => true)); - // check for database connection - if(\DB::connection()->getDatabaseName()) { - echo "Connected sucessfully to database ".\DB::connection()->getDatabaseName()."."; + // Creating minum settings + $system = System::where('id','=','1')->first(); + $system->time_zone = $timezone; + $system->date_time_format = $datetime; + $system->save(); + + // Creating default form field + $form1 = new Form_details; + $form1->label = 'Name'; + $form1->type = 'text'; + $form1->form_name_id = '1'; + $form1->save(); + + $form2 = new Form_details; + $form2->label = 'Phone'; + $form2->type = 'number'; + $form2->form_name_id = '1'; + $form2->save(); + + $form3 = new Form_details; + $form3->label = 'Email'; + $form3->type = 'text'; + $form3->form_name_id = '1'; + $form3->save(); + + $form4 = new Form_details; + $form4->label = 'Subject'; + $form4->type = 'text'; + $form4->form_name_id = '1'; + $form4->save(); + + $form5 = new Form_details; + $form5->label = 'Details'; + $form5->type = 'textarea'; + $form5->form_name_id = '1'; + $form5->save(); + + // Creating user + $user = User::create(array( + 'first_name' => $firstname, + 'last_name' => $lastname, + 'email' => $email, + 'user_name' => $username, + 'password' => Hash::make($password), + 'active' => 1, + 'role' => 'admin', + 'assign_group' => 'group A', + 'primary_dpt' => 'support', + )); + + // Setting database installed status + $value = '1'; + $install = app_path('../config/database.php'); + $datacontent = File::get($install); + $datacontent = str_replace('%0%', $value, $datacontent); + File::put($install, $datacontent); + + // Applying email configuration on route + $smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()"; + $path22 = app_path('Http/routes.php'); + $content23 = File::get($path22); + $content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23); + File::put($path22, $content23); + + // If user created return success + if($user){ + return ['response'=>'success','status'=>'1']; } - - // Check for pre install - if (\Config::get('database.install') == '%0%') { - $firstname = $request->firstname; - $lastname = $request->lastname; - $email = $request->email; - $username = $request->username; - $password = $request->password; - $timezone = $request->timezone; - $datetime = $request->datetime; - - // Migrate database - Artisan::call('migrate', array('--force' => true)); - Artisan::call('db:seed', array('--force' => true)); - - // Creating minum settings - $system = System::where('id','=','1')->first(); - $system->time_zone = $timezone; - $system->date_time_format = $datetime; - $system->save(); - - // Creating default form field - $form1 = new Form_details; - $form1->label = 'Name'; - $form1->type = 'text'; - $form1->form_name_id = '1'; - $form1->save(); - - $form2 = new Form_details; - $form2->label = 'Phone'; - $form2->type = 'number'; - $form2->form_name_id = '1'; - $form2->save(); - - $form3 = new Form_details; - $form3->label = 'Email'; - $form3->type = 'text'; - $form3->form_name_id = '1'; - $form3->save(); - - $form4 = new Form_details; - $form4->label = 'Subject'; - $form4->type = 'text'; - $form4->form_name_id = '1'; - $form4->save(); - - $form5 = new Form_details; - $form5->label = 'Details'; - $form5->type = 'textarea'; - $form5->form_name_id = '1'; - $form5->save(); - - // Creating user - $user = User::create(array( - 'first_name' => $firstname, - 'last_name' => $lastname, - 'email' => $email, - 'user_name' => $username, - 'password' => Hash::make($password), - 'active' => 1, - 'role' => 'admin', - 'assign_group' => 'group A', - 'primary_dpt' => 'support', - )); - - // Setting database installed status - $value = '1'; - $install = app_path('../config/database.php'); - $datacontent = File::get($install); - $datacontent = str_replace('%0%', $value, $datacontent); - File::put($install, $datacontent); - - // Applying email configuration on route - $smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()"; - $path22 = app_path('Http/routes.php'); - $content23 = File::get($path22); - $content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23); - File::put($path22, $content23); - - // If user created return success - if($user){ - return ['response'=>'success','status'=>'1']; - } - } else { - return ['response'=>'fail','reason'=>'this system is already installed','status'=>'0']; - } - }catch(\Exception $e){ - return $e->getMessage(); + } else { + return ['response'=>'fail','reason'=>'this system is already installed','status'=>'0']; } } } \ No newline at end of file diff --git a/app/Http/Controllers/Admin/helpdesk/AgentController.php b/app/Http/Controllers/Admin/helpdesk/AgentController.php index 76a11d23d..30b3924b1 100644 --- a/app/Http/Controllers/Admin/helpdesk/AgentController.php +++ b/app/Http/Controllers/Admin/helpdesk/AgentController.php @@ -1,10 +1,13 @@ middleware('auth'); + // checking admin roles $this->middleware('roles'); } /** - * get index page + * Get all agent list page * @param type User $user * @return type Response */ @@ -51,13 +64,13 @@ class AgentController extends Controller { } /** - * Show the form for creating a new resource. + * creating a new agent * @param type Assign_team_agent $team_assign_agent * @param type Timezones $timezone * @param type Groups $group * @param type Department $department * @param type Teams $team - * @return type Response + * @return type view */ public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) { try { @@ -68,19 +81,19 @@ class AgentController extends Controller { $teams = $team->lists('id', 'name'); return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team')); } catch (Exception $e) { - return view('404'); + return redirect()->back()->with('fails',$e->errorInfo[2]); } } /** - * Store a newly created resource in storage. + * store a new agent * @param type User $user * @param type AgentRequest $request * @param type Assign_team_agent $team_assign_agent * @return type Response */ public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) { - try { + /* Insert to user table */ $user->role = 'agent'; $user->fill($request->input())->save(); @@ -88,6 +101,7 @@ class AgentController extends Controller { $user->password = Hash::make($password); $requests = $request->input('team_id'); $id = $user->id; + // insert team foreach ($requests as $req) { DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]); } @@ -96,29 +110,22 @@ class AgentController extends Controller { $name = $user->user_name; $email = $user->email; $from = $this->company(); - Mail::send('emails.pass', ['name' => $name, 'password' => $password, 'from' => $from, 'emailadd' => $email], function ($message) use ($email, $name) { - $message->to($email, $name)->subject('[password]'); - }); + // send mail on registration + try{ + Mail::send('emails.pass', ['name' => $name, 'password' => $password, 'from' => $from, 'emailadd' => $email], function ($message) use ($email, $name) { + $message->to($email, $name)->subject('[password]'); + }); + } catch (Exception $e) { + return redirect('agents')->with('fails', 'Some error occuren while sending mail to the agent. Please check email settings'.'