当前位置: 首页>>代码示例>>PHP>>正文


PHP ACL::checkUserPermission方法代码示例

本文整理汇总了PHP中ACL::checkUserPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::checkUserPermission方法的具体用法?PHP ACL::checkUserPermission怎么用?PHP ACL::checkUserPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACL的用法示例。


在下文中一共展示了ACL::checkUserPermission方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: winnings

 public function winnings()
 {
     if (ACL::checkUserPermission('reports.winnings') == false) {
         return Redirect::action('dashboard');
     }
     $game_winnings = Gamewinnings::with('channel.tabledetails.operator')->get();
     $title = Lang::get('Winning Numbers');
     $data = array('acl' => ACL::buildACL(), 'winnings' => $game_winnings, 'title' => $title);
     return View::make('reports/winnings', $data);
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:10,代码来源:ReportsController.php

示例2: player

 public function player()
 {
     if (ACL::checkUserPermission('points.player') == false) {
         return Redirect::action('dashboard');
     }
     $form_open = Form::open(array('method' => 'post', 'files' => true, 'id' => 'form-player-csv', 'class' => 'smart-form', 'role' => 'form'));
     $userList = UserMember::with('user', 'group', 'points')->where('group_id', 4)->get();
     $title = Lang::get('Player List');
     $client_ip = Request::getClientIp(true);
     $data = array('acl' => ACL::buildACL(), 'userList' => $userList, 'title' => $title, 'form_open' => $form_open, 'client_ip' => $client_ip);
     return View::make('points/index', $data);
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:12,代码来源:PointsController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     if (ACL::checkUserPermission('bet.roulette') == false) {
         return Redirect::action('dashboard');
     }
     $param = Input::only('bettype', 'betnumber', 'amount', 'game_id');
     $retrieve = Wallet::where('account_id', Auth::user()->id)->first();
     $bet_type = array('straight', 'split', 'line', 'square', 'basket', 'doublestreet');
     if ($retrieve->credits >= $param['amount']) {
         if (Input::has('betnumber')) {
             if (count($param['betnumber']) >= 0 && count($param['betnumber']) <= 6) {
                 $retrieve = Wallet::where('account_id', Auth::user()->id)->first();
                 $index = count($param['betnumber']) - 1;
                 try {
                     $update = $retrieve->decrement('credits', (double) $param['amount']);
                     $fundinout = array('wallet_id' => $retrieve->id, 'onbehalf' => Auth::user()->id, 'credits' => $param['amount'], 'description' => 'Bet on Roulette amount of $' . (double) $param['amount'], 'fundtype' => 'bet');
                     $fundout = Fundinout::create($fundinout);
                     $bet = array('player_id' => Auth::user()->id, 'channel_id' => $param['game_id'], 'bet_number' => implode(',', $param['betnumber']), 'bet_amount' => $param['amount'], 'bet_type' => $bet_type[$index]);
                     Gamebets::create($bet);
                     $message = 'Bet has been successfully place.';
                     return Redirect::action('bet.roulette')->with('success', $message);
                 } catch (Exception $e) {
                     return false;
                 }
             } else {
                 return Redirect::action('bet.roulette')->with('error', 'You can only place maximum of 6 number.');
             }
         }
         if (Input::has('bettype')) {
             $param = Input::only('bettype', 'amount', 'game_id');
             $retrieve = Wallet::where('account_id', Auth::user()->id)->first();
             try {
                 $update = $retrieve->decrement('credits', (double) $param['amount']);
                 $fundinout = array('wallet_id' => $retrieve->id, 'onbehalf' => Auth::user()->id, 'credits' => $param['amount'], 'description' => 'Bet on Roulette amount of $' . (double) $param['amount'], 'fundtype' => 'bet');
                 $fundout = Fundinout::create($fundinout);
                 $bet = array('player_id' => Auth::user()->id, 'channel_id' => $param['game_id'], 'bet_number' => $param['bettype'], 'bet_amount' => $param['amount'], 'bet_type' => $param['bettype']);
                 Gamebets::create($bet);
                 $message = 'Bet has been successfully place.';
                 return Redirect::action('bet.roulette')->with('success', $message);
             } catch (Exception $e) {
                 return false;
             }
         }
     } else {
         return Redirect::action('bet.roulette')->with('error', 'Insufficient credits!');
     }
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:52,代码来源:BetController.php

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (ACL::checkUserPermission('settings.index') == false) {
         return Redirect::action('dashboard');
     }
     $settings = Settings::where('id', $id)->find($id);
     $settings->display_name = Input::get('display_name');
     $settings->value = Input::get('value');
     $settings->updated_at = date('Y-m-d H:i:s');
     if ($settings->save()) {
         $messageType = 'success';
         $message = 'Setting edit success';
     } else {
         $messageType = 'error';
         $message = 'Setting edit failed';
     }
     return Redirect::action('settings.index')->with($messageType, $message);
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:24,代码来源:SettingsController.php

示例5: edit

 public function edit($id)
 {
     if (ACL::checkUserPermission('games.edit') == false) {
         return Redirect::action('dashboard');
     }
     $title = Lang::get('Roulette Table');
     $formOpen = Form::open(array('method' => 'put', 'id' => 'form-group', 'class' => 'smart-form', 'route' => array('games.update', $id)));
     $formClose = Form::close();
     $operators = Usermember::with('group', 'user')->where('group_id', 3)->get();
     $tabledetails = Gametables::find($id);
     if (!empty($tabledetails)) {
         $data = array('title' => $title, 'operators' => $operators, 'tabledetails' => $tabledetails, 'formOpen' => $formOpen, 'formClose' => $formClose);
         return View::make('games/edit', $data);
     } else {
         $message = 'Cannot find roulette game table.';
         return Redirect::action('games.index')->with('error', $message);
     }
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:18,代码来源:GameController.php

示例6: start

 public function start()
 {
     if (ACL::checkUserPermission('roulette.start') == false) {
         return Redirect::action('dashboard');
     }
     if (Auth::user()->isOperator()) {
         $game = Games::where('game_name', 'Roulette')->take(1)->get()->first();
         $table = Gametables::where('operator_id', $this->operator_id)->take(1)->get()->first();
         $players = Playeroperators::with('playerdetails', 'credits')->where('operator_id', $this->operator_id)->get();
         if (!empty($table)) {
             $create_channel = array('channel_id' => Utils::generateRandomString(), 'table_id' => $table->id);
             $channel_id = '';
             $channel = Gamechannel::openchannel()->where('table_id', $table->id)->take(1)->get()->first();
             if (!empty($channel)) {
                 $channel_id = $channel->id;
             } else {
                 $channel_create = Gamechannel::create($create_channel);
                 $channel_id = $channel_create->id;
             }
             $gamedetails = Gamechannel::with('tabledetails.gamedetails', 'tabledetails.operator', 'bets', 'bets.playerdetails')->find($channel_id);
             $totalbets = 0;
             $totalplayers = 0;
             if ($gamedetails->bets != null) {
                 foreach ($gamedetails->bets as $gamebets) {
                     $totalbets += $gamebets->bet_amount;
                     $totalplayers++;
                 }
             }
             $title = Lang::get('Start Game');
             $data = array('title' => $title, 'totalbets' => $totalbets, 'totalplayers' => $totalplayers, 'gamedetails' => $gamedetails, 'players' => $players);
             return View::make('operator/create', $data);
         } else {
             return App::abort(401, 'No Roulette table has been assigned to your account.');
         }
     } else {
         return App::abort(401, 'You are not a operator.');
     }
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:38,代码来源:OperateContoller.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (ACL::checkUserPermission('player.edit') == false) {
         return Redirect::action('dashboard');
     }
     $player_info = User::find($id);
     if (!empty($player_info)) {
         $title = Lang::get('Edit Player Details');
         $form_open = Form::open(array('method' => 'put', 'id' => 'form-player', 'class' => 'smart-form', 'route' => array('player.update', $id)));
         $form_close = Form::close();
         $data = array('form_open' => $form_open, 'form_close' => $form_close, 'title' => $title, 'url_rfid' => URL::route('player.rfid'), 'player_info' => $player_info);
         return View::make('player/edit', $data);
     } else {
         $message = 'Cannot get player info. Please try again.';
         return Redirect::Action('player.index')->with('error', $message);
     }
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:23,代码来源:PlayerController.php

示例8: updatePermission

 public function updatePermission()
 {
     if (ACL::checkUserPermission('groups.edit') == false) {
         return Redirect::action('dashboard');
     }
     if (Input::has('permission')) {
         $permission = Input::get('permission');
         foreach ($permission as $key => $value) {
             ACL::saveGroupPermission($key, $value);
         }
     }
     $messageType = 'success';
     $message = 'Group edit permission success';
     return Redirect::action('settings.groups')->with($messageType, $message);
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:15,代码来源:GroupController.php

示例9: updatepermission

 public function updatepermission($id)
 {
     if (ACL::checkUserPermission('user.permission') == false) {
         return Redirect::action('dashboard');
     }
     if (Input::has('permission')) {
         $permission = Input::get('permission');
         $userpermission = ACL::saveUserPermission($id, $permission);
     } else {
         UserPermissions::where('user_id', '=', $id)->delete();
     }
     $message = 'User Permission has been modified';
     return Redirect::action('')->with('success', $message);
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:14,代码来源:UsersController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if (ACL::checkUserPermission('permission.delete') == false) {
         return Redirect::action('dashboard');
     }
     $permission = Permission::where('id', $id)->find($id);
     if (!empty($permission)) {
         $permission->delete();
         $messageType = 'success';
         $message = 'Permission delete success';
     } else {
         $messageType = 'error';
         $message = 'Permission delete failed';
     }
     return Redirect::action('settings.permission')->with($messageType, $message);
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:22,代码来源:PermissionController.php


注:本文中的ACL::checkUserPermission方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。