/**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @param  string|null  $guard
  *
  * @return mixed
  */
 public function handle($request, Closure $next, $guard = null)
 {
     if (Auth::guard($guard)->check()) {
         return redirect(handles('app::home'));
     }
     return $next($request);
 }
Esempio n. 2
0
 /**
  * Run the request filter.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @param  \Illuminate\Http\Request  $request
  * @param  string  $value
  *
  * @return mixed
  */
 public function filter(Route $route, Request $request, $value = '')
 {
     list($action, $type) = explode('-', $value);
     if (!$this->checkUserAuthorization($action, $type)) {
         return redirect(handles("orchestra::media/{$type}s"));
     }
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return redirect(handles('app::home'));
     }
     return $next($request);
 }
Esempio n. 4
0
 protected function setupFilters()
 {
     $this->beforeFilter('orchestra.csrf', ['only' => ['update', 'store']]);
     $this->beforeFilter(function () {
         if (Auth::guest()) {
             return Redirect::to(handles('orchestra::/'));
         }
     });
 }
Esempio n. 5
0
 /**
  * Table View Generator for Orchestra\Resources.
  *
  * @param  array  $model
  *
  * @return \Orchestra\Contracts\Html\Table\Builder
  */
 public function table($model)
 {
     return $this->table->of('orchestra.resources: list', function (TableGrid $table) use($model) {
         $table->with($model, false);
         $table->layout('orchestra/foundation::components.table');
         $table->column('name')->escape(false)->value(function ($row) {
             $link = app('html')->link(handles("orchestra::resources/{$row->id}"), e($row->name));
             return app('html')->create('strong', app('html')->raw($link));
         });
     });
 }
Esempio n. 6
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @param  string|null  $guard
  *
  * @return mixed
  */
 public function handle($request, Closure $next, $guard = null)
 {
     if (Auth::guard($guard)->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest(handles('orchestra::login'));
         }
     }
     return $next($request);
 }
Esempio n. 7
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest(handles('orchestra::login'));
         }
     }
     return $next($request);
 }
Esempio n. 8
0
 /**
  * Table actions View Generator for Orchestra\Model\User.
  *
  * @param  \Orchestra\Contracts\Html\Table\Builder  $table
  *
  * @return \Orchestra\Contracts\Html\Table\Builder
  */
 public function actions(TableBuilder $table)
 {
     return $table->extend(function (TableGrid $table) {
         $table->column('action')->label('Action')->escape(false)->attributes(function () {
             return ['class' => 'th-action'];
         })->value(function ($row) {
             $html = [app('html')->link(handles("orchestra::media/profile/{$row->id}/edit"), trans('orchestra/foundation::label.edit'), ['class' => 'btn btn-xs btn-warning'])];
             $roles = [(int) $this->config->get('orchestra/foundation::media.admin'), (int) $this->config->get('orchestra/foundation::media.member')];
             if (!in_array((int) $row->id, $roles)) {
                 $html[] = app('html')->link(handles("orchestra::media/profile/{$row->id}/delete", ['csrf' => true]), trans('orchestra/foundation::label.delete'), ['class' => 'btn btn-xs btn-danger']);
             }
             return app('html')->create('div', app('html')->raw(implode('', $html)), ['class' => 'btn-group']);
         });
     });
 }
Esempio n. 9
0
 /**
  * Generate URL by content.
  *
  * @param  string  $type
  * @param  \Orchestra\Story\Model\Content|null  $content
  *
  * @return string
  */
 public function permalink($type, $content = null)
 {
     $format = $this->app['config']->get("orchestra/story::permalink.{$type}");
     if (is_null($format) || !$content instanceof Content) {
         return handles('orchestra/story::/');
     }
     if (is_null($published = $content->getAttribute('published_at'))) {
         $published = Carbon::now();
     }
     $permalinks = ['id' => $content->getAttribute('id'), 'slug' => str_replace(['_post_/', '_page_/'], '', $content->getAttribute('slug')), 'type' => $content->getAttribute('type'), 'date' => $published->format('Y-m-d'), 'year' => $published->format('Y'), 'month' => $published->format('m'), 'day' => $published->format('d')];
     foreach ($permalinks as $key => $value) {
         $format = str_replace('{' . $key . '}', $value, $format);
     }
     return handles("orchestra/story::{$format}");
 }
Esempio n. 10
0
 /**
  * Form View Generator for Orchestra\Extension.
  *
  * @param  \Illuminate\Support\Fluent  $model
  * @param  string  $name
  *
  * @return \Orchestra\Contracts\Html\Form\Builder
  */
 public function configure($model, $name)
 {
     return $this->form->of("orchestra.extension: {$name}", function (FormGrid $form) use($model, $name) {
         $form->setup($this, "orchestra::extensions/{$name}/configure", $model);
         $handles = data_get($model, 'handles', $this->extension->option($name, 'handles'));
         $configurable = data_get($model, 'configurable', true);
         $form->fieldset(function (Fieldset $fieldset) use($handles, $name, $configurable) {
             // We should only cater for custom URL handles for a route.
             if (!is_null($handles) && $configurable !== false) {
                 $fieldset->control('input:text', 'handles')->label(trans('orchestra/foundation::label.extensions.handles'))->value($handles);
             }
             $fieldset->control('input:text', 'migrate')->label(trans('orchestra/foundation::label.extensions.update'))->field(function () use($name) {
                 return app('html')->link(handles("orchestra::extensions/{$name}/update", ['csrf' => true]), trans('orchestra/foundation::label.extensions.actions.update'), ['class' => 'btn btn-info']);
             });
         });
     });
 }
Esempio n. 11
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CoursesRequest $request)
 {
     try {
         $file = Input::file('file1');
         $filename1 = 'courses_' . uniqid() . '.jpg';
         $destinationPath = 'images/courses';
         $itemImage = Image::make($file)->fit(350, 450);
         $itemImage->save($destinationPath . '/' . $filename1);
         $request['photo'] = $destinationPath . '/' . $filename1;
         $courses = Courses::create($request->all());
     } catch (Exception $e) {
         Flash::error('Unable to Save');
         return $this->redirect(handles('bluschool/courses::courses'));
     }
     Flash::success($courses->name . ' Saved Successfully');
     return $this->redirect(handles('bluschool/courses::member'));
 }
Esempio n. 12
0
 /**
  * Update the role.
  * @return mixed
  */
 public function update($reporterId, Request $request)
 {
     $reporter = MediaReporter::find($reporterId);
     if ($reporter->status == 0) {
         foreach ($request->zone as $key => $zone) {
             $reporter->zone()->create(['zone' => $zone]);
         }
         $reporter->status = 1;
         $reporter->save();
     } else {
         if ($reporter->status == 1) {
             $massage = "Already Approve";
         } else {
             $massage = "Reporter Not Found";
         }
         Flash::error($massage);
         return $this->redirect(handles('blupl/printmedia::approval'));
     }
     Flash::success($reporter->name . ' Approved Successfully');
     return $this->redirect(handles('blupl/printmedia::approval'));
 }
Esempio n. 13
0
 /**
  * Update the role.
  * @return mixed
  */
 public function update($franchise, $cateegory, $id, Request $request)
 {
     $item = Franchise::find($franchise)->{$cateegory}->find($id);
     //        dd($item);
     if ($item->status == 0) {
         foreach ($request->zone as $zone) {
             $item->zone()->create(['zone' => $zone]);
         }
         $item->status = 1;
         $item->save();
     } else {
         if ($item->status == 1) {
             $massage = "Already Approve";
         } else {
             $massage = "Reporter Not Found";
         }
         Flash::error($massage);
         return $this->redirect(handles('blupl/franchise::approval/franchise/' . $franchise . '/' . $cateegory));
     }
     Flash::success($item->name . ' Approved Successfully');
     return $this->redirect(handles('blupl/franchise::approval/franchise/' . $franchise . '/' . $cateegory));
 }
Esempio n. 14
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(ManagementRequest $request)
 {
     try {
         $file = Input::file('file1');
         $filename1 = 'management_' . uniqid() . '.jpg';
         $destinationPath = 'images/management';
         $itemImage = Image::make($file)->fit(350, 450);
         $itemImage->save($destinationPath . '/' . $filename1);
         $request['photo'] = $destinationPath . '/' . $filename1;
         $attachFile = Input::file('file2');
         $filename2 = 'management_attach_' . uniqid() . '.jpg';
         $destinationPathAttach = 'images/management';
         $itemAttachment = Image::make($attachFile)->fit(450, 350);
         $itemAttachment->save($destinationPathAttach . '/' . $filename2);
         $request['attachment'] = $destinationPathAttach . '/' . $filename2;
         $management = Management::create($request->all());
     } catch (Exception $e) {
         Flash::error('Unable to Save');
         return $this->redirect(handles('blupl/management::management'));
     }
     Flash::success($management->name . ' Franchise Save Successfully');
     return $this->redirect(handles('blupl/management::member'));
 }
 /**
  * Redirect to specific page on orchestra/story.
  *
  * @return mixed
  */
 public function show($year, $month, $day, $slug)
 {
     $url = implode('/', [$year, $month, $day, $slug]);
     return redirect(handles("orchestra/story::{$url}"), 301);
 }
Esempio n. 16
0
 /**
  * 
  * Remove the project alongside deploy dir.
  * @param type $id
  * @return type
  */
 public function get_delete($id)
 {
     $project = Projects::find($id);
     $m = new Messages();
     if (!$project) {
         $m->add('error', "Unknown project!");
         return Redirect::to(handles('orchestra::resources/githubdeploys'))->with('message', $m->serialize());
     }
     $proj = new Githubdeploys\Release();
     $proj->deleteProject($project);
     if ($project->delete()) {
         Deploys::where('project_id', '=', $id)->delete();
         $m->add('success', "Project deleted alongside deploy path!");
     } else {
         $m->add('error', "Could not remove project from the database!");
     }
     return Redirect::to(handles('orchestra::resources/githubdeploys'))->with('message', $m->serialize());
 }
 /**
  * Response when update profile succeed.
  *
  * @return mixed
  */
 public function profileUpdated()
 {
     $message = trans('orchestra/foundation::response.account.profile.update');
     return $this->redirectWithMessage(handles('orchestra::account'), $message);
 }
Esempio n. 18
0
 /**
  * Response when destroying user succeed.
  *
  * @return mixed
  */
 public function userDeleted()
 {
     $message = trans('orchestra/foundation::response.users.delete');
     return $this->redirectWithMessage(handles('orchestra::users'), $message);
 }
Esempio n. 19
0
 /**
  * @return array
  */
 private function getUrlClosures()
 {
     $closures = ['edit' => function ($id) {
         return handles('admin/uppy/pictures/' . $id . '/edit');
     }, 'delete' => function ($id) {
         return handles('admin/uppy/pictures/' . $id . '/delete', ['csrf' => true]);
     }];
     return $closures;
 }
Esempio n. 20
0
 /**
  * Response to user has logged out successfully.
  *
  * @return mixed
  */
 public function userHasLoggedOut()
 {
     messages('success', trans('orchestra/foundation::response.credential.logged-out'));
     return Redirect::intended(handles(Input::get('redirect', 'orchestra::login')));
 }
Esempio n. 21
0
 /**
  * Response when sync roles succeed.
  *
  * @param  \Illuminate\Support\Fluent   $acl
  *
  * @return mixed
  */
 public function syncSucceed(Fluent $acl)
 {
     $message = trans('orchestra/control::response.acls.sync-roles', ['name' => $acl->get('name')]);
     return $this->redirectWithMessage(handles("orchestra::control/acl?name={$acl->get('name')}"), $message);
 }
Esempio n. 22
0
		    <div id="wood" class="tab-pane fade">
		    	<img src="<?php 
        woodSwatches();
        ?>
">
		    </div>
				<?php 
    }
    ?>

		    <?php 
    if (get_post_meta($post_id, 'wpcf-handles', true) != '') {
        ?>
		    <div id="window-handles" class="tab-pane fade">
		    	<img src="<?php 
        handles();
        ?>
">
		    </div>
				<?php 
    }
    ?>

				<?php 
    if (get_post_meta($post_id, 'wpcf-door-handles', true) != '') {
        ?>
		    <div id="door-handles" class="tab-pane fade">
		      <img src="<?php 
        doorHandles();
        ?>
">
Esempio n. 23
0
 /**
  * Get actions column for table builder.
  *
  * @return callable
  */
 protected function getActionsColumn()
 {
     return function ($row) {
         $btn = [];
         $btn[] = app('html')->link(handles("orchestra::users/{$row->id}/edit"), trans('orchestra/foundation::label.edit'), ['class' => 'btn btn-mini btn-warning', 'role' => 'edit', 'data-id' => $row->id]);
         if (!is_null($this->user) && $this->user->id !== $row->id) {
             $btn[] = app('html')->link(handles("orchestra::users/{$row->id}/delete", ['csrf' => true]), trans('orchestra/foundation::label.delete'), ['class' => 'btn btn-mini btn-danger', 'role' => 'delete', 'data-id' => $row->id]);
         }
         return app('html')->create('div', app('html')->raw(implode('', $btn)), ['class' => 'btn-group']);
     };
 }
Esempio n. 24
0
 /**
  * Redirect back to current publisher.
  *
  * @return mixed
  */
 public function redirectToCurrentPublisher()
 {
     return $this->redirect(handles('orchestra::publisher/ftp'));
 }
Esempio n. 25
0
 /**
  * Response when updating role succeed.
  *
  * @param  \Orchestra\Model\Role  $role
  *
  * @return mixed
  */
 public function destroySucceed(students $students)
 {
     $message = trans('orchestra/control::response.roles.delete', ['name' => $students->getAttribute('name')]);
     return $this->redirectWithMessage(handles('orchestra::students'), $message);
 }
Esempio n. 26
0
<?php

$navbar = new Illuminate\Support\Fluent(['id' => 'venue', 'title' => 'Venue Operations', 'url' => handles('blupl::venue/member'), 'menu' => view('blupl/venue::widgets._menu')]);
?>

@decorator('navbar', $navbar)
Esempio n. 27
0
 /**
  * Queue publishing asset to publisher.
  *
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 protected function queueToPublisher(Fluent $extension)
 {
     Publisher::queue($extension->get('name'));
     return $this->redirect(handles('orchestra::publisher'));
 }
 /**
  * Response when reset password succeed.
  *
  * @param  string  $response
  *
  * @return mixed
  */
 public function passwordHasReset($response)
 {
     $message = trans('orchestra/foundation::response.account.password.update');
     return $this->redirectWithMessage(handles('orchestra::/'), $message);
 }
Esempio n. 29
0
 /**
  * Response when update Orchestra Platform components succeed.
  *
  * @return mixed
  */
 public function systemHasUpdated()
 {
     $message = trans('orchestra/foundation::response.settings.system-update');
     return $this->redirectWithMessage(handles('orchestra::settings'), $message);
 }
Esempio n. 30
0
 /**
  * {@inheritdoc}
  */
 public function handles($url)
 {
     return handles($url);
 }