Skip to content

Commit 069e23a

Browse files
committed
Adding Travis
1 parent 90607e9 commit 069e23a

File tree

3 files changed

+49
-10
lines changed

3 files changed

+49
-10
lines changed

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
language: php
2+
3+
sudo: false
4+
5+
php:
6+
- 7.2
7+
8+
install:
9+
- composer global require drush/drush:8.x-dev drupal/coder mglaman/drupal-check friendsoftwig/twigcs
10+
- export PATH="$HOME/.config/composer/vendor/bin:$PATH"
11+
- phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer
12+
- phpenv rehash
13+
- nvm install node
14+
- nvm use node
15+
- npm install --global yarn
16+
- cd ../ && drush dl drupal-8 --drupal-project-rename=drupal
17+
- cd drupal
18+
- DRUPAL_ROOT=$(pwd)
19+
- export REPOSITORIES='"repositories":\ \['
20+
- export REPOSITORIES_REPLACE='"repositories":\[\{"type":"path","url":"..\/os2web_simplesaml","options":\{"symlink":false\}\},'
21+
- export REQUIRE='"require":\ {'
22+
- export REQUIRE_REPLACE='"require":{"os2web\/os2web_simplesaml":"\*",'
23+
- sed -i "s/$REPOSITORIES/$REPOSITORIES_REPLACE/g" composer.json
24+
- sed -i "s/$REQUIRE/$REQUIRE_REPLACE/g" composer.json
25+
- composer update
26+
- PROJECT_PATH=$DRUPAL_ROOT/modules/contrib/os2web_simplesaml
27+
- cd $DRUPAL_ROOT/core
28+
- yarn install
29+
- npm install --global eslint-config-drupal-bundle stylelint
30+
31+
script:
32+
- phpcs --standard=Drupal --ignore=*.md $PROJECT_PATH
33+
- twigcs $PROJECT_PATH
34+
- cd $DRUPAL_ROOT/core
35+
- eslint $PROJECT_PATH
36+
- stylelint --aei $PROJECT_PATH/**/*.css
37+
- drupal-check $PROJECT_PATH

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# OS2Web SimpleSAML Drupal module [![Build Status](https://travis-ci.org/OS2web/os2web_simplesaml.svg?branch=8.x)](https://travis-ci.org/OS2web/os2web_simplesaml)
2+
13
# Module purpose
24

35
The aim of this module is to enhance integration with **simplesamlphp_auth** module, by force triggering **SimpleSAML auth page** redirect when certain criteria are met.

os2web_simplesaml.module

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,32 @@ use Drupal\Core\Url;
1616
function os2web_simplesaml_form_simplesamlphp_auth_local_settings_form_alter(&$form, FormStateInterface $form_state, $form_id) {
1717
$config = \Drupal::config('os2web_simplesaml.settings');
1818

19-
$form['os2web_simplesaml_additional_settings'] = array(
19+
$form['os2web_simplesaml_additional_settings'] = [
2020
'#type' => 'fieldset',
2121
'#title' => t('OS2Web SimpleSAML additional settings'),
22-
);
23-
$form['os2web_simplesaml_additional_settings']['redirect_ips'] = array(
22+
];
23+
$form['os2web_simplesaml_additional_settings']['redirect_ips'] = [
2424
'#type' => 'textfield',
2525
'#title' => t("Redirect IP's to SimpleSAML login"),
2626
'#default_value' => $config->get('redirect_ips'),
2727
'#description' => t('Comma separated. Ex. 192.168.1.1,192.168.2.1'),
28-
);
29-
$form['os2web_simplesaml_additional_settings']['redirect_trigger_path'] = array(
28+
];
29+
$form['os2web_simplesaml_additional_settings']['redirect_trigger_path'] = [
3030
'#type' => 'textfield',
3131
'#title' => t('Redirect triggering path'),
3232
'#default_value' => $config->get('redirect_trigger_path'),
3333
'#description' => t('The path that will trigger the redirect. NB! The caching for that path will be programmatically disabled.'),
3434
'#required' => TRUE,
35-
);
36-
$form['os2web_simplesaml_additional_settings']['redirect_cookies_ttl'] = array(
35+
];
36+
$form['os2web_simplesaml_additional_settings']['redirect_cookies_ttl'] = [
3737
'#type' => 'number',
3838
'#min' => 0,
3939
'#step' => 10,
4040
'#title' => t('Redirect cookies time to live (TTL)'),
4141
'#default_value' => $config->get('redirect_cookies_ttl'),
4242
'#description' => t('Number of seconds, after which the positive or negative redirect decision will expire. Setting long time improves the performance, but IP rules change will take longer to become active for all users.'),
4343
'#required' => TRUE,
44-
);
44+
];
4545

4646
$form['#validate'][] = 'os2web_simplesaml_form_validate';
4747
$form['#submit'][] = 'os2web_simplesaml_form_submit';
@@ -143,7 +143,7 @@ function os2web_simplesaml_form_user_register_form_alter(&$form, FormStateInterf
143143
*
144144
* @see os2web_simplesaml_user_form_submit()
145145
*/
146-
function os2web_simplesaml_user_form_includes(&$form) {
146+
function os2web_simplesaml_user_form_includes(array &$form) {
147147
// Getting SimpleSAML existing authname to use as an example.
148148
$query = \Drupal::database()->select('authmap', 'am')
149149
->fields('am', ['authname'])
@@ -155,7 +155,7 @@ function os2web_simplesaml_user_form_includes(&$form) {
155155
'#type' => 'textfield',
156156
'#title' => t('SimpleSAML UID'),
157157
'#access' => \Drupal::currentUser()->hasPermission('change saml authentication setting'),
158-
'#description' => $simplesamlExample ? t('Example of the existing SimpleSAML entry from authmap table: <b>@simplesaml</b>', array('@simplesaml' => $simplesamlExample)) : t('Provide a string serves the UID of the user.')
158+
'#description' => $simplesamlExample ? t('Example of the existing SimpleSAML entry from authmap table: <b>@simplesaml</b>', ['@simplesaml' => $simplesamlExample]) : t('Provide a string serves the UID of the user.'),
159159
];
160160

161161
// Adding custom validation.

0 commit comments

Comments
 (0)