Inheritance: extends Illuminate\Routing\Controller, use trait Illuminate\Foundation\Auth\Access\AuthorizesRequests, use trait Illuminate\Foundation\Bus\DispatchesJobs, use trait Illuminate\Foundation\Validation\ValidatesRequests
Esempio n. 1
0
 /**
  * Constructor.
  *
  * @param type \Litecms\PriceList\Interfaces\PriceListRepositoryInterface $pricelist
  *
  * @return type
  */
 public function __construct(PriceListRepositoryInterface $pricelist)
 {
     $this->repository = $pricelist;
     $this->middleware('web');
     $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout'));
     parent::__construct();
 }
Esempio n. 2
0
 public function __construct()
 {
     $this->middleware('auth', ['only' => ['store']]);
     // $this->middleware('cachebefore', ['only' => ['show', 'showAjax']]);
     // $this->middleware('cacheafter', ['only' => ['show', 'showAjax']]);
     parent::__construct();
 }
Esempio n. 3
0
 /**
  * Ritorna la lista degli abbracci effettuati dall'utente.
  * Gestisce anche la paginazione automaticamente.
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function getList(Request $request)
 {
     $user = $this->getAuthenticatedUser();
     $hugs = Hug::where(function ($query) use($request) {
         /**
          * @var Builder $query
          */
         $query->whereNull('closed_at')->orWhere(function ($query) {
             /**
              * @var Builder $query
              */
             $query->whereNotNull('closed_at')->where('closed_at', '>=', Carbon::now()->subHours(24)->toDateTimeString());
             // Abbracci conclusi
         });
     })->where(function ($query) use($user) {
         /**
          * @var Builder $query
          */
         $query->where('user_seeker_id', '=', $user->id)->orWhere('user_sought_id', '=', $user->id);
     })->paginate(20);
     $response = json_decode($hugs->toJson());
     $response->list = $response->data;
     unset($response->data);
     return parent::response($response);
 }
Esempio n. 4
0
public function __construct()
	{
$this->middleware('auth');
//$this->user = Auth::user();
parent::__construct();

	}
 /**
  * Abort if request is not ajax
  * @param Request $request
  */
 public function __construct(Request $request)
 {
     if (!$request->ajax() || !Datatable::shouldHandle()) {
         abort(403, 'Forbidden');
     }
     parent::__construct();
 }
Esempio n. 6
0
 public function __construct()
 {
     parent::__construct();
     $this->roleModel = new Role();
     $this->appModel = new App();
     $this->authModel = new Auth();
 }
 /**
  * Add the permissions requirements for each route.
  */
 public function __construct()
 {
     // Require authentication
     $this->middleware('auth.permission:member', ['except' => ['dash', 'getMyProfile', 'postMyProfile', 'updatePassword', 'dashSU', 'profile']]);
     $this->middleware('auth', ['only' => ['dash', 'dashSU', 'getMyProfile', 'postMyProfile', 'updatePassword', 'profile']]);
     parent::__construct();
 }
Esempio n. 8
0
 /**
  * Create a new authentication controller instance.
  *
  * @param  \Illuminate\Contracts\Auth\Guard  $auth
  * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
  * @return void
  */
 public function __construct(Guard $auth, Registrar $registrar)
 {
     parent::__construct();
     $this->auth = $auth;
     $this->registrar = $registrar;
     $this->middleware('guest', ['except' => 'getLogout']);
 }
Esempio n. 9
0
 public function __construct()
 {
     $this->middleware('api');
     $this->middleware('jwt.auth:api');
     $this->setupTheme(config('theme.themes.user.theme'), config('theme.themes.user.layout'));
     parent::__construct();
 }
Esempio n. 10
0
 public function __construct()
 {
     parent::__construct();
     if (\Session::has('admin.username')) {
         $this->userid = \Session::get('admin.adminid');
     }
 }
 public function __construct()
 {
     Stripe::setApiVersion(config('services.stripe.api_version'));
     $this->middleware('auth');
     $this->postman = new Postman();
     parent::__construct();
 }
Esempio n. 12
0
 function __construct()
 {
     parent::__construct();
     if (!$this->isAdmin($this->getLoggedInUser())) {
         throw new \Exception("Not allowed, only admin has access", 401);
     }
 }
Esempio n. 13
0
 public function __construct(UserRepository $user, RoleRepository $role, PermissionRepository $perms)
 {
     parent::__construct();
     $this->user = $user;
     $this->role = $role;
     $this->permission = $perms;
 }
Esempio n. 14
0
 /**
  * FlyersController constructor.
  */
 public function __construct()
 {
     // everybody must be authenticated to access the methods
     // except for the show method
     $this->middleware('auth', ['except' => ['show']]);
     parent::__construct();
 }
Esempio n. 15
0
 public function __construct()
 {
     $this->middleware('web');
     $this->middleware('auth:client.web');
     $this->setupTheme(config('theme.themes.client.theme'), config('theme.themes.client.layout'));
     parent::__construct();
 }
 public function __construct(Request $request)
 {
     parent::__construct($request);
     if (Auth::user()->role != "supadmin") {
         abort(402, "Unauthorized");
     }
 }
Esempio n. 17
0
 public function __construct(ProfileService $profileService, UserRepo $userRepo, SaleRepo $saleRepo)
 {
     $this->profileService = $profileService;
     $this->userRepo = $userRepo;
     $this->saleRepo = $saleRepo;
     parent::__construct();
 }
 /**
  * @param Permission $permission
  * @param Role $role
  * @param Route $route
  */
 public function __construct(Application $app, Audit $audit, Permission $permission, Role $role, Route $route)
 {
     parent::__construct($app, $audit);
     $this->permission = $permission;
     $this->role = $role;
     $this->route = $route;
 }
Esempio n. 19
0
 /**
  * Create a new password controller instance.
  *
  * @param Guard           $auth
  * @param  PasswordBroker $passwords
  */
 public function __construct(Guard $auth, PasswordBroker $passwords)
 {
     $this->auth = $auth;
     $this->passwords = $passwords;
     $this->middleware('guest');
     parent::__construct();
 }
Esempio n. 20
0
public function __construct(){
$this->middleware('auth',[
'except' => [
'getIndex','show'
]]);
parent::__construct();
}
Esempio n. 21
0
 public function __construct()
 {
     parent::__construct();
     $this->middleware('auth', ['except' => ['index', 'show']]);
     $user = Sentinel::getUser();
     PostService::setUser($user);
 }
Esempio n. 22
0
 function __construct()
 {
     $this->middleware('auth');
     // create a filter for head only
     // only household heads allowed to create,update, and delete task
     parent::__construct();
 }
 /**
  * Create a new authentication controller instance.
  *
  * @param  \Illuminate\Contracts\Auth\Guard  $auth
  * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
  * @return void
  */
 public function __construct(Registrar $registrar, Auth $auth, Socialite $socialite, SocialUserRepository $socialUsers)
 {
     parent::__construct();
     $this->resolve();
     $this->loginPath = route('auth.login');
     $this->middleware('guest', ['except' => 'getLogout']);
 }
Esempio n. 24
0
 public function showCreateFrom()
 {
     if (Auth::user()->role !== 1) {
         return redirect('/');
     }
     return Controller::myView('admin_book.post');
 }
Esempio n. 25
0
 public function callConstructor()
 {
     $parent = new \ReflectionClass(parent::class);
     if ($parent->getConstructor()) {
         parent::__construct();
     }
 }
Esempio n. 26
0
 public function __construct()
 {
     $this->middleware('auth', ['only' => ['getInvoice', 'postUpdateCart', 'postAddToCart', 'postCheckout', 'postNewAddress', 'postUpdateAddress', 'postUpdateCart', 'putRequestNotification']]);
     $this->middleware('check-user-restricted', ['only' => ['getInvoice', 'postUpdateCart', 'postAddToCart', 'postCheckout', 'postNewAddress', 'postUpdateAddress', 'postUpdateCart', 'putRequestNotification']]);
     $this->middleware('verify-user', ['only' => ['getInvoice', 'getCheckout', 'postCheckout', 'postUpdateAddress']]);
     return parent::__construct();
 }
Esempio n. 27
0
 /**
  * @param DbBookRepository $bookRepository
  * @param AjaxBookRepository $ajaxRepository
  */
 public function __construct(DbBookRepository $bookRepository, AjaxBookRepository $ajaxRepository)
 {
     $this->middleware('acl:create_book', ['only' => ['index', 'create', 'store', 'edit', 'update', 'ajaxSearchISBN']]);
     $this->book = $bookRepository;
     $this->ajax = $ajaxRepository;
     parent::__construct();
 }
Esempio n. 28
0
 public function __construct(PartRepositoryEloquent $partRepo, TireSensorRepositoryEloquent $tireSensorRepo)
 {
     parent::__construct();
     $this->middleware('auth');
     $this->partRepo = $partRepo;
     $this->tireSensorRepo = $tireSensorRepo;
 }
Esempio n. 29
0
 /**
  * Constructor.
  *
  * @param type \Litecms\Team\Interfaces\TeamRepositoryInterface $team
  *
  * @return type
  */
 public function __construct(TeamRepositoryInterface $team)
 {
     $this->repository = $team;
     $this->middleware('web');
     $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout'));
     parent::__construct();
 }
Esempio n. 30
-1
 public function postSendsms(Request $request)
 {
     $mobile = Input::get('mobile');
     if (!preg_match("/1[3458]{1}\\d{9}\$/", $mobile)) {
         // if(!preg_match("/^13\d{9}$|^14\d{9}$|^15\d{9}$|^17\d{9}$|^18\d{9}$/",$mobile)){
         //手机号码格式不对
         return parent::returnJson(1, "手机号码格式不对" . $mobile);
     }
     $data = DB::select("select * from members where lifestatus=1 and mobile =" . $mobile);
     if (sizeof($data) > 0) {
         return parent::returnJson(1, "手机号已注册");
     }
     $checkCode = parent::get_code(6, 1);
     Session::put("m" . $mobile, $checkCode);
     $checkCode = Session::get("m" . $mobile);
     Log::error("sendsms:session:" . $checkCode);
     $msg = "尊敬的用户:" . $checkCode . "是您本次的短信验证码,5分钟内有效.";
     // Input::get('msg');
     $curl = new cURL();
     $serverUrl = "http://cf.lmobile.cn/submitdata/Service.asmx/g_Submit";
     $response = $curl->get($serverUrl . "?sname=dlrmcf58&spwd=ZRB2aP8K&scorpid=&sprdid=1012818&sdst=" . $mobile . "&smsg=" . rawurlencode($msg . "【投贷宝】"));
     $xml = simplexml_load_string($response);
     echo json_encode($xml);
     //$xml->State;
     //  <CSubmitState xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
     //   <State>0</State>
     //   <MsgID>1512191953407413801</MsgID>
     //   <MsgState>提交成功</MsgState>
     //   <Reserve>0</Reserve>
     // </CSubmitState>
     // <State>1023</State>
     //  <MsgID>0</MsgID>
     //  <MsgState>无效计费条数,号码不规则,过滤[1:186019249011,]</MsgState>
     //  <Reserve>0</Reserve>
 }