Skip to content

Commit

Permalink
Merge pull request #416 from CCALI/develop
Browse files Browse the repository at this point in the history
LHI contract
  • Loading branch information
tobiasnteireho authored Dec 11, 2024
2 parents 3127907 + fe18108 commit 8f3d96b
Show file tree
Hide file tree
Showing 51 changed files with 1,532 additions and 1,076 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: build-test
run-name: ${{ github.actor }} is testing the author build
on: [push]
jobs:
test-author-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm install -g grunt-cli
- run: npm run deploy
- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test
- uses: "8398a7/action-slack@v3"
with:
status: ${{ job.status }}
fields: "repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always() # Pick up events even if the job fails or is canceled.

23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

31 changes: 23 additions & 8 deletions CAJA_WS.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
$sql="insert into guides (title,editoruid) values ('".$mysqli->real_escape_string($title)."', ".$userid.")";
// If this fails on blank interview, likely `archive` Field in guides db needs to be ticked to allow default value of null
// Also make sure `archive` Field in guides db is set to 0 for default value
if ($res=$mysqli->query($sql)) {
if ($res=$mysqli->query($sql)) {
// Save as content to new folder owned by editor
$newgid=$mysqli->insert_id;
$userdir=$_SESSION['userdir'];
Expand All @@ -584,7 +584,9 @@
$newfile = $newdir.'/Guide.xml';
// ex: some/sever/path/userfiles/dev/guides/Guide924
$assetsdir = GUIDES_DIR.$newdir;
mkdir($assetsdir);

error_log("changing permissions fix for mac" . $assetsdir);
mkdir($assetsdir, 0775, true);
$filename=GUIDES_DIR.$newfile;
// create default Guide.xml and Guide.json
file_put_contents($filename,$xml);
Expand Down Expand Up @@ -1193,12 +1195,25 @@ function isExtensionAllowed($filename, $mediaOnly = false) {

$media = parse_ini_file($path . '/config_env.ini')['MEDIA_EXTS_ALLOWED'];
$other = parse_ini_file($path . '/config_env.ini')['EXTS_ALLOWED'];

if ($mediaOnly) {
$allowed = $media;
} else {
$allowed = array_merge($media, $other);
}

// Test for valid entries in config file
// currently only tests if entries are arrays
// this could be expanded
if (!is_array($media)){
error_log("MEDIA_EXTS_ALLOWED in config_env.ini is empty");
fail_and_exit(500, 'bad configuration');
}

if (!is_array($other)){
error_log("EXTS_ALLOWED in config_env.ini is empty");
fail_and_exit(500, 'bad configuration');
}

if ($mediaOnly) {
$allowed = $media;
} else {
$allowed = array_merge($media, $other);
}

$testname = strtolower($filename);

Expand Down
Loading

0 comments on commit 8f3d96b

Please sign in to comment.