Exemplo n.º 1
0
 /**
  * Response for extension configuration.
  *
  * @param  array  $data
  *
  * @return mixed
  */
 public function showConfigurationChanger(array $data)
 {
     $name = $data['extension']->name;
     set_meta('title', Foundation::memory()->get("extensions.available.{$name}.name", $name));
     set_meta('description', trans('orchestra/foundation::title.extensions.configure'));
     return view('orchestra/foundation::extensions.configure', $data);
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $role = Role::admin();
     $acl = Foundation::acl();
     $actions = ['Manage Roles', 'Manage Acl'];
     $acl->actions()->attach($actions);
     $acl->allow($role->name, $actions);
 }
Exemplo n.º 3
0
 /**
  * Send new registration e-mail to user.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\Account\ProfileCreator  $listener
  * @param  \Orchestra\Model\User  $user
  * @param  string  $password
  *
  * @return mixed
  */
 protected function notifyCreatedUser(Listener $listener, Eloquent $user, $password)
 {
     // Converting the user to an object allow the data to be a generic
     // object. This allow the data to be transferred to JSON if the
     // mail is send using queue.
     $memory = Foundation::memory();
     $site = $memory->get('site.name', 'Orchestra Platform');
     $data = ['password' => $password, 'site' => $site, 'user' => $user instanceof Arrayable ? $user->toArray() : $user];
     $subject = trans('orchestra/foundation::email.credential.register', ['site' => $site]);
     $message = Message::create(config('auth.register.email', 'emails.auth.register'), $data, $subject);
     $receipt = $user->notify($message);
     if ($receipt->failed()) {
         return $listener->profileCreatedWithoutNotification();
     }
     return $listener->profileCreated();
 }
Exemplo n.º 4
0
 /**
  * Request to reset password.
  *
  * @param  \Orchestra\Contracts\Auth\Listener\PasswordResetLink  $listener
  * @param  array  $input
  *
  * @return mixed
  */
 public function store(PasswordResetLink $listener, array $input)
 {
     $validation = $this->validator->with($input);
     if ($validation->fails()) {
         return $listener->resetLinkFailedValidation($validation->getMessageBag());
     }
     $memory = Foundation::memory();
     $site = $memory->get('site.name', 'Orchestra Platform');
     $data = ['email' => $input['email']];
     $response = $this->password->sendResetLink($data, function ($mail) use($site) {
         $mail->subject(trans('orchestra/foundation::email.forgot.request', ['site' => $site]));
     });
     if ($response != Password::RESET_LINK_SENT) {
         return $listener->resetLinkFailed($response);
     }
     return $listener->resetLinkSent($response);
 }
Exemplo n.º 5
0
 /**
  * Update an extension configuration.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Configure  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  * @param  array  $input
  *
  * @return mixed
  */
 public function update(Listener $listener, Fluent $extension, array $input)
 {
     if (!Extension::started($extension->get('name'))) {
         return $listener->suspend(404);
     }
     $validation = $this->validator->with($input, ["orchestra.validate: extension.{$extension->get('name')}"]);
     if ($validation->fails()) {
         return $listener->updateConfigurationFailedValidation($validation->getMessageBag(), $extension->uid);
     }
     $memory = Foundation::memory();
     $config = (array) $memory->get("extension.active.{$extension->get('name')}.config", []);
     $input = new Fluent(array_merge($config, $input));
     unset($input['_token']);
     Event::fire("orchestra.saving: extension.{$extension->get('name')}", [&$input]);
     $memory->put("extensions.active.{$extension->get('name')}.config", $input->getAttributes());
     $memory->put("extension_{$extension->get('name')}", $input->getAttributes());
     Event::fire("orchestra.saved: extension.{$extension->get('name')}", [$input]);
     return $listener->configurationUpdated($extension);
 }
Exemplo n.º 6
0
 /**
  * Create a new user.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\Account\ProfileCreator  $listener
  * @param  array  $input
  *
  * @return mixed
  */
 public function store(Listener $listener, array $input)
 {
     $random = Str::random(5);
     $password = Arr::get($input, 'password');
     if (empty($password)) {
         $password = $random;
     } else {
         $random = null;
     }
     $validation = $this->validator->on('register')->with($input);
     // Validate user registration, if any errors is found redirect it
     // back to registration page with the errors
     if ($validation->fails()) {
         return $listener->createProfileFailedValidation($validation->getMessageBag());
     }
     $user = Foundation::make('orchestra.user');
     try {
         $this->saving($user, $input, $password);
     } catch (Exception $e) {
         return $listener->createProfileFailed(['error' => $e->getMessage()]);
     }
     return $this->notifyCreatedUser($listener, $user, $random);
 }
Exemplo n.º 7
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
Foundation::group('bluschool/attendance', 'attendance', ['namespace' => 'Bluschool\\Attendance\\Http\\Controllers'], function (Router $router) {
    $router->get('attendance/create', 'AttendanceController@create');
    $router->get('attendance/admin', 'AttendanceController@index');
    $router->get('attendance/teacherAttendance/{id}', 'AttendanceController@teacherAttendance');
    $router->get('/', 'HomeController@index');
});
Exemplo n.º 8
0
use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
/*
|--------------------------------------------------------------------------
| Frontend Routing
|--------------------------------------------------------------------------
*/
Foundation::group('blupl/printmedia', 'media', ['namespace' => 'Blupl\\PrintMedia\\Http\\Controllers'], function (Router $router) {
    $router->get('printing/pdf/{id}', 'PrintingController@pdf');
    $router->get('printing/{id}', 'PrintingController@show');
    $router->get('printing', 'PrintingController@index');
    $router->get('approval/reporter/{id}', 'ApprovalController@showReporter');
    $router->put('approval/zone/{id}', ['as' => 'media.approval.zone', 'uses' => 'ApprovalController@update']);
    $router->get('approval/{id}', 'ApprovalController@show');
    $router->get('approval', 'ApprovalController@index');
    $router->resource('reporter', 'ReporterController');
    $router->get('/', 'HomeController@index');
});
/*
|--------------------------------------------------------------------------
| Backend Routing
|--------------------------------------------------------------------------
*/
Foundation::namespaced('Blupl\\PrintMedia\\Http\\Controllers\\Admin', function (Router $router) {
    $router->group(['prefix' => 'media'], function (Router $router) {
        $router->resource('reporter', 'ReporterController');
        $router->get('/', 'HomeController@index');
        $router->match(['GET', 'HEAD', 'DELETE'], 'profile/{roles}/delete', 'HomeController@delete');
    });
});
Exemplo n.º 9
0
 /**
  * Migrate Orchestra Platform components.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\SystemUpdater  $listener
  *
  * @return mixed
  */
 public function migrate(SystemUpdateListener $listener)
 {
     Foundation::make('orchestra.publisher.asset')->foundation();
     Foundation::make('orchestra.publisher.migrate')->foundation();
     return $listener->systemHasUpdated();
 }
Exemplo n.º 10
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
$router->get('login', 'AuthController@login');
Foundation::namespaced('', function (Router $router) {
    $router->resource('customers', 'CustomerController');
});
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Foundation::memory()->forget('acl_orchestra/story');
 }
Exemplo n.º 12
0
/*
|--------------------------------------------------------------------------
| Frontend Routing
|--------------------------------------------------------------------------
*/
Foundation::group('blupl/franchise', 'franchise', ['namespace' => 'Blupl\\Franchises\\Http\\Controllers'], function (Router $router) {
    $router->put('approval/franchise/{franchise}/{category}/{id}', ['as' => 'franchise.approval.zone', 'uses' => 'ApprovalController@update']);
    $router->get('approval/franchise/{franchise}/{category}/{id}', 'ApprovalController@showFranchise');
    $router->get('approval/franchise/{id}/{category}', 'ApprovalController@show');
    $router->get('approval', 'ApprovalController@index');
    $router->post('management/team-support-stuffs', 'FranchiseController@storeTeamStuff');
    $router->post('management/team-managements', 'FranchiseController@storeTeam');
    $router->post('management/player', 'FranchiseController@storePlayer');
    $router->post('management/franchise', 'FranchiseController@storeFranchiseManagement');
    $router->get('management/{id}', 'FranchiseController@franchiseManagement');
    $router->get('management', 'FranchiseController@franchise');
    $router->post('store', 'FranchiseController@storeFranchise');
    $router->get('create', 'FranchiseController@create');
    $router->get('/', 'FranchiseController@index');
});
/*
|--------------------------------------------------------------------------
| Backend Routing
|--------------------------------------------------------------------------
*/
Foundation::namespaced('Blupl\\Franchises\\Http\\Controllers\\Admin', function (Router $router) {
    $router->group(['prefix' => 'franchise'], function (Router $router) {
        $router->get('/', 'HomeController@index');
        $router->match(['GET', 'HEAD', 'DELETE'], 'profile/{roles}/delete', 'HomeController@delete');
    });
});
Exemplo n.º 13
0
 /**
  * Check if role name is already used.
  *
  * @param  \Orchestra\Support\Keyword  $name
  *
  * @return bool
  */
 protected function isRoleNameAlreadyUsed(Keyword $name)
 {
     $roles = Foundation::acl()->roles()->get();
     return $name->searchIn($roles) !== false;
 }
Exemplo n.º 14
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
Foundation::namespaced('', function (Router $router) {
    $router->resource('brands', 'Backend\\BrandController');
});
Exemplo n.º 15
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
Foundation::group('bluschool/account', 'account', ['namespace' => 'Bluschool\\Account\\Http\\Controllers'], function (Router $router) {
    $router->post('news/create', 'AccountController@store');
    $router->get('news/create', 'AccountController@create');
    $router->get('news/update/{id}', 'AccountController@update');
    $router->get('news/delete/{id}', 'AccountController@delete');
    $router->get('news', 'AccountController@news');
    $router->post('event/create', 'AccountController@store');
    $router->get('event/create', 'AccountController@create');
    $router->get('event/update/{id}', 'AccountController@update');
    $router->get('event/delete/{id}', 'AccountController@delete');
    $router->get('event', 'AccountController@event');
    $router->get('cal', 'AccountController@calendar');
    $router->get('activityFeed', 'AccountController@index');
    $router->get('/', 'HomeController@index');
});
Exemplo n.º 16
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
Foundation::group('bluschool/dashboard', 'dashboard', ['namespace' => 'Bluschool\\Dashboard\\Http\\Controllers'], function (Router $router) {
    $router->post('news/create', 'DashboardController@storeNews');
    $router->get('news/create', 'DashboardController@createNews');
    $router->get('news/update/{id}', 'DashboardController@updateNews');
    $router->get('news/delete/{id}', 'DashboardController@deleteNews');
    $router->get('news', 'DashboardController@news');
    $router->post('create/create', 'DashboardController@storeEvent');
    $router->get('event/create', 'DashboardController@createEvent');
    $router->get('event/update/{id}', 'DashboardController@updateEvent');
    $router->get('event/delete/{id}', 'DashboardController@deleteEvent');
    $router->get('event', 'DashboardController@event');
    $router->get('/', 'HomeController@index');
});
Exemplo n.º 17
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
Foundation::namespaced('Orchestra\\Foundation\\Http\\Controllers', function (Router $router) {
    // Route to account/profile.
    $router->get('account', 'Account\\ProfileUpdaterController@edit');
    $router->post('account', 'Account\\ProfileUpdaterController@update');
    $router->get('account/password', 'Account\\PasswordUpdaterController@edit');
    $router->post('account/password', 'Account\\PasswordUpdaterController@update');
    // Route to extensions.
    if (Foundation::bound('orchestra.extension')) {
        $router->get('extensions', 'Extension\\ViewerController@index');
        $router->post('extensions/{vendor}/{package}/activate', 'Extension\\ActionController@activate');
        $router->post('extensions/{vendor}/activate', 'Extension\\ActionController@activate');
        $router->post('extensions/{vendor}/{package}/deactivate', 'Extension\\ActionController@deactivate');
        $router->post('extensions/{vendor}/deactivate', 'Extension\\ActionController@deactivate');
        $router->post('extensions/{vendor}/{package}/update', 'Extension\\ActionController@migrate');
        $router->post('extensions/{vendor}/update', 'Extension\\ActionController@migrate');
        $router->get('extensions/{vendor}/{package}/configure', 'Extension\\ConfigureController@configure');
        $router->get('extensions/{vendor}/configure', 'Extension\\ConfigureController@configure');
        $router->post('extensions/{vendor}/{package}/configure', 'Extension\\ConfigureController@update');
        $router->post('extensions/{vendor}/configure', 'Extension\\ConfigureController@update');
    }
    // Route to request reset password.
    $router->get('forgot', 'Account\\PasswordBrokerController@showLinkRequestForm');
    $router->post('forgot', 'Account\\PasswordBrokerController@sendResetLinkEmail');
    // Route to reset password.
    $router->get('forgot/reset/{token?}', 'Account\\PasswordBrokerController@showResetForm');
    $router->post('forgot/reset', 'Account\\PasswordBrokerController@reset');
    // Route to asset publishing.
Exemplo n.º 18
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
Foundation::group('bluschool/courses', 'courses', ['namespace' => 'Bluschool\\Courses\\Http\\Controllers'], function (Router $router) {
    $router->post('courses/create', 'CoursesController@store');
    $router->get('courses/create', 'CoursesController@create');
    $router->get('courses/update/{id}', 'CoursesController@update');
    $router->get('courses/delete/{id}', 'CoursesController@delete');
    $router->get('courses/manageall', 'CoursesController@manageall');
    $router->get('courses/common', 'CoursesController@common');
    $router->get('courses/admin', 'CoursesController@index');
    $router->get('/', 'HomeController@index');
});
Exemplo n.º 19
0
 /**
  * Destroy a user.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\Account\UserRemover  $listener
  * @param  string|int  $id
  *
  * @return mixed
  */
 public function destroy(UserRemoverListener $listener, $id)
 {
     $user = Foundation::make('orchestra.user')->findOrFail($id);
     // Avoid self-deleting accident.
     if ((string) $user->id === (string) Auth::user()->id) {
         return $listener->selfDeletionFailed();
     }
     try {
         $this->fireEvent('deleting', [$user]);
         DB::transaction(function () use($user) {
             $user->delete();
         });
         $this->fireEvent('deleted', [$user]);
     } catch (Exception $e) {
         return $listener->userDeletionFailed(['error' => $e->getMessage()]);
     }
     return $listener->userDeleted();
 }
Exemplo n.º 20
0
<?php

use Illuminate\Routing\Router;
use Orchestra\Support\Facades\Foundation;
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
Foundation::group('bluschool/exam', 'exam', ['namespace' => 'Bluschool\\Exam\\Http\\Controllers'], function (Router $router) {
    $router->post('printing/pdf/batch', 'PrintingController@batchPrinting');
    $router->post('member/registration', 'HostController@store');
    $router->get('member/registration', 'HostController@create');
    $router->get('member', 'HostController@index');
    $router->get('/', 'HomeController@index');
});