Esempio n. 1
0
 /**
  * @param array $schema
  */
 protected static function prepareConfigSchemaField(array &$schema)
 {
     $roles = Role::whereIsActive(1)->get();
     $roleList = [];
     foreach ($roles as $role) {
         $roleList[] = ['label' => $role->name, 'name' => $role->id];
     }
     parent::prepareConfigSchemaField($schema);
     switch ($schema['name']) {
         case 'default_role':
             $schema['type'] = 'picklist';
             $schema['values'] = $roleList;
             $schema['description'] = 'Select a default role for users logging in with this OAuth service type.';
             break;
         case 'client_id':
             $schema['label'] = 'Client ID';
             $schema['description'] = 'A public string used by the service to identify your app and to build authorization URLs.';
             break;
         case 'client_secret':
             $schema['description'] = 'A private string used by the service to authenticate the identity of the application.';
             break;
         case 'redirect_url':
             $schema['label'] = 'Redirect URL';
             $schema['description'] = 'The location the user will be redirected to after a successful login.';
             break;
         case 'icon_class':
             $schema['description'] = 'The icon to display for this OAuth service.';
             break;
     }
 }
Esempio n. 2
0
 /**
  * @param array $schema
  */
 protected static function prepareConfigSchemaField(array &$schema)
 {
     $roles = Role::whereIsActive(1)->get();
     $roleList = [];
     foreach ($roles as $role) {
         $roleList[] = ['label' => $role->name, 'name' => $role->id];
     }
     parent::prepareConfigSchemaField($schema);
     switch ($schema['name']) {
         case 'default_role':
             $schema['type'] = 'picklist';
             $schema['values'] = $roleList;
             $schema['description'] = 'Select a default role for users logging in with this AD/LDAP service type.';
             break;
         case 'host':
             $schema['description'] = 'The host name for your AD/LDAP server.';
             break;
         case 'base_dn':
             $schema['label'] = 'Base DN';
             $schema['description'] = 'The base DN for your domain.';
             break;
         case 'account_suffix':
             $schema['description'] = 'The full account suffix for your domain.';
             break;
     }
 }
Esempio n. 3
0
 /** @inheritdoc */
 protected static function prepareConfigSchemaField(array &$schema)
 {
     $roles = Role::whereIsActive(1)->get();
     $roleList = [];
     foreach ($roles as $role) {
         $roleList[] = ['label' => $role->name, 'name' => $role->id];
     }
     parent::prepareConfigSchemaField($schema);
     switch ($schema['name']) {
         case 'default_role':
             $schema['type'] = 'picklist';
             $schema['values'] = $roleList;
             $schema['description'] = 'Select a default role for users logging in with this AD/LDAP service type.';
             break;
         case 'host':
             $schema['description'] = 'The host name for your AD/LDAP server.';
             break;
         case 'base_dn':
             $schema['label'] = 'Base DN';
             $schema['description'] = 'The base DN for your domain.';
             break;
         case 'account_suffix':
             $schema['description'] = 'The full account suffix for your domain.';
             break;
         case 'map_group_to_role':
             $schema['description'] = 'Checking this will map your Roles to AD Groups.';
             break;
         case 'username':
             $schema['description'] = '(Optional) Enter AD administrator username to enable additional features.';
             break;
         case 'password':
             $schema['description'] = '(Optional) Enter AD administrator password to enable additional features.';
             break;
     }
 }
Esempio n. 4
0
 /**
  * @param array $schema
  */
 protected static function prepareConfigSchemaField(array &$schema)
 {
     parent::prepareConfigSchemaField($schema);
     $roleList = [['label' => '', 'name' => null]];
     $emailSvcList = [['label' => '', 'name' => null]];
     $templateList = [['label' => '', 'name' => null]];
     switch ($schema['name']) {
         case 'open_reg_role_id':
             $roles = Role::whereIsActive(1)->get();
             foreach ($roles as $role) {
                 $roleList[] = ['label' => $role->name, 'name' => $role->id];
             }
             $schema['type'] = 'picklist';
             $schema['values'] = $roleList;
             $schema['label'] = 'Open Reg Role';
             $schema['description'] = 'Select a role for self registered users.';
             break;
         case 'open_reg_email_service_id':
         case 'invite_email_service_id':
         case 'password_email_service_id':
             $label = substr($schema['label'], 0, strlen($schema['label']) - 11);
             $services = Service::whereIsActive(1)->whereIn('type', ['aws_ses', 'smtp_email', 'mailgun_email', 'mandrill_email', 'local_email'])->get();
             foreach ($services as $service) {
                 $emailSvcList[] = ['label' => $service->label, 'name' => $service->id];
             }
             $schema['type'] = 'picklist';
             $schema['values'] = $emailSvcList;
             $schema['label'] = $label . ' Service';
             $schema['description'] = 'Select an Email service for sending out ' . $label . '.';
             break;
         case 'open_reg_email_template_id':
         case 'invite_email_template_id':
         case 'password_email_template_id':
             $label = substr($schema['label'], 0, strlen($schema['label']) - 11);
             $templates = EmailTemplate::get();
             foreach ($templates as $template) {
                 $templateList[] = ['label' => $template->name, 'name' => $template->id];
             }
             $schema['type'] = 'picklist';
             $schema['values'] = $templateList;
             $schema['label'] = $label . ' Template';
             $schema['description'] = 'Select an Email template to use for ' . $label . '.';
             break;
     }
 }