Apply fixes from StyleCI
This commit is contained in:

committed by
StyleCI Bot

parent
4ec6000d69
commit
c547b2e438
@@ -9,8 +9,8 @@ use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use Config;
|
||||
use Storage;
|
||||
|
||||
class StorageController extends Controller {
|
||||
|
||||
class StorageController extends Controller
|
||||
{
|
||||
protected $default;
|
||||
protected $driver;
|
||||
protected $root;
|
||||
@@ -25,7 +25,8 @@ class StorageController extends Controller {
|
||||
protected $rackspace_endpoint;
|
||||
protected $rackspace_url_type;
|
||||
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->default = $this->defaults();
|
||||
$this->driver = $this->driver();
|
||||
$this->root = $this->root();
|
||||
@@ -40,7 +41,8 @@ class StorageController extends Controller {
|
||||
$this->rackspace_username = $this->rackspaceUsername();
|
||||
}
|
||||
|
||||
protected function settings($option) {
|
||||
protected function settings($option)
|
||||
{
|
||||
$settings = new CommonSettings();
|
||||
$setting = $settings->getOptionValue('storage', $option);
|
||||
$value = '';
|
||||
@@ -51,7 +53,8 @@ class StorageController extends Controller {
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function defaults() {
|
||||
public function defaults()
|
||||
{
|
||||
$default = 'local';
|
||||
if ($this->settings('default')) {
|
||||
$default = $this->settings('default');
|
||||
@@ -60,11 +63,13 @@ class StorageController extends Controller {
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function driver() {
|
||||
public function driver()
|
||||
{
|
||||
return $this->settings('default');
|
||||
}
|
||||
|
||||
public function root() {
|
||||
public function root()
|
||||
{
|
||||
$root = storage_path('app');
|
||||
if ($this->settings('root')) {
|
||||
$root = $this->settings('root');
|
||||
@@ -73,47 +78,58 @@ class StorageController extends Controller {
|
||||
return $root;
|
||||
}
|
||||
|
||||
public function s3Key() {
|
||||
public function s3Key()
|
||||
{
|
||||
return $this->settings('s3_key');
|
||||
}
|
||||
|
||||
public function s3Region() {
|
||||
public function s3Region()
|
||||
{
|
||||
return $this->settings('s3_region');
|
||||
}
|
||||
|
||||
public function s3Secret() {
|
||||
public function s3Secret()
|
||||
{
|
||||
return $this->settings('s3_secret');
|
||||
}
|
||||
|
||||
public function s3Bucket() {
|
||||
public function s3Bucket()
|
||||
{
|
||||
return $this->settings('s3_bucket');
|
||||
}
|
||||
|
||||
public function rackspaceKey() {
|
||||
public function rackspaceKey()
|
||||
{
|
||||
return $this->settings('root');
|
||||
}
|
||||
|
||||
public function rackspaceRegion() {
|
||||
public function rackspaceRegion()
|
||||
{
|
||||
return $this->settings('rackspace_region');
|
||||
}
|
||||
|
||||
public function rackspaceUsername() {
|
||||
public function rackspaceUsername()
|
||||
{
|
||||
return $this->settings('rackspace_username');
|
||||
}
|
||||
|
||||
public function rackspaceContainer() {
|
||||
public function rackspaceContainer()
|
||||
{
|
||||
return $this->settings('rackspace_container');
|
||||
}
|
||||
|
||||
public function rackspaceEndpoint() {
|
||||
public function rackspaceEndpoint()
|
||||
{
|
||||
return $this->settings('rackspace_endpoint');
|
||||
}
|
||||
|
||||
public function rackspaceUrlType() {
|
||||
public function rackspaceUrlType()
|
||||
{
|
||||
return $this->settings('rackspace_url_type');
|
||||
}
|
||||
|
||||
protected function setFileSystem() {
|
||||
protected function setFileSystem()
|
||||
{
|
||||
$config = $this->config();
|
||||
//dd($config);
|
||||
foreach ($config as $key => $con) {
|
||||
@@ -128,7 +144,8 @@ class StorageController extends Controller {
|
||||
return Config::get('filesystem');
|
||||
}
|
||||
|
||||
protected function config() {
|
||||
protected function config()
|
||||
{
|
||||
return [
|
||||
'default' => $this->default,
|
||||
'cloud' => 's3',
|
||||
@@ -136,7 +153,8 @@ class StorageController extends Controller {
|
||||
];
|
||||
}
|
||||
|
||||
protected function disks() {
|
||||
protected function disks()
|
||||
{
|
||||
return [
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
@@ -161,7 +179,8 @@ class StorageController extends Controller {
|
||||
];
|
||||
}
|
||||
|
||||
public function upload($data, $filename, $type, $size, $disposition, $thread_id) {
|
||||
public function upload($data, $filename, $type, $size, $disposition, $thread_id)
|
||||
{
|
||||
$upload = new Ticket_attachments();
|
||||
$upload->thread_id = $thread_id;
|
||||
$upload->name = $filename;
|
||||
@@ -185,23 +204,23 @@ class StorageController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function saveAttachments($thread_id, $attachments = []) {
|
||||
public function saveAttachments($thread_id, $attachments = [])
|
||||
{
|
||||
$disposition = 'ATTACHMENT';
|
||||
$thread = '';
|
||||
foreach ($attachments as $attachment) {
|
||||
if (is_object($attachment)) {
|
||||
if (method_exists($attachment, 'getStructure')) {
|
||||
|
||||
$structure = $attachment->getStructure();
|
||||
if (isset($structure->disposition)) {
|
||||
$disposition = $structure->disposition;
|
||||
}
|
||||
$filename = rand(1111, 9999) . "_" . $attachment->getFileName();
|
||||
$filename = rand(1111, 9999).'_'.$attachment->getFileName();
|
||||
$type = $attachment->getMimeType();
|
||||
$size = $attachment->getSize();
|
||||
$data = $attachment->getData();
|
||||
} else {
|
||||
$filename = rand(1111, 9999) . "_" . $attachment->getClientOriginalName();
|
||||
$filename = rand(1111, 9999).'_'.$attachment->getClientOriginalName();
|
||||
$type = $attachment->getMimeType();
|
||||
$size = $attachment->getSize();
|
||||
$data = file_get_contents($attachment->getRealPath());
|
||||
@@ -210,10 +229,12 @@ class StorageController extends Controller {
|
||||
$thread = $this->updateBody($attachment, $thread_id, $filename);
|
||||
}
|
||||
}
|
||||
|
||||
return $thread;
|
||||
}
|
||||
|
||||
public function updateBody($attachment, $thread_id, $filename) {
|
||||
public function updateBody($attachment, $thread_id, $filename)
|
||||
{
|
||||
$threads = new Ticket_Thread();
|
||||
$thread = $threads->find($thread_id);
|
||||
$disposition = 'ATTACHMENT';
|
||||
@@ -235,17 +256,19 @@ class StorageController extends Controller {
|
||||
$thread->body = $body;
|
||||
$thread->save();
|
||||
}
|
||||
|
||||
return $thread;
|
||||
}
|
||||
|
||||
public function getFile($drive, $name, $root) {
|
||||
if ($drive != "database") {
|
||||
public function getFile($drive, $name, $root)
|
||||
{
|
||||
if ($drive != 'database') {
|
||||
$root = $root.DIRECTORY_SEPARATOR.$name;
|
||||
if (\File::exists($root)) {
|
||||
chmod($root, 0755);
|
||||
|
||||
return \File::get($root);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -271,10 +271,12 @@ class AgentController extends Controller
|
||||
$team_assign_agent = $team_assign_agent->where('agent_id', $id);
|
||||
$team_assign_agent->delete();
|
||||
$user = $user->whereId($id)->first();
|
||||
|
||||
try {
|
||||
$error = Lang::get('lang.this_staff_is_related_to_some_tickets');
|
||||
$user->id;
|
||||
$user->delete();
|
||||
|
||||
throw new \Exception($error);
|
||||
return redirect('agents')->with('success', Lang::get('lang.agent_deleted_sucessfully'));
|
||||
} catch (\Exception $e) {
|
||||
|
@@ -428,6 +428,7 @@ class EmailsController extends Controller
|
||||
return redirect('emails')->with('fails', Lang::get('lang.you_cannot_delete_system_default_email'));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// fetching the database instance of the current email
|
||||
$emails = $email->whereId($id)->first();
|
||||
|
@@ -106,6 +106,7 @@ class FormController extends Controller
|
||||
|
||||
return view('themes.default1.admin.helpdesk.manage.form.preview', compact('form', 'fields'));
|
||||
}
|
||||
|
||||
throw new Exception("Sorry we can't find your request");
|
||||
} catch (Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
@@ -125,6 +126,7 @@ class FormController extends Controller
|
||||
'name.*' => 'required',
|
||||
'type.*' => 'required',
|
||||
]);
|
||||
|
||||
try {
|
||||
$forms = new Forms();
|
||||
$require = Input::get('required');
|
||||
@@ -195,6 +197,7 @@ class FormController extends Controller
|
||||
//dd($fields);
|
||||
return view('themes.default1.admin.helpdesk.manage.form.edit', compact('form', 'fields', 'select_forms'));
|
||||
}
|
||||
|
||||
throw new Exception("Sorry we can't find your request");
|
||||
} catch (Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
@@ -213,6 +216,7 @@ class FormController extends Controller
|
||||
//dd($fields);
|
||||
return view('themes.default1.admin.helpdesk.manage.form.add-child', compact('form', 'fields', 'select_forms'));
|
||||
}
|
||||
|
||||
throw new Exception("Sorry we can't find your request");
|
||||
} catch (Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
@@ -227,6 +231,7 @@ class FormController extends Controller
|
||||
'name.*' => 'required',
|
||||
'type.*' => 'required',
|
||||
]);
|
||||
|
||||
try {
|
||||
if (!$request->input('formname')) {
|
||||
throw new Exception(Lang::get('lang.please_fill_form_name'));
|
||||
@@ -391,6 +396,7 @@ class FormController extends Controller
|
||||
public function addChild($fieldid, Request $request)
|
||||
{
|
||||
$ids = $request->except('_token');
|
||||
|
||||
try {
|
||||
foreach ($ids as $valueid => $formid) {
|
||||
$field_value = new \App\Model\helpdesk\Form\FieldValue();
|
||||
|
@@ -32,6 +32,7 @@ class SocialMediaController extends Controller
|
||||
'client_secret' => 'required',
|
||||
'redirect' => 'required|url',
|
||||
]);
|
||||
|
||||
try {
|
||||
$requests = $request->except('_token');
|
||||
$this->insertProvider($provider, $requests);
|
||||
|
@@ -149,6 +149,7 @@ class WorkflowController extends Controller
|
||||
$email_data["E-$key"] = $email;
|
||||
}
|
||||
$emails = $email_data;
|
||||
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.manage.workflow.create', compact('emails'));
|
||||
} catch (Exception $e) {
|
||||
|
@@ -37,10 +37,11 @@ use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use Crypt;
|
||||
use DB;
|
||||
use Exception;
|
||||
use GeoIP;
|
||||
// classes
|
||||
use GeoIP;
|
||||
use Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\support\Collection;
|
||||
@@ -49,7 +50,6 @@ use Lang;
|
||||
use Mail;
|
||||
use PDF;
|
||||
use UTC;
|
||||
use Crypt;
|
||||
|
||||
/**
|
||||
* TicketController.
|
||||
@@ -398,6 +398,7 @@ class TicketController extends Controller
|
||||
public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '')
|
||||
{
|
||||
\Event::fire('reply.request', [$request]);
|
||||
|
||||
try {
|
||||
if (is_array($request->file('attachment'))) {
|
||||
} else {
|
||||
@@ -543,7 +544,7 @@ class TicketController extends Controller
|
||||
'ticket_number' => $ticket_number,
|
||||
'user' => $username,
|
||||
'agent_sign' => $agentsign,
|
||||
'system_link'=>$link
|
||||
'system_link' => $link,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -810,6 +811,7 @@ class TicketController extends Controller
|
||||
}
|
||||
// Event fire
|
||||
\Event::fire(new \App\Events\ReadMailEvent($user_id, $password));
|
||||
|
||||
try {
|
||||
if ($auto_response == 0) {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->first_name, 'email' => $emailadd], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $user->first_name, 'email_address' => $emailadd, 'user_password' => $password]);
|
||||
@@ -862,6 +864,7 @@ class TicketController extends Controller
|
||||
}
|
||||
} else {
|
||||
$body2 = null;
|
||||
|
||||
try {
|
||||
if ($auto_response == 0) {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'],
|
||||
@@ -1260,6 +1263,7 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$from_email = $sending_emails->id;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_status->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1496,6 +1500,7 @@ class TicketController extends Controller
|
||||
$agent_email = $user_detail->email;
|
||||
$ticket_link = route('ticket.thread', $id);
|
||||
$master = Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master, 'ticket_link' => $ticket_link]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1629,6 +1634,7 @@ class TicketController extends Controller
|
||||
$create_user->password = Hash::make($password);
|
||||
$create_user->save();
|
||||
$user_id = $create_user->id;
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -2316,6 +2322,7 @@ class TicketController extends Controller
|
||||
$user->role = 'user';
|
||||
if ($user->save()) {
|
||||
$user_id = $user->id;
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||
} catch (\Exception $e) {
|
||||
|
@@ -298,6 +298,7 @@ class UserController extends Controller
|
||||
$password = $this->generateRandomString();
|
||||
$user->password = Hash::make($password);
|
||||
$user->role = 'user';
|
||||
|
||||
try {
|
||||
if ($request->get('country_code') == '' && ($request->get('phone_number') != '' || $request->get('mobile') != '')) {
|
||||
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
||||
@@ -708,6 +709,7 @@ class UserController extends Controller
|
||||
public function getProfile()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
try {
|
||||
return view('themes.default1.agent.helpdesk.user.profile', compact('user'));
|
||||
} catch (Exception $e) {
|
||||
@@ -727,6 +729,7 @@ class UserController extends Controller
|
||||
$phonecode = $code->where('iso', '=', $location->iso_code)->first();
|
||||
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
$status = $settings->status;
|
||||
|
||||
try {
|
||||
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'))
|
||||
->with(['phonecode' => $phonecode->phonecode,
|
||||
@@ -769,7 +772,7 @@ class UserController extends Controller
|
||||
// fetching upload destination path
|
||||
$destinationPath = 'uploads/profilepic';
|
||||
// adding a random value to profile picture filename
|
||||
$fileName = rand(0000, 9999).'.'.str_replace(" ", "_", $name);
|
||||
$fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name);
|
||||
// moving the picture to a destination folder
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
// saving filename to database
|
||||
@@ -805,6 +808,7 @@ class UserController extends Controller
|
||||
// checking if the old password matches the new password
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
|
||||
try {
|
||||
$user->save();
|
||||
|
||||
|
@@ -51,6 +51,7 @@ class PageController extends Controller
|
||||
{
|
||||
$pages = $this->page->paginate(3);
|
||||
$pages->setPath('page');
|
||||
|
||||
try {
|
||||
return view('themes.default1.agent.kb.pages.index', compact('pages'));
|
||||
} catch (Exception $e) {
|
||||
@@ -128,6 +129,7 @@ class PageController extends Controller
|
||||
$sl = $request->input('name');
|
||||
$slug = str_slug($sl, '-');
|
||||
$this->page->slug = $slug;
|
||||
|
||||
try {
|
||||
$this->page->fill($request->input())->save();
|
||||
|
||||
@@ -169,6 +171,7 @@ class PageController extends Controller
|
||||
$pages = $this->page->where('slug', $slug)->first();
|
||||
$sl = $request->input('name');
|
||||
$slug = str_slug($sl, '-');
|
||||
|
||||
try {
|
||||
$pages->fill($request->all())->save();
|
||||
$pages->slug = $slug;
|
||||
|
@@ -61,6 +61,7 @@ class ApiController extends Controller
|
||||
|
||||
$this->middleware('jwt.auth');
|
||||
$this->middleware('api', ['except' => 'GenerateApiKey']);
|
||||
|
||||
try {
|
||||
$user = \JWTAuth::parseToken()->authenticate();
|
||||
$this->user = $user;
|
||||
@@ -1288,6 +1289,7 @@ class ApiController extends Controller
|
||||
public function collaboratorSearch()
|
||||
{
|
||||
$this->validate($this->request, ['term' => 'required']);
|
||||
|
||||
try {
|
||||
$emails = $this->ticket->autosearch();
|
||||
//return $emails;
|
||||
|
@@ -713,6 +713,7 @@ class TicketController extends Controller
|
||||
return $collab;
|
||||
} catch (\Exception $ex) {
|
||||
return $ex->getMessage();
|
||||
|
||||
throw new \Exception('get collaborator for ticket fails');
|
||||
}
|
||||
}
|
||||
|
@@ -249,6 +249,7 @@ class FormController extends Controller
|
||||
}
|
||||
} catch (\Exception $ex) {
|
||||
dd($ex);
|
||||
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
}
|
||||
// dd($result);
|
||||
|
@@ -101,7 +101,7 @@ class GuestController extends Controller
|
||||
// fetching upload destination path
|
||||
$destinationPath = 'uploads/profilepic';
|
||||
// adding a random value to profile picture filename
|
||||
$fileName = rand(0000, 9999).'.'.str_replace(" ", "_", $name);
|
||||
$fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name);
|
||||
// moving the picture to a destination folder
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
// saving filename to database
|
||||
@@ -237,6 +237,7 @@ class GuestController extends Controller
|
||||
//echo $user->password;
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
|
||||
try {
|
||||
$user->save();
|
||||
|
||||
|
@@ -94,6 +94,7 @@ class UnAuthController extends Controller
|
||||
$ticket_token->token = $hashed_token;
|
||||
$ticket_token->save();
|
||||
}
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail(
|
||||
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user_details->email], $message = ['subject' => 'Ticket link Request ['.$ticket_number.']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => url('show-ticket/'.$ticket->id.'/'.$token)]
|
||||
@@ -270,6 +271,7 @@ class UnAuthController extends Controller
|
||||
} else {
|
||||
$from_email = $sending_emails->id;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
|
||||
} catch (\Exception $e) {
|
||||
|
@@ -51,6 +51,7 @@ class ApiSettings extends Controller
|
||||
$this->validate($request, [
|
||||
'ticket_detail' => 'url',
|
||||
]);
|
||||
|
||||
try {
|
||||
// dd($request->input());
|
||||
DB::table('settings_system')
|
||||
@@ -91,6 +92,7 @@ class ApiSettings extends Controller
|
||||
$this->postHook($data);
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
|
||||
throw new Exception($ex->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -106,6 +108,7 @@ class ApiSettings extends Controller
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
|
||||
throw new Exception($ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
@@ -120,6 +120,7 @@ class SettingsController extends Controller
|
||||
$widget = $widgets->where('id', '=', $id)->first();
|
||||
$widget->title = $request->title;
|
||||
$widget->value = $request->content;
|
||||
|
||||
try {
|
||||
$widget->save();
|
||||
|
||||
@@ -198,6 +199,7 @@ class SettingsController extends Controller
|
||||
$widget = $widgets->where('id', '=', $id)->first();
|
||||
$widget->title = $request->title;
|
||||
$widget->value = $request->content;
|
||||
|
||||
try {
|
||||
$widget->save();
|
||||
|
||||
@@ -234,6 +236,7 @@ class SettingsController extends Controller
|
||||
$data->name = $request->input('name');
|
||||
$data->email = $request->input('email');
|
||||
$data->password = Crypt::encrypt($request->input('password'));
|
||||
|
||||
try {
|
||||
$data->save();
|
||||
|
||||
@@ -257,6 +260,7 @@ class SettingsController extends Controller
|
||||
$pass = $request->input('password');
|
||||
$password = Crypt::encrypt($pass);
|
||||
$settings->password = $password;
|
||||
|
||||
try {
|
||||
$settings->save();
|
||||
} catch (Exception $e) {
|
||||
@@ -270,6 +274,7 @@ class SettingsController extends Controller
|
||||
$settings->logo = $fileName;
|
||||
$settings->save();
|
||||
}
|
||||
|
||||
try {
|
||||
$settings->fill($request->except('logo', 'password'))->save();
|
||||
|
||||
@@ -364,6 +369,7 @@ class SettingsController extends Controller
|
||||
public function PostPlugins(Request $request)
|
||||
{
|
||||
$this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
|
||||
|
||||
try {
|
||||
if (!extension_loaded('zip')) {
|
||||
throw new Exception('Please enable zip extension in your php');
|
||||
|
@@ -375,6 +375,7 @@ class InstallController extends Controller
|
||||
$datacontent2 = str_replace('http://localhost', $link, $datacontent2);
|
||||
File::put($app_url, $datacontent2);
|
||||
$language = Cache::get('language');
|
||||
|
||||
try {
|
||||
Cache::flush();
|
||||
|
||||
|
@@ -43,6 +43,7 @@ class MailController extends Controller
|
||||
public function getServiceForm($short_name)
|
||||
{
|
||||
$form = '';
|
||||
|
||||
try {
|
||||
switch ($short_name) {
|
||||
case 'smtp':
|
||||
|
@@ -4,11 +4,9 @@ namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
use Lang;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier
|
||||
{
|
||||
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
@@ -16,7 +14,7 @@ class VerifyCsrfToken extends BaseVerifier
|
||||
*/
|
||||
protected $except = [
|
||||
'CheckSerial',
|
||||
'api/v1/*'
|
||||
'api/v1/*',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@@ -29,6 +29,7 @@ class TicketRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
$error = '';
|
||||
|
||||
try {
|
||||
$size = $this->size();
|
||||
if ($size > 800 || $size == 0) {
|
||||
|
@@ -35,7 +35,7 @@ class Ticket_attachments extends Model
|
||||
if ($content) {
|
||||
$value = base64_encode($content);
|
||||
if (mime($this->type) != 'image') {
|
||||
$root = $root . "/" . $name;
|
||||
$root = $root.'/'.$name;
|
||||
chmod($root, 1204);
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
$pic = $this->checkArray('avatar', $info);
|
||||
}
|
||||
if (!$pic && $value) {
|
||||
$pic = "";
|
||||
$pic = '';
|
||||
$file = asset('uploads/profilepic/'.$value);
|
||||
if ($file) {
|
||||
$type = pathinfo($file, PATHINFO_EXTENSION);
|
||||
@@ -56,6 +56,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
if (!$value) {
|
||||
$pic = \Gravatar::src($this->attributes['email']);
|
||||
}
|
||||
|
||||
return $pic;
|
||||
}
|
||||
|
||||
|
@@ -41,7 +41,6 @@ if (!empty($_POST)) {
|
||||
<td><pre class="samples"><?php echo $value; ?></pre></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user