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


PHP Sentry::getGroupProvider方法代码示例

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


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

示例1: getAdminUser

 protected function getAdminUser($attr = array())
 {
     $user = $this->factory->create('User', $attr);
     $adminGroup = Sentry::getGroupProvider()->create(array('name' => 'admin', 'permissions' => array('admin' => 1, 'users' => 1)));
     $user->addGroup($adminGroup);
     return $user;
 }
开发者ID:thomaswelton,项目名称:laravel,代码行数:7,代码来源:AdminHomeControllerTest.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('groups')->delete();
     Sentry::getGroupProvider()->create(array('name' => 'Users'));
     Sentry::getGroupProvider()->create(array('name' => 'Admins'));
     Sentry::getGroupProvider()->create(array('name' => 'Subscribers'));
 }
开发者ID:ArbindJain,项目名称:scrapkart,代码行数:12,代码来源:SentryGroupSeeder.php

示例3: run

 public function run()
 {
     DB::table('users')->delete();
     DB::table('groups')->delete();
     DB::table('users_groups')->delete();
     Sentry::getUserProvider()->create(array('email' => 'admin@admin.com', 'password' => "admin", 'first_name' => 'admin', 'last_name' => 'admin', 'activated' => 1));
     Sentry::getGroupProvider()->create(array('name' => 'Super Admin', 'permissions' => array('admin' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'Office Admin', 'permissions' => array('admin' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'Project Manager', 'permissions' => array('admin' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'Team Leader', 'permissions' => array('admin' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'Developer', 'permissions' => array('admin' => 1)));
     Sentry::getUserProvider()->create(array('email' => 'ashok@admin.com', 'password' => "admin", 'first_name' => 'Ashok', 'last_name' => 'Adhikari', 'activated' => 1));
     Sentry::getUserProvider()->create(array('email' => 'santosh@admin.com', 'password' => "santosh", 'first_name' => 'Santosh', 'last_name' => 'Dhungana', 'activated' => 1));
     Sentry::getUserProvider()->create(array('email' => 'dinesh@admin.com', 'password' => "dinesh", 'first_name' => 'Dinesh', 'last_name' => 'Sharma', 'activated' => 1));
     Sentry::getUserProvider()->create(array('email' => 'asheem@admin.com', 'password' => "asheem", 'first_name' => 'Asheem', 'last_name' => 'Manandhar', 'activated' => 1));
     // Assign user permissions
     $adminUser = Sentry::getUserProvider()->findByLogin('admin@admin.com');
     $adminGroup = Sentry::getGroupProvider()->findByName('Super Admin');
     $adminUser->addGroup($adminGroup);
     $adminUser = Sentry::getUserProvider()->findByLogin('ashok@admin.com');
     $adminGroup = Sentry::getGroupProvider()->findByName('Office Admin');
     $adminUser->addGroup($adminGroup);
     $adminUser = Sentry::getUserProvider()->findByLogin('santosh@admin.com');
     $adminGroup = Sentry::getGroupProvider()->findByName('Project Manager');
     $adminUser->addGroup($adminGroup);
     $adminUser = Sentry::getUserProvider()->findByLogin('dinesh@admin.com');
     $adminGroup = Sentry::getGroupProvider()->findByName('Team Leader');
     $adminUser->addGroup($adminGroup);
     $adminUser = Sentry::getUserProvider()->findByLogin('asheem@admin.com');
     $adminGroup = Sentry::getGroupProvider()->findByName('Developer');
     $adminUser->addGroup($adminGroup);
 }
开发者ID:arikazukitomaharjan,项目名称:OfficeSystem,代码行数:32,代码来源:SentrySeeder.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $this->command->info('Seeding: CustomSentryGroupSeeder Class...');
     DB::table('groups')->delete();
     Sentry::getGroupProvider()->create(array('name' => 'Users', 'permissions' => array('admin' => 0, 'users' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'Admins', 'permissions' => array('admin' => 1, 'users' => 1)));
 }
开发者ID:centaurustech,项目名称:crowd2bank,代码行数:12,代码来源:CustomSentryGroupSeeder.php

示例5: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     $admins = Sentry::getGroupProvider()->findByName('Admins');
     $diff = array_diff($this->permissions, $admins->permissions);
     $admins->permissions = $diff;
     $admins->save();
 }
开发者ID:abhijo89,项目名称:VMPanel,代码行数:12,代码来源:2013_07_02_203016_adding_plan_permissions.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users_groups')->truncate();
     $userUser1 = Sentry::getUserProvider()->findByLogin('patient1@skywebplus.com');
     $userUser2 = Sentry::getUserProvider()->findByLogin('patient2@skywebplus.com');
     $userUser3 = Sentry::getUserProvider()->findByLogin('patient3@skywebplus.com');
     $userUser4 = Sentry::getUserProvider()->findByLogin('patient4@skywebplus.com');
     $userUser5 = Sentry::getUserProvider()->findByLogin('patient5@skywebplus.com');
     $clinic1User = Sentry::getUserProvider()->findByLogin('clinic1@skywebplus.com');
     $clinic2User = Sentry::getUserProvider()->findByLogin('clinic2@skywebplus.com');
     $doctor1User = Sentry::getUserProvider()->findByLogin('doctor1@skywebplus.com');
     $doctor2User = Sentry::getUserProvider()->findByLogin('doctor2@skywebplus.com');
     $doctor3User = Sentry::getUserProvider()->findByLogin('doctor3@skywebplus.com');
     $adminUser = Sentry::getUserProvider()->findByLogin('admin@skywebplus.com');
     $userGroup = Sentry::getGroupProvider()->findByName('Patients');
     $doctorsyGroup = Sentry::getGroupProvider()->findByName('Doctors');
     $clinicGroup = Sentry::getGroupProvider()->findByName('Clinics');
     $adminGroup = Sentry::getGroupProvider()->findByName('Admins');
     // Assign the groups to the users
     $userUser1->addGroup($userGroup);
     $userUser2->addGroup($userGroup);
     $userUser3->addGroup($userGroup);
     $userUser4->addGroup($userGroup);
     $userUser5->addGroup($userGroup);
     $clinic1User->addGroup($clinicGroup);
     $clinic2User->addGroup($clinicGroup);
     $doctor1User->addGroup($doctorsyGroup);
     $doctor2User->addGroup($doctorsyGroup);
     $doctor3User->addGroup($doctorsyGroup);
     $adminUser->addGroup($adminGroup);
 }
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:36,代码来源:SentryUserGroupSeeder.php

示例7: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('groups')->delete();
     Sentry::getGroupProvider()->create(array('name' => 'Users', 'permissions' => array('admin.users' => 0, 'user.interface' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'Admins', 'permissions' => array('admin.users' => 1, 'user.interface' => 1)));
     Sentry::getGroupProvider()->create(array('name' => 'EmfUsers', 'permissions' => array('admin.users' => 0, 'user.interface' => 1, 'emf.login' => 1)));
 }
开发者ID:jinxiao8942,项目名称:laravel-kuu,代码行数:12,代码来源:SentryGroupSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('groups')->delete();
     Sentry::getGroupProvider()->create(['name' => 'Invitados']);
     Sentry::getGroupProvider()->create(['name' => 'Administradores', 'permissions' => ['superuser' => 1]]);
     $this->command->info('Groups seeded!');
 }
开发者ID:kentronvzla,项目名称:webkentron,代码行数:12,代码来源:SentryGroupSeeder.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('groups')->delete();
     Sentry::getGroupProvider()->create(['name' => 'Users']);
     Sentry::getGroupProvider()->create(['name' => 'Admins']);
     $this->command->info('Groups seeded!');
 }
开发者ID:ArbindJain,项目名称:basic-auth-sentry,代码行数:12,代码来源:SentryGroupSeeder.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     try {
         $rules = array('first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|unique:users', 'phone' => 'numeric|digits_between:9,20');
         $validation = Validator::make(Input::all(), $rules);
         if ($validation->fails()) {
             return Redirect::back()->withInput()->withErrors($validation->messages());
         }
         $user = new User();
         $user->first_name = Input::get('first_name');
         $user->last_name = Input::get('last_name');
         $user->email = Input::get('email');
         $user->phone = Input::get('phone');
         $user->password = '12345';
         $user->activated = 1;
         if ($user->save()) {
             $group = \Sentry::getGroupProvider()->findByName('Admin');
             $user->addGroup($group);
             return Redirect::back()->with('message', 'Az adminisztrátor felvétele sikerült!');
         } else {
             return Redirect::back()->withInput()->withErrors('Az adminisztrátor felvétele nem sikerült!');
         }
     } catch (Exception $e) {
         if (Config::get('app.debug')) {
             return Redirect::back()->withInput()->withErrors($e->getMessage());
         } else {
             return Redirect::back()->withInput()->withErrors('Az adminisztrátor felvétele nem sikerült!');
         }
     }
 }
开发者ID:gabemiller,项目名称:project-dv,代码行数:35,代码来源:UsersController.php

示例11: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->info('Seeding table');
     DB::connection()->disableQueryLog();
     Eloquent::unguard();
     // Configuring curl options
     $options = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array('Content-type: application/json'));
     $start = $this->argument('start');
     $userGroup = Sentry::getGroupProvider()->findByName('user');
     for ($i = $start; $i < $start + 1000; $i++) {
         // jSON URL which should be requested
         $json_url = 'http://graph.facebook.com/' . $i;
         $this->info('Querying ' . $json_url);
         // Initializing curl
         $ch = curl_init($json_url);
         // Setting curl options
         curl_setopt_array($ch, $options);
         // Getting results
         $result = curl_exec($ch);
         // Getting jSON result string
         $json = json_decode($result);
         if (is_object($json) && !property_exists($json, 'error')) {
             $this->info('Creating ' . $json->first_name . ' ' . $json->last_name);
             $user = Sentry::register(array('first_name' => $json->first_name, 'last_name' => $json->last_name, 'email' => strtolower($json->first_name . '_' . $json->last_name) . '_' . $i . '@facebook.com', 'password' => 'password'), true);
             $user->addGroup($userGroup);
             Facebook::create(array('user_id' => $user->id, 'oauth_uid' => $i));
         } else {
             $this->error($json->error->message);
         }
     }
 }
开发者ID:thomaswelton,项目名称:laravel,代码行数:36,代码来源:FbusersCommand.php

示例12: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     try {
         $email = $this->argument('email');
         $pass = $this->argument('password');
         $username = $this->argument('username');
         $groupName = $this->argument('group');
         $validator = new UserValidator(array('email' => $email, 'pass' => $pass, 'username' => $username), 'create');
         if (!$validator->passes()) {
             foreach ($validator->getErrors() as $key => $messages) {
                 $this->info(ucfirst($key) . ' :');
                 foreach ($messages as $message) {
                     $this->error($message);
                 }
             }
         } else {
             // Create the user
             $user = \Sentry::getUserProvider()->create(array('email' => $email, 'password' => $pass, 'username' => $username));
             $activationCode = $user->getActivationCode();
             $user->attemptActivation($activationCode);
             if ($groupName !== NULL) {
                 $group = \Sentry::getGroupProvider()->findByName($groupName);
                 $user->addGroup($group);
             }
             $this->info('User created with success');
         }
     } catch (\Cartalyst\Sentry\Users\UserExistsException $e) {
         $this->error('User already exists !');
     } catch (\Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
         $this->error('Group ' . $groupName . ' does not exists !');
     }
 }
开发者ID:vrigzalejo,项目名称:usermanager,代码行数:37,代码来源:UserSeedCommand.php

示例13: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     $groups = array('Users', 'Resellers', 'Admins');
     foreach ($groups as $group) {
         $sentryGroup = Sentry::getGroupProvider()->findByName($group);
         $sentryGroup->delete();
     }
 }
开发者ID:abhijo89,项目名称:VMPanel,代码行数:13,代码来源:2013_06_17_011709_add_groups.php

示例14: run

 public function run()
 {
     DB::table('users_groups')->delete();
     $adminUser = Sentry::getUserProvider()->findByLogin('gabormolnar92@gmail.com');
     $adminGroup = Sentry::getGroupProvider()->findByName('Admin');
     // Assign the groups to the users
     $adminUser->addGroup($adminGroup);
 }
开发者ID:gabemiller,项目名称:project-dv,代码行数:8,代码来源:UserGroupTableSeeder.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('groups')->truncate();
     Sentry::getGroupProvider()->create(array('name' => 'Patients'));
     Sentry::getGroupProvider()->create(array('name' => 'Doctors'));
     Sentry::getGroupProvider()->create(array('name' => 'Clinics'));
     Sentry::getGroupProvider()->create(array('name' => 'Admins'));
 }
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:13,代码来源:SentryGroupSeeder.php


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